perf: rename (un)topmost

dev_deconstruction
DESKTOP-3BO4HSG\ksat 2 years ago
parent 04ff8fc649
commit f14aac14a9

Before

Width:  |  Height:  |  Size: 772 B

After

Width:  |  Height:  |  Size: 772 B

Before

Width:  |  Height:  |  Size: 631 B

After

Width:  |  Height:  |  Size: 631 B

@ -101,7 +101,7 @@ namespace STranslate
this.Hide();
//取消置顶
vm.TopImgSource = UnLockImgPath;
vm.TopImgSource = _UnTopmost;
}
//置顶 Ctrl+Shift+T
if (e.KeyboardDevice.Modifiers.HasFlag(ModifierKeys.Control)
@ -174,7 +174,7 @@ namespace STranslate
/// <param name="e"></param>
private void Window_Deactivated(object sender, EventArgs e)
{
if (vm.TopImgSource == UnLockImgPath)
if (vm.TopImgSource == _UnTopmost)
{
this.Hide();
}
@ -259,7 +259,7 @@ namespace STranslate
/// <param name="e"></param>
private void Top_Click(object sender, RoutedEventArgs e)
{
vm.TopImgSource = vm.TopImgSource == LockImgPath ? UnLockImgPath : LockImgPath;
vm.TopImgSource = vm.TopImgSource == _Topmost ? _UnTopmost : _Topmost;
}
/// <summary>
/// 退出
@ -274,13 +274,13 @@ namespace STranslate
}
private void InitView()
{
vm.TopImgSource = UnLockImgPath;
vm.TopImgSource = _UnTopmost;
this.Activate();
this.TextBoxInput.Focus();
}
private BitmapImage LockImgPath = new BitmapImage(new Uri("pack://application:,,,/STranslate;component/Images/Button_Default/lock.png"));
private BitmapImage UnLockImgPath = new BitmapImage(new Uri("pack://application:,,,/STranslate;component/Images/Button_Default/unlock.png"));
private static readonly BitmapImage _Topmost = new BitmapImage(new Uri("pack://application:,,,/STranslate;component/Images/Button_Default/topmost.png"));
private static readonly BitmapImage _UnTopmost = new BitmapImage(new Uri("pack://application:,,,/STranslate;component/Images/Button_Default/untopmost.png"));
private System.Windows.Forms.NotifyIcon notifyIcon = new System.Windows.Forms.NotifyIcon();
}
}

@ -60,16 +60,6 @@ namespace STranslate.Properties {
}
}
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
internal static System.Drawing.Bitmap _lock {
get {
object obj = ResourceManager.GetObject("_lock", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
@ -140,6 +130,16 @@ namespace STranslate.Properties {
}
}
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
internal static System.Drawing.Bitmap topmost {
get {
object obj = ResourceManager.GetObject("topmost", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// 查找类似于 (图标) 的 System.Drawing.Icon 类型的本地化资源。
/// </summary>
@ -153,9 +153,9 @@ namespace STranslate.Properties {
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
internal static System.Drawing.Bitmap unlock {
internal static System.Drawing.Bitmap untopmost {
get {
object obj = ResourceManager.GetObject("unlock", resourceCulture);
object obj = ResourceManager.GetObject("untopmost", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}

@ -139,16 +139,16 @@
<data name="screenshot" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\tray\screenshot.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="topmost" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\button_default\topmost.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="translate" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\translate.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="unlock" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\button_default\unlock.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
<data name="untopmost" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\button_default\untopmost.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="window" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\tray\window.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="_lock" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\button_default\lock.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>

@ -153,10 +153,10 @@
<Resource Include="Images\Tray\window.ico">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Resource>
<Resource Include="Images\Button_Default\unlock.png">
<Resource Include="Images\Button_Default\untopmost.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Resource>
<Resource Include="Images\Button_Default\lock.png">
<Resource Include="Images\Button_Default\topmost.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Resource>
<Resource Include="Images\translate.ico">

Loading…
Cancel
Save