dev_without_third_libraries
DESKTOP-3BO4HSG\ksat 2 years ago
parent c7f13fbbb2
commit 8f22076df3

@ -1,11 +1,10 @@
<Window x:Class="STranslate.MainWindow" <Window x:Class="STranslate.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 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:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:STranslate"
xmlns:hc="https://handyorg.github.io/handycontrol"
xmlns:vm="clr-namespace:STranslate.ViewModel" xmlns:vm="clr-namespace:STranslate.ViewModel"
xmlns:hc="https://handyorg.github.io/handycontrol"
mc:Ignorable="d" mc:Ignorable="d"
Background="Transparent" Background="Transparent"
WindowStartupLocation="CenterScreen" WindowStartupLocation="CenterScreen"
@ -21,7 +20,7 @@
Width="400" Width="400"
Icon="/Images/translate2.ico"> Icon="/Images/translate2.ico">
<Window.DataContext> <Window.DataContext>
<vm:MainVM/> <vm:MainVM />
</Window.DataContext> </Window.DataContext>
<Border BorderThickness="0" <Border BorderThickness="0"
Background="#fff" Background="#fff"
@ -49,10 +48,10 @@
<MenuItem x:Name="InputTranslateMenuItem" <MenuItem x:Name="InputTranslateMenuItem"
Click="InputTranslateMenuItem_Click" Click="InputTranslateMenuItem_Click"
Header="输入翻译" /> Header="输入翻译" />
<Separator/> <Separator />
<MenuItem Command="hc:ControlCommands.PushMainWindow2Top" <MenuItem Command="hc:ControlCommands.PushMainWindow2Top"
Header="显示主界面" /> Header="显示主界面" />
<Separator/> <Separator />
<MenuItem Command="hc:ControlCommands.ShutdownApp" <MenuItem Command="hc:ControlCommands.ShutdownApp"
Header="退出" /> Header="退出" />
</ContextMenu> </ContextMenu>

@ -13,6 +13,7 @@ namespace STranslate
public partial class MainWindow : Window public partial class MainWindow : Window
{ {
private MainVM vm; private MainVM vm;
public MainWindow() public MainWindow()
{ {
InitializeComponent(); InitializeComponent();
@ -110,6 +111,7 @@ namespace STranslate
HwndSource source = HwndSource.FromHwnd(handle); HwndSource source = HwndSource.FromHwnd(handle);
source.AddHook(WndProc); source.AddHook(WndProc);
} }
/// <summary> /// <summary>
/// 热键的功能 /// 热键的功能
/// </summary> /// </summary>
@ -154,7 +156,6 @@ namespace STranslate
{ {
vm.InputTxt = string.Empty; vm.InputTxt = string.Empty;
vm.OutputTxt = string.Empty; vm.OutputTxt = string.Empty;
} }
/// <summary> /// <summary>

@ -1,9 +1,5 @@
using System; using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading; using System.Threading;
using System.Threading.Tasks;
using System.Windows; using System.Windows;
namespace STranslate.Utils namespace STranslate.Utils
@ -48,6 +44,5 @@ namespace STranslate.Utils
} }
return null; return null;
} }
} }
} }

@ -1,5 +1,4 @@
using STranslate.Model; using System;
using System;
using static STranslate.Utils.NativeMethod; using static STranslate.Utils.NativeMethod;
namespace STranslate.Utils namespace STranslate.Utils
@ -13,6 +12,7 @@ namespace STranslate.Utils
public static String Text = "A"; public static String Text = "A";
public static bool Conflict = false; public static bool Conflict = false;
} }
public static class CrosswordTranslate public static class CrosswordTranslate
{ {
public static byte Modifiers = (byte)KeyModifiers.MOD_CTRL; public static byte Modifiers = (byte)KeyModifiers.MOD_CTRL;
@ -20,6 +20,7 @@ namespace STranslate.Utils
public static String Text = "D"; public static String Text = "D";
public static bool Conflict = false; public static bool Conflict = false;
} }
public static class ScreenShotTranslate public static class ScreenShotTranslate
{ {
public static byte Modifiers = (byte)KeyModifiers.MOD_CTRL; public static byte Modifiers = (byte)KeyModifiers.MOD_CTRL;
@ -29,7 +30,6 @@ namespace STranslate.Utils
} }
} }
internal class HotKeysUtil internal class HotKeysUtil
{ {
public static IntPtr mainFormHandle; public static IntPtr mainFormHandle;

Loading…
Cancel
Save