diff --git a/ClipboardIndicator.sln b/ClipboardIndicator.sln
index 60d2250..b25b81d 100644
--- a/ClipboardIndicator.sln
+++ b/ClipboardIndicator.sln
@@ -1,13 +1,12 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
-VisualStudioVersion = 15.0.26430.13
+VisualStudioVersion = 15.0.26430.14
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ClipboardIndicator", "ClipboardIndicator\ClipboardIndicator.csproj", "{869CFB0B-8104-417E-8F15-120F777F2F1B}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{236F0040-FB7C-4A00-AC88-A1841C153BDF}"
ProjectSection(SolutionItems) = preProject
- AppImage.png = AppImage.png
README.md = README.md
EndProjectSection
EndProject
diff --git a/ClipboardIndicator/About.xaml b/ClipboardIndicator/About.xaml
index 701c5a0..770fcad 100644
--- a/ClipboardIndicator/About.xaml
+++ b/ClipboardIndicator/About.xaml
@@ -2,7 +2,8 @@
x:Class="ClipboardIndicator.About"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- Title="{Binding AssemblyName, Mode=OneWay, StringFormat=\{0\} のバージョン情報}"
+ xmlns:utility="clr-namespace:ClipboardIndicator.Utility"
+ Title="{Binding Source={x:Static utility:ProductInfo.Name}, StringFormat=\{0\} のバージョン情報}"
ResizeMode="NoResize"
SizeToContent="WidthAndHeight">
@@ -18,76 +19,35 @@
+ Text="{x:Static utility:ProductInfo.Name}" />
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/ClipboardIndicator/About.xaml.cs b/ClipboardIndicator/About.xaml.cs
index 371b63d..5fba9f1 100644
--- a/ClipboardIndicator/About.xaml.cs
+++ b/ClipboardIndicator/About.xaml.cs
@@ -1,6 +1,4 @@
-using System;
-using System.Diagnostics;
-using System.Reflection;
+using System.Diagnostics;
using System.Windows;
using System.Windows.Navigation;
@@ -8,16 +6,7 @@ namespace ClipboardIndicator
{
public partial class About : Window
{
- private static Version v = Assembly.GetExecutingAssembly().GetName().Version;
- public string AssemblyVersion { get; } = $"{v.Major}.{v.Minor}.{v.Build}";
- public string AssemblyName { get; } = Assembly.GetEntryAssembly().GetName().Name;
- public string AssemblyCopyright { get; } = ((AssemblyCopyrightAttribute)Attribute.GetCustomAttribute(Assembly.GetExecutingAssembly(), typeof(AssemblyCopyrightAttribute))).Copyright;
-
- public About()
- {
- InitializeComponent();
- DataContext = this;
- }
+ public About() => InitializeComponent();
private void Hyperlink_RequestNavigate(object sender, RequestNavigateEventArgs e)
{
diff --git a/ClipboardIndicator/App.xaml b/ClipboardIndicator/App.xaml
index 43fc94d..0a546d2 100644
--- a/ClipboardIndicator/App.xaml
+++ b/ClipboardIndicator/App.xaml
@@ -1,9 +1,32 @@
-
-
-
-
+
+
+
+
+
diff --git a/ClipboardIndicator/ClipboardIndicator.csproj b/ClipboardIndicator/ClipboardIndicator.csproj
index 20fdc44..2e3e03e 100644
--- a/ClipboardIndicator/ClipboardIndicator.csproj
+++ b/ClipboardIndicator/ClipboardIndicator.csproj
@@ -8,11 +8,12 @@
WinExe
ClipboardIndicator
ClipboardIndicator
- v4.5.2
+ v4.7
512
{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
4
true
+
AnyCPU
@@ -23,6 +24,7 @@
DEBUG;TRACE
prompt
4
+ false
AnyCPU
@@ -32,6 +34,7 @@
TRACE
prompt
4
+ false
Resources\App.ico
@@ -67,16 +70,23 @@
About.xaml
-
+
+
+
+
+
+
+
-
+
SettingWindow.xaml
-
+
+
Designer
MSBuild:Compile
@@ -104,25 +114,7 @@
Code
-
- True
- True
- Resources.resx
-
-
- True
- Settings.settings
- True
-
-
- ResXFileCodeGenerator
- Resources.Designer.cs
-
-
- PublicSettingsSingleFileGenerator
- Settings.Designer.cs
-
diff --git a/ClipboardIndicator/ClipboardService.cs b/ClipboardIndicator/ClipboardService.cs
index 43a2353..bee6b5a 100644
--- a/ClipboardIndicator/ClipboardService.cs
+++ b/ClipboardIndicator/ClipboardService.cs
@@ -8,16 +8,18 @@
namespace ClipboardIndicator
{
+ public delegate void ClipboardCopiedEventHandler(string text);
+
public class ClipboardService
{
+ private const int WM_CLIPBOARDUPDATE = 0x031D;
+
[DllImport("user32.dll", SetLastError = true)]
private extern static void AddClipboardFormatListener(IntPtr hwnd);
[DllImport("user32.dll", SetLastError = true)]
private extern static void RemoveClipboardFormatListener(IntPtr hwnd);
- private const int WM_CLIPBOARDUPDATE = 0x031D;
- public delegate void ClipboardCopiedEventHandler(string text);
public event ClipboardCopiedEventHandler ClipboardCopied;
private Window actualWindow;
@@ -34,17 +36,16 @@ public ClipboardService(Window window)
actualWindow.Closing += (s, e) => Unhook();
}
- public async Task ClearAsync()
+ public void Clear()
{
- //CLIPBRD_E_CANT_OPEN対策にリトライ処理
- for(var i = 0; i < 5; i++)
+ for(var i = 0; i < 5; i++) //CLIPBRD_E_CANT_OPEN対策にリトライ処理
{
try
{
Clipboard.Clear();
+ return;
}
- catch { }
- await Task.Delay(100);
+ catch { Task.Delay(100).Wait(); }
}
}
@@ -54,7 +55,7 @@ private void Hook()
HwndSource.FromHwnd(handle).AddHook(WndProc);
AddClipboardFormatListener(handle);
- var _ = OnClipboardCopied(); //#pragma warning disable CS4014
+ OnClipboardCopied();
}
private void Unhook()
{
@@ -65,50 +66,39 @@ private void Unhook()
private IntPtr WndProc(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled)
{
if(msg == WM_CLIPBOARDUPDATE)
- {
- var _ = OnClipboardCopied(); //#pragma warning disable CS4014
- }
+ OnClipboardCopied();
return IntPtr.Zero;
}
- private async Task OnClipboardCopied()
+ private void OnClipboardCopied()
{
- var text = await GetTextAsync();
+ var text = GetText();
Debug.WriteLine($"ClipboardCopied:{text}");
ClipboardCopied(text);
}
- private async Task GetTextAsync()
+ private string GetText()
{
- //CLIPBRD_E_CANT_OPEN対策にリトライ処理
- for(var i = 0; i < 5; i++)
+ for(var i = 0; i < 5; i++) //CLIPBRD_E_CANT_OPEN対策にリトライ処理
{
try
{
return GetClipboardTextFirstLine();
}
- catch { }
- await Task.Delay(100);
+ catch { Task.Delay(100).Wait(); }
}
return "";
}
-
- private static string GetClipboardTextFirstLine()
+ private string GetClipboardTextFirstLine()
{
- string text;
if(Clipboard.ContainsText())
- text = Clipboard.GetText()
+ return Clipboard.GetText()
.Split(new string[] { Environment.NewLine }, StringSplitOptions.None)
.First();
+ else if(!Clipboard.GetDataObject().GetFormats().Any())
+ return "";
else
- {
- if(!Clipboard.GetDataObject().GetFormats().Any())
- text = "";
- else
- text = "";
- }
-
- return text;
+ return "";
}
}
}
diff --git a/ClipboardIndicator/DraggableButton.cs b/ClipboardIndicator/Controls/DraggableButton.cs
similarity index 77%
rename from ClipboardIndicator/DraggableButton.cs
rename to ClipboardIndicator/Controls/DraggableButton.cs
index f2be44b..6bc311b 100644
--- a/ClipboardIndicator/DraggableButton.cs
+++ b/ClipboardIndicator/Controls/DraggableButton.cs
@@ -5,11 +5,14 @@
namespace ClipboardIndicator
{
+ ///親Windowごとドラッグ移動するボタン
public class DraggableButton : Button
{
- public static readonly DependencyProperty CanMoveProperty =
- DependencyProperty.Register(nameof(CanMove), typeof(bool), typeof(DraggableButton), new PropertyMetadata(true));
+ ///移動するかどうか
public bool CanMove { get => (bool)GetValue(CanMoveProperty); set => SetValue(CanMoveProperty, value); }
+ public static readonly DependencyProperty CanMoveProperty
+ = DependencyProperty.Register(nameof(CanMove), typeof(bool),
+ typeof(DraggableButton), new PropertyMetadata(true));
private Point? startPos;
@@ -34,10 +37,9 @@ protected override void OnPreviewMouseMove(MouseEventArgs e)
ReleaseMouseCapture();
Window.GetWindow(this).DragMove();
startPos = null;
- }
- private bool IsDragStartable(Vector delta)
- {
- return (SystemParameters.MinimumHorizontalDragDistance < Math.Abs(delta.X))
+
+ bool IsDragStartable(Vector delta)
+ => (SystemParameters.MinimumHorizontalDragDistance < Math.Abs(delta.X))
|| (SystemParameters.MinimumVerticalDragDistance < Math.Abs(delta.Y));
}
}
diff --git a/ClipboardIndicator/StartupPopup.cs b/ClipboardIndicator/Controls/StartupPopup.cs
similarity index 79%
rename from ClipboardIndicator/StartupPopup.cs
rename to ClipboardIndicator/Controls/StartupPopup.cs
index ae8e369..02eb82a 100644
--- a/ClipboardIndicator/StartupPopup.cs
+++ b/ClipboardIndicator/Controls/StartupPopup.cs
@@ -10,10 +10,7 @@ namespace ClipboardIndicator
///コンテンツのサイズをStartupPopupのWidth Heightに設定すること
public class StartupPopup : Popup
{
- public StartupPopup() : base()
- {
- Loaded += OnLoaded;
- }
+ public StartupPopup() : base() => Loaded += OnLoaded;
private void OnLoaded(object sender, RoutedEventArgs e)
{
@@ -21,12 +18,13 @@ private void OnLoaded(object sender, RoutedEventArgs e)
AllowsTransparency = true;
PopupAnimation = PopupAnimation.Fade;
Placement = PlacementMode.Custom;
- CustomPopupPlacementCallback = CustomCallback;
+ CustomPopupPlacementCallback = PlacementCallback;
RenderTransform = new RotateTransform();
var window = this.GetLogicalAncestor();
window.ContentRendered += Window_ContentRendered;
}
+
//PointToScreenを取れるかつRenderTransformが動かせる(唯一の?)タイミング
//この後でAngle等いじっても反映されない PopupAnimation関連でのPopupの仕様??
private void Window_ContentRendered(object sender, EventArgs e)
@@ -59,33 +57,18 @@ private void Window_ContentRendered(object sender, EventArgs e)
IsOpen = true;
BeginStoryboard(storyboard);
}
- private CustomPopupPlacement[] CustomCallback(Size popupSize, Size targetSize, Point offset)
+
+ private CustomPopupPlacement[] PlacementCallback(Size popupSize, Size targetSize, Point offset)
{
//上下反転すると(よくわからないが)ずれたので自前実装
- //第1希望:真下 第2希望:真上
var x = (targetSize.Width - popupSize.Width) / 2;
return new CustomPopupPlacement[]
{
+ //第1希望:真下 第2希望:真上
new CustomPopupPlacement(new Point(x , targetSize.Height), PopupPrimaryAxis.None),
new CustomPopupPlacement(new Point(x, -popupSize.Height), PopupPrimaryAxis.None),
};
}
}
-
- static class DependencyObjectExtensions
- {
- public static T GetLogicalAncestor(this DependencyObject depObj) where T : class
- {
- var target = depObj;
- do
- {
- target = LogicalTreeHelper.GetParent(target);
- if(target == null) break;
-
- } while(!(target is T));
-
- return target as T;
- }
- }
}
diff --git a/ClipboardIndicator/Extensions/ConvertExtensions.cs b/ClipboardIndicator/Extensions/ConvertExtensions.cs
new file mode 100644
index 0000000..c0ff5a7
--- /dev/null
+++ b/ClipboardIndicator/Extensions/ConvertExtensions.cs
@@ -0,0 +1,13 @@
+using System.ComponentModel;
+
+namespace ClipboardIndicator
+{
+ internal static class ConvertExtensions
+ {
+ public static T ConvertFromString(this T target, string value)
+ => (T)TypeDescriptor.GetConverter(target.GetType()).ConvertFrom(value);
+
+ public static string ConvertToString(this T value)
+ => (string)TypeDescriptor.GetConverter(value.GetType()).ConvertTo(value, typeof(string));
+ }
+}
diff --git a/ClipboardIndicator/Extensions/DependencyObjectExtensions.cs b/ClipboardIndicator/Extensions/DependencyObjectExtensions.cs
new file mode 100644
index 0000000..55c4df7
--- /dev/null
+++ b/ClipboardIndicator/Extensions/DependencyObjectExtensions.cs
@@ -0,0 +1,20 @@
+using System.Windows;
+
+namespace ClipboardIndicator
+{
+ static class DependencyObjectExtensions
+ {
+ ///LogicalTreeHelperで祖先を検索
+ public static T GetLogicalAncestor(this DependencyObject obj) where T : class
+ {
+ do
+ {
+ obj = LogicalTreeHelper.GetParent(obj);
+ if(obj == null) break;
+
+ } while(!(obj is T));
+
+ return obj as T;
+ }
+ }
+}
diff --git a/ClipboardIndicator/Extensions/WindowExtensions.cs b/ClipboardIndicator/Extensions/WindowExtensions.cs
new file mode 100644
index 0000000..b54216c
--- /dev/null
+++ b/ClipboardIndicator/Extensions/WindowExtensions.cs
@@ -0,0 +1,27 @@
+using System;
+using System.Runtime.InteropServices;
+using System.Windows;
+using System.Windows.Interop;
+
+namespace ClipboardIndicator
+{
+ internal static class WindowExtensions
+ {
+ private const int GWL_STYLE = -16;
+ private const int WS_MAXIMIZEBOX = 0x10000;
+ private const int WS_MINIMIZEBOX = 0x20000;
+
+ [DllImport("user32.dll")]
+ extern private static int GetWindowLong(IntPtr hwnd, int index);
+ [DllImport("user32.dll")]
+ extern private static int SetWindowLong(IntPtr hwnd, int index, int value);
+
+ internal static void HideMinMaxButton(this Window window)
+ {
+ var hwnd = new WindowInteropHelper(window).Handle;
+ var style = GetWindowLong(hwnd, GWL_STYLE) & ~WS_MAXIMIZEBOX & ~WS_MINIMIZEBOX;
+
+ SetWindowLong(hwnd, GWL_STYLE, style);
+ }
+ }
+}
diff --git a/ClipboardIndicator/MainWindow.xaml b/ClipboardIndicator/MainWindow.xaml
index 0ba43e0..1fd6251 100644
--- a/ClipboardIndicator/MainWindow.xaml
+++ b/ClipboardIndicator/MainWindow.xaml
@@ -1,89 +1,89 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+ x:Class="ClipboardIndicator.MainWindow"
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+ xmlns:l="clr-namespace:ClipboardIndicator"
+ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+ d:DataContext="{d:DesignInstance {x:Type l:ViewModel}}"
+ AllowsTransparency="True"
+ Background="Transparent"
+ ContextMenu="{DynamicResource ContextMenu}"
+ IsTabStop="False"
+ Left="{Binding Setting.Window.Left, Mode=TwoWay}"
+ ResizeMode="NoResize"
+ ShowInTaskbar="False"
+ SizeToContent="WidthAndHeight"
+ SnapsToDevicePixels="True"
+ Top="{Binding Setting.Window.Top, Mode=TwoWay}"
+ Topmost="True"
+ WindowStyle="None"
+ mc:Ignorable="d">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
\ No newline at end of file
diff --git a/ClipboardIndicator/MainWindow.xaml.cs b/ClipboardIndicator/MainWindow.xaml.cs
index 888de30..0702cd6 100644
--- a/ClipboardIndicator/MainWindow.xaml.cs
+++ b/ClipboardIndicator/MainWindow.xaml.cs
@@ -21,7 +21,11 @@ public MainWindow()
//余計なお世話な場合region丸ごと削除で大丈夫です
#region ウィンドウ移動制限
+ private const int WM_MOVING = 0x0216;
+ [StructLayout(LayoutKind.Sequential)]
+ private struct RECT { public int Left, Top, Right, Bottom; }
private HwndSource hwndSource;
+
protected override void OnSourceInitialized(EventArgs e)
{
base.OnSourceInitialized(e);
@@ -38,50 +42,41 @@ protected override void OnClosed(EventArgs e)
}
private IntPtr WndProc(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled)
{
- if(msg == WM_MOVING)
+ if(msg != WM_MOVING)
{
- var window = (RECT)Marshal.PtrToStructure(lParam, typeof(RECT));
- var w = (int)SystemParameters.PrimaryScreenWidth;
- var h = (int)SystemParameters.PrimaryScreenHeight;
-
- if(window.Left < 0) SetLeft(ref window);
- if(window.Top < 0) SetTop(ref window);
- if(window.Right > w) SetRight(ref window, w);
- if(window.Bottom > h) SetBottom(ref window, h);
+ handled = false;
+ return IntPtr.Zero;
+ }
- Marshal.StructureToPtr(window, lParam, true);
+ var rect = (RECT)Marshal.PtrToStructure(lParam, typeof(RECT));
+ var w = (int)SystemParameters.PrimaryScreenWidth;
+ var h = (int)SystemParameters.PrimaryScreenHeight;
- handled = true;
- return new IntPtr(1);
+ if(rect.Left < 0)
+ {
+ rect.Right = rect.Right - rect.Left;
+ rect.Left = 0;
+ }
+ if(rect.Top < 0)
+ {
+ rect.Bottom = rect.Bottom - rect.Top;
+ rect.Top = 0;
+ }
+ if(rect.Right > w)
+ {
+ rect.Left = w - rect.Right + rect.Left;
+ rect.Right = w;
+ }
+ if(rect.Bottom > h)
+ {
+ rect.Top = h - rect.Bottom + rect.Top;
+ rect.Bottom = h;
}
- handled = false;
- return IntPtr.Zero;
- }
- private const int WM_MOVING = 0x0216;
-
- [StructLayout(LayoutKind.Sequential)]
- private struct RECT { public int Left, Top, Right, Bottom; }
+ Marshal.StructureToPtr(rect, lParam, true);
- private void SetLeft(ref RECT rect)
- {
- rect.Right = rect.Right - rect.Left;
- rect.Left = 0;
- }
- private void SetTop(ref RECT rect)
- {
- rect.Bottom = rect.Bottom - rect.Top;
- rect.Top = 0;
- }
- private void SetRight(ref RECT rect, int width)
- {
- rect.Left = width - rect.Right + rect.Left;
- rect.Right = width;
- }
- private void SetBottom(ref RECT rect, int height)
- {
- rect.Top = height - rect.Bottom + rect.Top;
- rect.Bottom = height;
+ handled = true;
+ return new IntPtr(1);
}
#endregion
}
diff --git a/ClipboardIndicator/Models/ColorModel.cs b/ClipboardIndicator/Models/ColorModel.cs
new file mode 100644
index 0000000..6b16948
--- /dev/null
+++ b/ClipboardIndicator/Models/ColorModel.cs
@@ -0,0 +1,34 @@
+using System.Runtime.Serialization;
+using System.Windows.Media;
+
+namespace ClipboardIndicator
+{
+ [DataContract(Namespace = "")]
+ public class ColorModel : BindableBase
+ {
+ // 冗長だが...まあ妥協点か?
+ [DataMember(Name = "Foreground", Order = 0)]
+ public string ForegroundString
+ {
+ get => Foreground.ConvertToString();
+ set { try { Foreground = Foreground.ConvertFromString(value); } catch { } }
+ }
+ private Color _Foreground;
+ public Color Foreground { get => _Foreground; set => Set(ref _Foreground, value); }
+
+ [DataMember(Name = "Background", Order = 1)]
+ public string BackgroundString
+ {
+ get => Background.ConvertToString();
+ set { try { Background = Background.ConvertFromString(value); } catch { } }
+ }
+ private Color _Background;
+ public Color Background { get => _Background; set => Set(ref _Background, value); }
+
+ protected override void Init()
+ {
+ Foreground = Colors.Black;
+ Background = Background.ConvertFromString("#BCCBD9");
+ }
+ }
+}
diff --git a/ClipboardIndicator/Models/FontModel.cs b/ClipboardIndicator/Models/FontModel.cs
new file mode 100644
index 0000000..70c59aa
--- /dev/null
+++ b/ClipboardIndicator/Models/FontModel.cs
@@ -0,0 +1,60 @@
+using System.Runtime.Serialization;
+using System.Windows;
+using System.Windows.Media;
+
+namespace ClipboardIndicator
+{
+ [DataContract(Namespace = "")]
+ public class FontModel : BindableBase
+ {
+ // 冗長だが...まあ妥協点か?
+ [DataMember(Name = "Family", Order = 0)]
+ private string FamilyString
+ {
+ get => Family.ConvertToString();
+ set { try { Family = Family.ConvertFromString(value); } catch { } }
+ }
+ private FontFamily _Family;
+ public FontFamily Family { get => _Family; set => Set(ref _Family, value); }
+
+ [DataMember(Name = "Style", Order = 1)]
+ public string StyleString
+ {
+ get => Style.ConvertToString();
+ set { try { Style = Style.ConvertFromString(value); } catch { } }
+ }
+ private FontStyle _Style;
+ public FontStyle Style { get => _Style; set => Set(ref _Style, value); }
+
+ [DataMember(Name = "Weight", Order = 2)]
+ public string WeightString
+ {
+ get => Weight.ConvertToString();
+ set { try { Weight = Weight.ConvertFromString(value); } catch { } }
+ }
+ private FontWeight _Weight;
+ public FontWeight Weight { get => _Weight; set => Set(ref _Weight, value); }
+
+ [DataMember(Name = "Stretch", Order = 3)]
+ public string StretchString
+ {
+ get => Stretch.ConvertToString();
+ set { try { Stretch = Stretch.ConvertFromString(value); } catch { } }
+ }
+ private FontStretch _Stretch;
+ public FontStretch Stretch { get => _Stretch; set => Set(ref _Stretch, value); }
+
+ [DataMember(Name = "Size", Order = 4)]
+ private double _Size;
+ public double Size { get => _Size; set => Set(ref _Size, value); }
+
+ protected override void Init()
+ {
+ _Family = new FontFamily("Arial");
+ _Style = FontStyles.Normal;
+ _Weight = FontWeights.Black;
+ _Stretch = FontStretches.Normal;
+ _Size = 11;
+ }
+ }
+}
diff --git a/ClipboardIndicator/Models/SettingsModel.cs b/ClipboardIndicator/Models/SettingsModel.cs
new file mode 100644
index 0000000..495dc8f
--- /dev/null
+++ b/ClipboardIndicator/Models/SettingsModel.cs
@@ -0,0 +1,24 @@
+using System.Runtime.Serialization;
+
+namespace ClipboardIndicator
+{
+ [DataContract(Namespace = "", Name = "Setting")]
+ public class SettingsModel : BindableBase
+ {
+ [DataMember(Order = 0)]
+ public WindowModel Window { get; private set; }
+
+ [DataMember(Order = 1)]
+ public FontModel Font { get; private set; }
+
+ [DataMember(Order = 2)]
+ public ColorModel Color { get; private set; }
+
+ protected override void Init()
+ {
+ Window = new WindowModel();
+ Font = new FontModel();
+ Color = new ColorModel();
+ }
+ }
+}
diff --git a/ClipboardIndicator/Models/WindowModel.cs b/ClipboardIndicator/Models/WindowModel.cs
new file mode 100644
index 0000000..a797d7f
--- /dev/null
+++ b/ClipboardIndicator/Models/WindowModel.cs
@@ -0,0 +1,32 @@
+using System.Runtime.Serialization;
+
+namespace ClipboardIndicator
+{
+ [DataContract(Namespace = "")]
+ public class WindowModel : BindableBase
+ {
+ [DataMember(Name = "Top", Order = 0)]
+ private double _Top;
+ public double Top { get => _Top; set => Set(ref _Top, value); }
+
+ [DataMember(Name = "Left", Order = 1)]
+ private double _Left;
+ public double Left { get => _Left; set => Set(ref _Left, value); }
+
+ [DataMember(Name = "Width", Order = 2)]
+ private double _Width;
+ public double Width { get => _Width; set => Set(ref _Width, value); }
+
+ [DataMember(Name = "CanMove", Order = 3)]
+ private bool _CanMove;
+ public bool CanMove { get => _CanMove; set => Set(ref _CanMove, value); }
+
+ protected override void Init()
+ {
+ _Top = 0;
+ _Left = 500;
+ _Width = 100;
+ _CanMove = true;
+ }
+ }
+}
diff --git a/ClipboardIndicator/Properties/AssemblyInfo.cs b/ClipboardIndicator/Properties/AssemblyInfo.cs
index e4d266c..5548c7d 100644
--- a/ClipboardIndicator/Properties/AssemblyInfo.cs
+++ b/ClipboardIndicator/Properties/AssemblyInfo.cs
@@ -1,6 +1,4 @@
using System.Reflection;
-using System.Resources;
-using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Windows;
@@ -8,10 +6,10 @@
// アセンブリに関連付けられている情報を変更するには、
// これらの属性値を変更してください。
[assembly: AssemblyTitle("ClipboardIndicator")]
-[assembly: AssemblyDescription("")]
+[assembly: AssemblyDescription("ClipboardIndicator")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("ClipboardIndicator")]
+[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("Copyright © 2017 T.Naga")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
@@ -51,5 +49,5 @@
// すべての値を指定するか、次を使用してビルド番号とリビジョン番号を既定に設定できます
// 既定値にすることができます:
// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
+[assembly: AssemblyVersion("1.0.1.0")]
+[assembly: AssemblyFileVersion("1.0.1.0")]
diff --git a/ClipboardIndicator/Properties/Resources.Designer.cs b/ClipboardIndicator/Properties/Resources.Designer.cs
deleted file mode 100644
index 45bed4a..0000000
--- a/ClipboardIndicator/Properties/Resources.Designer.cs
+++ /dev/null
@@ -1,63 +0,0 @@
-//------------------------------------------------------------------------------
-//
-// このコードはツールによって生成されました。
-// ランタイム バージョン:4.0.30319.42000
-//
-// このファイルへの変更は、以下の状況下で不正な動作の原因になったり、
-// コードが再生成されるときに損失したりします。
-//
-//------------------------------------------------------------------------------
-
-namespace ClipboardIndicator.Properties {
- using System;
-
-
- ///
- /// ローカライズされた文字列などを検索するための、厳密に型指定されたリソース クラスです。
- ///
- // このクラスは StronglyTypedResourceBuilder クラスが ResGen
- // または Visual Studio のようなツールを使用して自動生成されました。
- // メンバーを追加または削除するには、.ResX ファイルを編集して、/str オプションと共に
- // ResGen を実行し直すか、または VS プロジェクトをビルドし直します。
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
- internal class Resources {
-
- private static global::System.Resources.ResourceManager resourceMan;
-
- private static global::System.Globalization.CultureInfo resourceCulture;
-
- [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
- internal Resources() {
- }
-
- ///
- /// このクラスで使用されているキャッシュされた ResourceManager インスタンスを返します。
- ///
- [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
- internal static global::System.Resources.ResourceManager ResourceManager {
- get {
- if (object.ReferenceEquals(resourceMan, null)) {
- global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ClipboardIndicator.Properties.Resources", typeof(Resources).Assembly);
- resourceMan = temp;
- }
- return resourceMan;
- }
- }
-
- ///
- /// 厳密に型指定されたこのリソース クラスを使用して、すべての検索リソースに対し、
- /// 現在のスレッドの CurrentUICulture プロパティをオーバーライドします。
- ///
- [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
- internal static global::System.Globalization.CultureInfo Culture {
- get {
- return resourceCulture;
- }
- set {
- resourceCulture = value;
- }
- }
- }
-}
diff --git a/ClipboardIndicator/Properties/Resources.resx b/ClipboardIndicator/Properties/Resources.resx
deleted file mode 100644
index af7dbeb..0000000
--- a/ClipboardIndicator/Properties/Resources.resx
+++ /dev/null
@@ -1,117 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- text/microsoft-resx
-
-
- 2.0
-
-
- System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
\ No newline at end of file
diff --git a/ClipboardIndicator/Properties/Settings.Designer.cs b/ClipboardIndicator/Properties/Settings.Designer.cs
deleted file mode 100644
index 664539b..0000000
--- a/ClipboardIndicator/Properties/Settings.Designer.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-//------------------------------------------------------------------------------
-//
-// このコードはツールによって生成されました。
-// ランタイム バージョン:4.0.30319.42000
-//
-// このファイルへの変更は、以下の状況下で不正な動作の原因になったり、
-// コードが再生成されるときに損失したりします。
-//
-//------------------------------------------------------------------------------
-
-namespace ClipboardIndicator.Properties {
-
-
- [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.1.0.0")]
- public sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
-
- private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
-
- public static Settings Default {
- get {
- return defaultInstance;
- }
- }
- }
-}
diff --git a/ClipboardIndicator/Properties/Settings.settings b/ClipboardIndicator/Properties/Settings.settings
deleted file mode 100644
index 8e615f2..0000000
--- a/ClipboardIndicator/Properties/Settings.settings
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/ClipboardIndicator/SettingWindow.xaml b/ClipboardIndicator/SettingWindow.xaml
index e402dda..0e31247 100644
--- a/ClipboardIndicator/SettingWindow.xaml
+++ b/ClipboardIndicator/SettingWindow.xaml
@@ -6,8 +6,9 @@
xmlns:font="clr-namespace:FontChoices;assembly=FontChoices"
xmlns:l="clr-namespace:ClipboardIndicator"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+ xmlns:utility="clr-namespace:ClipboardIndicator.Utility"
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
- Title="{Binding AssemblyName, Mode=OneWay, StringFormat=設定 - \{0\}}"
+ Title="{Binding Source={x:Static utility:ProductInfo.Name}, StringFormat=設定 - \{0\}}"
Width="400"
Height="350"
d:DataContext="{d:DesignInstance {x:Type l:SettingsModel}}"
@@ -28,40 +29,31 @@
SelectedFontStyle="{Binding Font.Style}"
SelectedFontWeight="{Binding Font.Weight}" />
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/ClipboardIndicator/SettingWindow.xaml.cs b/ClipboardIndicator/SettingWindow.xaml.cs
index 61c9fb5..4b0e154 100644
--- a/ClipboardIndicator/SettingWindow.xaml.cs
+++ b/ClipboardIndicator/SettingWindow.xaml.cs
@@ -1,23 +1,19 @@
using System;
-using System.Runtime.InteropServices;
+using System.ComponentModel;
using System.Windows;
-using System.Windows.Interop;
namespace ClipboardIndicator
{
public partial class SettingWindow : Window
{
- public SettingWindow()
- {
- InitializeComponent();
- }
+ public SettingWindow() => InitializeComponent();
protected override void OnSourceInitialized(EventArgs e)
{
base.OnSourceInitialized(e);
this.HideMinMaxButton();
}
- protected override void OnClosing(System.ComponentModel.CancelEventArgs e)
+ protected override void OnClosing(CancelEventArgs e)
{
base.OnClosing(e);
@@ -25,25 +21,4 @@ protected override void OnClosing(System.ComponentModel.CancelEventArgs e)
Hide();
}
}
-
- internal static class WindowExtensions
- {
- private const int GWL_STYLE = -16;
- private const int WS_MAXIMIZEBOX = 0x10000;
- private const int WS_MINIMIZEBOX = 0x20000;
-
- [DllImport("user32.dll")]
- extern private static int GetWindowLong(IntPtr hwnd, int index);
-
- [DllImport("user32.dll")]
- extern private static int SetWindowLong(IntPtr hwnd, int index, int value);
-
- internal static void HideMinMaxButton(this Window window)
- {
- var hwnd = new WindowInteropHelper(window).Handle;
- var style = GetWindowLong(hwnd, GWL_STYLE) & ~WS_MAXIMIZEBOX & ~WS_MINIMIZEBOX;
-
- SetWindowLong(hwnd, GWL_STYLE, style);
- }
- }
}
diff --git a/ClipboardIndicator/SettingsModel.cs b/ClipboardIndicator/SettingsModel.cs
deleted file mode 100644
index c2a1380..0000000
--- a/ClipboardIndicator/SettingsModel.cs
+++ /dev/null
@@ -1,159 +0,0 @@
-using System.ComponentModel;
-using System.Reflection;
-using System.Runtime.Serialization;
-using System.Windows;
-using System.Windows.Media;
-
-namespace ClipboardIndicator
-{
- [DataContract(Namespace = "")]
- public class ColorModel : BindableBase
- {
- #region Foreground
- [DataMember(Name = "Foreground", Order = 0)]
- public string ForegroundString
- {
- get => Foreground.ConvertToString();
- set { try { Foreground = Foreground.ConvertFromString(value); } catch { } }
- }
- private Color _Foreground;
- public Color Foreground { get => _Foreground; set => SetProperty(ref _Foreground, value); }
- #endregion
- #region Background
- [DataMember(Name = "Background", Order = 1)]
- public string BackgroundString
- {
- get => Background.ConvertToString();
- set { try { Background = Background.ConvertFromString(value); } catch { } }
- }
- private Color _Background;
- public Color Background { get => _Background; set => SetProperty(ref _Background, value); }
- #endregion
-
- protected override void Init()
- {
- Foreground = Colors.Black;
- Background = Background.ConvertFromString("#BCCBD9");
- }
- }
-
- [DataContract(Namespace = "")]
- public class WindowModel : BindableBase
- {
- [DataMember(Name = "Top", Order = 0)]
- private double _Top;
- public double Top { get => _Top; set => SetProperty(ref _Top, value); }
-
- [DataMember(Name = "Left", Order = 1)]
- private double _Left;
- public double Left { get => _Left; set => SetProperty(ref _Left, value); }
-
- [DataMember(Name = "Width", Order = 2)]
- private double _Width;
- public double Width { get => _Width; set => SetProperty(ref _Width, value); }
-
- //[DataMember(Order = 3, Name = "Height")]
- //private double _Height;
- //public double Height { get => _Height; set => SetProperty(ref _Height, value); }
-
- [DataMember(Name = "CanMove", Order = 4)]
- private bool _CanMove;
- public bool CanMove { get { return _CanMove; } set { SetProperty(ref _CanMove, value); } }
-
- protected override void Init()
- {
- _Top = 0;
- _Left = 500;
- _Width = 100;
- //_Height = 600;
- _CanMove = true;
- }
- }
-
- [DataContract(Namespace = "")]
- public class FontModel : BindableBase
- {
- #region Family
- [DataMember(Name = "Family", Order = 0)]
- private string FamilyString
- {
- get => Family.ConvertToString();
- set { try { Family = Family.ConvertFromString(value); } catch { } }
- }
- private FontFamily _Family;
- public FontFamily Family { get => _Family; set => SetProperty(ref _Family, value); }
- #endregion
- #region Style
- [DataMember(Name = "Style", Order = 1)]
- public string StyleString
- {
- get => Style.ConvertToString();
- set { try { Style = Style.ConvertFromString(value); } catch { } }
- }
- private FontStyle _Style;
- public FontStyle Style { get => _Style; set => SetProperty(ref _Style, value); }
- #endregion
- #region Weight
- [DataMember(Name = "Weight", Order = 2)]
- public string WeightString
- {
- get => Weight.ConvertToString();
- set { try { Weight = Weight.ConvertFromString(value); } catch { } }
- }
- private FontWeight _Weight;
- public FontWeight Weight { get => _Weight; set => SetProperty(ref _Weight, value); }
- #endregion
- #region Stretch
- [DataMember(Name = "Stretch", Order = 3)]
- public string StretchString
- {
- get => Stretch.ConvertToString();
- set { try { Stretch = Stretch.ConvertFromString(value); } catch { } }
- }
- private FontStretch _Stretch;
- public FontStretch Stretch { get => _Stretch; set => SetProperty(ref _Stretch, value); }
- #endregion
- [DataMember(Name = "Size", Order = 4)]
- private double _Size;
- public double Size { get => _Size; set => SetProperty(ref _Size, value); }
-
- protected override void Init()
- {
- _Family = new FontFamily("Arial");
- _Style = FontStyles.Normal;
- _Weight = FontWeights.Black;
- _Stretch = FontStretches.Normal;
- _Size = 11;
- }
- }
-
- [DataContract(Namespace = "", Name = "Setting")]
- public class SettingsModel : BindableBase
- {
- public string AssemblyName { get; } = Assembly.GetEntryAssembly().GetName().Name;
-
- [DataMember(Order = 0)]
- public WindowModel Window { get; private set; }
-
- [DataMember(Order = 1)]
- public FontModel Font { get; private set; }
-
- [DataMember(Order = 2)]
- public ColorModel Color { get; private set; }
-
- protected override void Init()
- {
- Window = new WindowModel();
- Font = new FontModel();
- Color = new ColorModel();
- }
- }
-
- internal static class ConvertExtensions
- {
- public static T ConvertFromString(this T target, string value)
- => (T)TypeDescriptor.GetConverter(target.GetType()).ConvertFrom(value);
- public static string ConvertToString(this T value)
- => (string)TypeDescriptor.GetConverter(value.GetType()).ConvertTo(value, typeof(string));
- }
-}
diff --git a/ClipboardIndicator/Utility/BindableBase.cs b/ClipboardIndicator/Utility/BindableBase.cs
index c490d86..2e5d2b5 100644
--- a/ClipboardIndicator/Utility/BindableBase.cs
+++ b/ClipboardIndicator/Utility/BindableBase.cs
@@ -4,19 +4,15 @@
namespace ClipboardIndicator
{
+ ///シリアライズ向けBindableBase
[DataContract]
public abstract class BindableBase : INotifyPropertyChanged
{
- public event PropertyChangedEventHandler PropertyChanged { add { handler += value; } remove { handler -= value; } }
+ public event PropertyChangedEventHandler PropertyChanged;
- private PropertyChangedEventHandler handler;
+ public BindableBase() => Init();
- public BindableBase()
- {
- Init();
- }
-
- protected virtual bool SetProperty(ref T storage, T value, [CallerMemberName] string propertyName = null)
+ protected virtual bool Set(ref T storage, T value, [CallerMemberName] string propertyName = null)
{
if(Equals(storage, value))
return false;
@@ -26,10 +22,10 @@ protected virtual bool SetProperty(ref T storage, T value, [CallerMemberName]
return true;
}
protected void OnPropertyChanged([CallerMemberName] string propertyName = null)
- => handler?.Invoke(this, new PropertyChangedEventArgs(propertyName));
+ => PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
[OnDeserializing]
- protected void OnDeserializing(StreamingContext sc) => Init();
+ private void OnDeserializing(StreamingContext sc) => Init();
///デシリアライズ時の初期値設定
protected virtual void Init() { }
}
diff --git a/ClipboardIndicator/Utility/BoolInvertConverter.cs b/ClipboardIndicator/Utility/BoolInvertConverter.cs
index d1b08d3..3f0715f 100644
--- a/ClipboardIndicator/Utility/BoolInvertConverter.cs
+++ b/ClipboardIndicator/Utility/BoolInvertConverter.cs
@@ -7,10 +7,8 @@ namespace ClipboardIndicator
public class BoolInvertConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
- {
- if(value is bool val) return !val;
- return false;
- }
+ => value is bool ? !(bool)value : false;
+
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
=> Convert(value, targetType, parameter, culture);
}
diff --git a/ClipboardIndicator/Utility/DelegateCommand.cs b/ClipboardIndicator/Utility/DelegateCommand.cs
index dd49967..be42646 100644
--- a/ClipboardIndicator/Utility/DelegateCommand.cs
+++ b/ClipboardIndicator/Utility/DelegateCommand.cs
@@ -1,7 +1,7 @@
//(c)okazuki 2010
//http://blog.okazuki.jp/entry/20100223/1266897125
-//Tooltip等用のTextプロパティを追加 TN
+//Tooltip等用のTextプロパティを追加 T.Naga
using System;
using System.Windows.Input;
@@ -41,10 +41,7 @@ public sealed class DelegateCommand : ICommand
private Func _canExecute;
private static readonly bool IS_VALUE_TYPE;
- static DelegateCommand()
- {
- IS_VALUE_TYPE = typeof(T).IsValueType;
- }
+ static DelegateCommand() => IS_VALUE_TYPE = typeof(T).IsValueType;
public DelegateCommand(Action execute) : this(null, execute, o => true) { }
public DelegateCommand(Action execute, Func canExecute) : this(null, execute, canExecute) { }
diff --git a/ClipboardIndicator/Utility/ProductInfo.cs b/ClipboardIndicator/Utility/ProductInfo.cs
new file mode 100644
index 0000000..928a356
--- /dev/null
+++ b/ClipboardIndicator/Utility/ProductInfo.cs
@@ -0,0 +1,27 @@
+using System;
+using System.Reflection;
+
+namespace ClipboardIndicator.Utility
+{
+ ///アセンブリ情報
+ public static class ProductInfo
+ {
+ public static string Name { get; }
+ public static string Version { get; }
+ public static string Description { get; }
+ public static string Copyright { get; }
+
+ static ProductInfo()
+ {
+ var assembly = Assembly.GetExecutingAssembly();
+ Name = assembly.GetName().Name;
+ var version = assembly.GetName().Version;
+ Version = $"{version.Major}.{version.Minor}.{version.Build}";
+ Description = Get(assembly).Description;
+ Copyright = Get(assembly).Copyright;
+
+ T Get(Assembly a) where T : Attribute
+ => (T)Attribute.GetCustomAttribute(a, typeof(T));
+ }
+ }
+}
diff --git a/ClipboardIndicator/Utility/SerializeHelper.cs b/ClipboardIndicator/Utility/SerializeHelper.cs
index 920405c..68ad624 100644
--- a/ClipboardIndicator/Utility/SerializeHelper.cs
+++ b/ClipboardIndicator/Utility/SerializeHelper.cs
@@ -18,9 +18,7 @@ namespace ClipboardIndicator
/// ファイルへのシリアライズヘルパー
/// ファイル先頭に書き込むコメント中の名前 特にチェックはしない デフォルトAssemblyName
public SerializeHelper(string appName = null)
- {
- this.appName = appName ?? Assembly.GetEntryAssembly().GetName().Name;
- }
+ => this.appName = appName ?? Assembly.GetEntryAssembly().GetName().Name;
private string GetConfigFilePath()
{
@@ -63,7 +61,7 @@ public T Load(string path = null)
public void Save(T obj, bool displaySaveError = true)
{
if(xmlPath == null) throw new InvalidOperationException("Load前にSaveはできません。");
- SaveAs(obj, xmlPath);
+ SaveAs(obj, xmlPath, displaySaveError);
}
/// 名前を付けてファイルにシリアライズ
/// 保存失敗時にダイアログを出すかどうか true:出す
diff --git a/ClipboardIndicator/ViewModel.cs b/ClipboardIndicator/ViewModel.cs
index 51959dc..3d2aa12 100644
--- a/ClipboardIndicator/ViewModel.cs
+++ b/ClipboardIndicator/ViewModel.cs
@@ -4,21 +4,21 @@ namespace ClipboardIndicator
{
public class ViewModel : BindableBase
{
- public string ClipboardText { get => _ClipboardText; set => SetProperty(ref _ClipboardText, value); }
+ public string ClipboardText { get => _ClipboardText; set => Set(ref _ClipboardText, value); }
private string _ClipboardText;
public SettingsModel Setting { get; }
public SettingWindow SettingWindow { get; }
public DelegateCommand ClearCommand { get; }
- public DelegateCommand CloseCommand { get; }
+ public DelegateCommand TopMostCommand { get; }
public DelegateCommand ShowSettingCommand { get; }
public DelegateCommand ShowAboutCommand { get; }
+ public DelegateCommand CloseCommand { get; }
- public ViewModel()
- {
- Setting = new SettingsModel();
- }
+ // DesignInstance用
+ public ViewModel() => Setting = new SettingsModel();
+ // clip <- MainWindowから注入
public ViewModel(ClipboardService clip)
{
var serializer = new SerializeHelper();
@@ -27,21 +27,27 @@ public ViewModel(ClipboardService clip)
SettingWindow = new SettingWindow();
SettingWindow.DataContext = Setting;
- ClearCommand = new DelegateCommand(async () => await clip.ClearAsync());
- ShowSettingCommand = new DelegateCommand(() => SettingWindow.Show());
- CloseCommand = new DelegateCommand(() =>
+ ClearCommand = new DelegateCommand(() => clip.Clear());
+ TopMostCommand = new DelegateCommand(() =>
{
- serializer.Save(Setting);
- Application.Current.MainWindow.Close();
+ var w = Application.Current.MainWindow;
+ w.Topmost = false;
+ w.Topmost = true;
});
+ ShowSettingCommand = new DelegateCommand(() => SettingWindow.Show());
ShowAboutCommand = new DelegateCommand(() =>
{
var dlg = new About();
dlg.Owner = Application.Current.MainWindow;
dlg.ShowDialog();
});
+ CloseCommand = new DelegateCommand(() =>
+ {
+ serializer.Save(Setting);
+ Application.Current.MainWindow.Close();
+ });
- clip.ClipboardCopied += txt => ClipboardText = txt;
+ clip.ClipboardCopied += text => ClipboardText = text;
}
}
}
diff --git a/README.md b/README.md
index 55c6eff..33f4bc7 100644
--- a/README.md
+++ b/README.md
@@ -1,21 +1,30 @@
# ClipboardIndicator
![AvXN[Vbg](https://github.com/TN8001/ClipboardIndicator/blob/master/AppImage.png)
## Tv
-Nbv{[hɕĂ邩mF풓^AvB
+Nbv{[hɕĂ邩mF****̏풓^AvB
##
* ŒRs[omF邾̏i傫o܂j
-* ̂ŋNɌȂ߂̃As[@\iĂ܂Α債Ƃ͂Ă܂ ɋĴŎQlɂĒKłj
-* Nbv{[h̃NA@\
+* ̂ŋNɌȂ߂̃As[@\i債Ƃ͂Ă܂ ӊOƋĴŎQlɂĒKłj
+* NbNŃNbv{[h̃NA
## g
1. N
1. DȈʒuɈړ
1. ENbNŐݒDɕς
-1. D݂ŃX^[gAbvɓĂ
+1. D݂ŃX^[gAbvɓ
ȏ
## CZX
[MIT](https://github.com/TN8001/ClipboardIndicator/blob/master/LICENSE)
## ӎ
+* .NETFramework 4.7ȏ
* ؐӔC͎܂
* st@C̃tH_ɐݒt@Ĉŏ߂tH_ɂĂiProgram Files͔Ăj
* ʂ͂ݏoȂ@\̂߃}`j^ɂ͕sΉ
+## ӎ
+J[sbJ[EAbv_ERg[ɁAL𗘗pĒĂ܂B
+[Extended WPF Toolkit](https://github.com/xceedsoftware/wpftoolkit) Copyright (C) 2007-2013 Xceed Software Inc.
+
+
+## XV
+* 2017/06/20 ver1.0.0 [X
+* 2018/01/20 ver1.0.1 uőOʍĐݒvʼnĂȂ rhύX
\ No newline at end of file