mirror of
https://github.com/Stone-Red-Code/ClipCMD.git
synced 2026-09-04 08:56:11 +02:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2c294c4f84 | ||
|
|
3d67ad37a0 | ||
|
|
ffb13fa0e8 | ||
|
|
faec5d20bb | ||
|
|
a282049074 | ||
|
|
5cde74dbe9 |
@@ -5,6 +5,9 @@
|
|||||||
<TargetFramework>net6.0-windows</TargetFramework>
|
<TargetFramework>net6.0-windows</TargetFramework>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
<UseWPF>true</UseWPF>
|
<UseWPF>true</UseWPF>
|
||||||
|
<AssemblyVersion>0.0.0.2</AssemblyVersion>
|
||||||
|
<FileVersion>0.0.0.2</FileVersion>
|
||||||
|
<Version>0.0.0.2</Version>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
@@ -10,8 +10,7 @@ public class ClipboardManager
|
|||||||
|
|
||||||
public ClipboardManager(Window windowSource)
|
public ClipboardManager(Window windowSource)
|
||||||
{
|
{
|
||||||
HwndSource? source = PresentationSource.FromVisual(windowSource) as HwndSource;
|
if (PresentationSource.FromVisual(windowSource) is not HwndSource source)
|
||||||
if (source == null)
|
|
||||||
{
|
{
|
||||||
throw new ArgumentException(
|
throw new ArgumentException(
|
||||||
"Window source MUST be initialized first, such as in the Window's OnSourceInitialized handler."
|
"Window source MUST be initialized first, such as in the Window's OnSourceInitialized handler."
|
||||||
|
|||||||
@@ -5,14 +5,14 @@
|
|||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:local="clr-namespace:ClipCMD"
|
xmlns:local="clr-namespace:ClipCMD"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
Title="MainWindow" Height="450" Width="800">
|
Title="ClipCMD" Height="450" Width="800">
|
||||||
<DockPanel>
|
<DockPanel>
|
||||||
<StackPanel DockPanel.Dock="Top" Orientation="Horizontal">
|
<StackPanel DockPanel.Dock="Top" Orientation="Horizontal">
|
||||||
<Label Content="Prefix" />
|
<Label Content="Prefix:" Width="45" />
|
||||||
<TextBox x:Name="prefixTextBox" KeyUp="FixTextBox_TextChanged" Text="01" />
|
<TextBox x:Name="prefixTextBox" KeyUp="FixTextBox_TextChanged" Text="01" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
<StackPanel DockPanel.Dock="Top" Orientation="Horizontal">
|
<StackPanel DockPanel.Dock="Top" Orientation="Horizontal">
|
||||||
<Label Content="Suffix" />
|
<Label Content="Suffix:" Width="45" />
|
||||||
<TextBox x:Name="suffixTextBox" KeyUp="FixTextBox_TextChanged" Text="01" />
|
<TextBox x:Name="suffixTextBox" KeyUp="FixTextBox_TextChanged" Text="01" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ public partial class MainWindow : Window
|
|||||||
{
|
{
|
||||||
{ "time", (_) => DateTime.Now.ToShortTimeString() },
|
{ "time", (_) => DateTime.Now.ToShortTimeString() },
|
||||||
{ "date", (_) => DateTime.Now.ToShortDateString() },
|
{ "date", (_) => DateTime.Now.ToShortDateString() },
|
||||||
{ "calc", (math) => new DataTable().Compute(math.Trim()[4..], null)?.ToString() ?? string.Empty }
|
{ "calc", (math) => new DataTable().Compute(math.Trim()[4..], null)?.ToString() ?? string.Empty },
|
||||||
};
|
};
|
||||||
|
|
||||||
public MainWindow()
|
public MainWindow()
|
||||||
@@ -127,7 +127,7 @@ public partial class MainWindow : Window
|
|||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
logListBox.Items.Add($"Error: {ex.Message}");
|
logListBox.Items.Insert(0, $"Error: {ex.Message}");
|
||||||
Debug.WriteLine(ex);
|
Debug.WriteLine(ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -150,6 +150,7 @@ public partial class MainWindow : Window
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
staticCommandsTextBox.Foreground = Brushes.Black;
|
staticCommandsTextBox.Foreground = Brushes.Black;
|
||||||
|
stuffToReplace["list"] = (_) => string.Join(", ", staticCommandsTextBox.Text.Split('\n').Where(x => !string.IsNullOrWhiteSpace(x)).Select(x => x.Split('>').FirstOrDefault()?.Trim()));
|
||||||
File.WriteAllText("cmd.txt", staticCommandsTextBox.Text);
|
File.WriteAllText("cmd.txt", staticCommandsTextBox.Text);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
## What is it?
|
## What is it?
|
||||||
|
|
||||||
ClipCMD is a window app that allows you to create macros and run them by copying them to the clipboard.
|
ClipCMD is a windows app that allows you to create macros and run them by copying them to the clipboard.
|
||||||
You write a macro anywhere, copy it to your clipboard and it will be automatically replaced by the specified macro text.
|
You write a macro anywhere, copy it to your clipboard and it will be automatically replaced by the specified macro text.
|
||||||
|
|
||||||
### Example
|
### Example
|
||||||
@@ -12,9 +12,9 @@ You write a macro anywhere, copy it to your clipboard and it will be automatical
|
|||||||
> Prefix: `_`\
|
> Prefix: `_`\
|
||||||
> Suffix: `_`\
|
> Suffix: `_`\
|
||||||
> Macro name: `email`\
|
> Macro name: `email`\
|
||||||
> Macro text: `[email protected]`\
|
> Macro text: `[email protected]`
|
||||||
|
|
||||||
> Input: `_email_`
|
> Input: `_email_`\
|
||||||
> Output: `[email protected]`
|
> Output: `[email protected]`
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|||||||
Reference in New Issue
Block a user