mirror of
https://github.com/Stone-Red-Code/ClipCMD.git
synced 2026-09-04 00:46:10 +02:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2c294c4f84 | ||
|
|
3d67ad37a0 | ||
|
|
ffb13fa0e8 | ||
|
|
faec5d20bb | ||
|
|
a282049074 | ||
|
|
5cde74dbe9 |
@@ -5,6 +5,9 @@
|
||||
<TargetFramework>net6.0-windows</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<UseWPF>true</UseWPF>
|
||||
<AssemblyVersion>0.0.0.2</AssemblyVersion>
|
||||
<FileVersion>0.0.0.2</FileVersion>
|
||||
<Version>0.0.0.2</Version>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -10,8 +10,7 @@ public class ClipboardManager
|
||||
|
||||
public ClipboardManager(Window windowSource)
|
||||
{
|
||||
HwndSource? source = PresentationSource.FromVisual(windowSource) as HwndSource;
|
||||
if (source == null)
|
||||
if (PresentationSource.FromVisual(windowSource) is not HwndSource source)
|
||||
{
|
||||
throw new ArgumentException(
|
||||
"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:local="clr-namespace:ClipCMD"
|
||||
mc:Ignorable="d"
|
||||
Title="MainWindow" Height="450" Width="800">
|
||||
Title="ClipCMD" Height="450" Width="800">
|
||||
<DockPanel>
|
||||
<StackPanel DockPanel.Dock="Top" Orientation="Horizontal">
|
||||
<Label Content="Prefix" />
|
||||
<Label Content="Prefix:" Width="45" />
|
||||
<TextBox x:Name="prefixTextBox" KeyUp="FixTextBox_TextChanged" Text="01" />
|
||||
</StackPanel>
|
||||
<StackPanel DockPanel.Dock="Top" Orientation="Horizontal">
|
||||
<Label Content="Suffix" />
|
||||
<Label Content="Suffix:" Width="45" />
|
||||
<TextBox x:Name="suffixTextBox" KeyUp="FixTextBox_TextChanged" Text="01" />
|
||||
</StackPanel>
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ public partial class MainWindow : Window
|
||||
{
|
||||
{ "time", (_) => DateTime.Now.ToShortTimeString() },
|
||||
{ "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()
|
||||
@@ -127,7 +127,7 @@ public partial class MainWindow : Window
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
logListBox.Items.Add($"Error: {ex.Message}");
|
||||
logListBox.Items.Insert(0, $"Error: {ex.Message}");
|
||||
Debug.WriteLine(ex);
|
||||
}
|
||||
}
|
||||
@@ -150,6 +150,7 @@ public partial class MainWindow : Window
|
||||
else
|
||||
{
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
## 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.
|
||||
|
||||
### Example
|
||||
@@ -12,9 +12,9 @@ You write a macro anywhere, copy it to your clipboard and it will be automatical
|
||||
> Prefix: `_`\
|
||||
> Suffix: `_`\
|
||||
> Macro name: `email`\
|
||||
> Macro text: `[email protected]`\
|
||||
> Macro text: `[email protected]`
|
||||
|
||||
> Input: `_email_`
|
||||
> Input: `_email_`\
|
||||
> Output: `[email protected]`
|
||||
|
||||
## Usage
|
||||
|
||||
Reference in New Issue
Block a user