6 Commits
Author SHA1 Message Date
Stone_Red 2c294c4f84 Update version number 2022-05-29 23:47:09 +02:00
Stone_Red 3d67ad37a0 Add list command 2022-05-28 17:21:00 +02:00
Stone_Red ffb13fa0e8 Minor code imporvment 2022-05-06 15:32:21 +02:00
Stone_Red faec5d20bb Fix UI alignment and order of log messages 2022-05-06 15:32:21 +02:00
Stone_Red a282049074 Fix formatting 2022-05-04 21:52:47 +02:00
Stone_Red 5cde74dbe9 Update README.md 2022-05-03 22:30:15 +02:00
5 changed files with 13 additions and 10 deletions
+3
View File
@@ -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>
+1 -2
View File
@@ -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."
+3 -3
View File
@@ -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>
+3 -2
View File
@@ -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);
} }
} }
+3 -3
View File
@@ -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