Compare commits
18 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bc7d125801 | ||
|
|
bf5a6da448 | ||
|
|
2d2f1672dd | ||
|
|
072985d2b6 | ||
|
|
e5f1368c8b | ||
|
|
89ebbbed78 | ||
|
|
c1d6aec622 | ||
|
|
fbcd55b586 | ||
|
|
9053f4c25b | ||
|
|
13fbacba40 | ||
|
|
dee1caa435 | ||
|
|
dedf20528f | ||
|
|
33b9d3af42 | ||
|
|
4f59c2c64d | ||
|
|
701734e048 | ||
|
|
78b685c9ed | ||
|
|
746eda8b84 | ||
|
|
b4215fb27d |
14
App.config
14
App.config
@@ -19,14 +19,13 @@
|
|||||||
<add key="Services" value="服务" />
|
<add key="Services" value="服务" />
|
||||||
</SystemIcons>
|
</SystemIcons>
|
||||||
<SystemBGs>
|
<SystemBGs>
|
||||||
<GradientBGParam Color1="#FCCF31" Color2="#F55555" Name="诸神黄昏" />
|
<GradientBGParam Color1="#FCCF31" Color2="#F55555" Name="诸神黄昏"/>
|
||||||
</SystemBGs>
|
</SystemBGs>
|
||||||
<startup>
|
<startup>
|
||||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
|
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
|
||||||
</startup>
|
</startup>
|
||||||
<runtime>
|
<runtime>
|
||||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||||
<probing privatePath="lib" />
|
|
||||||
<dependentAssembly>
|
<dependentAssembly>
|
||||||
<assemblyIdentity name="CommonServiceLocator" publicKeyToken="489b6accfaf20ef0" culture="neutral" />
|
<assemblyIdentity name="CommonServiceLocator" publicKeyToken="489b6accfaf20ef0" culture="neutral" />
|
||||||
<bindingRedirect oldVersion="0.0.0.0-2.0.6.0" newVersion="2.0.6.0" />
|
<bindingRedirect oldVersion="0.0.0.0-2.0.6.0" newVersion="2.0.6.0" />
|
||||||
@@ -47,22 +46,17 @@
|
|||||||
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||||
<bindingRedirect oldVersion="0.0.0.0-4.0.1.1" newVersion="4.0.1.1" />
|
<bindingRedirect oldVersion="0.0.0.0-4.0.1.1" newVersion="4.0.1.1" />
|
||||||
</dependentAssembly>
|
</dependentAssembly>
|
||||||
<dependentAssembly>
|
|
||||||
<assemblyIdentity name="Microsoft.Extensions.Logging.Abstractions" publicKeyToken="adb9793829ddae60" culture="neutral" />
|
|
||||||
<bindingRedirect oldVersion="0.0.0.0-2.1.1.0" newVersion="2.1.1.0" />
|
|
||||||
</dependentAssembly>
|
|
||||||
</assemblyBinding>
|
</assemblyBinding>
|
||||||
</runtime>
|
</runtime>
|
||||||
<appSettings>
|
<appSettings>
|
||||||
<add key="Version" value="2.5.11" />
|
<add key="Version" value="2.4.15" />
|
||||||
<add key="GitHubUrl" value="https://github.com/BookerLiu/GeekDesk" />
|
<add key="GitHubUrl" value="https://github.com/BookerLiu/GeekDesk" />
|
||||||
<add key="GiteeUrl" value="https://gitee.com/BookerLiu/GeekDesk/tree/master" />
|
<add key="GiteeUrl" value="https://gitee.com/BookerLiu/GeekDesk/tree/master" />
|
||||||
<add key="GitHubUpdateUrl" value="https://raw.githubusercontent.com/BookerLiu/GeekDesk/master/Update.json" />
|
<add key="GitHubUpdateUrl" value="https://raw.githubusercontent.com/BookerLiu/GeekDesk/master/Update.json" />
|
||||||
<add key="GiteeUpdateUrl" value="https://gitee.com/BookerLiu/GeekDesk/raw/master/Update.json" />
|
<add key="GiteeUpdateUrl" value="https://gitee.com/BookerLiu/GeekDesk/raw/master/Update.json" />
|
||||||
<!--<add key="GiteeUpdateUrl" value="file:///D:/WorkSpace/workspace-VS/GeekDesk/Update.json" />-->
|
<!--<add key="GiteeUpdateUrl" value="file:///C:/Users/Fei/Desktop/GeekDesk/Update.json" />-->
|
||||||
<add key="ClientSettingsProvider.ServiceUri" value="" />
|
<add key="ClientSettingsProvider.ServiceUri" value="" />
|
||||||
<add key="CustomIconTeachUrl" value="https://mp.weixin.qq.com/s/LxoHAekho9HBVl4FRw_Law" />
|
<add key="CustomIconTeachUrl" value="https://mp.weixin.qq.com/s/LxoHAekho9HBVl4FRw_Law" />
|
||||||
<add key="ShowPublicWeChat" value="Y"/>
|
|
||||||
</appSettings>
|
</appSettings>
|
||||||
<system.web>
|
<system.web>
|
||||||
<membership defaultProvider="ClientAuthenticationMembershipProvider">
|
<membership defaultProvider="ClientAuthenticationMembershipProvider">
|
||||||
|
|||||||
2
App.xaml
2
App.xaml
@@ -13,8 +13,6 @@
|
|||||||
<ResourceDictionary Source="pack://application:,,,/HandyControl;component/Themes/SkinDefault.xaml"/>
|
<ResourceDictionary Source="pack://application:,,,/HandyControl;component/Themes/SkinDefault.xaml"/>
|
||||||
<ResourceDictionary Source="pack://application:,,,/HandyControl;component/Themes/Theme.xaml"/>
|
<ResourceDictionary Source="pack://application:,,,/HandyControl;component/Themes/Theme.xaml"/>
|
||||||
<ResourceDictionary Source="/GeekDesk;component/Resource/Dictionary/CommonStyle.xaml"/>
|
<ResourceDictionary Source="/GeekDesk;component/Resource/Dictionary/CommonStyle.xaml"/>
|
||||||
<ResourceDictionary Source="pack://application:,,,/XamlFlair.WPF;component/DefaultAnimations.xaml"/>
|
|
||||||
<ResourceDictionary Source="/GeekDesk;component/Resource/Dictionary/XamlFlairSettings.xaml"/>
|
|
||||||
</ResourceDictionary.MergedDictionaries>
|
</ResourceDictionary.MergedDictionaries>
|
||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
||||||
</Application.Resources>
|
</Application.Resources>
|
||||||
|
|||||||
@@ -13,22 +13,14 @@ namespace GeekDesk.Constant
|
|||||||
|
|
||||||
public static string MY_NAME = DEV ? "GeekDesk-D" : "GeekDesk";
|
public static string MY_NAME = DEV ? "GeekDesk-D" : "GeekDesk";
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// app数据文件路径
|
/// app数据文件路径
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static string DATA_FILE_PATH = APP_DIR + "Data"; //app数据文件路径
|
public static string DATA_FILE_PATH = APP_DIR + "Data"; //app数据文件路径
|
||||||
|
|
||||||
/// <summary>
|
public static string LOG_FILE_PATH = APP_DIR + "Log.log";
|
||||||
/// 备份文件路径
|
|
||||||
/// </summary>
|
|
||||||
public static string DATA_FILE_BAK_PATH = APP_DIR + "bak\\Data.bak"; //app备份数据文件路径
|
|
||||||
|
|
||||||
public static string PW_FILE_BAK_PATH = APP_DIR + "bak\\pw.txt"; //密码文件路径
|
public static string ERROR_FILE_PATH = APP_DIR + "Error.log";
|
||||||
|
|
||||||
public static string LOG_FILE_PATH = APP_DIR + "logs\\log.log"; //日志文件
|
|
||||||
|
|
||||||
public static string ERROR_FILE_PATH = APP_DIR + "logs\\error.log"; // 错误日志
|
|
||||||
|
|
||||||
public static int SHADOW_WIDTH = 20;
|
public static int SHADOW_WIDTH = 20;
|
||||||
|
|
||||||
|
|||||||
@@ -1,16 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace GeekDesk.Constant
|
|
||||||
{
|
|
||||||
public enum PasswordType
|
|
||||||
{
|
|
||||||
INPUT = 0, //键入密码
|
|
||||||
CREATE = 1, //新建密码
|
|
||||||
ALTER = 2, //修改密码
|
|
||||||
CANCEL = 3, //取消密码
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -20,25 +20,7 @@
|
|||||||
public static bool LOCK_APP_PANEL = false;
|
public static bool LOCK_APP_PANEL = false;
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 是否弹出了菜单密码框
|
|
||||||
/// </summary>
|
|
||||||
public static bool SHOW_MENU_PASSWORDBOX = false;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 是否弹出了右键菜单
|
|
||||||
/// </summary>
|
|
||||||
public static bool SHOW_RIGHT_BTN_MENU = false;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 是否点击了面板功能按钮
|
|
||||||
/// </summary>
|
|
||||||
public static bool APP_BTN_IS_DOWN = false;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 是否正在编辑菜单
|
|
||||||
/// </summary>
|
|
||||||
public static bool IS_MENU_EDIT = false;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ namespace GeekDesk.Control.Other
|
|||||||
}
|
}
|
||||||
ToDoTask.activityBacklog[info].Close(); //关闭桌面通知
|
ToDoTask.activityBacklog[info].Close(); //关闭桌面通知
|
||||||
ToDoTask.activityBacklog.Remove(info);//激活任务删除
|
ToDoTask.activityBacklog.Remove(info);//激活任务删除
|
||||||
CommonCode.SaveAppData(appData, Constants.DATA_FILE_PATH);
|
CommonCode.SaveAppData(appData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,54 +0,0 @@
|
|||||||
<Border x:Class="GeekDesk.Control.Other.GlobalMsgNotification"
|
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
||||||
xmlns:hc="https://handyorg.github.io/handycontrol"
|
|
||||||
BorderThickness="0"
|
|
||||||
Style="{StaticResource BorderBG}"
|
|
||||||
Margin="15"
|
|
||||||
BorderBrush="{DynamicResource BorderBrush}"
|
|
||||||
Width="320"
|
|
||||||
Height="400">
|
|
||||||
<Border.Background>
|
|
||||||
<SolidColorBrush Color="AliceBlue" Opacity="0.96"/>
|
|
||||||
</Border.Background>
|
|
||||||
<Grid>
|
|
||||||
|
|
||||||
<StackPanel>
|
|
||||||
<Image Source="/Resource/Image/BacklogImg.png" Width="260" Margin="0,20,0,0"/>
|
|
||||||
<hc:Card Width="260" Height="220" BorderThickness="0" Effect="{DynamicResource EffectShadow2}" Margin="0,20,0,0">
|
|
||||||
|
|
||||||
<Border CornerRadius="4,4,0,0" Height="160" Padding="10,0,10,0">
|
|
||||||
<ScrollViewer>
|
|
||||||
<TextBlock TextOptions.TextFormattingMode="Display"
|
|
||||||
TextOptions.TextHintingMode="Animated"
|
|
||||||
UseLayoutRounding="True"
|
|
||||||
TextWrapping="Wrap"
|
|
||||||
FontStyle="Normal"
|
|
||||||
FontSize="15"
|
|
||||||
LineHeight="22"
|
|
||||||
VerticalAlignment="Center"
|
|
||||||
HorizontalAlignment="Center"
|
|
||||||
Text="{Binding Msg}"/>
|
|
||||||
</ScrollViewer>
|
|
||||||
</Border>
|
|
||||||
|
|
||||||
|
|
||||||
<!--<hc:Card.Footer>
|
|
||||||
<StackPanel Margin="10" Width="160">
|
|
||||||
|
|
||||||
<TextBlock TextWrapping="NoWrap" FontSize="20" Style="{DynamicResource TextBlockLargeBold}" TextTrimming="CharacterEllipsis"
|
|
||||||
Text="{Binding Title}"
|
|
||||||
HorizontalAlignment="Left"/>
|
|
||||||
|
|
||||||
|
|
||||||
<TextBlock TextWrapping="NoWrap" Style="{DynamicResource TextBlockDefault}" TextTrimming="CharacterEllipsis"
|
|
||||||
Margin="0,6,0,0"
|
|
||||||
HorizontalAlignment="Left"/>
|
|
||||||
</StackPanel>
|
|
||||||
</hc:Card.Footer>-->
|
|
||||||
</hc:Card>
|
|
||||||
</StackPanel>
|
|
||||||
|
|
||||||
<Button Click="Close_Click" Content="朕已阅" Margin="10,0,10,20" Width="298" VerticalAlignment="Bottom"/>
|
|
||||||
</Grid>
|
|
||||||
</Border>
|
|
||||||
@@ -1,61 +0,0 @@
|
|||||||
using GeekDesk.Constant;
|
|
||||||
using GeekDesk.Task;
|
|
||||||
using GeekDesk.Util;
|
|
||||||
using GeekDesk.ViewModel;
|
|
||||||
using HandyControl.Controls;
|
|
||||||
using Quartz;
|
|
||||||
using System;
|
|
||||||
using System.Windows;
|
|
||||||
using System.Windows.Input;
|
|
||||||
|
|
||||||
namespace GeekDesk.Control.Other
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// BacklogNotificatin.xaml 的交互逻辑
|
|
||||||
/// </summary>
|
|
||||||
public partial class GlobalMsgNotification
|
|
||||||
{
|
|
||||||
|
|
||||||
public Notification ntf;
|
|
||||||
public GlobalMsgNotification(DialogMsg msg)
|
|
||||||
{
|
|
||||||
InitializeComponent();
|
|
||||||
this.DataContext = msg;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public class DialogMsg
|
|
||||||
{
|
|
||||||
public string msg;
|
|
||||||
public string title;
|
|
||||||
|
|
||||||
public string Msg
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return msg;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
msg = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public string Title
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return title;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
title = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void Close_Click(object sender, RoutedEventArgs e)
|
|
||||||
{
|
|
||||||
ntf.Close();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -2,7 +2,6 @@
|
|||||||
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:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:hc="https://handyorg.github.io/handycontrol"
|
xmlns:hc="https://handyorg.github.io/handycontrol"
|
||||||
xmlns:cvt="clr-namespace:GeekDesk.Converts"
|
|
||||||
CornerRadius="4"
|
CornerRadius="4"
|
||||||
Width="350"
|
Width="350"
|
||||||
Height="450"
|
Height="450"
|
||||||
@@ -11,39 +10,29 @@
|
|||||||
<Border.Resources>
|
<Border.Resources>
|
||||||
<Style x:Key="LeftTB" TargetType="TextBlock" BasedOn="{StaticResource TextBlockBaseStyle}">
|
<Style x:Key="LeftTB" TargetType="TextBlock" BasedOn="{StaticResource TextBlockBaseStyle}">
|
||||||
<Setter Property="Width" Value="75"/>
|
<Setter Property="Width" Value="75"/>
|
||||||
<Setter Property="TextAlignment" Value="Left"/>
|
<Setter Property="TextAlignment" Value="Center"/>
|
||||||
<Setter Property="HorizontalAlignment" Value="Left"/>
|
<Setter Property="HorizontalAlignment" Value="Left"/>
|
||||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||||
<Setter Property="Margin" Value="5,8,0,0"/>
|
<Setter Property="Margin" Value="0,8,0,0"/>
|
||||||
<Setter Property="FontSize" Value="14"/>
|
<Setter Property="FontSize" Value="14"/>
|
||||||
</Style>
|
</Style>
|
||||||
<cvt:StringAppendConvert x:Key="StringAppendConvert"/>
|
|
||||||
</Border.Resources>
|
</Border.Resources>
|
||||||
<hc:SimplePanel Margin="10" VerticalAlignment="Center">
|
<hc:SimplePanel Margin="10" VerticalAlignment="Center">
|
||||||
<StackPanel>
|
<StackPanel>
|
||||||
<Button Width="22" Height="22" Command="hc:ControlCommands.Close" Style="{StaticResource ButtonIcon}" Foreground="{DynamicResource {x:Static SystemColors.ControlDarkDarkBrushKey}}" hc:IconElement.Geometry="{StaticResource ErrorGeometry}" Padding="0" HorizontalAlignment="Right" VerticalAlignment="Top"/>
|
<Button Width="22" Height="22" Command="hc:ControlCommands.Close" Style="{StaticResource ButtonIcon}" Foreground="{DynamicResource {x:Static SystemColors.ControlDarkDarkBrushKey}}" hc:IconElement.Geometry="{StaticResource ErrorGeometry}" Padding="0" HorizontalAlignment="Right" VerticalAlignment="Top"/>
|
||||||
<hc:UniformSpacingPanel Spacing="10" Margin="0,15,0,0">
|
<hc:UniformSpacingPanel Spacing="10">
|
||||||
<TextBlock Text="名称:" Style="{StaticResource LeftTB}"/>
|
<TextBlock Text="名称:" Style="{StaticResource LeftTB}"/>
|
||||||
<TextBox x:Name="IconName" Text="{Binding Name, Mode=OneWay}" Width="230" FontSize="14"/>
|
<TextBox x:Name="IconName" Text="{Binding Name, Mode=OneWay}" Width="230" FontSize="14"/>
|
||||||
</hc:UniformSpacingPanel>
|
</hc:UniformSpacingPanel>
|
||||||
<hc:UniformSpacingPanel Spacing="10" Margin="0,15,0,0">
|
<hc:Divider LineStrokeDashArray="3,3" LineStroke="Black"/>
|
||||||
<TextBlock Text="相对路径:" Style="{StaticResource LeftTB}"/>
|
<hc:UniformSpacingPanel Spacing="10" Grid.ColumnSpan="4">
|
||||||
<TextBlock Text="{Binding RelativePath, Mode=OneWay}"
|
|
||||||
VerticalAlignment="Center"
|
|
||||||
Margin="0,8,0,0"
|
|
||||||
Width="230"
|
|
||||||
FontSize="14"
|
|
||||||
TextTrimming="WordEllipsis"
|
|
||||||
hc:Poptip.Placement="Bottom"
|
|
||||||
hc:Poptip.Content="{Binding RelativePath, Mode=OneWay, Converter={StaticResource StringAppendConvert}, ConverterParameter='\{\}\\\n(同盘符下才会建立相对路径)'}"/>
|
|
||||||
</hc:UniformSpacingPanel>
|
|
||||||
<hc:UniformSpacingPanel Spacing="10" Grid.ColumnSpan="4" Margin="0,15,0,0">
|
|
||||||
<TextBlock Text="图标:" Style="{StaticResource LeftTB}"/>
|
<TextBlock Text="图标:" Style="{StaticResource LeftTB}"/>
|
||||||
<Image x:Name="IconImg" Source="{Binding BitmapImage, Mode=OneWay}" RenderOptions.BitmapScalingMode="HighQuality" Width="60" Height="60"/>
|
<Image x:Name="IconImg" Source="{Binding BitmapImage, Mode=OneWay}" RenderOptions.BitmapScalingMode="HighQuality" Width="60" Height="60"/>
|
||||||
<Button Content="修改" Click="EditImage"/>
|
<Button Content="修改" Click="EditImage"/>
|
||||||
<Button Content="重置" Click="ReStoreImage"/>
|
<Button Content="重置" Click="ReStoreImage"/>
|
||||||
</hc:UniformSpacingPanel>
|
</hc:UniformSpacingPanel>
|
||||||
<hc:UniformSpacingPanel Spacing="10" Margin="4,15,0,0">
|
<hc:Divider LineStrokeDashArray="3,3" LineStroke="Black" Grid.ColumnSpan="4"/>
|
||||||
|
<hc:UniformSpacingPanel Spacing="10">
|
||||||
<CheckBox x:Name="IconIsAdmin" Content="始终以管理员方式启动" IsChecked="{Binding AdminStartUp, Mode=OneWay}">
|
<CheckBox x:Name="IconIsAdmin" Content="始终以管理员方式启动" IsChecked="{Binding AdminStartUp, Mode=OneWay}">
|
||||||
<CheckBox.Background>
|
<CheckBox.Background>
|
||||||
<LinearGradientBrush EndPoint="1,0" StartPoint="0,0">
|
<LinearGradientBrush EndPoint="1,0" StartPoint="0,0">
|
||||||
@@ -52,11 +41,12 @@
|
|||||||
</CheckBox.Background>
|
</CheckBox.Background>
|
||||||
</CheckBox>
|
</CheckBox>
|
||||||
</hc:UniformSpacingPanel>
|
</hc:UniformSpacingPanel>
|
||||||
<hc:UniformSpacingPanel Spacing="10" Margin="0,15,0,0">
|
<hc:Divider LineStrokeDashArray="3,3" LineStroke="Black" Grid.ColumnSpan="4"/>
|
||||||
|
<hc:UniformSpacingPanel Spacing="10">
|
||||||
<TextBlock Text="启动参数:" Style="{StaticResource LeftTB}"/>
|
<TextBlock Text="启动参数:" Style="{StaticResource LeftTB}"/>
|
||||||
<TextBox x:Name="StartArg" Text="{Binding StartArg, Mode=OneWay}" Width="230" Height="100" TextWrapping="Wrap" FontSize="14"/>
|
<TextBox x:Name="StartArg" Text="{Binding StartArg, Mode=OneWay}" Width="230" Height="100" TextWrapping="Wrap" FontSize="14"/>
|
||||||
</hc:UniformSpacingPanel>
|
</hc:UniformSpacingPanel>
|
||||||
<hc:UniformSpacingPanel Margin="0,25,0,0" Spacing="10" Grid.ColumnSpan="4">
|
<hc:UniformSpacingPanel Spacing="10" Grid.ColumnSpan="4">
|
||||||
<Button Content="保存" Style="{StaticResource Btn1}" Click="SaveProperty" Margin="265,10,0,0"/>
|
<Button Content="保存" Style="{StaticResource Btn1}" Click="SaveProperty" Margin="265,10,0,0"/>
|
||||||
</hc:UniformSpacingPanel>
|
</hc:UniformSpacingPanel>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using GeekDesk.Constant;
|
using GeekDesk.Util;
|
||||||
using GeekDesk.Util;
|
|
||||||
using GeekDesk.ViewModel;
|
using GeekDesk.ViewModel;
|
||||||
using Microsoft.Win32;
|
using Microsoft.Win32;
|
||||||
using System;
|
using System;
|
||||||
@@ -39,7 +38,7 @@ namespace GeekDesk.Control.Other
|
|||||||
info.Name = IconName.Text;
|
info.Name = IconName.Text;
|
||||||
info.AdminStartUp = IconIsAdmin.IsChecked.Value;
|
info.AdminStartUp = IconIsAdmin.IsChecked.Value;
|
||||||
info.StartArg = StartArg.Text;
|
info.StartArg = StartArg.Text;
|
||||||
CommonCode.SaveAppData(MainWindow.appData, Constants.DATA_FILE_PATH);
|
CommonCode.SaveAppData(MainWindow.appData);
|
||||||
dialog.Close();
|
dialog.Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -52,7 +51,7 @@ namespace GeekDesk.Control.Other
|
|||||||
{
|
{
|
||||||
IconInfo info = this.DataContext as IconInfo;
|
IconInfo info = this.DataContext as IconInfo;
|
||||||
info.BitmapImage = ImageUtil.ByteArrToImage(info.DefaultImage);
|
info.BitmapImage = ImageUtil.ByteArrToImage(info.DefaultImage);
|
||||||
CommonCode.SaveAppData(MainWindow.appData, Constants.DATA_FILE_PATH);
|
CommonCode.SaveAppData(MainWindow.appData);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -73,7 +72,7 @@ namespace GeekDesk.Control.Other
|
|||||||
{
|
{
|
||||||
IconInfo info = this.DataContext as IconInfo;
|
IconInfo info = this.DataContext as IconInfo;
|
||||||
info.BitmapImage = ImageUtil.GetBitmapIconByPath(ofd.FileName);
|
info.BitmapImage = ImageUtil.GetBitmapIconByPath(ofd.FileName);
|
||||||
CommonCode.SaveAppData(MainWindow.appData, Constants.DATA_FILE_PATH);
|
CommonCode.SaveAppData(MainWindow.appData);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception e1)
|
catch (Exception e1)
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ namespace GeekDesk.Control.Other
|
|||||||
{
|
{
|
||||||
MainWindow.appData.MenuList[MainWindow.appData.AppConfig.SelectedMenuIndex].IconList.Add(info);
|
MainWindow.appData.MenuList[MainWindow.appData.AppConfig.SelectedMenuIndex].IconList.Add(info);
|
||||||
}
|
}
|
||||||
CommonCode.SaveAppData(MainWindow.appData, Constants.DATA_FILE_PATH);
|
CommonCode.SaveAppData(MainWindow.appData);
|
||||||
dialog.Close();
|
dialog.Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -65,7 +65,7 @@ namespace GeekDesk.Control.Other
|
|||||||
{
|
{
|
||||||
IconInfo info = this.DataContext as IconInfo;
|
IconInfo info = this.DataContext as IconInfo;
|
||||||
info.BitmapImage = ImageUtil.ByteArrToImage(info.DefaultImage);
|
info.BitmapImage = ImageUtil.ByteArrToImage(info.DefaultImage);
|
||||||
CommonCode.SaveAppData(MainWindow.appData, Constants.DATA_FILE_PATH);
|
CommonCode.SaveAppData(MainWindow.appData);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -86,7 +86,7 @@ namespace GeekDesk.Control.Other
|
|||||||
{
|
{
|
||||||
IconInfo info = this.DataContext as IconInfo;
|
IconInfo info = this.DataContext as IconInfo;
|
||||||
info.BitmapImage = ImageUtil.GetBitmapIconByPath(ofd.FileName);
|
info.BitmapImage = ImageUtil.GetBitmapIconByPath(ofd.FileName);
|
||||||
CommonCode.SaveAppData(MainWindow.appData, Constants.DATA_FILE_PATH);
|
CommonCode.SaveAppData(MainWindow.appData);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
|
|||||||
@@ -1,75 +0,0 @@
|
|||||||
<Border x:Class="GeekDesk.Control.Other.PasswordDialog"
|
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
||||||
xmlns:hc="https://handyorg.github.io/handycontrol"
|
|
||||||
xmlns:xf="clr-namespace:XamlFlair;assembly=XamlFlair.WPF"
|
|
||||||
CornerRadius="6"
|
|
||||||
Width="300"
|
|
||||||
Height="150"
|
|
||||||
BorderThickness="0"
|
|
||||||
>
|
|
||||||
<Border.Resources>
|
|
||||||
<Style x:Key="PassBox" TargetType="PasswordBox" BasedOn="{StaticResource PasswordBoxBaseStyle}">
|
|
||||||
<Setter Property="Height" Value="40"/>
|
|
||||||
<Setter Property="Width" Value="40"/>
|
|
||||||
<Setter Property="HorizontalContentAlignment" Value="Center"/>
|
|
||||||
<Setter Property="VerticalContentAlignment" Value="Center"/>
|
|
||||||
<Setter Property="FontSize" Value="18"/>
|
|
||||||
<Setter Property="Focusable" Value="True"/>
|
|
||||||
<Setter Property="MaxLength" Value="1"/>
|
|
||||||
<EventSetter Event="PasswordChanged" Handler="PasswordBox_PasswordChanged"/>
|
|
||||||
<EventSetter Event="PreviewKeyDown" Handler="PasswordBox_KeyDown"/>
|
|
||||||
</Style>
|
|
||||||
<Style x:Key="NextTB" TargetType="TextBlock">
|
|
||||||
<Setter Property="Foreground" Value="#408CCB"/>
|
|
||||||
<Setter Property="TextDecorations" Value="Underline"/>
|
|
||||||
<Style.Triggers>
|
|
||||||
<Trigger Property="IsMouseOver" Value="True">
|
|
||||||
<Setter Property="Foreground" Value="Red"/>
|
|
||||||
</Trigger>
|
|
||||||
</Style.Triggers>
|
|
||||||
</Style>
|
|
||||||
</Border.Resources>
|
|
||||||
<Border.Background>
|
|
||||||
<SolidColorBrush Color="White" Opacity="0.7"/>
|
|
||||||
</Border.Background>
|
|
||||||
<StackPanel VerticalAlignment="Center">
|
|
||||||
<hc:UniformSpacingPanel Spacing="10" VerticalAlignment="Center" HorizontalAlignment="Center">
|
|
||||||
<TextBlock x:Name="Title" Text="请输入密码"
|
|
||||||
FontSize="15"/>
|
|
||||||
</hc:UniformSpacingPanel>
|
|
||||||
<Grid Height="65" x:Name="PasswordGrid" Visibility="Visible" xf:Animations.Primary="{xf:Animate BasedOn={StaticResource FadeInAndGrowHorizontally}, Event=Visibility}">
|
|
||||||
<TextBlock x:Name="HintMsg"
|
|
||||||
Visibility="Hidden"
|
|
||||||
VerticalAlignment="Top"
|
|
||||||
HorizontalAlignment="Center"
|
|
||||||
Width="250"
|
|
||||||
TextAlignment="Center"
|
|
||||||
Margin="0,3,0,0"
|
|
||||||
Text="提示:"
|
|
||||||
hc:Poptip.Content="{Binding ElementName=HintMsg, Path=Text}"
|
|
||||||
Foreground="Gray"/>
|
|
||||||
<hc:UniformSpacingPanel Margin="0,20,0,0" Spacing="10" VerticalAlignment="Center" HorizontalAlignment="Center">
|
|
||||||
<PasswordBox x:Name="P1" Tag="P1" Style="{StaticResource PassBox}"/>
|
|
||||||
<PasswordBox x:Name="P2" Tag="P2" Style="{StaticResource PassBox}"/>
|
|
||||||
<PasswordBox x:Name="P3" Tag="P3" Style="{StaticResource PassBox}"/>
|
|
||||||
<PasswordBox x:Name="P4" Tag="P4" Style="{StaticResource PassBox}"/>
|
|
||||||
</hc:UniformSpacingPanel>
|
|
||||||
<TextBlock HorizontalAlignment="Right"
|
|
||||||
x:Name="ErrorMsg"
|
|
||||||
Margin="0,65,37,-65"
|
|
||||||
Foreground="Red"
|
|
||||||
Text="密码输入错误"
|
|
||||||
Visibility="Visible"/>
|
|
||||||
</Grid>
|
|
||||||
<Grid Height="65" x:Name="HintGrid" Visibility="Collapsed" Margin="0,20,0,0" xf:Animations.Primary="{xf:Animate BasedOn={StaticResource FadeIn}, Event=Visibility}">
|
|
||||||
<hc:UniformSpacingPanel Spacing="10" VerticalAlignment="Top" HorizontalAlignment="Center">
|
|
||||||
<hc:TextBox x:Name="HintBox" TextAlignment="Left" Width="220"/>
|
|
||||||
</hc:UniformSpacingPanel>
|
|
||||||
<hc:UniformSpacingPanel Spacing="10" Margin="202,35,0,0" VerticalAlignment="Top" HorizontalAlignment="Left">
|
|
||||||
<TextBlock Text="跳过" MouseLeftButtonDown="NextTB_MouseLeftButtonDown" Style="{StaticResource NextTB}"/>
|
|
||||||
<TextBlock Text="完成" MouseLeftButtonDown="DoneTB_MouseLeftButtonDown" Style="{StaticResource NextTB}"/>
|
|
||||||
</hc:UniformSpacingPanel>
|
|
||||||
</Grid>
|
|
||||||
</StackPanel>
|
|
||||||
</Border>
|
|
||||||
@@ -1,280 +0,0 @@
|
|||||||
using GeekDesk.Constant;
|
|
||||||
using GeekDesk.Util;
|
|
||||||
using GeekDesk.ViewModel;
|
|
||||||
using Microsoft.Win32;
|
|
||||||
using System;
|
|
||||||
using System.Threading;
|
|
||||||
using System.Windows;
|
|
||||||
using System.Windows.Controls;
|
|
||||||
using System.Windows.Input;
|
|
||||||
using System.Windows.Media.Imaging;
|
|
||||||
using System.Windows.Threading;
|
|
||||||
|
|
||||||
namespace GeekDesk.Control.Other
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// TextDialog.xaml 的交互逻辑
|
|
||||||
/// </summary>
|
|
||||||
public partial class PasswordDialog
|
|
||||||
{
|
|
||||||
private AppData appData = MainWindow.appData;
|
|
||||||
|
|
||||||
public PasswordType type;
|
|
||||||
public MenuInfo menuInfo;
|
|
||||||
public int count = 0;
|
|
||||||
private string tempPassword = null;
|
|
||||||
private PasswordType tempType;
|
|
||||||
public PasswordDialog()
|
|
||||||
{
|
|
||||||
InitializeComponent();
|
|
||||||
}
|
|
||||||
private void PasswordBox_PasswordChanged(object sender, RoutedEventArgs e)
|
|
||||||
{
|
|
||||||
PasswordBox pb = sender as PasswordBox;
|
|
||||||
if (!string.IsNullOrEmpty(pb.Password))
|
|
||||||
{
|
|
||||||
char c = pb.Password.ToCharArray()[0];
|
|
||||||
if (c > '9' || c < '0')
|
|
||||||
{
|
|
||||||
pb.Password = "";
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
string tag = pb.Tag.ToString();
|
|
||||||
switch (tag)
|
|
||||||
{
|
|
||||||
case "P1":
|
|
||||||
if (!string.IsNullOrEmpty(pb.Password))
|
|
||||||
{
|
|
||||||
P2.Focus();
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case "P2":
|
|
||||||
if (!string.IsNullOrEmpty(pb.Password))
|
|
||||||
{
|
|
||||||
P3.Focus();
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case "P3":
|
|
||||||
if (!string.IsNullOrEmpty(pb.Password))
|
|
||||||
{
|
|
||||||
P4.Focus();
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case "P4":
|
|
||||||
if (string.IsNullOrEmpty(pb.Password))
|
|
||||||
{
|
|
||||||
P3.Focus();
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(P1.Password)
|
|
||||||
&& !string.IsNullOrEmpty(P2.Password)
|
|
||||||
&& !string.IsNullOrEmpty(P3.Password)
|
|
||||||
&& !string.IsNullOrEmpty(P4.Password))
|
|
||||||
{
|
|
||||||
string pw = P1.Password
|
|
||||||
+ P2.Password
|
|
||||||
+ P3.Password
|
|
||||||
+ P4.Password;
|
|
||||||
pw = MD5Util.CreateMD5(pw);
|
|
||||||
if (type == PasswordType.INPUT || type == PasswordType.CANCEL)
|
|
||||||
{
|
|
||||||
if (pw.Equals(appData.AppConfig.MenuPassword))
|
|
||||||
{
|
|
||||||
//隐藏弹框
|
|
||||||
MainWindow.mainWindow.RightCard.PDDialog.Visibility = Visibility.Collapsed;
|
|
||||||
//赋值
|
|
||||||
MainWindow.appData.AppConfig.SelectedMenuIcons
|
|
||||||
= appData.MenuList[
|
|
||||||
MainWindow.mainWindow.LeftCard.MenuListBox.SelectedIndex
|
|
||||||
].IconList;
|
|
||||||
//显示数据托盘
|
|
||||||
MainWindow.mainWindow.RightCard.WrapUFG.Visibility = Visibility.Visible;
|
|
||||||
//取消加密操作
|
|
||||||
if (type == PasswordType.CANCEL)
|
|
||||||
{
|
|
||||||
menuInfo.IsEncrypt = false;
|
|
||||||
}
|
|
||||||
} else
|
|
||||||
{
|
|
||||||
//密码比对不一致
|
|
||||||
ErrorMsg.Text = "密码输入错误";
|
|
||||||
ErrorMsg.Visibility = Visibility.Visible;
|
|
||||||
if (!string.IsNullOrEmpty(appData.AppConfig.PasswordHint))
|
|
||||||
{
|
|
||||||
//显示提示信息
|
|
||||||
HintMsg.Visibility = Visibility.Visible;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else if (type == PasswordType.CREATE)
|
|
||||||
{
|
|
||||||
//创建密码
|
|
||||||
if (count == 0)
|
|
||||||
{
|
|
||||||
count++;
|
|
||||||
tempPassword = pw;
|
|
||||||
Title.Text = "再次输入密码";
|
|
||||||
ClearVal();
|
|
||||||
SetFocus(0);
|
|
||||||
} else
|
|
||||||
{
|
|
||||||
if (tempPassword.Equals(pw))
|
|
||||||
{
|
|
||||||
//两次密码设置一致 显示提示输入框
|
|
||||||
Title.Text = "填写密码提示";
|
|
||||||
PasswordGrid.Visibility = Visibility.Collapsed;
|
|
||||||
HintGrid.Visibility = Visibility.Visible;
|
|
||||||
HintBox.Focus();
|
|
||||||
} else
|
|
||||||
{
|
|
||||||
ErrorMsg.Text = "两次密码输入不一致";
|
|
||||||
ErrorMsg.Visibility = Visibility.Visible;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else if (type == PasswordType.ALTER)
|
|
||||||
{
|
|
||||||
//修改密码
|
|
||||||
if (appData.AppConfig.MenuPassword.Equals(pw))
|
|
||||||
{
|
|
||||||
tempType = type;
|
|
||||||
type = PasswordType.CREATE;
|
|
||||||
Title.Text = "设置新密码";
|
|
||||||
ClearVal();
|
|
||||||
SetFocus(0);
|
|
||||||
} else
|
|
||||||
{
|
|
||||||
//密码比对不一致
|
|
||||||
ErrorMsg.Text = "密码输入错误";
|
|
||||||
ErrorMsg.Visibility = Visibility.Visible;
|
|
||||||
HintMsg.Text = MainWindow.appData.AppConfig.PasswordHint;
|
|
||||||
HintMsg.Visibility = Visibility.Visible;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else
|
|
||||||
{
|
|
||||||
//密码未输入完全 隐藏错误信息
|
|
||||||
if (ErrorMsg.IsVisible)
|
|
||||||
{
|
|
||||||
ErrorMsg.Visibility = Visibility.Hidden;
|
|
||||||
HintMsg.Visibility = Visibility.Hidden;
|
|
||||||
HintMsg.Visibility = Visibility.Hidden;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void SetFocus(int time = 100)
|
|
||||||
{
|
|
||||||
new Thread(() =>
|
|
||||||
{
|
|
||||||
Thread.Sleep(time);
|
|
||||||
Dispatcher.Invoke(() =>
|
|
||||||
{
|
|
||||||
if (string.IsNullOrEmpty(P1.Password))
|
|
||||||
{
|
|
||||||
P1.Focus();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (string.IsNullOrEmpty(P2.Password))
|
|
||||||
{
|
|
||||||
P2.Focus();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (string.IsNullOrEmpty(P3.Password))
|
|
||||||
{
|
|
||||||
P3.Focus();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
P4.Focus();
|
|
||||||
});
|
|
||||||
}).Start();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void ClearVal()
|
|
||||||
{
|
|
||||||
P1.Clear();
|
|
||||||
P2.Clear();
|
|
||||||
P3.Clear();
|
|
||||||
P4.Clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 跳过设置密码提示
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="sender"></param>
|
|
||||||
/// <param name="e"></param>
|
|
||||||
private void NextTB_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
|
|
||||||
{
|
|
||||||
appData.AppConfig.PasswordHint = "";
|
|
||||||
DonePassword();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void DoneTB_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
|
|
||||||
{
|
|
||||||
string hint = HintBox.Text.Trim();
|
|
||||||
appData.AppConfig.PasswordHint = hint;
|
|
||||||
DonePassword();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void DonePassword()
|
|
||||||
{
|
|
||||||
appData.AppConfig.MenuPassword = tempPassword;
|
|
||||||
CommonCode.SavePassword(tempPassword);
|
|
||||||
MainWindow.mainWindow.RightCard.PDDialog.Visibility = Visibility.Collapsed;
|
|
||||||
PasswordGrid.Visibility = Visibility.Visible;
|
|
||||||
HintGrid.Visibility = Visibility.Collapsed;
|
|
||||||
if (tempType == PasswordType.ALTER)
|
|
||||||
{
|
|
||||||
HandyControl.Controls.Growl.Success("密码修改成功!", "MainWindowGrowl");
|
|
||||||
} else
|
|
||||||
{
|
|
||||||
menuInfo.IsEncrypt = true;
|
|
||||||
HandyControl.Controls.Growl.Success(menuInfo.MenuName + " 已加密!", "MainWindowGrowl");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
private void PasswordBox_KeyDown(object sender, KeyEventArgs e)
|
|
||||||
{
|
|
||||||
if (e.Key == Key.Back)
|
|
||||||
{
|
|
||||||
if (P2.IsKeyboardFocused)
|
|
||||||
{
|
|
||||||
if (string.IsNullOrEmpty(P2.Password))
|
|
||||||
{
|
|
||||||
P1.Password = "";
|
|
||||||
} else
|
|
||||||
{
|
|
||||||
P2.Password = "";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (P3.IsKeyboardFocused)
|
|
||||||
{
|
|
||||||
if (string.IsNullOrEmpty(P3.Password))
|
|
||||||
{
|
|
||||||
P2.Password = "";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
P3.Password = "";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (P4.IsKeyboardFocused)
|
|
||||||
{
|
|
||||||
if (string.IsNullOrEmpty(P4.Password))
|
|
||||||
{
|
|
||||||
P3.Password = "";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
P4.Password = "";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
SetFocus(0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -4,7 +4,6 @@
|
|||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:cvt="clr-namespace:GeekDesk.Converts"
|
xmlns:cvt="clr-namespace:GeekDesk.Converts"
|
||||||
xmlns:xf="clr-namespace:XamlFlair;assembly=XamlFlair.WPF"
|
|
||||||
xmlns:local="clr-namespace:GeekDesk.Control.UserControls.PannelCard"
|
xmlns:local="clr-namespace:GeekDesk.Control.UserControls.PannelCard"
|
||||||
xmlns:hc="https://handyorg.github.io/handycontrol"
|
xmlns:hc="https://handyorg.github.io/handycontrol"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
@@ -17,11 +16,7 @@
|
|||||||
<Grid MouseDown="DragMove">
|
<Grid MouseDown="DragMove">
|
||||||
<hc:SimplePanel Margin="20,50,20,20" >
|
<hc:SimplePanel Margin="20,50,20,20" >
|
||||||
<StackPanel Orientation="Vertical" HorizontalAlignment="Center" VerticalAlignment="Top">
|
<StackPanel Orientation="Vertical" HorizontalAlignment="Center" VerticalAlignment="Top">
|
||||||
<Image Source="/Resource/Image/About.png"
|
<Image Source="/Resource/Image/About.png" Width="400" Height="100"/>
|
||||||
Width="400"
|
|
||||||
Height="100"
|
|
||||||
xf:Animations.Primary="{xf:Animate BasedOn={StaticResource FadeInAndContract}, Delay=250}"
|
|
||||||
/>
|
|
||||||
<TextBlock x:Name="AppInfo" TextAlignment="Center" Text="Copyright © 2021 GeekDesk V"/>
|
<TextBlock x:Name="AppInfo" TextAlignment="Center" Text="Copyright © 2021 GeekDesk V"/>
|
||||||
<hc:UniformSpacingPanel Spacing="5" HorizontalAlignment="Center" Margin="10,10,0,0" VerticalAlignment="Center">
|
<hc:UniformSpacingPanel Spacing="5" HorizontalAlignment="Center" Margin="10,10,0,0" VerticalAlignment="Center">
|
||||||
<hc:Shield Subject=".net" Status=">=4.72" Margin="0,0,10,0" Color="#1182c3"/>
|
<hc:Shield Subject=".net" Status=">=4.72" Margin="0,0,10,0" Color="#1182c3"/>
|
||||||
@@ -32,21 +27,18 @@
|
|||||||
MouseLeave="SC_MouseLeave"
|
MouseLeave="SC_MouseLeave"
|
||||||
Command="hc:ControlCommands.OpenLink"
|
Command="hc:ControlCommands.OpenLink"
|
||||||
CommandParameter="https://github.com/BookerLiu/GeekDesk"
|
CommandParameter="https://github.com/BookerLiu/GeekDesk"
|
||||||
Margin="0,0,10,0" Color="#24292F"
|
Margin="0,0,10,0" Color="#24292F"/>
|
||||||
/>
|
|
||||||
|
|
||||||
<hc:Shield Subject="Gitee" Visibility="Visible" Status="Star"
|
<hc:Shield Subject="Gitee" Visibility="Visible" Status="Star"
|
||||||
MouseEnter="SC_MouseEnter"
|
MouseEnter="SC_MouseEnter"
|
||||||
MouseLeave="SC_MouseLeave"
|
MouseLeave="SC_MouseLeave"
|
||||||
Command="hc:ControlCommands.OpenLink"
|
Command="hc:ControlCommands.OpenLink"
|
||||||
CommandParameter="https://gitee.com/BookerLiu/GeekDesk"
|
CommandParameter="https://gitee.com/BookerLiu/GeekDesk"
|
||||||
Margin="0,0,10,0" Color="#C71D23"
|
Margin="0,0,10,0" Color="#C71D23"/>
|
||||||
/>
|
|
||||||
|
|
||||||
|
|
||||||
</hc:UniformSpacingPanel>
|
</hc:UniformSpacingPanel>
|
||||||
<hc:UniformSpacingPanel Spacing="10" HorizontalAlignment="Center" Margin="0,5,0,0">
|
<hc:UniformSpacingPanel Spacing="10" HorizontalAlignment="Center" Margin="0,5,0,0">
|
||||||
<hc:Shield x:Name="PublicWeChatPanel" Subject="公众号" Visibility="Visible" Status="抓几个娃" Margin="0,0,5,0" Color="#04913B">
|
<hc:Shield Subject="公众号" Visibility="Visible" Status="抓几个娃" Margin="0,0,5,0" Color="#04913B">
|
||||||
<hc:Poptip.Instance>
|
<hc:Poptip.Instance>
|
||||||
<hc:Poptip PlacementType="Top">
|
<hc:Poptip PlacementType="Top">
|
||||||
<hc:Poptip.Content>
|
<hc:Poptip.Content>
|
||||||
|
|||||||
@@ -16,15 +16,6 @@ namespace GeekDesk.Control.UserControls.Config
|
|||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
AppInfo.Text += ConfigurationManager.AppSettings["Version"];
|
AppInfo.Text += ConfigurationManager.AppSettings["Version"];
|
||||||
string showPublicWeChat = ConfigurationManager.AppSettings["ShowPublicWeChat"];
|
|
||||||
if ("Y".Equals(showPublicWeChat))
|
|
||||||
{
|
|
||||||
PublicWeChatPanel.Visibility = Visibility.Visible;
|
|
||||||
} else
|
|
||||||
{
|
|
||||||
PublicWeChatPanel.Visibility = Visibility.Collapsed;
|
|
||||||
}
|
|
||||||
|
|
||||||
PublicWeChat.Source = ImageUtil.Base64ToBitmapImage(Constants.PUBLIC_WE_CHAT_IMG_BASE64);
|
PublicWeChat.Source = ImageUtil.Base64ToBitmapImage(Constants.PUBLIC_WE_CHAT_IMG_BASE64);
|
||||||
WeChatCode.Source = ImageUtil.Base64ToBitmapImage(Constants.WE_CHAT_CODE_IMG_BASE64);
|
WeChatCode.Source = ImageUtil.Base64ToBitmapImage(Constants.WE_CHAT_CODE_IMG_BASE64);
|
||||||
ZFBCode.Source = ImageUtil.Base64ToBitmapImage(Constants.ZFB_CODE_IMG_BASE64);
|
ZFBCode.Source = ImageUtil.Base64ToBitmapImage(Constants.ZFB_CODE_IMG_BASE64);
|
||||||
|
|||||||
@@ -84,7 +84,15 @@
|
|||||||
</CheckBox>
|
</CheckBox>
|
||||||
</hc:UniformSpacingPanel>
|
</hc:UniformSpacingPanel>
|
||||||
|
|
||||||
|
<hc:UniformSpacingPanel Spacing="10" Margin="10,5,0,0" Grid.ColumnSpan="4">
|
||||||
|
<CheckBox Content="主窗口动画效果" IsChecked="{Binding AppAnimation}" Click="Animation_Checked">
|
||||||
|
<CheckBox.Background>
|
||||||
|
<LinearGradientBrush EndPoint="1,0" StartPoint="0,0">
|
||||||
|
<GradientStop Color="#FF9EA3A6"/>
|
||||||
|
</LinearGradientBrush>
|
||||||
|
</CheckBox.Background>
|
||||||
|
</CheckBox>
|
||||||
|
</hc:UniformSpacingPanel>
|
||||||
|
|
||||||
<hc:UniformSpacingPanel Spacing="10" Margin="0,10,0,0" Grid.ColumnSpan="4">
|
<hc:UniformSpacingPanel Spacing="10" Margin="0,10,0,0" Grid.ColumnSpan="4">
|
||||||
<TextBlock Text="面板关闭方式" VerticalAlignment="Center"/>
|
<TextBlock Text="面板关闭方式" VerticalAlignment="Center"/>
|
||||||
|
|||||||
@@ -35,6 +35,8 @@ namespace GeekDesk.Control.UserControls.Config
|
|||||||
/// <param name="e"></param>
|
/// <param name="e"></param>
|
||||||
private void HotKeyDown(object sender, KeyEventArgs e)
|
private void HotKeyDown(object sender, KeyEventArgs e)
|
||||||
{
|
{
|
||||||
|
Console.WriteLine("downKey:" + e.Key.ToString());
|
||||||
|
|
||||||
lock (this)
|
lock (this)
|
||||||
{
|
{
|
||||||
HotKeyType hkType = (HotKeyType)(sender as TextBox).Tag;
|
HotKeyType hkType = (HotKeyType)(sender as TextBox).Tag;
|
||||||
@@ -47,6 +49,8 @@ namespace GeekDesk.Control.UserControls.Config
|
|||||||
|
|
||||||
if (!CheckIsEnable(hkType)) return;
|
if (!CheckIsEnable(hkType)) return;
|
||||||
|
|
||||||
|
|
||||||
|
Console.WriteLine("prevKeyTemp:" + prevKeyTemp.ToString());
|
||||||
|
|
||||||
if (prevKeyTemp == Key.None || prevKeyTemp != downKey)
|
if (prevKeyTemp == Key.None || prevKeyTemp != downKey)
|
||||||
{
|
{
|
||||||
@@ -97,6 +101,7 @@ namespace GeekDesk.Control.UserControls.Config
|
|||||||
appConfig.ColorPickerHotkeyModifiers = GetModifierKeys(downKey);
|
appConfig.ColorPickerHotkeyModifiers = GetModifierKeys(downKey);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Console.WriteLine("进入设置" + downKey.ToString());
|
||||||
prevKeyTemp = downKey;
|
prevKeyTemp = downKey;
|
||||||
keysTemp.Add(e);
|
keysTemp.Add(e);
|
||||||
}
|
}
|
||||||
@@ -114,10 +119,7 @@ namespace GeekDesk.Control.UserControls.Config
|
|||||||
KeyUtil.KeyProp keyProp = new KeyUtil.KeyProp();
|
KeyUtil.KeyProp keyProp = new KeyUtil.KeyProp();
|
||||||
KeyUtil.KeyToChar(downKey, ref keyProp, true);
|
KeyUtil.KeyToChar(downKey, ref keyProp, true);
|
||||||
string downKeyStr = keyProp.character.ToString();
|
string downKeyStr = keyProp.character.ToString();
|
||||||
if (keyProp.character == '\x00')
|
//string downKeyStr = "";
|
||||||
{
|
|
||||||
downKeyStr = downKey.ToString();
|
|
||||||
}
|
|
||||||
switch (hkType)
|
switch (hkType)
|
||||||
{
|
{
|
||||||
case HotKeyType.Main:
|
case HotKeyType.Main:
|
||||||
@@ -306,6 +308,15 @@ namespace GeekDesk.Control.UserControls.Config
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void Animation_Checked(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
if (MainWindow.mainWindow.Visibility == Visibility.Collapsed)
|
||||||
|
{
|
||||||
|
MainWindow.mainWindow.Visibility = Visibility.Visible;
|
||||||
|
// 执行一下动画 防止太过突兀
|
||||||
|
MainWindow.FadeStoryBoard(0, (int)CommonEnum.WINDOW_ANIMATION_TIME, Visibility.Collapsed);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -93,16 +93,6 @@
|
|||||||
Foreground="Black"
|
Foreground="Black"
|
||||||
IsChecked="{Binding UpdateType, Mode=TwoWay, Converter={StaticResource UpdateTypeConvert}, ConverterParameter=2}"/>
|
IsChecked="{Binding UpdateType, Mode=TwoWay, Converter={StaticResource UpdateTypeConvert}, ConverterParameter=2}"/>
|
||||||
</hc:UniformSpacingPanel>
|
</hc:UniformSpacingPanel>
|
||||||
|
|
||||||
<TextBlock Text="其它" Margin="0,25,0,0"/>
|
|
||||||
<hc:UniformSpacingPanel Spacing="10" Margin="20,8,0,0">
|
|
||||||
<Button Content="备份数据"
|
|
||||||
hc:Poptip.Content="当数据文件损坏时, 以便能够恢复部分数据 (损坏时将有操作提示)"
|
|
||||||
hc:Poptip.Placement="TopLeft"
|
|
||||||
hc:Poptip.Offset="10"
|
|
||||||
Style="{StaticResource Btn1}"
|
|
||||||
Click="BakDataFile"/>
|
|
||||||
</hc:UniformSpacingPanel>
|
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</hc:SimplePanel>
|
</hc:SimplePanel>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|||||||
@@ -107,10 +107,5 @@ namespace GeekDesk.Control.UserControls.Config
|
|||||||
CountLowSort.Visibility = Visibility.Visible;
|
CountLowSort.Visibility = Visibility.Visible;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void BakDataFile(object sender, RoutedEventArgs e)
|
|
||||||
{
|
|
||||||
CommonCode.BakAppData();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -110,25 +110,7 @@
|
|||||||
|
|
||||||
<hc:Divider LineStrokeDashArray="3,3" Margin="0,0,0,0" Height="20" LineStroke="Black" Grid.ColumnSpan="1"/>
|
<hc:Divider LineStrokeDashArray="3,3" Margin="0,0,0,0" Height="20" LineStroke="Black" Grid.ColumnSpan="1"/>
|
||||||
|
|
||||||
<hc:UniformSpacingPanel Spacing="10" Margin="5,-10,0,0" Grid.ColumnSpan="4">
|
<hc:UniformSpacingPanel Spacing="10" Margin="5,-10,0,0" Grid.ColumnSpan="4">
|
||||||
<CheckBox Content="主窗口动画" IsChecked="{Binding AppAnimation}" Click="Animation_Checked">
|
|
||||||
<CheckBox.Background>
|
|
||||||
<LinearGradientBrush EndPoint="1,0" StartPoint="0,0">
|
|
||||||
<GradientStop Color="#FF9EA3A6"/>
|
|
||||||
</LinearGradientBrush>
|
|
||||||
</CheckBox.Background>
|
|
||||||
</CheckBox>
|
|
||||||
</hc:UniformSpacingPanel>
|
|
||||||
<hc:UniformSpacingPanel Spacing="10" Margin="5,10,0,0" Grid.ColumnSpan="4">
|
|
||||||
<CheckBox Content="列表展开动画" IsChecked="{Binding ItemSpradeAnimation}">
|
|
||||||
<CheckBox.Background>
|
|
||||||
<LinearGradientBrush EndPoint="1,0" StartPoint="0,0">
|
|
||||||
<GradientStop Color="#FF9EA3A6"/>
|
|
||||||
</LinearGradientBrush>
|
|
||||||
</CheckBox.Background>
|
|
||||||
</CheckBox>
|
|
||||||
</hc:UniformSpacingPanel>
|
|
||||||
<hc:UniformSpacingPanel Spacing="10" Margin="5,10,0,0" Grid.ColumnSpan="4">
|
|
||||||
<CheckBox x:Name="BarIcon" Content="显示托盘图标" IsChecked="{Binding ShowBarIcon}">
|
<CheckBox x:Name="BarIcon" Content="显示托盘图标" IsChecked="{Binding ShowBarIcon}">
|
||||||
<CheckBox.Background>
|
<CheckBox.Background>
|
||||||
<LinearGradientBrush EndPoint="1,0" StartPoint="0,0">
|
<LinearGradientBrush EndPoint="1,0" StartPoint="0,0">
|
||||||
@@ -138,7 +120,7 @@
|
|||||||
</CheckBox>
|
</CheckBox>
|
||||||
</hc:UniformSpacingPanel>
|
</hc:UniformSpacingPanel>
|
||||||
|
|
||||||
<hc:UniformSpacingPanel Spacing="10" Margin="5,10,0,0" Grid.ColumnSpan="4">
|
<hc:UniformSpacingPanel Spacing="10" Margin="5,5,0,0" Grid.ColumnSpan="4">
|
||||||
<CheckBox Content="显示主面板Logo" IsChecked="{Binding TitleLogoVisible, Mode=TwoWay, Converter={StaticResource Visibility2BooleanConverter}}">
|
<CheckBox Content="显示主面板Logo" IsChecked="{Binding TitleLogoVisible, Mode=TwoWay, Converter={StaticResource Visibility2BooleanConverter}}">
|
||||||
<CheckBox.Background>
|
<CheckBox.Background>
|
||||||
<LinearGradientBrush EndPoint="1,0" StartPoint="0,0">
|
<LinearGradientBrush EndPoint="1,0" StartPoint="0,0">
|
||||||
@@ -167,7 +149,7 @@
|
|||||||
|
|
||||||
|
|
||||||
<hc:UniformSpacingPanel Spacing="10" Margin="0,10,0,0" Grid.ColumnSpan="4">
|
<hc:UniformSpacingPanel Spacing="10" Margin="0,10,0,0" Grid.ColumnSpan="4">
|
||||||
<TextBlock Text="背景不透明度" VerticalAlignment="Center"/>
|
<TextBlock Text="背景图片不透明度" VerticalAlignment="Center"/>
|
||||||
</hc:UniformSpacingPanel>
|
</hc:UniformSpacingPanel>
|
||||||
<hc:UniformSpacingPanel Spacing="10" Margin="10,5,0,0" Grid.ColumnSpan="4">
|
<hc:UniformSpacingPanel Spacing="10" Margin="10,5,0,0" Grid.ColumnSpan="4">
|
||||||
<hc:PreviewSlider Value="{Binding BgOpacity}"
|
<hc:PreviewSlider Value="{Binding BgOpacity}"
|
||||||
@@ -182,7 +164,7 @@
|
|||||||
</hc:UniformSpacingPanel>
|
</hc:UniformSpacingPanel>
|
||||||
|
|
||||||
|
|
||||||
<!--<hc:UniformSpacingPanel Spacing="10" Margin="0,10,0,0" Grid.ColumnSpan="4">
|
<hc:UniformSpacingPanel Spacing="10" Margin="0,10,0,0" Grid.ColumnSpan="4">
|
||||||
<TextBlock Text="主面板不透明度" VerticalAlignment="Center"/>
|
<TextBlock Text="主面板不透明度" VerticalAlignment="Center"/>
|
||||||
</hc:UniformSpacingPanel>
|
</hc:UniformSpacingPanel>
|
||||||
<hc:UniformSpacingPanel Spacing="10" Margin="10,5,0,0" Grid.ColumnSpan="4">
|
<hc:UniformSpacingPanel Spacing="10" Margin="10,5,0,0" Grid.ColumnSpan="4">
|
||||||
@@ -195,7 +177,7 @@
|
|||||||
<Label Style="{StaticResource LabelPrimary}" Content="{Binding Path=(hc:PreviewSlider.PreviewPosition),RelativeSource={RelativeSource Self}}" ContentStringFormat="#0"/>
|
<Label Style="{StaticResource LabelPrimary}" Content="{Binding Path=(hc:PreviewSlider.PreviewPosition),RelativeSource={RelativeSource Self}}" ContentStringFormat="#0"/>
|
||||||
</hc:PreviewSlider.PreviewContent>
|
</hc:PreviewSlider.PreviewContent>
|
||||||
</hc:PreviewSlider>
|
</hc:PreviewSlider>
|
||||||
</hc:UniformSpacingPanel>-->
|
</hc:UniformSpacingPanel>
|
||||||
|
|
||||||
<hc:UniformSpacingPanel Spacing="10" Margin="0,10,0,0" Grid.ColumnSpan="4">
|
<hc:UniformSpacingPanel Spacing="10" Margin="0,10,0,0" Grid.ColumnSpan="4">
|
||||||
<TextBlock Text="主面板圆角大小" VerticalAlignment="Center"/>
|
<TextBlock Text="主面板圆角大小" VerticalAlignment="Center"/>
|
||||||
|
|||||||
@@ -157,16 +157,5 @@ namespace GeekDesk.Control.UserControls.Config
|
|||||||
GradientBGDialog gbg = new GradientBGDialog();
|
GradientBGDialog gbg = new GradientBGDialog();
|
||||||
gbg.dialog = HandyControl.Controls.Dialog.Show(gbg, "ConfigWindowDialog");
|
gbg.dialog = HandyControl.Controls.Dialog.Show(gbg, "ConfigWindowDialog");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void Animation_Checked(object sender, RoutedEventArgs e)
|
|
||||||
{
|
|
||||||
if (MainWindow.mainWindow.Visibility == Visibility.Collapsed)
|
|
||||||
{
|
|
||||||
appConfig.IsShow = true;
|
|
||||||
}
|
|
||||||
appConfig.IsShow = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,6 @@
|
|||||||
xmlns:local="clr-namespace:GeekDesk.Control.UserControls.PannelCard"
|
xmlns:local="clr-namespace:GeekDesk.Control.UserControls.PannelCard"
|
||||||
xmlns:hc="https://handyorg.github.io/handycontrol"
|
xmlns:hc="https://handyorg.github.io/handycontrol"
|
||||||
xmlns:cvt="clr-namespace:GeekDesk.Converts"
|
xmlns:cvt="clr-namespace:GeekDesk.Converts"
|
||||||
xmlns:cst="clr-namespace:GeekDesk.Constant"
|
|
||||||
xmlns:DraggAnimatedPanel="clr-namespace:DraggAnimatedPanel"
|
xmlns:DraggAnimatedPanel="clr-namespace:DraggAnimatedPanel"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
d:DesignHeight="450" d:DesignWidth="800"
|
d:DesignHeight="450" d:DesignWidth="800"
|
||||||
@@ -19,18 +18,11 @@
|
|||||||
<Setter Property="Margin" Value="0,0,0,1"/>
|
<Setter Property="Margin" Value="0,0,0,1"/>
|
||||||
<Setter Property="Background">
|
<Setter Property="Background">
|
||||||
<Setter.Value>
|
<Setter.Value>
|
||||||
<SolidColorBrush Color="Black" Opacity="0.01"/>
|
<SolidColorBrush Opacity="0"/>
|
||||||
</Setter.Value>
|
</Setter.Value>
|
||||||
</Setter>
|
</Setter>
|
||||||
<Setter Property="AllowDrop" Value="True"/>
|
|
||||||
<EventSetter Event="Drop" Handler="Menu_Drop"/>
|
|
||||||
<EventSetter Event="PreviewDragEnter" Handler="Menu_PreviewDragEnter"/>
|
|
||||||
<EventSetter Event="PreviewDragLeave" Handler="Menu_PreviewDragLeave"/>
|
|
||||||
<EventSetter Event="MouseLeave" Handler="Menu_MouseLeave"/>
|
|
||||||
<Setter Property="FocusVisualStyle" Value="{x:Null}" />
|
<Setter Property="FocusVisualStyle" Value="{x:Null}" />
|
||||||
<EventSetter Event="MouseEnter" Handler="Menu_MouseEnter"/>
|
<EventSetter Event="MouseEnter" Handler="Menu_MouseEnter"/>
|
||||||
<EventSetter Event="PreviewMouseLeftButtonDown" Handler="ListBoxItem_MouseDown"/>
|
|
||||||
<EventSetter Event="PreviewMouseRightButtonDown" Handler="ListBoxItem_PreviewMouseRightButtonDown"/>
|
|
||||||
<!--<EventSetter Event="Unselected" Handler="Lbi_Unselected"/>-->
|
<!--<EventSetter Event="Unselected" Handler="Lbi_Unselected"/>-->
|
||||||
<Style.Triggers>
|
<Style.Triggers>
|
||||||
<MultiTrigger>
|
<MultiTrigger>
|
||||||
@@ -53,11 +45,7 @@
|
|||||||
</BeginStoryboard>
|
</BeginStoryboard>
|
||||||
</MultiTrigger.ExitActions>
|
</MultiTrigger.ExitActions>
|
||||||
<MultiTrigger.Setters>
|
<MultiTrigger.Setters>
|
||||||
<Setter Property="Background">
|
<Setter Property="Background" Value="Transparent"/>
|
||||||
<Setter.Value>
|
|
||||||
<SolidColorBrush Color="Black" Opacity="0.01"/>
|
|
||||||
</Setter.Value>
|
|
||||||
</Setter>
|
|
||||||
<Setter Property="Foreground" Value="Black"/>
|
<Setter Property="Foreground" Value="Black"/>
|
||||||
</MultiTrigger.Setters>
|
</MultiTrigger.Setters>
|
||||||
</MultiTrigger>
|
</MultiTrigger>
|
||||||
@@ -78,149 +66,110 @@
|
|||||||
<Setter Property="Foreground" Value="Black"/>
|
<Setter Property="Foreground" Value="Black"/>
|
||||||
</Trigger>-->
|
</Trigger>-->
|
||||||
<Trigger Property="IsMouseOver" Value="False">
|
<Trigger Property="IsMouseOver" Value="False">
|
||||||
<Setter Property="Background" Value="#00FFFFFF"/>
|
<Setter Property="Background" Value="Transparent"/>
|
||||||
<Setter Property="Foreground" Value="Black"/>
|
<Setter Property="Foreground" Value="Black"/>
|
||||||
</Trigger>
|
</Trigger>
|
||||||
|
|
||||||
|
|
||||||
</Style.Triggers>
|
</Style.Triggers>
|
||||||
</Style>
|
</Style>
|
||||||
<Style x:Key="MyPoptipStyle" TargetType="Border">
|
|
||||||
<Setter Property="HorizontalAlignment" Value="Center"/>
|
|
||||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
|
||||||
<Setter Property="BorderThickness" Value="1"/>
|
|
||||||
<Setter Property="Background" Value="White"/>
|
|
||||||
<Setter Property="BorderBrush" Value="{DynamicResource BorderBrush}"/>
|
|
||||||
<Setter Property="CornerRadius" Value="{StaticResource DefaultCornerRadius}"/>
|
|
||||||
<Setter Property="Padding" Value="{StaticResource DefaultControlPadding}"/>
|
|
||||||
<!--<Setter Property="Template">
|
|
||||||
<Setter.Value>
|
|
||||||
<ControlTemplate TargetType="hc:Poptip">
|
|
||||||
<Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" CornerRadius="{Binding Path=(hc:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}">
|
|
||||||
<ContentPresenter Margin="{TemplateBinding Padding}" ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}" ContentStringFormat="{TemplateBinding ContentStringFormat}" ContentTemplate="{TemplateBinding ContentTemplate}"/>
|
|
||||||
</Border>
|
|
||||||
</ControlTemplate>
|
|
||||||
</Setter.Value>
|
|
||||||
</Setter>-->
|
|
||||||
</Style>
|
|
||||||
|
|
||||||
<cvt:MenuWidthConvert x:Key="MenuWidthConvert"/>
|
<cvt:MenuWidthConvert x:Key="MenuWidthConvert"/>
|
||||||
<cvt:OpcityConvert x:Key="OpcityConvert"/>
|
<cvt:OpcityConvert x:Key="OpcityConvert"/>
|
||||||
<cvt:StringAppendConvert x:Key="StringAppendConvert"/>
|
|
||||||
</UserControl.Resources>
|
</UserControl.Resources>
|
||||||
<Grid Background="Transparent">
|
<!--左侧栏-->
|
||||||
<Popup Name="MyPoptip" FlowDirection="LeftToRight"
|
<hc:Card x:Name="MyCard"
|
||||||
PopupAnimation="None" Placement="Mouse" IsOpen="False"
|
BorderThickness="1"
|
||||||
AllowsTransparency="True"
|
Effect="{DynamicResource EffectShadow2}"
|
||||||
>
|
Margin="5,0,0,5"
|
||||||
<Grid Background="Transparent">
|
MouseDown="MyCard_MouseDown"
|
||||||
<Border Style="{StaticResource MyPoptipStyle}">
|
>
|
||||||
<TextBlock Name="MyPoptipContent" HorizontalAlignment="Center" VerticalAlignment="Center" TextAlignment="Center" Text="Test" FontSize="14"/>
|
<hc:Card.Background>
|
||||||
</Border>
|
<SolidColorBrush Color="#FFFFFFFF" hc:GeometryEffect.GeometryEffect="20" Opacity="{Binding AppConfig.CardOpacity, Mode=TwoWay, Converter={StaticResource OpcityConvert}}">
|
||||||
</Grid>
|
|
||||||
</Popup>
|
|
||||||
|
|
||||||
<!--左侧栏-->
|
</SolidColorBrush>
|
||||||
<hc:Card x:Name="MyCard"
|
</hc:Card.Background>
|
||||||
BorderThickness="1"
|
<hc:Card.BorderBrush>
|
||||||
Effect="{DynamicResource EffectShadow2}"
|
<SolidColorBrush Color="#FFFFFFFF" Opacity="0"/>
|
||||||
Margin="5,0,0,5"
|
</hc:Card.BorderBrush>
|
||||||
MouseDown="MyCard_MouseDown"
|
<hc:Card.ContextMenu>
|
||||||
PreviewMouseRightButtonDown="MyCard_PreviewMouseRightButtonDown"
|
<ContextMenu Width="200">
|
||||||
>
|
<MenuItem Header="新建菜单" Click="CreateMenu"/>
|
||||||
<hc:Card.Background>
|
</ContextMenu>
|
||||||
<SolidColorBrush Color="#FFFFFFFF" hc:GeometryEffect.GeometryEffect="20" Opacity="{Binding AppConfig.CardOpacity, Mode=TwoWay, Converter={StaticResource OpcityConvert}}">
|
</hc:Card.ContextMenu>
|
||||||
|
<WrapPanel Orientation="Horizontal">
|
||||||
|
<ListBox x:Name="MenuListBox"
|
||||||
|
Padding="2,3,0,2"
|
||||||
|
ItemsSource="{Binding MenuList}"
|
||||||
|
Tag="{Binding AppConfig.MenuCardWidth}"
|
||||||
|
BorderThickness="0" Foreground="{x:Null}"
|
||||||
|
SelectedIndex="{Binding AppConfig.SelectedMenuIndex}"
|
||||||
|
VirtualizingPanel.VirtualizationMode="Recycling"
|
||||||
|
SelectionChanged="Menu_SelectionChanged"
|
||||||
|
PreviewMouseWheel="Menu_MouseWheel"
|
||||||
|
>
|
||||||
|
<ListBox.Resources>
|
||||||
|
<ContextMenu x:Key="MenuDialog" Width="200">
|
||||||
|
<MenuItem Header="新建菜单" Click="CreateMenu"/>
|
||||||
|
<MenuItem Header="重命名" Click="RenameMenu" Tag="{Binding}"/>
|
||||||
|
<MenuItem Header="修改图标" Click="EditMenuGeometry" Tag="{Binding}"/>
|
||||||
|
<MenuItem Header="删除" Click="DeleteMenu" Tag="{Binding}"/>
|
||||||
|
</ContextMenu>
|
||||||
|
</ListBox.Resources>
|
||||||
|
|
||||||
</SolidColorBrush>
|
<ListBox.ItemContainerStyle>
|
||||||
</hc:Card.Background>
|
<Style TargetType="ListBoxItem" BasedOn="{StaticResource MenuStyle}">
|
||||||
<hc:Card.BorderBrush>
|
<Setter Property="ContextMenu" Value="{StaticResource MenuDialog}"/>
|
||||||
<SolidColorBrush Color="#FFFFFFFF" Opacity="0"/>
|
</Style>
|
||||||
</hc:Card.BorderBrush>
|
</ListBox.ItemContainerStyle>
|
||||||
<hc:Card.ContextMenu>
|
<ListBox.Background>
|
||||||
<ContextMenu Width="200">
|
<SolidColorBrush Color="AliceBlue" Opacity="0"/>
|
||||||
<MenuItem Header="新建菜单" Click="CreateMenu"/>
|
</ListBox.Background>
|
||||||
<MenuItem x:Name="AlterPW1" Header="修改密码" Click="AlterPassword"/>
|
|
||||||
</ContextMenu>
|
|
||||||
</hc:Card.ContextMenu>
|
|
||||||
|
|
||||||
<WrapPanel Orientation="Horizontal">
|
<ListBox.ItemsPanel>
|
||||||
<ListBox x:Name="MenuListBox"
|
<ItemsPanelTemplate>
|
||||||
Padding="2,3,0,2"
|
<DraggAnimatedPanel:DraggAnimatedPanel ItemsHeight="33" ItemsWidth="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type ListBox},AncestorLevel=1},Path=Tag, Mode=TwoWay, Converter={StaticResource MenuWidthConvert}, ConverterParameter=10}" HorizontalAlignment="Center" VerticalAlignment="Top" SwapCommand="{Binding SwapCommand, RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}"/>
|
||||||
ItemsSource="{Binding MenuList}"
|
</ItemsPanelTemplate>
|
||||||
Tag="{Binding AppConfig.MenuCardWidth}"
|
</ListBox.ItemsPanel>
|
||||||
BorderThickness="0" Foreground="{x:Null}"
|
|
||||||
SelectedIndex="{Binding AppConfig.SelectedMenuIndex}"
|
|
||||||
VirtualizingPanel.VirtualizationMode="Recycling"
|
|
||||||
SelectionChanged="Menu_SelectionChanged"
|
|
||||||
PreviewMouseWheel="Menu_MouseWheel"
|
|
||||||
PreviewMouseRightButtonDown="MyCard_PreviewMouseRightButtonDown"
|
|
||||||
>
|
|
||||||
<ListBox.Resources>
|
|
||||||
<ContextMenu x:Key="MenuDialog" Width="200">
|
|
||||||
<MenuItem Header="新建菜单" Click="CreateMenu"/>
|
|
||||||
<MenuItem Header="重命名" Click="RenameMenu" Tag="{Binding}"/>
|
|
||||||
<MenuItem Header="加密此列表" Click="EncryptMenu" Tag="{Binding}"/>
|
|
||||||
<MenuItem x:Name="AlterPW2" Header="修改密码" Click="AlterPassword"/>
|
|
||||||
<MenuItem Header="修改图标" Click="EditMenuGeometry" Tag="{Binding}"/>
|
|
||||||
<MenuItem Header="删除" Click="DeleteMenu" Tag="{Binding}"/>
|
|
||||||
</ContextMenu>
|
|
||||||
</ListBox.Resources>
|
|
||||||
|
|
||||||
<ListBox.ItemContainerStyle>
|
<ListBox.ItemTemplate>
|
||||||
<Style TargetType="ListBoxItem" BasedOn="{StaticResource MenuStyle}">
|
<DataTemplate>
|
||||||
<Setter Property="ContextMenu" Value="{StaticResource MenuDialog}"/>
|
<StackPanel Tag="{Binding}" MouseDown="ListBoxItem_MouseDown">
|
||||||
</Style>
|
<TextBox Text="{Binding Path=MenuName, Mode=TwoWay}"
|
||||||
</ListBox.ItemContainerStyle>
|
HorizontalAlignment="Left"
|
||||||
<ListBox.Background>
|
Width="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type ListBox},AncestorLevel=1},Path=Tag, Mode=TwoWay, Converter={StaticResource MenuWidthConvert}, ConverterParameter=35}"
|
||||||
<SolidColorBrush Color="AliceBlue" Opacity="0"/>
|
FontSize="16"
|
||||||
</ListBox.Background>
|
Height="28"
|
||||||
|
VerticalAlignment="Center"
|
||||||
<ListBox.ItemsPanel>
|
TextAlignment="Left"
|
||||||
<ItemsPanelTemplate>
|
LostFocus="LostFocusOrEnterDown"
|
||||||
<DraggAnimatedPanel:DraggAnimatedPanel ItemsHeight="33" ItemsWidth="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type ListBox},AncestorLevel=1},Path=Tag, Mode=TwoWay, Converter={StaticResource MenuWidthConvert}, ConverterParameter=10}" HorizontalAlignment="Center" VerticalAlignment="Top" SwapCommand="{Binding SwapCommand, RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}"/>
|
KeyDown="LostFocusOrEnterDown"
|
||||||
</ItemsPanelTemplate>
|
Tag="{Binding}"
|
||||||
</ListBox.ItemsPanel>
|
Padding="2"
|
||||||
|
|
||||||
<ListBox.ItemTemplate>
|
|
||||||
<DataTemplate>
|
|
||||||
<StackPanel Tag="{Binding}">
|
|
||||||
<TextBox Text="{Binding Path=MenuName, Mode=TwoWay}"
|
|
||||||
HorizontalAlignment="Left"
|
|
||||||
Width="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type ListBox},AncestorLevel=1},Path=Tag, Mode=TwoWay, Converter={StaticResource MenuWidthConvert}, ConverterParameter=35}"
|
|
||||||
FontSize="16"
|
|
||||||
Height="28"
|
|
||||||
VerticalAlignment="Center"
|
|
||||||
TextAlignment="Left"
|
|
||||||
LostFocus="LostFocusOrEnterDown"
|
|
||||||
KeyDown="LostFocusOrEnterDown"
|
|
||||||
Tag="{Binding}"
|
|
||||||
Padding="2"
|
|
||||||
BorderThickness="0"
|
|
||||||
IsVisibleChanged="MenuEditWhenVisibilityChanged"
|
|
||||||
Visibility="{Binding MenuEdit}"/>
|
|
||||||
<StackPanel Orientation="Horizontal"
|
|
||||||
IsVisibleChanged="MenuWhenVisibilityChanged"
|
|
||||||
Visibility="{Binding NotMenuEdit}">
|
|
||||||
<Button Background="Transparent"
|
|
||||||
BorderThickness="0"
|
BorderThickness="0"
|
||||||
hc:IconElement.Geometry="{Binding MenuGeometry}"
|
IsVisibleChanged="MenuEditWhenVisibilityChanged"
|
||||||
hc:IconElement.Height="18"
|
Visibility="{Binding MenuEdit}"/>
|
||||||
hc:IconElement.Width="18"
|
<StackPanel Orientation="Horizontal"
|
||||||
IsEnabled="False"
|
IsVisibleChanged="MenuWhenVisibilityChanged"
|
||||||
Opacity="1"
|
Visibility="{Binding NotMenuEdit}">
|
||||||
Foreground="{Binding GeometryColor}"
|
<Button Background="Transparent"
|
||||||
/>
|
BorderThickness="0"
|
||||||
<TextBlock Text="{Binding MenuName}"
|
hc:IconElement.Geometry="{Binding MenuGeometry}"
|
||||||
HorizontalAlignment="Center"
|
hc:IconElement.Height="18"
|
||||||
TextAlignment="Center"
|
hc:IconElement.Width="18"
|
||||||
VerticalAlignment="Center"
|
IsEnabled="False"
|
||||||
|
Opacity="1"
|
||||||
|
Foreground="{Binding GeometryColor}"
|
||||||
/>
|
/>
|
||||||
</StackPanel>
|
<TextBlock Text="{Binding MenuName}"
|
||||||
|
HorizontalAlignment="Center"
|
||||||
|
TextAlignment="Center"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</DataTemplate>
|
</StackPanel>
|
||||||
</ListBox.ItemTemplate>
|
</DataTemplate>
|
||||||
</ListBox>
|
</ListBox.ItemTemplate>
|
||||||
</WrapPanel>
|
</ListBox>
|
||||||
</hc:Card>
|
</WrapPanel>
|
||||||
</Grid>
|
</hc:Card>
|
||||||
</UserControl>
|
</UserControl>
|
||||||
@@ -1,6 +1,5 @@
|
|||||||
using DraggAnimatedPanelExample;
|
using DraggAnimatedPanelExample;
|
||||||
using GeekDesk.Constant;
|
using GeekDesk.Constant;
|
||||||
using GeekDesk.Control.Other;
|
|
||||||
using GeekDesk.Control.Windows;
|
using GeekDesk.Control.Windows;
|
||||||
using GeekDesk.Util;
|
using GeekDesk.Util;
|
||||||
using GeekDesk.ViewModel;
|
using GeekDesk.ViewModel;
|
||||||
@@ -25,6 +24,9 @@ namespace GeekDesk.Control.UserControls.PannelCard
|
|||||||
private SolidColorBrush bac = new SolidColorBrush(Color.FromRgb(236, 236, 236));
|
private SolidColorBrush bac = new SolidColorBrush(Color.FromRgb(236, 236, 236));
|
||||||
|
|
||||||
|
|
||||||
|
//是否正在修改菜单
|
||||||
|
private static bool IS_EDIT = false;
|
||||||
|
|
||||||
public LeftCardControl()
|
public LeftCardControl()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
@@ -203,9 +205,9 @@ namespace GeekDesk.Control.UserControls.PannelCard
|
|||||||
/// <param name="e"></param>
|
/// <param name="e"></param>
|
||||||
private void RenameMenu(object sender, RoutedEventArgs e)
|
private void RenameMenu(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
RunTimeStatus.IS_MENU_EDIT = true;
|
|
||||||
MenuInfo menuInfo = ((MenuItem)sender).Tag as MenuInfo;
|
MenuInfo menuInfo = ((MenuItem)sender).Tag as MenuInfo;
|
||||||
menuInfo.MenuEdit = (int)Visibility.Visible;
|
menuInfo.MenuEdit = (int)Visibility.Visible;
|
||||||
|
IS_EDIT = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -273,9 +275,7 @@ namespace GeekDesk.Control.UserControls.PannelCard
|
|||||||
menuInfo.MenuName = text;
|
menuInfo.MenuName = text;
|
||||||
menuInfo.MenuEdit = Visibility.Collapsed;
|
menuInfo.MenuEdit = Visibility.Collapsed;
|
||||||
}
|
}
|
||||||
RunTimeStatus.IS_MENU_EDIT = false;
|
IS_EDIT = false;
|
||||||
//为了解决无法修改菜单的问题
|
|
||||||
MainWindow.mainWindow.SearchBox.Focus();
|
|
||||||
MenuListBox.SelectedIndex = menuSelectIndexTemp;
|
MenuListBox.SelectedIndex = menuSelectIndexTemp;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -309,14 +309,6 @@ namespace GeekDesk.Control.UserControls.PannelCard
|
|||||||
|
|
||||||
private void Menu_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
private void Menu_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||||
{
|
{
|
||||||
if (RunTimeStatus.IS_MENU_EDIT) return;
|
|
||||||
|
|
||||||
if (appData.AppConfig.ItemSpradeAnimation)
|
|
||||||
{
|
|
||||||
//是否启用列表展开动画
|
|
||||||
MainWindow.mainWindow.RightCard.WrapUFG.Visibility = Visibility.Collapsed;
|
|
||||||
}
|
|
||||||
|
|
||||||
//设置对应菜单的图标列表
|
//设置对应菜单的图标列表
|
||||||
if (MenuListBox.SelectedIndex == -1)
|
if (MenuListBox.SelectedIndex == -1)
|
||||||
{
|
{
|
||||||
@@ -324,20 +316,8 @@ namespace GeekDesk.Control.UserControls.PannelCard
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (appData.MenuList[MenuListBox.SelectedIndex].IsEncrypt)
|
appData.AppConfig.SelectedMenuIcons = appData.MenuList[MenuListBox.SelectedIndex].IconList;
|
||||||
{
|
|
||||||
appData.AppConfig.SelectedMenuIcons = null;
|
|
||||||
RunTimeStatus.SHOW_MENU_PASSWORDBOX = true;
|
|
||||||
MainWindow.mainWindow.RightCard.PDDialog.Title.Text = "输入密码";
|
|
||||||
MainWindow.mainWindow.RightCard.PDDialog.Visibility = Visibility.Visible;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
MainWindow.mainWindow.RightCard.PDDialog.Visibility = Visibility.Collapsed;
|
|
||||||
appData.AppConfig.SelectedMenuIcons = appData.MenuList[MenuListBox.SelectedIndex].IconList;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
MainWindow.mainWindow.RightCard.WrapUFG.Visibility = Visibility.Visible;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -348,7 +328,7 @@ namespace GeekDesk.Control.UserControls.PannelCard
|
|||||||
/// <param name="e"></param>
|
/// <param name="e"></param>
|
||||||
private void Menu_MouseEnter(object sender, MouseEventArgs e)
|
private void Menu_MouseEnter(object sender, MouseEventArgs e)
|
||||||
{
|
{
|
||||||
if (appData.AppConfig.HoverMenu && !RunTimeStatus.IS_MENU_EDIT)
|
if (appData.AppConfig.HoverMenu && !IS_EDIT)
|
||||||
{
|
{
|
||||||
Thread t = new Thread(() =>
|
Thread t = new Thread(() =>
|
||||||
{
|
{
|
||||||
@@ -379,31 +359,8 @@ namespace GeekDesk.Control.UserControls.PannelCard
|
|||||||
{
|
{
|
||||||
MainWindow.mainWindow.HidedSearchBox();
|
MainWindow.mainWindow.HidedSearchBox();
|
||||||
}
|
}
|
||||||
|
|
||||||
ListBoxItem lbi = sender as ListBoxItem;
|
|
||||||
MenuInfo mi = lbi.DataContext as MenuInfo;
|
|
||||||
int index = MenuListBox.Items.IndexOf(mi);
|
|
||||||
MenuListBox.SelectedIndex = index;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
///// <summary>
|
|
||||||
///// 点击菜单后 隐藏搜索框
|
|
||||||
///// </summary>
|
|
||||||
///// <param name="sender"></param>
|
|
||||||
///// <param name="e"></param>
|
|
||||||
//private void ListBoxItemPanel_MouseDown(object sender, MouseButtonEventArgs e)
|
|
||||||
//{
|
|
||||||
// if (RunTimeStatus.SEARCH_BOX_SHOW)
|
|
||||||
// {
|
|
||||||
// MainWindow.mainWindow.HidedSearchBox();
|
|
||||||
// }
|
|
||||||
// MenuInfo mi = (sender as StackPanel).Tag as MenuInfo;
|
|
||||||
// int index = MenuListBox.Items.IndexOf(mi);
|
|
||||||
// MenuListBox.SelectedIndex = index;
|
|
||||||
//}
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 隐藏搜索框
|
/// 隐藏搜索框
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -419,7 +376,6 @@ namespace GeekDesk.Control.UserControls.PannelCard
|
|||||||
|
|
||||||
private void Menu_MouseWheel(object sender, MouseWheelEventArgs e)
|
private void Menu_MouseWheel(object sender, MouseWheelEventArgs e)
|
||||||
{
|
{
|
||||||
if (RunTimeStatus.IS_MENU_EDIT) return;
|
|
||||||
if (e.Delta < 0)
|
if (e.Delta < 0)
|
||||||
{
|
{
|
||||||
int index = MenuListBox.SelectedIndex;
|
int index = MenuListBox.SelectedIndex;
|
||||||
@@ -445,134 +401,5 @@ namespace GeekDesk.Control.UserControls.PannelCard
|
|||||||
MenuListBox.SelectedIndex = index;
|
MenuListBox.SelectedIndex = index;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void Menu_PreviewDragLeave(object sender, DragEventArgs e)
|
|
||||||
{
|
|
||||||
MyPoptip.IsOpen = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void Menu_PreviewDragEnter(object sender, DragEventArgs e)
|
|
||||||
{
|
|
||||||
MenuInfo mi = (sender as ListBoxItem).DataContext as MenuInfo;
|
|
||||||
MyPoptipContent.Text = "移动至:" + mi.MenuName;
|
|
||||||
MyPoptip.VerticalOffset = 30;
|
|
||||||
MyPoptip.IsOpen = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void Menu_MouseLeave(object sender, MouseEventArgs e)
|
|
||||||
{
|
|
||||||
MyPoptip.IsOpen = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void Menu_Drop(object sender, DragEventArgs e)
|
|
||||||
{
|
|
||||||
MyPoptip.IsOpen = false;
|
|
||||||
|
|
||||||
MenuInfo mi = (sender as ListBoxItem).DataContext as MenuInfo;
|
|
||||||
IconInfo iconInfo = (IconInfo)e.Data.GetData(typeof(IconInfo));
|
|
||||||
|
|
||||||
appData.MenuList[MenuListBox.SelectedIndex].IconList.Remove(iconInfo);
|
|
||||||
appData.MenuList[MenuListBox.Items.IndexOf(mi)].IconList.Add(iconInfo);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void EncryptMenu(object sender, RoutedEventArgs e)
|
|
||||||
{
|
|
||||||
MenuInfo menuInfo = ((MenuItem)sender).Tag as MenuInfo;
|
|
||||||
if (menuInfo.IsEncrypt)
|
|
||||||
{
|
|
||||||
MainWindow.mainWindow.RightCard.PDDialog.menuInfo = menuInfo;
|
|
||||||
MainWindow.mainWindow.RightCard.PDDialog.Title.Text = "输入密码";
|
|
||||||
MainWindow.mainWindow.RightCard.PDDialog.type = PasswordType.CANCEL;
|
|
||||||
RunTimeStatus.SHOW_MENU_PASSWORDBOX = true;
|
|
||||||
MainWindow.mainWindow.RightCard.PDDialog.Visibility = Visibility.Visible;
|
|
||||||
//单独设置焦点
|
|
||||||
MainWindow.mainWindow.RightCard.PDDialog.SetFocus();
|
|
||||||
} else
|
|
||||||
{
|
|
||||||
if (string.IsNullOrEmpty(appData.AppConfig.MenuPassword))
|
|
||||||
{
|
|
||||||
MainWindow.mainWindow.RightCard.PDDialog.menuInfo = menuInfo;
|
|
||||||
MainWindow.mainWindow.RightCard.PDDialog.Title.Text = "设置新密码";
|
|
||||||
MainWindow.mainWindow.RightCard.PDDialog.type = PasswordType.CREATE;
|
|
||||||
RunTimeStatus.SHOW_MENU_PASSWORDBOX = true;
|
|
||||||
MainWindow.mainWindow.RightCard.PDDialog.Visibility = Visibility.Visible;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
menuInfo.IsEncrypt = true;
|
|
||||||
HandyControl.Controls.Growl.Success(menuInfo.MenuName + " 已加密!", "MainWindowGrowl");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void AlterPassword(object sender, RoutedEventArgs e)
|
|
||||||
{
|
|
||||||
MainWindow.mainWindow.RightCard.PDDialog.Title.Text = "输入旧密码";
|
|
||||||
MainWindow.mainWindow.RightCard.PDDialog.type = PasswordType.ALTER;
|
|
||||||
MainWindow.mainWindow.RightCard.PDDialog.Visibility = Visibility.Visible;
|
|
||||||
//单独设置焦点
|
|
||||||
MainWindow.mainWindow.RightCard.PDDialog.SetFocus();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 右键点击进行处理
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="sender"></param>
|
|
||||||
/// <param name="e"></param>
|
|
||||||
private void MyCard_PreviewMouseRightButtonDown(object sender, MouseButtonEventArgs e)
|
|
||||||
{
|
|
||||||
RunTimeStatus.SHOW_RIGHT_BTN_MENU = true;
|
|
||||||
new Thread(() =>
|
|
||||||
{
|
|
||||||
Thread.Sleep(50);
|
|
||||||
RunTimeStatus.SHOW_RIGHT_BTN_MENU = false;
|
|
||||||
}).Start();
|
|
||||||
|
|
||||||
//在没有设置密码的情况下不弹出修改密码菜单
|
|
||||||
if (string.IsNullOrEmpty(appData.AppConfig.MenuPassword))
|
|
||||||
{
|
|
||||||
AlterPW1.Visibility = Visibility.Collapsed;
|
|
||||||
} else
|
|
||||||
{
|
|
||||||
AlterPW1.Visibility = Visibility.Visible;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void ListBoxItem_PreviewMouseRightButtonDown(object sender, MouseButtonEventArgs e)
|
|
||||||
{
|
|
||||||
ListBoxItem lbi = sender as ListBoxItem;
|
|
||||||
MenuInfo info = lbi.DataContext as MenuInfo;
|
|
||||||
|
|
||||||
ItemCollection ics = lbi.ContextMenu.Items;
|
|
||||||
|
|
||||||
foreach (object obj in ics)
|
|
||||||
{
|
|
||||||
MenuItem mi = (MenuItem)obj;
|
|
||||||
if (mi.Header.Equals("修改密码"))
|
|
||||||
{
|
|
||||||
if (string.IsNullOrEmpty(appData.AppConfig.MenuPassword))
|
|
||||||
{
|
|
||||||
mi.Visibility = Visibility.Collapsed;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
mi.Visibility = Visibility.Visible;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if (mi.Header.Equals("加密此列表") || mi.Header.Equals("取消加密此列表"))
|
|
||||||
{
|
|
||||||
if (info.IsEncrypt)
|
|
||||||
{
|
|
||||||
mi.Header = "取消加密此列表";
|
|
||||||
} else
|
|
||||||
{
|
|
||||||
mi.Header = "加密此列表";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,8 +7,6 @@
|
|||||||
xmlns:hc="https://handyorg.github.io/handycontrol"
|
xmlns:hc="https://handyorg.github.io/handycontrol"
|
||||||
xmlns:cvt="clr-namespace:GeekDesk.Converts"
|
xmlns:cvt="clr-namespace:GeekDesk.Converts"
|
||||||
xmlns:DraggAnimatedPanel="clr-namespace:DraggAnimatedPanel"
|
xmlns:DraggAnimatedPanel="clr-namespace:DraggAnimatedPanel"
|
||||||
xmlns:xf="clr-namespace:XamlFlair;assembly=XamlFlair.WPF"
|
|
||||||
xmlns:ot="clr-namespace:GeekDesk.Control.Other"
|
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
d:DesignHeight="450" d:DesignWidth="800"
|
d:DesignHeight="450" d:DesignWidth="800"
|
||||||
>
|
>
|
||||||
@@ -21,6 +19,15 @@
|
|||||||
</Trigger>
|
</Trigger>
|
||||||
</Style.Triggers>
|
</Style.Triggers>
|
||||||
</Style>-->
|
</Style>-->
|
||||||
|
|
||||||
|
<Storyboard x:Key="Custom1Transition" x:Shared="False">
|
||||||
|
<DoubleAnimation From="50" To="0" Duration="0:0:0.4" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)">
|
||||||
|
<DoubleAnimation.EasingFunction>
|
||||||
|
<ElasticEase Oscillations="1"/>
|
||||||
|
</DoubleAnimation.EasingFunction>
|
||||||
|
</DoubleAnimation>
|
||||||
|
</Storyboard>
|
||||||
|
|
||||||
<Style x:Key="ImageStyle" TargetType="Image">
|
<Style x:Key="ImageStyle" TargetType="Image">
|
||||||
<Setter Property="Width" Value="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type Window}},Path=DataContext.AppConfig.ImageWidth, Mode=OneWay}"/>
|
<Setter Property="Width" Value="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type Window}},Path=DataContext.AppConfig.ImageWidth, Mode=OneWay}"/>
|
||||||
<Setter Property="Height" Value="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type Window}},Path=DataContext.AppConfig.ImageHeight, Mode=OneWay}"/>
|
<Setter Property="Height" Value="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type Window}},Path=DataContext.AppConfig.ImageHeight, Mode=OneWay}"/>
|
||||||
@@ -39,48 +46,6 @@
|
|||||||
</Setter>
|
</Setter>
|
||||||
</Style>
|
</Style>
|
||||||
|
|
||||||
<Style x:Key="SearchListBoxItemStyle" TargetType="{x:Type ListBoxItem}">
|
|
||||||
<Setter Property="FocusVisualStyle" Value="{x:Null}" />
|
|
||||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
|
||||||
<Setter Property="Template">
|
|
||||||
<Setter.Value>
|
|
||||||
<ControlTemplate TargetType="{x:Type ListBoxItem}">
|
|
||||||
<Border>
|
|
||||||
<Border.Style>
|
|
||||||
<Style TargetType="Border">
|
|
||||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
|
||||||
</Style>
|
|
||||||
</Border.Style>
|
|
||||||
<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
|
|
||||||
</Border>
|
|
||||||
</ControlTemplate>
|
|
||||||
</Setter.Value>
|
|
||||||
</Setter>
|
|
||||||
</Style>
|
|
||||||
|
|
||||||
<Storyboard x:Key="Custom1Transition1" x:Shared="False">
|
|
||||||
<DoubleAnimation From="50" To="0" Duration="0:0:0.4" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)">
|
|
||||||
<DoubleAnimation.EasingFunction>
|
|
||||||
<ElasticEase Oscillations="1"/>
|
|
||||||
</DoubleAnimation.EasingFunction>
|
|
||||||
</DoubleAnimation>
|
|
||||||
</Storyboard>
|
|
||||||
<Storyboard x:Key="Custom2Transition2" x:Shared="False">
|
|
||||||
<DoubleAnimation From="10" To="0" Duration="0:0:0.4" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)">
|
|
||||||
<DoubleAnimation.EasingFunction>
|
|
||||||
<ElasticEase Oscillations="1"/>
|
|
||||||
</DoubleAnimation.EasingFunction>
|
|
||||||
</DoubleAnimation>
|
|
||||||
</Storyboard>
|
|
||||||
|
|
||||||
<Storyboard x:Key="Custom3Transition3" x:Shared="False">
|
|
||||||
<DoubleAnimation From=".8" To="1" Duration="0:0:0.4">
|
|
||||||
<DoubleAnimation.EasingFunction>
|
|
||||||
<ElasticEase Oscillations="1"/>
|
|
||||||
</DoubleAnimation.EasingFunction>
|
|
||||||
</DoubleAnimation>
|
|
||||||
</Storyboard>
|
|
||||||
|
|
||||||
<cvt:OpcityConvert x:Key="OpcityConvert"/>
|
<cvt:OpcityConvert x:Key="OpcityConvert"/>
|
||||||
<cvt:SearchResWidth x:Key="SearchResWidth"/>
|
<cvt:SearchResWidth x:Key="SearchResWidth"/>
|
||||||
<temp:SearchIconList x:Key="SearchIconList"/>
|
<temp:SearchIconList x:Key="SearchIconList"/>
|
||||||
@@ -94,9 +59,7 @@
|
|||||||
BorderThickness="1"
|
BorderThickness="1"
|
||||||
Effect="{DynamicResource EffectShadow2}"
|
Effect="{DynamicResource EffectShadow2}"
|
||||||
Margin="5,0,5,5" Grid.ColumnSpan="2"
|
Margin="5,0,5,5" Grid.ColumnSpan="2"
|
||||||
PreviewMouseRightButtonDown="WrapCard_PreviewMouseRightButtonDown"
|
PreviewMouseRightButtonDown="WrapCard_PreviewMouseRightButtonDown">
|
||||||
hc:Dialog.Token="RightWrapCardDialog"
|
|
||||||
>
|
|
||||||
<hc:Card.Background>
|
<hc:Card.Background>
|
||||||
<SolidColorBrush Color="AliceBlue" hc:GeometryEffect.GeometryEffect="20" Opacity="{Binding AppConfig.CardOpacity, Mode=TwoWay, Converter={StaticResource OpcityConvert}}"/>
|
<SolidColorBrush Color="AliceBlue" hc:GeometryEffect.GeometryEffect="20" Opacity="{Binding AppConfig.CardOpacity, Mode=TwoWay, Converter={StaticResource OpcityConvert}}"/>
|
||||||
</hc:Card.Background>
|
</hc:Card.Background>
|
||||||
@@ -110,100 +73,87 @@
|
|||||||
<MenuItem x:Name="CardLockCM" Header="锁定主面板" Click="LockAppPanel"/>
|
<MenuItem x:Name="CardLockCM" Header="锁定主面板" Click="LockAppPanel"/>
|
||||||
</ContextMenu>
|
</ContextMenu>
|
||||||
</hc:Card.ContextMenu>
|
</hc:Card.ContextMenu>
|
||||||
<hc:DialogContainer>
|
<Grid>
|
||||||
<Grid>
|
<StackPanel Panel.ZIndex="1" Margin="0,-10,-300,0" hc:Growl.GrowlParent="True" hc:Growl.Token="MainWindowGrowl"/>
|
||||||
<ot:PasswordDialog xf:Animations.Primary="{xf:Animate BasedOn={StaticResource FadeInAndGrowHorizontally}, Event=Visibility, Duration=50, Delay=0}"
|
<WrapPanel Orientation="Horizontal" VirtualizingPanel.VirtualizationMode="Recycling"
|
||||||
x:Name="PDDialog"
|
VirtualizingPanel.IsVirtualizing="True"
|
||||||
Panel.ZIndex="99"
|
VirtualizingPanel.IsContainerVirtualizable="True"
|
||||||
IsVisibleChanged="PDDialog_IsVisibleChanged"
|
>
|
||||||
Margin="0,-100,0,0"/>
|
<ListBox x:Name="IconListBox" ItemsSource="{Binding AppConfig.SelectedMenuIcons, Mode=OneWay}"
|
||||||
<StackPanel Panel.ZIndex="1" Margin="0,-10,-0,0"/>
|
BorderThickness="0"
|
||||||
<WrapPanel Orientation="Horizontal"
|
|
||||||
VirtualizingPanel.VirtualizationMode="Recycling"
|
|
||||||
VirtualizingPanel.IsVirtualizing="True"
|
|
||||||
VirtualizingPanel.IsContainerVirtualizable="True"
|
|
||||||
>
|
|
||||||
<UniformGrid x:Name="WrapUFG" xf:Animations.Primary="{xf:Animate BasedOn={StaticResource FadeInAndGrowHorizontally}, Event=Visibility}">
|
|
||||||
<!--<hc:TransitioningContentControl TransitionStoryboard="{StaticResource Custom3Transition3}">-->
|
|
||||||
<ListBox x:Name="IconListBox"
|
|
||||||
ItemsSource="{Binding AppConfig.SelectedMenuIcons, Mode=OneWay}"
|
|
||||||
BorderThickness="0"
|
|
||||||
Padding="0,10,0,0"
|
Padding="0,10,0,0"
|
||||||
>
|
>
|
||||||
<ListBox.Background>
|
<ListBox.Background>
|
||||||
<SolidColorBrush Opacity="0"/>
|
<SolidColorBrush Opacity="0"/>
|
||||||
</ListBox.Background>
|
</ListBox.Background>
|
||||||
<ListBox.ItemsPanel>
|
<ListBox.ItemsPanel>
|
||||||
<ItemsPanelTemplate>
|
<ItemsPanelTemplate>
|
||||||
<!--<DraggAnimatedPanel:DraggAnimatedPanel Background="#00FFFFFF"
|
<DraggAnimatedPanel:DraggAnimatedPanel Background="#00FFFFFF"
|
||||||
ItemsWidth="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type Window}},Path=DataContext.AppConfig.ImgPanelWidth, Mode=OneWay}"
|
ItemsWidth="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type Window}},Path=DataContext.AppConfig.ImgPanelWidth, Mode=OneWay}"
|
||||||
ItemsHeight="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type Window}},Path=DataContext.AppConfig.ImgPanelHeight, Mode=OneWay}"
|
ItemsHeight="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type Window}},Path=DataContext.AppConfig.ImgPanelHeight, Mode=OneWay}"
|
||||||
HorizontalAlignment="Center"
|
HorizontalAlignment="Center"
|
||||||
SwapCommand="{Binding SwapCommand, RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}"/>-->
|
SwapCommand="{Binding SwapCommand, RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}"/>
|
||||||
<WrapPanel />
|
</ItemsPanelTemplate>
|
||||||
</ItemsPanelTemplate>
|
</ListBox.ItemsPanel>
|
||||||
</ListBox.ItemsPanel>
|
|
||||||
|
|
||||||
<ListBox.Resources>
|
<ListBox.Resources>
|
||||||
<ContextMenu x:Key="IconDialog" Width="200">
|
<ContextMenu x:Key="IconDialog" Width="200">
|
||||||
<MenuItem Header="管理员方式运行" Click="IconAdminStart" Tag="{Binding}"/>
|
<MenuItem Header="管理员方式运行" Click="IconAdminStart" Tag="{Binding}"/>
|
||||||
<MenuItem Header="打开文件所在位置" Click="ShowInExplore" Tag="{Binding}"/>
|
<MenuItem Header="打开文件所在位置" Click="ShowInExplore" Tag="{Binding}"/>
|
||||||
<MenuItem Header="添加URL项目" Click="AddUrlIcon"/>
|
<MenuItem Header="添加URL项目" Click="AddUrlIcon"/>
|
||||||
<MenuItem Header="添加系统项目" Click="AddSystemIcon"/>
|
<MenuItem Header="添加系统项目" Click="AddSystemIcon"/>
|
||||||
<MenuItem Header="资源管理器菜单" Click="SystemContextMenu" Tag="{Binding}"/>
|
<MenuItem Header="资源管理器菜单" Click="SystemContextMenu" Tag="{Binding}"/>
|
||||||
<MenuItem Header="属性" Click="PropertyConfig" Tag="{Binding}"/>
|
<MenuItem Header="属性" Click="PropertyConfig" Tag="{Binding}"/>
|
||||||
<MenuItem Header="从列表移除" Click="RemoveIcon" Tag="{Binding}"/>
|
<MenuItem Header="从列表移除" Click="RemoveIcon" Tag="{Binding}"/>
|
||||||
</ContextMenu>
|
</ContextMenu>
|
||||||
</ListBox.Resources>
|
</ListBox.Resources>
|
||||||
|
|
||||||
<ListBox.ItemContainerStyle>
|
<ListBox.ItemContainerStyle>
|
||||||
<Style TargetType="ListBoxItem" BasedOn="{StaticResource MyListBoxItemStyle}">
|
<Style TargetType="ListBoxItem" BasedOn="{StaticResource MyListBoxItemStyle}">
|
||||||
<Setter Property="ContextMenu" Value="{StaticResource IconDialog}"/>
|
<Setter Property="ContextMenu" Value="{StaticResource IconDialog}"/>
|
||||||
</Style>
|
</Style>
|
||||||
</ListBox.ItemContainerStyle>
|
</ListBox.ItemContainerStyle>
|
||||||
|
|
||||||
<ListBox.ItemTemplate>
|
<ListBox.ItemTemplate>
|
||||||
<DataTemplate>
|
<DataTemplate>
|
||||||
|
<hc:SimpleStackPanel Tag="{Binding}"
|
||||||
<hc:SimpleStackPanel Tag="{Binding}"
|
Height="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type Window}},Path=DataContext.AppConfig.ImgPanelHeight, Mode=OneWay}"
|
||||||
Height="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type Window}},Path=DataContext.AppConfig.ImgPanelHeight, Mode=OneWay}"
|
Width="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type Window}},Path=DataContext.AppConfig.ImgPanelWidth, Mode=OneWay}"
|
||||||
Width="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type Window}},Path=DataContext.AppConfig.ImgPanelWidth, Mode=OneWay}"
|
HorizontalAlignment="Center"
|
||||||
HorizontalAlignment="Center"
|
hc:Poptip.Content="{Binding Content}"
|
||||||
hc:Poptip.Content="{Binding Content}"
|
hc:Poptip.Placement="BottomLeft"
|
||||||
hc:Poptip.Placement="BottomLeft"
|
Background="#00FFFFFF"
|
||||||
Background="#00FFFFFF"
|
MouseEnter="StackPanel_MouseEnter"
|
||||||
MouseEnter="StackPanel_MouseEnter"
|
MouseLeave="StackPanel_MouseLeave"
|
||||||
MouseLeave="StackPanel_MouseLeave"
|
MouseLeftButtonDown="Icon_MouseLeftButtonDown"
|
||||||
MouseLeftButtonDown="Icon_MouseLeftButtonDown"
|
MouseLeftButtonUp="Icon_MouseLeftButtonUp"
|
||||||
MouseLeftButtonUp="Icon_MouseLeftButtonUp"
|
>
|
||||||
>
|
<!--<StackPanel Background="#00FFFFFF"
|
||||||
<!--<StackPanel Background="#00FFFFFF"
|
MouseEnter="CursorPanel_MouseEnter"
|
||||||
MouseEnter="CursorPanel_MouseEnter"
|
MouseLeave="CursorPanel_MouseLeave"
|
||||||
MouseLeave="CursorPanel_MouseLeave"
|
Width="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type Window}},Path=DataContext.AppConfig.ImageWidth, Mode=OneWay}">-->
|
||||||
Width="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type Window}},Path=DataContext.AppConfig.ImageWidth, Mode=OneWay}">-->
|
|
||||||
<Image Style="{StaticResource ImageStyle}"
|
<Image Style="{StaticResource ImageStyle}"
|
||||||
RenderOptions.BitmapScalingMode="HighQuality"/>
|
RenderOptions.BitmapScalingMode="HighQuality"/>
|
||||||
<TextBlock MaxWidth="80"
|
<TextBlock MaxWidth="80"
|
||||||
Margin="0,5,0,0"
|
Margin="0,5,0,0"
|
||||||
MaxHeight="40"
|
MaxHeight="40"
|
||||||
FontSize="13"
|
FontSize="13"
|
||||||
TextWrapping="Wrap"
|
TextWrapping="Wrap"
|
||||||
TextTrimming="WordEllipsis"
|
TextTrimming="WordEllipsis"
|
||||||
TextAlignment="Center"
|
TextAlignment="Center"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
Foreground="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type Window}},Path=DataContext.AppConfig.TextColor}"
|
Foreground="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type Window}},Path=DataContext.AppConfig.TextColor}"
|
||||||
Text="{Binding Name}"/>
|
Text="{Binding Name}"/>
|
||||||
<!--</StackPanel>-->
|
<!--</StackPanel>-->
|
||||||
|
|
||||||
|
</hc:SimpleStackPanel>
|
||||||
|
</DataTemplate>
|
||||||
|
</ListBox.ItemTemplate>
|
||||||
|
</ListBox>
|
||||||
|
|
||||||
</hc:SimpleStackPanel>
|
</WrapPanel>
|
||||||
</DataTemplate>
|
|
||||||
</ListBox.ItemTemplate>
|
</Grid>
|
||||||
</ListBox>
|
|
||||||
<!--</hc:TransitioningContentControl>-->
|
|
||||||
</UniformGrid>
|
|
||||||
</WrapPanel>
|
|
||||||
</Grid>
|
|
||||||
</hc:DialogContainer>
|
|
||||||
</hc:Card>
|
</hc:Card>
|
||||||
|
|
||||||
<hc:Card x:Name="VerticalCard"
|
<hc:Card x:Name="VerticalCard"
|
||||||
@@ -222,18 +172,17 @@
|
|||||||
<SolidColorBrush Color="#FFFFFFFF" Opacity="0"/>
|
<SolidColorBrush Color="#FFFFFFFF" Opacity="0"/>
|
||||||
</hc:Card.BorderBrush>
|
</hc:Card.BorderBrush>
|
||||||
<Grid>
|
<Grid>
|
||||||
|
<StackPanel Panel.ZIndex="1" Margin="0,-10,-300,0" hc:Growl.GrowlParent="True" hc:Growl.Token="MainWindowGrowl"/>
|
||||||
<WrapPanel Orientation="Horizontal" VirtualizingPanel.VirtualizationMode="Recycling"
|
<WrapPanel Orientation="Horizontal" VirtualizingPanel.VirtualizationMode="Recycling"
|
||||||
VirtualizingPanel.IsVirtualizing="True"
|
VirtualizingPanel.IsVirtualizing="True"
|
||||||
VirtualizingPanel.IsContainerVirtualizable="True"
|
VirtualizingPanel.IsContainerVirtualizable="True"
|
||||||
>
|
>
|
||||||
<UniformGrid x:Name="VerticalUFG" xf:Animations.Primary="{xf:Animate BasedOn={StaticResource FadeIn}, OffsetY= -10, Event=Visibility}">
|
<UniformGrid x:Name="VerticalUFG">
|
||||||
<!--<hc:TransitioningContentControl TransitionMode="Left2RightWithFade">-->
|
<hc:TransitioningContentControl TransitionMode="Left2RightWithFade">
|
||||||
<ListBox ItemsSource="{Binding Source={StaticResource SearchIconList},Path=IconList}"
|
<ListBox ItemsSource="{Binding Source={StaticResource SearchIconList},Path=IconList}"
|
||||||
BorderThickness="0"
|
BorderThickness="0"
|
||||||
Padding="0,10,0,0"
|
Padding="0,10,0,0"
|
||||||
x:Name="SearchListBox"
|
>
|
||||||
SelectionChanged="SearchListBox_SelectionChanged"
|
|
||||||
>
|
|
||||||
<ListBox.Background>
|
<ListBox.Background>
|
||||||
<SolidColorBrush Opacity="0"/>
|
<SolidColorBrush Opacity="0"/>
|
||||||
</ListBox.Background>
|
</ListBox.Background>
|
||||||
@@ -250,7 +199,7 @@
|
|||||||
</ListBox.Resources>
|
</ListBox.Resources>
|
||||||
|
|
||||||
<ListBox.ItemContainerStyle>
|
<ListBox.ItemContainerStyle>
|
||||||
<Style TargetType="ListBoxItem" BasedOn="{StaticResource SearchListBoxItemStyle}">
|
<Style TargetType="ListBoxItem" BasedOn="{StaticResource MyListBoxItemStyle}">
|
||||||
<Setter Property="ContextMenu" Value="{StaticResource IconDialog}"/>
|
<Setter Property="ContextMenu" Value="{StaticResource IconDialog}"/>
|
||||||
</Style>
|
</Style>
|
||||||
</ListBox.ItemContainerStyle>
|
</ListBox.ItemContainerStyle>
|
||||||
@@ -265,54 +214,36 @@
|
|||||||
|
|
||||||
<ListBox.ItemTemplate>
|
<ListBox.ItemTemplate>
|
||||||
<DataTemplate>
|
<DataTemplate>
|
||||||
<Border CornerRadius="8">
|
|
||||||
<Border.Style>
|
|
||||||
<Style TargetType="Border">
|
|
||||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
|
||||||
<Style.Triggers>
|
|
||||||
<DataTrigger Binding="{Binding Path=IsSelected, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type ListBoxItem }}}"
|
|
||||||
Value="True">
|
|
||||||
<Setter Property="Background">
|
|
||||||
<Setter.Value>
|
|
||||||
<SolidColorBrush Color="White" Opacity="0.68"/>
|
|
||||||
</Setter.Value>
|
|
||||||
</Setter>
|
|
||||||
</DataTrigger>
|
|
||||||
</Style.Triggers>
|
|
||||||
</Style>
|
|
||||||
</Border.Style>
|
|
||||||
<WrapPanel Tag="{Binding}"
|
<WrapPanel Tag="{Binding}"
|
||||||
Height="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type Window}},Path=DataContext.AppConfig.ImageHeight, Mode=OneWay}"
|
Height="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type Window}},Path=DataContext.AppConfig.ImageHeight, Mode=OneWay}"
|
||||||
Width="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type Window}},Path=DataContext.AppConfig.MenuCardWidth, Mode=OneWay, Converter={StaticResource SearchResWidth}, ConverterParameter=2}"
|
Width="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type Window}},Path=DataContext.AppConfig.MenuCardWidth, Mode=OneWay, Converter={StaticResource SearchResWidth}, ConverterParameter=2}"
|
||||||
HorizontalAlignment="Left"
|
HorizontalAlignment="Left"
|
||||||
VerticalAlignment="Center"
|
hc:Poptip.HitMode="None"
|
||||||
hc:Poptip.HitMode="None"
|
hc:Poptip.IsOpen="{Binding IsMouseOver, RelativeSource={RelativeSource Self}}"
|
||||||
hc:Poptip.IsOpen="{Binding IsMouseOver, RelativeSource={RelativeSource Self}}"
|
hc:Poptip.Content="{Binding Content}"
|
||||||
hc:Poptip.Content="{Binding Content}"
|
hc:Poptip.Placement="BottomLeft"
|
||||||
hc:Poptip.Placement="BottomLeft"
|
Background="#00FFFFFF"
|
||||||
Background="#00FFFFFF"
|
MouseLeftButtonDown="Icon_MouseLeftButtonDown"
|
||||||
MouseLeftButtonDown="Icon_MouseLeftButtonDown"
|
MouseLeftButtonUp="Icon_MouseLeftButtonUp"
|
||||||
MouseLeftButtonUp="Icon_MouseLeftButtonUp"
|
Margin="25,20,0,0"
|
||||||
Margin="25,10,0,10"
|
>
|
||||||
>
|
|
||||||
<Image Style="{StaticResource ImageStyle}" RenderOptions.BitmapScalingMode="HighQuality"/>
|
<Image Style="{StaticResource ImageStyle}" RenderOptions.BitmapScalingMode="HighQuality"/>
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Margin="10,5,0,0"
|
Margin="10,5,0,0"
|
||||||
MaxHeight="40"
|
MaxHeight="40"
|
||||||
FontSize="13"
|
FontSize="13"
|
||||||
TextWrapping="Wrap"
|
TextWrapping="Wrap"
|
||||||
TextTrimming="WordEllipsis"
|
TextTrimming="WordEllipsis"
|
||||||
TextAlignment="Left"
|
TextAlignment="Left"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
Foreground="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type Window}},Path=DataContext.AppConfig.TextColor}"
|
Foreground="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type Window}},Path=DataContext.AppConfig.TextColor}"
|
||||||
Text="{Binding Name}"/>
|
Text="{Binding Name}"/>
|
||||||
</WrapPanel>
|
</WrapPanel>
|
||||||
</Border>
|
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
</ListBox.ItemTemplate>
|
</ListBox.ItemTemplate>
|
||||||
</ListBox>
|
</ListBox>
|
||||||
|
|
||||||
<!--</hc:TransitioningContentControl>-->
|
</hc:TransitioningContentControl>
|
||||||
</UniformGrid>
|
</UniformGrid>
|
||||||
</WrapPanel>
|
</WrapPanel>
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ using System.Threading;
|
|||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
using System.Windows.Media;
|
|
||||||
using System.Windows.Media.Animation;
|
using System.Windows.Media.Animation;
|
||||||
using System.Windows.Threading;
|
using System.Windows.Threading;
|
||||||
|
|
||||||
@@ -26,76 +25,68 @@ namespace GeekDesk.Control.UserControls.PannelCard
|
|||||||
{
|
{
|
||||||
private AppData appData = MainWindow.appData;
|
private AppData appData = MainWindow.appData;
|
||||||
|
|
||||||
ListBoxDragDropManager<IconInfo> dragMgr;
|
private volatile static bool DROP_ICON = false;
|
||||||
|
private Thread dropCheckThread = null;
|
||||||
//private Thread dropCheckThread = null;
|
|
||||||
|
|
||||||
public RightCardControl()
|
public RightCardControl()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
this.Loaded += RightCardControl_Loaded;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void RightCardControl_Loaded(object sender, RoutedEventArgs e)
|
|
||||||
|
#region 图标拖动
|
||||||
|
DelegateCommand<int[]> _swap;
|
||||||
|
public DelegateCommand<int[]> SwapCommand
|
||||||
{
|
{
|
||||||
this.dragMgr = new ListBoxDragDropManager<IconInfo>(this.IconListBox);
|
get
|
||||||
|
{
|
||||||
|
if (_swap == null)
|
||||||
|
_swap = new DelegateCommand<int[]>(
|
||||||
|
(indexes) =>
|
||||||
|
{
|
||||||
|
DROP_ICON = true;
|
||||||
|
if (appData.AppConfig.IconSortType != SortType.CUSTOM
|
||||||
|
&& (dropCheckThread == null || !dropCheckThread.IsAlive))
|
||||||
|
{
|
||||||
|
dropCheckThread = new Thread(() =>
|
||||||
|
{
|
||||||
|
do
|
||||||
|
{
|
||||||
|
DROP_ICON = false;
|
||||||
|
Thread.Sleep(1000);
|
||||||
|
} while (DROP_ICON);
|
||||||
|
|
||||||
|
MainWindow.appData.AppConfig.IconSortType = SortType.CUSTOM;
|
||||||
|
App.Current.Dispatcher.Invoke(() =>
|
||||||
|
{
|
||||||
|
if (MainWindow.mainWindow.Visibility == Visibility.Collapsed
|
||||||
|
|| MainWindow.mainWindow.Opacity != 1)
|
||||||
|
{
|
||||||
|
Growl.WarningGlobal("已将图标排序规则重置为自定义!");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Growl.Warning("已将图标排序规则重置为自定义!", "MainWindowGrowl");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
dropCheckThread.Start();
|
||||||
|
}
|
||||||
|
int fromS = indexes[0];
|
||||||
|
int to = indexes[1];
|
||||||
|
ObservableCollection<IconInfo> iconList = appData.MenuList[appData.AppConfig.SelectedMenuIndex].IconList;
|
||||||
|
var elementSource = iconList[to];
|
||||||
|
var dragged = iconList[fromS];
|
||||||
|
|
||||||
|
iconList.Remove(dragged);
|
||||||
|
iconList.Insert(to, dragged);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
return _swap;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endregion 图标拖动
|
||||||
//#region 图标拖动
|
|
||||||
//DelegateCommand<int[]> _swap;
|
|
||||||
//public DelegateCommand<int[]> SwapCommand
|
|
||||||
//{
|
|
||||||
// get
|
|
||||||
// {
|
|
||||||
// if (_swap == null)
|
|
||||||
// _swap = new DelegateCommand<int[]>(
|
|
||||||
// (indexes) =>
|
|
||||||
// {
|
|
||||||
// DROP_ICON = true;
|
|
||||||
// if (appData.AppConfig.IconSortType != SortType.CUSTOM
|
|
||||||
// && (dropCheckThread == null || !dropCheckThread.IsAlive))
|
|
||||||
// {
|
|
||||||
// dropCheckThread = new Thread(() =>
|
|
||||||
// {
|
|
||||||
// do
|
|
||||||
// {
|
|
||||||
// DROP_ICON = false;
|
|
||||||
// Thread.Sleep(1000);
|
|
||||||
// } while (DROP_ICON);
|
|
||||||
|
|
||||||
// MainWindow.appData.AppConfig.IconSortType = SortType.CUSTOM;
|
|
||||||
// App.Current.Dispatcher.Invoke(() =>
|
|
||||||
// {
|
|
||||||
// if (MainWindow.mainWindow.Visibility == Visibility.Collapsed
|
|
||||||
// || MainWindow.mainWindow.Opacity != 1)
|
|
||||||
// {
|
|
||||||
// Growl.WarningGlobal("已将图标排序规则重置为自定义!");
|
|
||||||
// }
|
|
||||||
// else
|
|
||||||
// {
|
|
||||||
// Growl.Warning("已将图标排序规则重置为自定义!", "MainWindowGrowl");
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
// });
|
|
||||||
// dropCheckThread.Start();
|
|
||||||
// }
|
|
||||||
// int fromS = indexes[0];
|
|
||||||
// int to = indexes[1];
|
|
||||||
// ObservableCollection<IconInfo> iconList = appData.MenuList[appData.AppConfig.SelectedMenuIndex].IconList;
|
|
||||||
// var elementSource = iconList[to];
|
|
||||||
// var dragged = iconList[fromS];
|
|
||||||
|
|
||||||
// iconList.Remove(dragged);
|
|
||||||
// iconList.Insert(to, dragged);
|
|
||||||
// }
|
|
||||||
// );
|
|
||||||
// return _swap;
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
|
|
||||||
//#endregion 图标拖动
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -172,51 +163,33 @@ namespace GeekDesk.Control.UserControls.PannelCard
|
|||||||
StartIconApp(icon, IconStartType.SHOW_IN_EXPLORE);
|
StartIconApp(icon, IconStartType.SHOW_IN_EXPLORE);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void StartIconApp(IconInfo icon, IconStartType type, bool useRelativePath = false)
|
private void StartIconApp(IconInfo icon, IconStartType type)
|
||||||
{
|
{
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
using (Process p = new Process())
|
using (Process p = new Process())
|
||||||
{
|
{
|
||||||
string startArg = icon.StartArg;
|
string startArg = icon.StartArg;
|
||||||
|
|
||||||
if (startArg != null && Constants.SYSTEM_ICONS.ContainsKey(startArg))
|
if (startArg != null && Constants.SYSTEM_ICONS.ContainsKey(startArg))
|
||||||
{
|
{
|
||||||
StartSystemApp(startArg, type);
|
StartSystemApp(startArg, type);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
string path;
|
p.StartInfo.FileName = icon.Path;
|
||||||
if (useRelativePath)
|
|
||||||
{
|
|
||||||
string fullPath = Path.Combine(Constants.APP_DIR, icon.RelativePath);
|
|
||||||
path = Path.GetFullPath(fullPath);
|
|
||||||
} else
|
|
||||||
{
|
|
||||||
path = icon.Path;
|
|
||||||
}
|
|
||||||
p.StartInfo.FileName = path;
|
|
||||||
if (!StringUtil.IsEmpty(startArg))
|
if (!StringUtil.IsEmpty(startArg))
|
||||||
{
|
{
|
||||||
p.StartInfo.Arguments = startArg;
|
p.StartInfo.Arguments = startArg;
|
||||||
}
|
}
|
||||||
if (icon.IconType == IconType.OTHER)
|
if (icon.IconType == IconType.OTHER)
|
||||||
{
|
{
|
||||||
if (!File.Exists(path) && !Directory.Exists(path))
|
if (!File.Exists(icon.Path) && !Directory.Exists(icon.Path))
|
||||||
{
|
{
|
||||||
//如果没有使用相对路径 那么使用相对路径启动一次
|
HandyControl.Controls.Growl.WarningGlobal("程序启动失败(文件路径不存在或已删除)!");
|
||||||
if (!useRelativePath)
|
return;
|
||||||
{
|
|
||||||
StartIconApp(icon, type, true);
|
|
||||||
return;
|
|
||||||
} else
|
|
||||||
{
|
|
||||||
HandyControl.Controls.Growl.WarningGlobal("程序启动失败(文件路径不存在或已删除)!");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
p.StartInfo.WorkingDirectory = path.Substring(0, path.LastIndexOf("\\"));
|
p.StartInfo.WorkingDirectory = icon.Path.Substring(0, icon.Path.LastIndexOf("\\"));
|
||||||
switch (type)
|
switch (type)
|
||||||
{
|
{
|
||||||
case IconStartType.ADMIN_STARTUP:
|
case IconStartType.ADMIN_STARTUP:
|
||||||
@@ -284,11 +257,6 @@ namespace GeekDesk.Control.UserControls.PannelCard
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
p.Start();
|
p.Start();
|
||||||
if (useRelativePath)
|
|
||||||
{
|
|
||||||
//如果使用相对路径启动成功 那么重新设置程序绝对路径
|
|
||||||
icon.Path = path;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
icon.Count++;
|
icon.Count++;
|
||||||
@@ -301,15 +269,8 @@ namespace GeekDesk.Control.UserControls.PannelCard
|
|||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
if (!useRelativePath)
|
HandyControl.Controls.Growl.WarningGlobal("程序启动失败(不支持的启动方式)!");
|
||||||
{
|
LogUtil.WriteErrorLog(e, "程序启动失败:path=" + icon.Path + ",type=" + type);
|
||||||
StartIconApp(icon, type, true);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
HandyControl.Controls.Growl.WarningGlobal("程序启动失败(可能为不支持的启动方式)!");
|
|
||||||
LogUtil.WriteErrorLog(e, "程序启动失败:path=" + icon.Path + ",type=" + type);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -407,7 +368,7 @@ namespace GeekDesk.Control.UserControls.PannelCard
|
|||||||
MainWindow.appData.MenuList[appData.AppConfig.SelectedMenuIndex].IconList.Add(iconInfo);
|
MainWindow.appData.MenuList[appData.AppConfig.SelectedMenuIndex].IconList.Add(iconInfo);
|
||||||
}
|
}
|
||||||
CommonCode.SortIconList();
|
CommonCode.SortIconList();
|
||||||
CommonCode.SaveAppData(MainWindow.appData, Constants.DATA_FILE_PATH);
|
CommonCode.SaveAppData(MainWindow.appData);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -444,11 +405,11 @@ namespace GeekDesk.Control.UserControls.PannelCard
|
|||||||
{
|
{
|
||||||
case IconType.URL:
|
case IconType.URL:
|
||||||
IconInfoUrlDialog urlDialog = new IconInfoUrlDialog(info);
|
IconInfoUrlDialog urlDialog = new IconInfoUrlDialog(info);
|
||||||
urlDialog.dialog = HandyControl.Controls.Dialog.Show(urlDialog, "MainWindowDialog");
|
urlDialog.dialog = HandyControl.Controls.Dialog.Show(urlDialog, "IconInfoDialog");
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
IconInfoDialog dialog = new IconInfoDialog(info);
|
IconInfoDialog dialog = new IconInfoDialog(info);
|
||||||
dialog.dialog = HandyControl.Controls.Dialog.Show(dialog, "MainWindowDialog");
|
dialog.dialog = HandyControl.Controls.Dialog.Show(dialog, "IconInfoDialog");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -675,7 +636,7 @@ namespace GeekDesk.Control.UserControls.PannelCard
|
|||||||
private void AddUrlIcon(object sender, RoutedEventArgs e)
|
private void AddUrlIcon(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
IconInfoUrlDialog urlDialog = new IconInfoUrlDialog();
|
IconInfoUrlDialog urlDialog = new IconInfoUrlDialog();
|
||||||
urlDialog.dialog = HandyControl.Controls.Dialog.Show(urlDialog, "MainWindowDialog");
|
urlDialog.dialog = HandyControl.Controls.Dialog.Show(urlDialog, "IconInfoDialog");
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -755,68 +716,5 @@ namespace GeekDesk.Control.UserControls.PannelCard
|
|||||||
CardLockCM.Header = "锁定主面板";
|
CardLockCM.Header = "锁定主面板";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SearchListBoxIndexAdd()
|
|
||||||
{
|
|
||||||
if (SearchListBox.Items.Count > 0)
|
|
||||||
{
|
|
||||||
if (SearchListBox.SelectedIndex < SearchListBox.Items.Count - 1)
|
|
||||||
{
|
|
||||||
SearchListBox.SelectedIndex += 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void SearchListBoxIndexSub()
|
|
||||||
{
|
|
||||||
if (SearchListBox.Items.Count > 0)
|
|
||||||
{
|
|
||||||
if (SearchListBox.SelectedIndex > 0)
|
|
||||||
{
|
|
||||||
SearchListBox.SelectedIndex -= 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void StartupSelectionItem()
|
|
||||||
{
|
|
||||||
if (SearchListBox.SelectedItem != null)
|
|
||||||
{
|
|
||||||
IconInfo icon = SearchListBox.SelectedItem as IconInfo;
|
|
||||||
if (icon.AdminStartUp)
|
|
||||||
{
|
|
||||||
StartIconApp(icon, IconStartType.ADMIN_STARTUP);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
StartIconApp(icon, IconStartType.DEFAULT_STARTUP);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void SearchListBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
|
||||||
{
|
|
||||||
SearchListBox.ScrollIntoView(SearchListBox.SelectedItem);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void PDDialog_IsVisibleChanged(object sender, DependencyPropertyChangedEventArgs e)
|
|
||||||
{
|
|
||||||
if (PDDialog.Visibility == Visibility.Visible)
|
|
||||||
{
|
|
||||||
RunTimeStatus.SHOW_MENU_PASSWORDBOX = true;
|
|
||||||
PDDialog.ClearVal();
|
|
||||||
PDDialog.ErrorMsg.Visibility = Visibility.Collapsed;
|
|
||||||
PDDialog.PasswordGrid.Visibility = Visibility.Visible;
|
|
||||||
PDDialog.HintGrid.Visibility = Visibility.Collapsed;
|
|
||||||
PDDialog.count = 0;
|
|
||||||
PDDialog.SetFocus();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
RunTimeStatus.SHOW_MENU_PASSWORDBOX = false;
|
|
||||||
PDDialog.ClearVal();
|
|
||||||
MainWindow.mainWindow.Focus();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ namespace GeekDesk.Control.UserControls.SystemItem
|
|||||||
iconInfo = CommonCode.GetIconInfoByPath(thisInfo.LnkPath_NoWrite);
|
iconInfo = CommonCode.GetIconInfoByPath(thisInfo.LnkPath_NoWrite);
|
||||||
}
|
}
|
||||||
menuInfo.IconList.Add(iconInfo);
|
menuInfo.IconList.Add(iconInfo);
|
||||||
CommonCode.SaveAppData(MainWindow.appData, Constants.DATA_FILE_PATH);
|
CommonCode.SaveAppData(MainWindow.appData);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
xmlns:local="clr-namespace:GeekDesk.Control.UserControls.PannelCard"
|
xmlns:local="clr-namespace:GeekDesk.Control.UserControls.PannelCard"
|
||||||
xmlns:hc="https://handyorg.github.io/handycontrol" xmlns:viewmodel="clr-namespace:GeekDesk.ViewModel" d:DataContext="{d:DesignInstance Type=viewmodel:ToDoInfo}"
|
xmlns:hc="https://handyorg.github.io/handycontrol" xmlns:viewmodel="clr-namespace:GeekDesk.ViewModel" d:DataContext="{d:DesignInstance Type=viewmodel:ToDoInfo}"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
|
xmlns:cst="clr-namespace:GeekDesk.Converts"
|
||||||
Background="Transparent"
|
Background="Transparent"
|
||||||
>
|
>
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using GeekDesk.Constant;
|
using GeekDesk.Control.Windows;
|
||||||
using GeekDesk.Control.Windows;
|
|
||||||
using GeekDesk.Util;
|
using GeekDesk.Util;
|
||||||
using GeekDesk.ViewModel;
|
using GeekDesk.ViewModel;
|
||||||
using HandyControl.Controls;
|
using HandyControl.Controls;
|
||||||
@@ -43,7 +42,7 @@ namespace GeekDesk.Control.UserControls.Backlog
|
|||||||
{
|
{
|
||||||
MainWindow.appData.HiToDoList.Remove(info);
|
MainWindow.appData.HiToDoList.Remove(info);
|
||||||
}
|
}
|
||||||
CommonCode.SaveAppData(MainWindow.appData, Constants.DATA_FILE_PATH);
|
CommonCode.SaveAppData(MainWindow.appData);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}, "DeleteConfirm");
|
}, "DeleteConfirm");
|
||||||
|
|||||||
@@ -4,7 +4,6 @@
|
|||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:hc="https://handyorg.github.io/handycontrol"
|
xmlns:hc="https://handyorg.github.io/handycontrol"
|
||||||
xmlns:xf="clr-namespace:XamlFlair;assembly=XamlFlair.WPF"
|
|
||||||
xmlns:local="clr-namespace:GeekDesk"
|
xmlns:local="clr-namespace:GeekDesk"
|
||||||
Title="Setting"
|
Title="Setting"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
@@ -110,14 +109,14 @@
|
|||||||
</hc:SideMenu>
|
</hc:SideMenu>
|
||||||
</hc:Card>
|
</hc:Card>
|
||||||
<hc:ScrollViewer Grid.Row="0" Grid.Column="1" BorderThickness="0" Margin="0,5,1,5">
|
<hc:ScrollViewer Grid.Row="0" Grid.Column="1" BorderThickness="0" Margin="0,5,1,5">
|
||||||
<UniformGrid x:Name="UFG" xf:Animations.Primary="{xf:Animate BasedOn={StaticResource FadeIn}, Event=Visibility, Delay=0}">
|
<UniformGrid x:Name="UFG">
|
||||||
<!--<hc:TransitioningContentControl TransitionMode="Left2RightWithFade">-->
|
<hc:TransitioningContentControl TransitionMode="Left2RightWithFade">
|
||||||
<hc:Card x:Name="RightCard" BorderThickness="0" MouseDown="DragMove">
|
<hc:Card x:Name="RightCard" BorderThickness="0" MouseDown="DragMove">
|
||||||
<hc:Card.Background>
|
<hc:Card.Background>
|
||||||
<SolidColorBrush Opacity="0"/>
|
<SolidColorBrush Opacity="0"/>
|
||||||
</hc:Card.Background>
|
</hc:Card.Background>
|
||||||
</hc:Card>
|
</hc:Card>
|
||||||
<!--</hc:TransitioningContentControl>-->
|
</hc:TransitioningContentControl>
|
||||||
</UniformGrid>
|
</UniformGrid>
|
||||||
</hc:ScrollViewer>
|
</hc:ScrollViewer>
|
||||||
|
|
||||||
|
|||||||
@@ -36,8 +36,6 @@ namespace GeekDesk.Control.Windows
|
|||||||
RightCard.Content = about;
|
RightCard.Content = about;
|
||||||
this.Topmost = true;
|
this.Topmost = true;
|
||||||
this.mainWindow = mainWindow;
|
this.mainWindow = mainWindow;
|
||||||
UFG.Visibility = Visibility.Collapsed;
|
|
||||||
UFG.Visibility = Visibility.Visible;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -81,25 +81,15 @@ namespace GeekDesk.Control.Windows
|
|||||||
if (window == null || !window.Activate())
|
if (window == null || !window.Activate())
|
||||||
{
|
{
|
||||||
window = new GlobalColorPickerWindow();
|
window = new GlobalColorPickerWindow();
|
||||||
window.Opacity = 0;
|
|
||||||
App.DoEvents();
|
|
||||||
window.Show();
|
window.Show();
|
||||||
}
|
}
|
||||||
window.Hide();
|
window.Hide();
|
||||||
new Thread(() =>
|
GlobalColorPickerWindow thisWindow = (GlobalColorPickerWindow)window;
|
||||||
|
if (thisWindow.colorPickerWindow == null || !thisWindow.colorPickerWindow.Activate())
|
||||||
{
|
{
|
||||||
Thread.Sleep(200);
|
thisWindow.colorPickerWindow = new PixelColorPickerWindow(thisWindow.MyColorPicker);
|
||||||
App.Current.Dispatcher.Invoke(() =>
|
}
|
||||||
{
|
thisWindow.colorPickerWindow.Show();
|
||||||
GlobalColorPickerWindow thisWindow = (GlobalColorPickerWindow)window;
|
|
||||||
if (thisWindow.colorPickerWindow == null || !thisWindow.colorPickerWindow.Activate())
|
|
||||||
{
|
|
||||||
thisWindow.colorPickerWindow = new PixelColorPickerWindow(thisWindow.MyColorPicker);
|
|
||||||
}
|
|
||||||
thisWindow.colorPickerWindow.Show();
|
|
||||||
});
|
|
||||||
}).Start();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void Show()
|
public static void Show()
|
||||||
@@ -108,7 +98,6 @@ namespace GeekDesk.Control.Windows
|
|||||||
{
|
{
|
||||||
window = new GlobalColorPickerWindow();
|
window = new GlobalColorPickerWindow();
|
||||||
}
|
}
|
||||||
window.Opacity = 1;
|
|
||||||
window.Show();
|
window.Show();
|
||||||
Keyboard.Focus(window);
|
Keyboard.Focus(window);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -138,7 +138,7 @@ namespace GeekDesk.Control.Windows
|
|||||||
}
|
}
|
||||||
window.Show();
|
window.Show();
|
||||||
Keyboard.Focus(window);
|
Keyboard.Focus(window);
|
||||||
ShowWindowFollowMouse.Show(window, MousePosition.LEFT_CENTER, 0, 0);
|
ShowWindowFollowMouse.Show(window, MousePosition.LEFT_CENTER, 0, 0, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void CustomButton_Click(object sender, RoutedEventArgs e)
|
private void CustomButton_Click(object sender, RoutedEventArgs e)
|
||||||
|
|||||||
@@ -280,7 +280,7 @@ namespace GeekDesk.Control.Windows
|
|||||||
}
|
}
|
||||||
window.Show();
|
window.Show();
|
||||||
Keyboard.Focus(window);
|
Keyboard.Focus(window);
|
||||||
ShowWindowFollowMouse.Show(window, MousePosition.LEFT_CENTER, 0, 0);
|
ShowWindowFollowMouse.Show(window, MousePosition.LEFT_CENTER, 0, 0, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -178,7 +178,7 @@ namespace GeekDesk.Control.Windows
|
|||||||
Growl.SuccessGlobal("设置待办任务成功, 系统将在 " + minutes + " 分钟后提醒您!");
|
Growl.SuccessGlobal("设置待办任务成功, 系统将在 " + minutes + " 分钟后提醒您!");
|
||||||
}
|
}
|
||||||
|
|
||||||
CommonCode.SaveAppData(MainWindow.appData, Constants.DATA_FILE_PATH);
|
CommonCode.SaveAppData(MainWindow.appData);
|
||||||
this.Close();
|
this.Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -10,21 +10,12 @@ namespace GeekDesk.Converts
|
|||||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||||
{
|
{
|
||||||
int val = int.Parse(value.ToString());
|
int val = int.Parse(value.ToString());
|
||||||
var param = 0;
|
|
||||||
if (parameter != null)
|
|
||||||
{
|
|
||||||
param = int.Parse(parameter.ToString());
|
|
||||||
}
|
|
||||||
if (val + param > 0)
|
|
||||||
{
|
|
||||||
val += param;
|
|
||||||
}
|
|
||||||
return new CornerRadius(val);
|
return new CornerRadius(val);
|
||||||
}
|
}
|
||||||
|
|
||||||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
||||||
{
|
{
|
||||||
return null;
|
throw new NotImplementedException();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,22 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Globalization;
|
|
||||||
using System.Windows;
|
|
||||||
using System.Windows.Data;
|
|
||||||
|
|
||||||
namespace GeekDesk.Converts
|
|
||||||
{
|
|
||||||
internal class ReverseBoolConvert : IValueConverter
|
|
||||||
{
|
|
||||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
|
||||||
{
|
|
||||||
if (value == null) return null;
|
|
||||||
bool val = (bool)value;
|
|
||||||
return !val;
|
|
||||||
}
|
|
||||||
|
|
||||||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
|
||||||
{
|
|
||||||
throw new NotImplementedException();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -8,10 +8,7 @@ namespace GeekDesk.Converts
|
|||||||
{
|
{
|
||||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||||
{
|
{
|
||||||
if (value == null)
|
if (value == null) return null;
|
||||||
{
|
|
||||||
value = "";
|
|
||||||
}
|
|
||||||
if (parameter == null)
|
if (parameter == null)
|
||||||
{
|
{
|
||||||
return value.ToString();
|
return value.ToString();
|
||||||
@@ -19,14 +16,7 @@ namespace GeekDesk.Converts
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
string val = value.ToString();
|
string val = value.ToString();
|
||||||
if (string.IsNullOrEmpty(val))
|
|
||||||
{
|
|
||||||
return parameter.ToString()
|
|
||||||
.Replace("\\n", "")
|
|
||||||
.Replace("{}", "");
|
|
||||||
}
|
|
||||||
string param = parameter.ToString();
|
string param = parameter.ToString();
|
||||||
param = param.Replace("\\n", "\n");
|
|
||||||
return param.Replace("{}", val);
|
return param.Replace("{}", val);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,7 +21,6 @@ namespace DraggAnimatedPanel
|
|||||||
#endregion
|
#endregion
|
||||||
static DraggAnimatedPanel()
|
static DraggAnimatedPanel()
|
||||||
{
|
{
|
||||||
|
|
||||||
DefaultStyleKeyProperty.OverrideMetadata(typeof(DraggAnimatedPanel), new FrameworkPropertyMetadata(typeof(DraggAnimatedPanel)));
|
DefaultStyleKeyProperty.OverrideMetadata(typeof(DraggAnimatedPanel), new FrameworkPropertyMetadata(typeof(DraggAnimatedPanel)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
<Import Project="packages\Microsoft.SourceLink.GitHub.1.0.0\build\Microsoft.SourceLink.GitHub.props" Condition="Exists('packages\Microsoft.SourceLink.GitHub.1.0.0\build\Microsoft.SourceLink.GitHub.props')" />
|
|
||||||
<Import Project="packages\Microsoft.SourceLink.Common.1.0.0\build\Microsoft.SourceLink.Common.props" Condition="Exists('packages\Microsoft.SourceLink.Common.1.0.0\build\Microsoft.SourceLink.Common.props')" />
|
|
||||||
<Import Project="packages\Microsoft.Build.Tasks.Git.1.0.0\build\Microsoft.Build.Tasks.Git.props" Condition="Exists('packages\Microsoft.Build.Tasks.Git.1.0.0\build\Microsoft.Build.Tasks.Git.props')" />
|
|
||||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||||
@@ -33,8 +30,6 @@
|
|||||||
<IsWebBootstrapper>false</IsWebBootstrapper>
|
<IsWebBootstrapper>false</IsWebBootstrapper>
|
||||||
<UseApplicationTrust>false</UseApplicationTrust>
|
<UseApplicationTrust>false</UseApplicationTrust>
|
||||||
<BootstrapperEnabled>true</BootstrapperEnabled>
|
<BootstrapperEnabled>true</BootstrapperEnabled>
|
||||||
<NuGetPackageImportStamp>
|
|
||||||
</NuGetPackageImportStamp>
|
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||||
@@ -49,7 +44,7 @@
|
|||||||
<Prefer32Bit>false</Prefer32Bit>
|
<Prefer32Bit>false</Prefer32Bit>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||||
<PlatformTarget>x64</PlatformTarget>
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||||
<DebugType>pdbonly</DebugType>
|
<DebugType>pdbonly</DebugType>
|
||||||
<Optimize>true</Optimize>
|
<Optimize>true</Optimize>
|
||||||
<OutputPath>bin\Release\</OutputPath>
|
<OutputPath>bin\Release\</OutputPath>
|
||||||
@@ -57,8 +52,6 @@
|
|||||||
<ErrorReport>prompt</ErrorReport>
|
<ErrorReport>prompt</ErrorReport>
|
||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||||
<Prefer32Bit>false</Prefer32Bit>
|
|
||||||
<GenerateSerializationAssemblies>Auto</GenerateSerializationAssemblies>
|
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<StartupObject>GeekDesk.App</StartupObject>
|
<StartupObject>GeekDesk.App</StartupObject>
|
||||||
@@ -120,19 +113,12 @@
|
|||||||
<Reference Include="System.Numerics.Vectors, Version=4.1.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
<Reference Include="System.Numerics.Vectors, Version=4.1.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||||
<HintPath>packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll</HintPath>
|
<HintPath>packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="System.Reactive, Version=5.0.0.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL">
|
|
||||||
<HintPath>packages\System.Reactive.5.0.0\lib\net472\System.Reactive.dll</HintPath>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||||
<HintPath>packages\System.Runtime.CompilerServices.Unsafe.4.5.3\lib\net461\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
|
<HintPath>packages\System.Runtime.CompilerServices.Unsafe.4.5.3\lib\net461\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="System.Runtime.Remoting" />
|
<Reference Include="System.Runtime.Remoting" />
|
||||||
<Reference Include="System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
|
||||||
<HintPath>packages\System.Threading.Tasks.Extensions.4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll</HintPath>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="System.Web" />
|
<Reference Include="System.Web" />
|
||||||
<Reference Include="System.Web.Extensions" />
|
<Reference Include="System.Web.Extensions" />
|
||||||
<Reference Include="System.Windows" />
|
|
||||||
<Reference Include="System.Windows.Forms" />
|
<Reference Include="System.Windows.Forms" />
|
||||||
<Reference Include="System.Xml" />
|
<Reference Include="System.Xml" />
|
||||||
<Reference Include="Microsoft.CSharp" />
|
<Reference Include="Microsoft.CSharp" />
|
||||||
@@ -146,9 +132,6 @@
|
|||||||
<Reference Include="WindowsBase" />
|
<Reference Include="WindowsBase" />
|
||||||
<Reference Include="PresentationCore" />
|
<Reference Include="PresentationCore" />
|
||||||
<Reference Include="PresentationFramework" />
|
<Reference Include="PresentationFramework" />
|
||||||
<Reference Include="XamlFlair.WPF, Version=1.2.13.0, Culture=neutral, processorArchitecture=MSIL">
|
|
||||||
<HintPath>packages\XamlFlair.WPF.1.2.13\lib\net472\XamlFlair.WPF.dll</HintPath>
|
|
||||||
</Reference>
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ApplicationDefinition Include="App.xaml">
|
<ApplicationDefinition Include="App.xaml">
|
||||||
@@ -163,16 +146,12 @@
|
|||||||
<Compile Include="Constant\IconType.cs" />
|
<Compile Include="Constant\IconType.cs" />
|
||||||
<Compile Include="Constant\CommonEnum.cs" />
|
<Compile Include="Constant\CommonEnum.cs" />
|
||||||
<Compile Include="Constant\IconStartType.cs" />
|
<Compile Include="Constant\IconStartType.cs" />
|
||||||
<Compile Include="Constant\PasswordType.cs" />
|
|
||||||
<Compile Include="Constant\RunTimeStatus.cs" />
|
<Compile Include="Constant\RunTimeStatus.cs" />
|
||||||
<Compile Include="Constant\SearchType.cs" />
|
<Compile Include="Constant\SearchType.cs" />
|
||||||
<Compile Include="Constant\SortType.cs" />
|
<Compile Include="Constant\SortType.cs" />
|
||||||
<Compile Include="Constant\TodoTaskExecType.cs" />
|
<Compile Include="Constant\TodoTaskExecType.cs" />
|
||||||
<Compile Include="Constant\BGStyle.cs" />
|
<Compile Include="Constant\BGStyle.cs" />
|
||||||
<Compile Include="Constant\UpdateType.cs" />
|
<Compile Include="Constant\UpdateType.cs" />
|
||||||
<Compile Include="Control\Other\GlobalMsgNotification.xaml.cs">
|
|
||||||
<DependentUpon>GlobalMsgNotification.xaml</DependentUpon>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="Control\Other\BacklogNotificatin.xaml.cs">
|
<Compile Include="Control\Other\BacklogNotificatin.xaml.cs">
|
||||||
<DependentUpon>BacklogNotificatin.xaml</DependentUpon>
|
<DependentUpon>BacklogNotificatin.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
@@ -182,9 +161,6 @@
|
|||||||
<Compile Include="Control\Other\GradientBGDialog.xaml.cs">
|
<Compile Include="Control\Other\GradientBGDialog.xaml.cs">
|
||||||
<DependentUpon>GradientBGDialog.xaml</DependentUpon>
|
<DependentUpon>GradientBGDialog.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="Control\Other\PasswordDialog.xaml.cs">
|
|
||||||
<DependentUpon>PasswordDialog.xaml</DependentUpon>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="Control\Other\MyColorPickerDialog.xaml.cs">
|
<Compile Include="Control\Other\MyColorPickerDialog.xaml.cs">
|
||||||
<DependentUpon>MyColorPickerDialog.xaml</DependentUpon>
|
<DependentUpon>MyColorPickerDialog.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
@@ -258,38 +234,30 @@
|
|||||||
<Compile Include="Converts\OpcityConvert.cs" />
|
<Compile Include="Converts\OpcityConvert.cs" />
|
||||||
<Compile Include="Converts\BGStyleConvert.cs" />
|
<Compile Include="Converts\BGStyleConvert.cs" />
|
||||||
<Compile Include="Converts\UpdateTypeConvert.cs" />
|
<Compile Include="Converts\UpdateTypeConvert.cs" />
|
||||||
<Compile Include="Converts\ReverseBoolConvert.cs" />
|
|
||||||
<Compile Include="Converts\Visibility2BooleanConverter.cs" />
|
<Compile Include="Converts\Visibility2BooleanConverter.cs" />
|
||||||
<Compile Include="DraggAnimatedPanel\DraggAnimatedPanel.cs" />
|
<Compile Include="DraggAnimatedPanel\DraggAnimatedPanel.cs" />
|
||||||
<Compile Include="DraggAnimatedPanel\DraggAnimatedPanel.Drag.cs" />
|
<Compile Include="DraggAnimatedPanel\DraggAnimatedPanel.Drag.cs" />
|
||||||
<Compile Include="Converts\HideTypeConvert.cs" />
|
<Compile Include="Converts\HideTypeConvert.cs" />
|
||||||
<Compile Include="Interface\IWindowCommon.cs" />
|
<Compile Include="Interface\IWindowCommon.cs" />
|
||||||
<Compile Include="MyThread\RelativePathThread.cs" />
|
|
||||||
<Compile Include="Task\ShowSecondTask.cs" />
|
|
||||||
<Compile Include="Task\ToDoTask.cs" />
|
<Compile Include="Task\ToDoTask.cs" />
|
||||||
<Compile Include="MyThread\MouseHookThread.cs" />
|
<Compile Include="MyThread\MouseHookThread.cs" />
|
||||||
<Compile Include="MyThread\DispatcherBuild.cs" />
|
<Compile Include="MyThread\DispatcherBuild.cs" />
|
||||||
<Compile Include="MyThread\UpdateThread.cs" />
|
<Compile Include="MyThread\UpdateThread.cs" />
|
||||||
<Compile Include="Util\AeroGlassHelper.cs" />
|
<Compile Include="Util\AeroGlassHelper.cs" />
|
||||||
<Compile Include="Util\BGSettingUtil.cs" />
|
<Compile Include="Util\BGSettingUtil.cs" />
|
||||||
<Compile Include="Util\BlurGlassUtil.cs" />
|
|
||||||
<Compile Include="Util\ColorUtil.cs" />
|
<Compile Include="Util\ColorUtil.cs" />
|
||||||
<Compile Include="Util\DragAdorner.cs" />
|
|
||||||
<Compile Include="Util\GlobalHotKey.cs" />
|
<Compile Include="Util\GlobalHotKey.cs" />
|
||||||
<Compile Include="Util\CommonCode.cs" />
|
<Compile Include="Util\CommonCode.cs" />
|
||||||
<Compile Include="Util\FileIcon.cs" />
|
<Compile Include="Util\FileIcon.cs" />
|
||||||
<Compile Include="Util\FileUtil.cs" />
|
<Compile Include="Util\FileUtil.cs" />
|
||||||
<Compile Include="Util\KeyUtil.cs" />
|
<Compile Include="Util\KeyUtil.cs" />
|
||||||
<Compile Include="Util\ListBoxDragDropManager.cs" />
|
|
||||||
<Compile Include="Util\LogUtil.cs" />
|
<Compile Include="Util\LogUtil.cs" />
|
||||||
<Compile Include="Util\MarginHide.cs" />
|
<Compile Include="Util\MarginHide.cs" />
|
||||||
<Compile Include="Util\HttpUtil.cs" />
|
<Compile Include="Util\HttpUtil.cs" />
|
||||||
<Compile Include="Util\ImageUtil.cs" />
|
<Compile Include="Util\ImageUtil.cs" />
|
||||||
<Compile Include="Converts\MenuWidthConvert.cs" />
|
<Compile Include="Converts\MenuWidthConvert.cs" />
|
||||||
<Compile Include="Util\MD5Util.cs" />
|
|
||||||
<Compile Include="Util\MouseUtil.cs" />
|
<Compile Include="Util\MouseUtil.cs" />
|
||||||
<Compile Include="Util\RegisterUtil.cs" />
|
<Compile Include="Util\RegisterUtil.cs" />
|
||||||
<Compile Include="Util\RelayCommand.cs" />
|
|
||||||
<Compile Include="Util\ShellContextMenu.cs" />
|
<Compile Include="Util\ShellContextMenu.cs" />
|
||||||
<Compile Include="Util\ShowWindowFollowMouse.cs" />
|
<Compile Include="Util\ShowWindowFollowMouse.cs" />
|
||||||
<Compile Include="Util\StringUtil.cs" />
|
<Compile Include="Util\StringUtil.cs" />
|
||||||
@@ -304,10 +272,6 @@
|
|||||||
<Compile Include="ViewModel\IconfontInfo.cs" />
|
<Compile Include="ViewModel\IconfontInfo.cs" />
|
||||||
<Compile Include="ViewModel\IconInfo.cs" />
|
<Compile Include="ViewModel\IconInfo.cs" />
|
||||||
<Compile Include="ViewModel\MenuInfo.cs" />
|
<Compile Include="ViewModel\MenuInfo.cs" />
|
||||||
<Page Include="Control\Other\GlobalMsgNotification.xaml">
|
|
||||||
<Generator>MSBuild:Compile</Generator>
|
|
||||||
<SubType>Designer</SubType>
|
|
||||||
</Page>
|
|
||||||
<Page Include="Control\Other\BacklogNotificatin.xaml">
|
<Page Include="Control\Other\BacklogNotificatin.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
@@ -320,10 +284,6 @@
|
|||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
</Page>
|
</Page>
|
||||||
<Page Include="Control\Other\PasswordDialog.xaml">
|
|
||||||
<Generator>MSBuild:Compile</Generator>
|
|
||||||
<SubType>Designer</SubType>
|
|
||||||
</Page>
|
|
||||||
<Page Include="Control\Other\MyColorPickerDialog.xaml">
|
<Page Include="Control\Other\MyColorPickerDialog.xaml">
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
@@ -424,11 +384,6 @@
|
|||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
</Page>
|
</Page>
|
||||||
<Page Include="Resource\Dictionary\XamlFlairSettings.xaml">
|
|
||||||
<SubType>Designer</SubType>
|
|
||||||
<Generator>MSBuild:Compile</Generator>
|
|
||||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
|
||||||
</Page>
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="Properties\AssemblyInfo.cs">
|
<Compile Include="Properties\AssemblyInfo.cs">
|
||||||
@@ -520,30 +475,7 @@
|
|||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
<ProjectExtensions>
|
<ProjectExtensions>
|
||||||
<VisualStudio>
|
<VisualStudio>
|
||||||
<UserProperties update_1json__JsonSchema="https://beaujs.com/schema.json" />
|
<UserProperties update_1json__JsonSchema="https://typedoc.org/schema.json" />
|
||||||
</VisualStudio>
|
</VisualStudio>
|
||||||
</ProjectExtensions>
|
</ProjectExtensions>
|
||||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
|
||||||
<PropertyGroup>
|
|
||||||
<ErrorText>这台计算机上缺少此项目引用的 NuGet 程序包。使用“NuGet 程序包还原”可下载这些程序包。有关更多信息,请参见 http://go.microsoft.com/fwlink/?LinkID=322105。缺少的文件是 {0}。</ErrorText>
|
|
||||||
</PropertyGroup>
|
|
||||||
<Error Condition="!Exists('packages\Microsoft.Build.Tasks.Git.1.0.0\build\Microsoft.Build.Tasks.Git.props')" Text="$([System.String]::Format('$(ErrorText)', 'packages\Microsoft.Build.Tasks.Git.1.0.0\build\Microsoft.Build.Tasks.Git.props'))" />
|
|
||||||
<Error Condition="!Exists('packages\Microsoft.Build.Tasks.Git.1.0.0\build\Microsoft.Build.Tasks.Git.targets')" Text="$([System.String]::Format('$(ErrorText)', 'packages\Microsoft.Build.Tasks.Git.1.0.0\build\Microsoft.Build.Tasks.Git.targets'))" />
|
|
||||||
<Error Condition="!Exists('packages\Microsoft.SourceLink.Common.1.0.0\build\Microsoft.SourceLink.Common.props')" Text="$([System.String]::Format('$(ErrorText)', 'packages\Microsoft.SourceLink.Common.1.0.0\build\Microsoft.SourceLink.Common.props'))" />
|
|
||||||
<Error Condition="!Exists('packages\Microsoft.SourceLink.Common.1.0.0\build\Microsoft.SourceLink.Common.targets')" Text="$([System.String]::Format('$(ErrorText)', 'packages\Microsoft.SourceLink.Common.1.0.0\build\Microsoft.SourceLink.Common.targets'))" />
|
|
||||||
<Error Condition="!Exists('packages\Microsoft.SourceLink.GitHub.1.0.0\build\Microsoft.SourceLink.GitHub.props')" Text="$([System.String]::Format('$(ErrorText)', 'packages\Microsoft.SourceLink.GitHub.1.0.0\build\Microsoft.SourceLink.GitHub.props'))" />
|
|
||||||
<Error Condition="!Exists('packages\Microsoft.SourceLink.GitHub.1.0.0\build\Microsoft.SourceLink.GitHub.targets')" Text="$([System.String]::Format('$(ErrorText)', 'packages\Microsoft.SourceLink.GitHub.1.0.0\build\Microsoft.SourceLink.GitHub.targets'))" />
|
|
||||||
</Target>
|
|
||||||
<Import Project="packages\Microsoft.Build.Tasks.Git.1.0.0\build\Microsoft.Build.Tasks.Git.targets" Condition="Exists('packages\Microsoft.Build.Tasks.Git.1.0.0\build\Microsoft.Build.Tasks.Git.targets')" />
|
|
||||||
<Import Project="packages\Microsoft.SourceLink.Common.1.0.0\build\Microsoft.SourceLink.Common.targets" Condition="Exists('packages\Microsoft.SourceLink.Common.1.0.0\build\Microsoft.SourceLink.Common.targets')" />
|
|
||||||
<Import Project="packages\Microsoft.SourceLink.GitHub.1.0.0\build\Microsoft.SourceLink.GitHub.targets" Condition="Exists('packages\Microsoft.SourceLink.GitHub.1.0.0\build\Microsoft.SourceLink.GitHub.targets')" />
|
|
||||||
<PropertyGroup>
|
|
||||||
<PreBuildEvent>
|
|
||||||
</PreBuildEvent>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup>
|
|
||||||
<PostBuildEvent>; Move all assemblies and related files to lib folder
|
|
||||||
ROBOCOPY "$(TargetDir) " "$(TargetDir)lib\ " /XF Data *.exe *.config *.manifest /XD lib logs bak /E /IS /MOVE
|
|
||||||
if %25errorlevel%25 leq 4 exit 0 else exit %25errorlevel%25</PostBuildEvent>
|
|
||||||
</PropertyGroup>
|
|
||||||
</Project>
|
</Project>
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
|
|
||||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
# Visual Studio Version 17
|
# Visual Studio Version 17
|
||||||
VisualStudioVersion = 17.1.32319.34
|
VisualStudioVersion = 17.1.32319.34
|
||||||
MinimumVisualStudioVersion = 10.0.40219.1
|
MinimumVisualStudioVersion = 10.0.40219.1
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GeekDesk", "GeekDesk.csproj", "{B4983CEC-2281-413C-8ECF-92EE0E40A713}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GeekDesk", "GeekDesk.csproj", "{B4983CEC-2281-413C-8ECF-92EE0E40A713}"
|
||||||
|
|||||||
@@ -4,6 +4,6 @@ namespace GeekDesk.Interface
|
|||||||
{
|
{
|
||||||
public interface IWindowCommon
|
public interface IWindowCommon
|
||||||
{
|
{
|
||||||
void OnKeyDown(object sender, KeyEventArgs e);
|
void OnKeyDown(object sender, KeyEventArgs e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
- 这是个人开发的程序,任何人可任意修改和免费使用(未做较大功能性改动不允许修改赞赏码,重新修改发布需注明出处)
|
- 这是个人开发的程序,任何人可任意修改和免费使用(未做较大功能性改动不允许修改赞赏码,重新修改发布需注明出处)
|
||||||
- 商用需联系作者
|
- 商用需联系作者
|
||||||
|
|||||||
128
MainWindow.xaml
128
MainWindow.xaml
@@ -5,8 +5,6 @@
|
|||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:uc="clr-namespace:GeekDesk.Control.UserControls.PannelCard"
|
xmlns:uc="clr-namespace:GeekDesk.Control.UserControls.PannelCard"
|
||||||
xmlns:cn="clr-namespace:GeekDesk.Constant"
|
xmlns:cn="clr-namespace:GeekDesk.Constant"
|
||||||
xmlns:xf="clr-namespace:XamlFlair;assembly=XamlFlair.WPF"
|
|
||||||
xmlns:local="clr-namespace:GeekDesk"
|
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
xmlns:cvt="clr-namespace:GeekDesk.Converts"
|
xmlns:cvt="clr-namespace:GeekDesk.Converts"
|
||||||
x:Name="AppWindow"
|
x:Name="AppWindow"
|
||||||
@@ -19,17 +17,18 @@
|
|||||||
AllowsTransparency="True"
|
AllowsTransparency="True"
|
||||||
Background="Transparent"
|
Background="Transparent"
|
||||||
ShowInTaskbar="False"
|
ShowInTaskbar="False"
|
||||||
Opacity="1"
|
Opacity="0"
|
||||||
Deactivated="AppWindow_Deactivated"
|
Deactivated="AppWindow_Deactivated"
|
||||||
SizeChanged="Window_SizeChanged"
|
SizeChanged="Window_SizeChanged"
|
||||||
PreviewKeyDown="OnKeyDown"
|
KeyDown="OnKeyDown"
|
||||||
Focusable="True"
|
Focusable="True"
|
||||||
MouseDown="MainWindow_MouseDown"
|
MouseDown="MainWindow_MouseDown"
|
||||||
MouseEnter="MainWindow_MouseEnter"
|
MouseEnter="MainWindow_MouseEnter"
|
||||||
GotFocus="Window_GotFocus"
|
GotFocus="Window_GotFocus"
|
||||||
Loaded="Window_Loaded"
|
|
||||||
>
|
>
|
||||||
|
<WindowChrome.WindowChrome>
|
||||||
|
<WindowChrome CaptionHeight="0" ResizeBorderThickness="15"/>
|
||||||
|
</WindowChrome.WindowChrome>
|
||||||
<Window.Resources>
|
<Window.Resources>
|
||||||
<RoutedUICommand x:Key="SearchHotKeyDown" Text="SearchHotKeyDown"/>
|
<RoutedUICommand x:Key="SearchHotKeyDown" Text="SearchHotKeyDown"/>
|
||||||
|
|
||||||
@@ -37,38 +36,37 @@
|
|||||||
<cvt:OpcityConvert x:Key="OpcityConvert"/>
|
<cvt:OpcityConvert x:Key="OpcityConvert"/>
|
||||||
<cvt:IntToCornerRadius x:Key="IntToCornerRadius"/>
|
<cvt:IntToCornerRadius x:Key="IntToCornerRadius"/>
|
||||||
<cvt:DoubleToGridLength x:Key="DoubleToGridLength"/>
|
<cvt:DoubleToGridLength x:Key="DoubleToGridLength"/>
|
||||||
<cvt:ReverseBoolConvert x:Key="ReverseBoolConvert"/>
|
<Style x:Key="BorderBacStyle" TargetType="Border">
|
||||||
|
|
||||||
|
</Style>
|
||||||
|
|
||||||
</Window.Resources>
|
</Window.Resources>
|
||||||
|
|
||||||
<WindowChrome.WindowChrome>
|
|
||||||
<WindowChrome CaptionHeight="0" CornerRadius="30" ResizeBorderThickness="15"/>
|
|
||||||
</WindowChrome.WindowChrome>
|
|
||||||
|
|
||||||
<Window.InputBindings>
|
<Window.InputBindings>
|
||||||
<KeyBinding Gesture="Ctrl+F" Key="F" Command="{StaticResource SearchHotKeyDown}"/>
|
<KeyBinding Gesture="Ctrl+F" Key="F" Command="{StaticResource SearchHotKeyDown}"/>
|
||||||
</Window.InputBindings>
|
</Window.InputBindings>
|
||||||
<Window.CommandBindings>
|
<Window.CommandBindings>
|
||||||
<CommandBinding Command="{StaticResource SearchHotKeyDown}" CanExecute="SearchHotKeyDown"/>
|
<CommandBinding Command="{StaticResource SearchHotKeyDown}" CanExecute="SearchHotKeyDown"/>
|
||||||
|
<!--<CommandBinding Command="ChangeImgBG" Executed="ChangeImgBG_Executed" CanExecute="ChangeImgBG_CanExecute" />-->
|
||||||
|
|
||||||
</Window.CommandBindings>
|
</Window.CommandBindings>
|
||||||
|
|
||||||
<!--Opacity="{Binding AppConfig.PannelOpacity, Mode=TwoWay, Converter={StaticResource OpcityConvert}}"-->
|
<Window.Effect>
|
||||||
<Border Margin="20" CornerRadius="{Binding AppConfig.PannelCornerRadius, Mode=TwoWay, Converter={StaticResource IntToCornerRadius}}"
|
<DropShadowEffect BlurRadius="30" Direction="-90" Color="Gray"
|
||||||
BorderThickness="0"
|
|
||||||
Focusable="True"
|
|
||||||
x:Name="BGBorder"
|
|
||||||
hc:Dialog.Token="MainWindowDialog"
|
|
||||||
xf:Animations.Primary="{xf:Animate BasedOn={StaticResource FadeInAndGrowHorizontally}, Event=None}"
|
|
||||||
xf:Animations.PrimaryBinding="{Binding AppConfig.IsShow, Mode=OneWay}"
|
|
||||||
xf:Animations.Secondary="{xf:Animate BasedOn={StaticResource FadeOut}, Event=None}"
|
|
||||||
xf:Animations.SecondaryBinding="{Binding AppConfig.IsShow, Mode=OneWay, Converter={StaticResource ReverseBoolConvert}}"
|
|
||||||
xf:Animations.SecondaryCompletionCommand="{Binding HideCommand, RelativeSource={RelativeSource AncestorType={x:Type Window}}}"
|
|
||||||
xf:Animations.AllowOpacityReset="False"
|
|
||||||
>
|
|
||||||
<Border.Effect>
|
|
||||||
<DropShadowEffect BlurRadius="30" Direction="-90" Color="Gray"
|
|
||||||
RenderingBias="Quality" ShadowDepth="2"/>
|
RenderingBias="Quality" ShadowDepth="2"/>
|
||||||
</Border.Effect>
|
</Window.Effect>
|
||||||
<hc:DialogContainer Focusable="True">
|
<Border Margin="20" CornerRadius="{Binding AppConfig.PannelCornerRadius, Mode=TwoWay, Converter={StaticResource IntToCornerRadius}}" BorderThickness="0"
|
||||||
|
Background="AliceBlue"
|
||||||
|
Opacity="{Binding AppConfig.PannelOpacity, Mode=TwoWay, Converter={StaticResource OpcityConvert}}"
|
||||||
|
hc:Dialog.Token="IconInfoDialog"
|
||||||
|
Focusable="True"
|
||||||
|
>
|
||||||
|
<hc:DialogContainer Focusable="True">
|
||||||
|
<!-- -1是为了解决圆角白线的问题-->
|
||||||
|
<Border x:Name="BGBorder"
|
||||||
|
CornerRadius="{Binding AppConfig.PannelCornerRadius, Mode=TwoWay, Converter={StaticResource IntToCornerRadius}}"
|
||||||
|
BorderThickness="0"
|
||||||
|
Margin="-1"
|
||||||
|
>
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition Height="40" MouseMove="DragMove"></RowDefinition>
|
<RowDefinition Height="40" MouseMove="DragMove"></RowDefinition>
|
||||||
@@ -79,10 +77,9 @@
|
|||||||
<ColumnDefinition x:Name="RightColumn" Width="*"></ColumnDefinition>
|
<ColumnDefinition x:Name="RightColumn" Width="*"></ColumnDefinition>
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
<CheckBox x:Name="ShowBox" Visibility="Hidden" Panel.ZIndex="2"/>
|
<!--获取焦点用-->
|
||||||
<CheckBox x:Name="HideBox" Visibility="Hidden" Panel.ZIndex="2"/>
|
<TextBox x:Name="EmptyTextBox" Width="0"/>
|
||||||
|
|
||||||
<StackPanel HorizontalAlignment="Right" Panel.ZIndex="99" hc:Growl.GrowlParent="False" hc:Growl.Token="MainWindowGrowl" Grid.Column="1" Grid.Row="1"/>
|
|
||||||
|
|
||||||
<DockPanel Grid.Row="0" Grid.Column="0" MouseMove="DragMove">
|
<DockPanel Grid.Row="0" Grid.Column="0" MouseMove="DragMove">
|
||||||
<DockPanel.Background>
|
<DockPanel.Background>
|
||||||
@@ -97,39 +94,38 @@
|
|||||||
</DockPanel.Background>
|
</DockPanel.Background>
|
||||||
<hc:UniformSpacingPanel Grid.ColumnSpan="4" HorizontalAlignment="Right" VerticalAlignment="Center">
|
<hc:UniformSpacingPanel Grid.ColumnSpan="4" HorizontalAlignment="Right" VerticalAlignment="Center">
|
||||||
<Button Background="Transparent"
|
<Button Background="Transparent"
|
||||||
BorderThickness="0"
|
BorderThickness="0"
|
||||||
hc:IconElement.Geometry="M917.930667 512c0-57.6 36.181333-106.496 86.869333-125.952a505.429333 505.429333 0 0 0-55.210667-133.461333A134.826667 134.826667 0 0 1 771.413333 74.410667 507.733333 507.733333 0 0 0 637.952 19.2 135.168 135.168 0 0 1 512 106.069333 134.912 134.912 0 0 1 386.048 19.2 505.429333 505.429333 0 0 0 252.586667 74.410667c22.186667 49.749333 13.141333 109.824-27.562667 150.528a135.168 135.168 0 0 1-150.528 27.648 502.016 502.016 0 0 0-55.296 133.461333c50.688 19.626667 86.869333 68.437333 86.869333 125.952 0 57.6-36.181333 106.496-86.869333 125.952 12.117333 47.530667 30.72 92.330667 55.210667 133.461333a134.826667 134.826667 0 0 1 178.090666 178.176 507.733333 507.733333 0 0 0 133.546667 55.210667A135.168 135.168 0 0 1 512 917.930667c57.6 0 106.496 36.181333 125.952 86.869333a505.429333 505.429333 0 0 0 133.461333-55.210667 134.912 134.912 0 0 1 27.562667-150.528 135.168 135.168 0 0 1 150.528-27.648 502.016 502.016 0 0 0 55.296-133.461333A134.912 134.912 0 0 1 917.930667 512zM512 647.338667a135.338667 135.338667 0 1 1 0.085333-270.762667A135.338667 135.338667 0 0 1 512 647.338667z"
|
hc:IconElement.Geometry="M917.930667 512c0-57.6 36.181333-106.496 86.869333-125.952a505.429333 505.429333 0 0 0-55.210667-133.461333A134.826667 134.826667 0 0 1 771.413333 74.410667 507.733333 507.733333 0 0 0 637.952 19.2 135.168 135.168 0 0 1 512 106.069333 134.912 134.912 0 0 1 386.048 19.2 505.429333 505.429333 0 0 0 252.586667 74.410667c22.186667 49.749333 13.141333 109.824-27.562667 150.528a135.168 135.168 0 0 1-150.528 27.648 502.016 502.016 0 0 0-55.296 133.461333c50.688 19.626667 86.869333 68.437333 86.869333 125.952 0 57.6-36.181333 106.496-86.869333 125.952 12.117333 47.530667 30.72 92.330667 55.210667 133.461333a134.826667 134.826667 0 0 1 178.090666 178.176 507.733333 507.733333 0 0 0 133.546667 55.210667A135.168 135.168 0 0 1 512 917.930667c57.6 0 106.496 36.181333 125.952 86.869333a505.429333 505.429333 0 0 0 133.461333-55.210667 134.912 134.912 0 0 1 27.562667-150.528 135.168 135.168 0 0 1 150.528-27.648 502.016 502.016 0 0 0 55.296-133.461333A134.912 134.912 0 0 1 917.930667 512zM512 647.338667a135.338667 135.338667 0 1 1 0.085333-270.762667A135.338667 135.338667 0 0 1 512 647.338667z"
|
||||||
hc:IconElement.Height="18"
|
hc:IconElement.Height="18"
|
||||||
hc:IconElement.Width="18"
|
hc:IconElement.Width="18"
|
||||||
HorizontalAlignment="Right"
|
HorizontalAlignment="Right"
|
||||||
Click="ConfigButtonClick"
|
Click="ConfigButtonClick"
|
||||||
Initialized="SettingButton_Initialized"
|
Initialized="SettingButton_Initialized"
|
||||||
PreviewMouseLeftButtonDown="AppButton_PreviewMouseLeftButtonDown"
|
x:Name="SettingButton"
|
||||||
x:Name="SettingButton"
|
FocusVisualStyle="{x:Null}"
|
||||||
FocusVisualStyle="{x:Null}"
|
>
|
||||||
>
|
<Button.ContextMenu>
|
||||||
<Button.ContextMenu>
|
<ContextMenu x:Name="SettingMenus" Width="130">
|
||||||
<ContextMenu x:Name="SettingMenus" Width="130">
|
<MenuItem Header="设置" Click="ConfigMenuClick"/>
|
||||||
<MenuItem Header="设置" Click="ConfigMenuClick"/>
|
<MenuItem Header="待办" Click="BacklogMenuClick"/>
|
||||||
<MenuItem Header="待办" Click="BacklogMenuClick"/>
|
</ContextMenu>
|
||||||
</ContextMenu>
|
</Button.ContextMenu>
|
||||||
</Button.ContextMenu>
|
|
||||||
</Button>
|
</Button>
|
||||||
<Button Background="Transparent"
|
<Button Background="Transparent"
|
||||||
BorderThickness="0"
|
BorderThickness="0"
|
||||||
hc:IconElement.Geometry="M828.770654 148.714771C641.293737-20.89959 354.184117-19.590868 168.245698 152.630946c-212.062907 196.418185-212.062907 522.329912 0 718.748098 185.93842 172.221815 473.048039 173.520546 660.524956 3.916176 219.435707-198.536117 219.435707-528.054322 0-726.580449z m-121.880976 569.643707c-11.708566 11.708566-30.680039 11.708566-42.388605 0L502.729054 556.586459c-0.659356-0.659356-1.728312-0.659356-2.397659 0L338.609327 718.318517c-11.708566 11.708566-30.680039 11.708566-42.388605 0l-0.039961-0.039961c-11.708566-11.708566-11.708566-30.680039 0-42.388605l161.732059-161.732058c0.659356-0.659356 0.659356-1.728312 0-2.397659L296.1408 350.008195c-11.708566-11.708566-11.708566-30.680039 0-42.388605l0.039961-0.039961c11.708566-11.708566 30.680039-11.708566 42.388605 0l161.772019 161.77202c0.659356 0.659356 1.728312 0.659356 2.397659 0L664.551024 307.539668c11.708566-11.708566 30.680039-11.708566 42.388605 0l0.039961 0.039961c11.708566 11.708566 11.708566 30.680039 0 42.388605L545.15762 511.770224c-0.659356 0.659356-0.659356 1.728312 0 2.397659L706.919649 675.939902c11.708566 11.708566 11.708566 30.680039 0 42.388605l-0.029971 0.029971z"
|
hc:IconElement.Geometry="M828.770654 148.714771C641.293737-20.89959 354.184117-19.590868 168.245698 152.630946c-212.062907 196.418185-212.062907 522.329912 0 718.748098 185.93842 172.221815 473.048039 173.520546 660.524956 3.916176 219.435707-198.536117 219.435707-528.054322 0-726.580449z m-121.880976 569.643707c-11.708566 11.708566-30.680039 11.708566-42.388605 0L502.729054 556.586459c-0.659356-0.659356-1.728312-0.659356-2.397659 0L338.609327 718.318517c-11.708566 11.708566-30.680039 11.708566-42.388605 0l-0.039961-0.039961c-11.708566-11.708566-11.708566-30.680039 0-42.388605l161.732059-161.732058c0.659356-0.659356 0.659356-1.728312 0-2.397659L296.1408 350.008195c-11.708566-11.708566-11.708566-30.680039 0-42.388605l0.039961-0.039961c11.708566-11.708566 30.680039-11.708566 42.388605 0l161.772019 161.77202c0.659356 0.659356 1.728312 0.659356 2.397659 0L664.551024 307.539668c11.708566-11.708566 30.680039-11.708566 42.388605 0l0.039961 0.039961c11.708566 11.708566 11.708566 30.680039 0 42.388605L545.15762 511.770224c-0.659356 0.659356-0.659356 1.728312 0 2.397659L706.919649 675.939902c11.708566 11.708566 11.708566 30.680039 0 42.388605l-0.029971 0.029971z"
|
||||||
hc:IconElement.Height="18"
|
hc:IconElement.Height="18"
|
||||||
hc:IconElement.Width="18"
|
hc:IconElement.Width="18"
|
||||||
HorizontalAlignment="Right"
|
HorizontalAlignment="Right"
|
||||||
Click="CloseButtonClick"
|
Click="CloseButtonClick"
|
||||||
PreviewMouseLeftButtonDown="AppButton_PreviewMouseLeftButtonDown"
|
FocusVisualStyle="{x:Null}"
|
||||||
FocusVisualStyle="{x:Null}"
|
/>
|
||||||
/>
|
|
||||||
</hc:UniformSpacingPanel>
|
</hc:UniformSpacingPanel>
|
||||||
|
|
||||||
</DockPanel>
|
</DockPanel>
|
||||||
|
|
||||||
|
|
||||||
<uc:LeftCardControl x:Name="LeftCard" Grid.Row="1" Grid.Column="0"/>
|
<uc:LeftCardControl Grid.Row="1" Grid.Column="0"/>
|
||||||
|
|
||||||
<!--分割线-->
|
<!--分割线-->
|
||||||
<GridSplitter Opacity="0" Grid.Row="1" Grid.Column="0" Width="1" VerticalAlignment="Stretch" HorizontalAlignment="Right"/>
|
<GridSplitter Opacity="0" Grid.Row="1" Grid.Column="0" Width="1" VerticalAlignment="Stretch" HorizontalAlignment="Right"/>
|
||||||
@@ -145,14 +141,15 @@
|
|||||||
TextChanged="SearchBox_TextChanged"
|
TextChanged="SearchBox_TextChanged"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
<uc:RightCardControl x:Name="RightCard" Grid.Row="1" Grid.Column="1"/>
|
||||||
|
|
||||||
<hc:NotifyIcon Icon="/Taskbar.ico" Click="NotifyIcon_Click" x:Name="BarIcon"
|
<hc:NotifyIcon Icon="/Taskbar.ico" Click="NotifyIcon_Click" x:Name="BarIcon"
|
||||||
Visibility="{Binding AppConfig.ShowBarIcon, Mode=TwoWay, Converter={StaticResource Boolean2VisibilityConverter}}">
|
MouseRightButtonDown="BarIcon_MouseRightButtonDown"
|
||||||
|
Visibility="{Binding AppConfig.ShowBarIcon, Mode=TwoWay, Converter={StaticResource Boolean2VisibilityConverter}}">
|
||||||
<hc:NotifyIcon.ContextMenu>
|
<hc:NotifyIcon.ContextMenu>
|
||||||
<ContextMenu Width="130" x:Name="TaskbarContextMenu">
|
<ContextMenu Width="130" x:Name="TaskbarContextMenu">
|
||||||
<MenuItem Header="打开面板" Click="ShowApp"/>
|
<MenuItem Header="打开面板" Click="ShowApp"/>
|
||||||
<MenuItem Header="拾色器" Click="ColorPicker"/>
|
<MenuItem Header="拾色器" Click="ColorPicker"/>
|
||||||
<MenuItem Header="备份" Click="BakDataFile"/>
|
|
||||||
<MenuItem Header="隐藏图标" Click="CloseBarIcon"/>
|
<MenuItem Header="隐藏图标" Click="CloseBarIcon"/>
|
||||||
<MenuItem Header="待办" Click="BacklogMenuClick"/>
|
<MenuItem Header="待办" Click="BacklogMenuClick"/>
|
||||||
<MenuItem Header="程序目录" Click="OpenThisDir"/>
|
<MenuItem Header="程序目录" Click="OpenThisDir"/>
|
||||||
@@ -161,13 +158,12 @@
|
|||||||
<MenuItem Header="退出" Click="ExitApp"/>
|
<MenuItem Header="退出" Click="ExitApp"/>
|
||||||
</ContextMenu>
|
</ContextMenu>
|
||||||
</hc:NotifyIcon.ContextMenu>
|
</hc:NotifyIcon.ContextMenu>
|
||||||
|
|
||||||
</hc:NotifyIcon>
|
</hc:NotifyIcon>
|
||||||
|
|
||||||
<uc:RightCardControl x:Name="RightCard" Grid.Row="1" Grid.Column="1"/>
|
|
||||||
|
|
||||||
<StackPanel hc:Growl.GrowlParent="True" VerticalAlignment="Top" Margin="0,10,10,0"/>
|
<StackPanel hc:Growl.GrowlParent="True" VerticalAlignment="Top" Margin="0,10,10,0"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
</hc:DialogContainer>
|
</Border>
|
||||||
|
</hc:DialogContainer>
|
||||||
</Border>
|
</Border>
|
||||||
|
|
||||||
</Window>
|
</Window>
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
using GeekDesk.Constant;
|
using GeekDesk.Constant;
|
||||||
using GeekDesk.Control.UserControls.Config;
|
using GeekDesk.Control.UserControls.Config;
|
||||||
using GeekDesk.Control.UserControls.PannelCard;
|
|
||||||
using GeekDesk.Control.Windows;
|
using GeekDesk.Control.Windows;
|
||||||
using GeekDesk.Interface;
|
using GeekDesk.Interface;
|
||||||
using GeekDesk.MyThread;
|
using GeekDesk.MyThread;
|
||||||
@@ -8,7 +7,6 @@ using GeekDesk.Task;
|
|||||||
using GeekDesk.Util;
|
using GeekDesk.Util;
|
||||||
using GeekDesk.ViewModel;
|
using GeekDesk.ViewModel;
|
||||||
using GeekDesk.ViewModel.Temp;
|
using GeekDesk.ViewModel.Temp;
|
||||||
using Microsoft.Win32;
|
|
||||||
using NPinyin;
|
using NPinyin;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.ObjectModel;
|
using System.Collections.ObjectModel;
|
||||||
@@ -17,7 +15,6 @@ using System.Threading;
|
|||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
using System.Windows.Interop;
|
|
||||||
using System.Windows.Media.Animation;
|
using System.Windows.Media.Animation;
|
||||||
using System.Windows.Threading;
|
using System.Windows.Threading;
|
||||||
using static GeekDesk.Util.ShowWindowFollowMouse;
|
using static GeekDesk.Util.ShowWindowFollowMouse;
|
||||||
@@ -39,33 +36,26 @@ namespace GeekDesk
|
|||||||
public static MainWindow mainWindow;
|
public static MainWindow mainWindow;
|
||||||
public MainWindow()
|
public MainWindow()
|
||||||
{
|
{
|
||||||
//加载数据
|
|
||||||
LoadData();
|
LoadData();
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
|
||||||
//用于其他类访问
|
|
||||||
mainWindow = this;
|
mainWindow = this;
|
||||||
|
|
||||||
//置于顶层
|
|
||||||
this.Topmost = true;
|
this.Topmost = true;
|
||||||
|
this.Loaded += Window_Loaded;
|
||||||
//执行待办提醒
|
this.SizeChanged += MainWindow_Resize;
|
||||||
ToDoTask.BackLogCheck();
|
ToDoTask.BackLogCheck();
|
||||||
|
|
||||||
|
|
||||||
////实例化隐藏 Hide类,进行时间timer设置
|
////实例化隐藏 Hide类,进行时间timer设置
|
||||||
MarginHide.ReadyHide(this);
|
MarginHide.ReadyHide(this);
|
||||||
if (appData.AppConfig.MarginHide)
|
if (appData.AppConfig.MarginHide)
|
||||||
{
|
{
|
||||||
MarginHide.StartHide();
|
MarginHide.StartHide();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 搜索快捷键按下
|
/// 显示搜索框
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="sender"></param>
|
/// <param name="sender"></param>
|
||||||
/// <param name="e"></param>
|
/// <param name="e"></param>
|
||||||
@@ -77,9 +67,6 @@ namespace GeekDesk
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 显示搜索框
|
|
||||||
/// </summary>
|
|
||||||
private void ShowSearchBox()
|
private void ShowSearchBox()
|
||||||
{
|
{
|
||||||
RunTimeStatus.SEARCH_BOX_SHOW = true;
|
RunTimeStatus.SEARCH_BOX_SHOW = true;
|
||||||
@@ -129,16 +116,9 @@ namespace GeekDesk
|
|||||||
{
|
{
|
||||||
SearchIconList.IconList.Clear();
|
SearchIconList.IconList.Clear();
|
||||||
}
|
}
|
||||||
if (RightCard.SearchListBox.Items.Count > 0)
|
|
||||||
{
|
|
||||||
RightCard.SearchListBox.SelectedIndex = 0;
|
|
||||||
}
|
|
||||||
RightCard.VerticalUFG.Visibility = Visibility.Visible;
|
RightCard.VerticalUFG.Visibility = Visibility.Visible;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 隐藏搜索框
|
|
||||||
/// </summary>
|
|
||||||
public void HidedSearchBox()
|
public void HidedSearchBox()
|
||||||
{
|
{
|
||||||
RunTimeStatus.SEARCH_BOX_SHOW = false;
|
RunTimeStatus.SEARCH_BOX_SHOW = false;
|
||||||
@@ -179,13 +159,20 @@ namespace GeekDesk
|
|||||||
BGSettingUtil.BGSetting();
|
BGSettingUtil.BGSetting();
|
||||||
if (!appData.AppConfig.StartedShowPanel)
|
if (!appData.AppConfig.StartedShowPanel)
|
||||||
{
|
{
|
||||||
this.Visibility = Visibility.Collapsed;
|
if (appData.AppConfig.AppAnimation)
|
||||||
|
{
|
||||||
|
this.Opacity = 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
this.Visibility = Visibility.Collapsed;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ShowApp();
|
ShowApp();
|
||||||
}
|
}
|
||||||
//ShowSecondTask.SHowSecond();
|
|
||||||
//给任务栏图标一个名字
|
//给任务栏图标一个名字
|
||||||
BarIcon.Text = Constants.MY_NAME;
|
BarIcon.Text = Constants.MY_NAME;
|
||||||
|
|
||||||
@@ -218,12 +205,6 @@ namespace GeekDesk
|
|||||||
|
|
||||||
//更新线程开启 检测更新
|
//更新线程开启 检测更新
|
||||||
UpdateThread.Update();
|
UpdateThread.Update();
|
||||||
|
|
||||||
//建立相对路径
|
|
||||||
RelativePathThread.MakeRelativePath();
|
|
||||||
|
|
||||||
//毛玻璃 暂时未解决阴影问题
|
|
||||||
//BlurGlassUtil.EnableBlur(this);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -348,6 +329,21 @@ namespace GeekDesk
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 重置窗体大小 写入缓存
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sender"></param>
|
||||||
|
/// <param name="e"></param>
|
||||||
|
void MainWindow_Resize(object sender, System.EventArgs e)
|
||||||
|
{
|
||||||
|
if (this.DataContext != null)
|
||||||
|
{
|
||||||
|
AppData appData = this.DataContext as AppData;
|
||||||
|
appData.AppConfig.WindowWidth = this.Width;
|
||||||
|
appData.AppConfig.WindowHeight = this.Height;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -426,6 +422,8 @@ namespace GeekDesk
|
|||||||
// return;
|
// return;
|
||||||
//}
|
//}
|
||||||
|
|
||||||
|
MainWindow.mainWindow.Activate();
|
||||||
|
|
||||||
if (MarginHide.ON_HIDE)
|
if (MarginHide.ON_HIDE)
|
||||||
{
|
{
|
||||||
//修改贴边隐藏状态为未隐藏
|
//修改贴边隐藏状态为未隐藏
|
||||||
@@ -439,65 +437,35 @@ namespace GeekDesk
|
|||||||
|
|
||||||
if (appData.AppConfig.FollowMouse)
|
if (appData.AppConfig.FollowMouse)
|
||||||
{
|
{
|
||||||
ShowWindowFollowMouse.Show(mainWindow, MousePosition.CENTER, 0, 0);
|
ShowWindowFollowMouse.Show(mainWindow, MousePosition.CENTER, 0, 0, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
MainWindow.mainWindow.Activate();
|
FadeStoryBoard(1, (int)CommonEnum.WINDOW_ANIMATION_TIME, Visibility.Visible);
|
||||||
mainWindow.Show();
|
|
||||||
//mainWindow.Visibility = Visibility.Visible;
|
|
||||||
if (appData.AppConfig.AppAnimation)
|
|
||||||
{
|
|
||||||
appData.AppConfig.IsShow = true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
appData.AppConfig.IsShow = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//FadeStoryBoard(1, (int)CommonEnum.WINDOW_ANIMATION_TIME, Visibility.Visible);
|
|
||||||
|
|
||||||
Keyboard.Focus(mainWindow);
|
Keyboard.Focus(mainWindow);
|
||||||
if (RunTimeStatus.SHOW_MENU_PASSWORDBOX)
|
Keyboard.Focus(mainWindow.SearchBox);
|
||||||
{
|
|
||||||
mainWindow.RightCard.PDDialog.SetFocus();
|
|
||||||
} else
|
|
||||||
{
|
|
||||||
Keyboard.Focus(mainWindow.SearchBox);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void HideApp()
|
public static void HideApp()
|
||||||
{
|
{
|
||||||
if (appData.AppConfig.AppAnimation)
|
if (!MarginHide.IS_HIDE)
|
||||||
{
|
{
|
||||||
appData.AppConfig.IsShow = false;
|
//关闭锁定
|
||||||
|
RunTimeStatus.LOCK_APP_PANEL = false;
|
||||||
|
if (RunTimeStatus.SEARCH_BOX_SHOW)
|
||||||
|
{
|
||||||
|
mainWindow.HidedSearchBox();
|
||||||
|
FadeStoryBoard(0, (int)CommonEnum.WINDOW_ANIMATION_TIME, Visibility.Collapsed);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
FadeStoryBoard(0, (int)CommonEnum.WINDOW_ANIMATION_TIME, Visibility.Collapsed);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
appData.AppConfig.IsShow = null;
|
ShowApp();
|
||||||
HideAppVis();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void HideAppVis()
|
|
||||||
{
|
|
||||||
//关闭锁定
|
|
||||||
RunTimeStatus.LOCK_APP_PANEL = false;
|
|
||||||
if (RunTimeStatus.SEARCH_BOX_SHOW)
|
|
||||||
{
|
|
||||||
mainWindow.HidedSearchBox();
|
|
||||||
}
|
|
||||||
mainWindow.Visibility = Visibility.Collapsed;
|
|
||||||
//if (!MarginHide.IS_HIDE)
|
|
||||||
//{
|
|
||||||
|
|
||||||
//}
|
|
||||||
//else
|
|
||||||
//{
|
|
||||||
// ShowApp();
|
|
||||||
//}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -708,24 +676,16 @@ namespace GeekDesk
|
|||||||
{
|
{
|
||||||
HideApp();
|
HideApp();
|
||||||
}
|
}
|
||||||
|
//else if (
|
||||||
if (RunTimeStatus.SEARCH_BOX_SHOW && (e.Key == Key.Up
|
// appData.AppConfig.SearchType == SearchType.KEY_DOWN &&
|
||||||
|| e.Key == Key.Down
|
// (
|
||||||
|| e.Key == Key.Tab
|
// (e.Key >= Key.D0 && e.Key <= Key.Z)
|
||||||
|| e.Key == Key.Enter
|
// || (e.Key >= Key.NumPad0 && e.Key < Key.NumPad9)
|
||||||
))
|
// )
|
||||||
{
|
// )
|
||||||
if (e.Key == Key.Down || e.Key == Key.Tab)
|
//{
|
||||||
{
|
// ShowSearchBox();
|
||||||
RightCard.SearchListBoxIndexAdd();
|
//}
|
||||||
} else if (e.Key == Key.Up)
|
|
||||||
{
|
|
||||||
RightCard.SearchListBoxIndexSub();
|
|
||||||
} else if (e.Key == Key.Enter)
|
|
||||||
{
|
|
||||||
RightCard.StartupSelectionItem();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -758,87 +718,29 @@ namespace GeekDesk
|
|||||||
/// <param name="e"></param>
|
/// <param name="e"></param>
|
||||||
private void ColorPicker(object sender, RoutedEventArgs e)
|
private void ColorPicker(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
TaskbarContextMenu.IsOpen = false;
|
TaskbarContextMenu.Visibility = Visibility.Collapsed;
|
||||||
|
App.DoEvents();
|
||||||
GlobalColorPickerWindow.CreateNoShow();
|
GlobalColorPickerWindow.CreateNoShow();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 防止点击拾色器后无法显示菜单的问题
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sender"></param>
|
||||||
|
/// <param name="e"></param>
|
||||||
|
private void BarIcon_MouseRightButtonDown(object sender, MouseButtonEventArgs e)
|
||||||
|
{
|
||||||
|
TaskbarContextMenu.Visibility = Visibility.Visible;
|
||||||
|
}
|
||||||
|
|
||||||
private void Window_GotFocus(object sender, RoutedEventArgs e)
|
private void Window_GotFocus(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
// 如果没有在修改菜单 并且不是右键点击了面板
|
Keyboard.Focus(SearchBox);
|
||||||
if (!RunTimeStatus.IS_MENU_EDIT
|
|
||||||
&& !RunTimeStatus.SHOW_RIGHT_BTN_MENU
|
|
||||||
&& !RunTimeStatus.APP_BTN_IS_DOWN)
|
|
||||||
{
|
|
||||||
if (RunTimeStatus.SHOW_MENU_PASSWORDBOX)
|
|
||||||
{
|
|
||||||
//必须在其它文本框没有工作的时候才给密码框焦点
|
|
||||||
RightCard.PDDialog.SetFocus();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
//必须在其它文本框没有工作的时候才给搜索框焦点
|
|
||||||
Keyboard.Focus(SearchBox);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void AppWindow_Deactivated(object sender, EventArgs e)
|
private void AppWindow_Deactivated(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
AppWindowLostFocus();
|
AppWindowLostFocus();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 备份数据文件
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="sender"></param>
|
|
||||||
/// <param name="e"></param>
|
|
||||||
[Obsolete]
|
|
||||||
private void BakDataFile(object sender, RoutedEventArgs e)
|
|
||||||
{
|
|
||||||
Thread t = new Thread(() =>
|
|
||||||
{
|
|
||||||
CommonCode.BakAppData();
|
|
||||||
});
|
|
||||||
t.ApartmentState = ApartmentState.STA;
|
|
||||||
t.Start();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void AppButton_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
|
|
||||||
{
|
|
||||||
//点击了面板
|
|
||||||
RunTimeStatus.APP_BTN_IS_DOWN = true;
|
|
||||||
new Thread(() =>
|
|
||||||
{
|
|
||||||
Thread.Sleep(50);
|
|
||||||
RunTimeStatus.APP_BTN_IS_DOWN = false;
|
|
||||||
}).Start();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private ICommand _hideCommand;
|
|
||||||
public ICommand HideCommand
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
if (_hideCommand == null)
|
|
||||||
{
|
|
||||||
_hideCommand = new RelayCommand(
|
|
||||||
p =>
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
},
|
|
||||||
p =>
|
|
||||||
{
|
|
||||||
HideAppVis();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
return _hideCommand;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
# BookerLiu
|
|
||||||
diff a/MainWindow.xaml b/MainWindow.xaml (rejected hunks)
|
diff a/MainWindow.xaml b/MainWindow.xaml (rejected hunks)
|
||||||
@@ -20,6 +20,7 @@
|
@@ -20,6 +20,7 @@
|
||||||
SizeChanged="Window_SizeChanged"
|
SizeChanged="Window_SizeChanged"
|
||||||
|
|||||||
@@ -1,42 +0,0 @@
|
|||||||
using GeekDesk.Constant;
|
|
||||||
using GeekDesk.Util;
|
|
||||||
using GeekDesk.ViewModel;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Collections.ObjectModel;
|
|
||||||
using System.IO;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace GeekDesk.MyThread
|
|
||||||
{
|
|
||||||
public class RelativePathThread
|
|
||||||
{
|
|
||||||
public static void MakeRelativePath()
|
|
||||||
{
|
|
||||||
new Thread(() =>
|
|
||||||
{
|
|
||||||
ObservableCollection<MenuInfo> menuList = MainWindow.appData.MenuList;
|
|
||||||
|
|
||||||
string myExePath = Constants.APP_DIR + "GeekDesk.exe";
|
|
||||||
foreach (MenuInfo mi in menuList)
|
|
||||||
{
|
|
||||||
ObservableCollection<IconInfo> iconList = mi.IconList;
|
|
||||||
foreach (IconInfo icon in iconList)
|
|
||||||
{
|
|
||||||
string relativePath = FileUtil.MakeRelativePath(myExePath, icon.Path);
|
|
||||||
if (File.Exists(icon.Path)
|
|
||||||
&& !string.IsNullOrEmpty(relativePath)
|
|
||||||
&& !relativePath.Equals(icon.Path)) {
|
|
||||||
icon.RelativePath_NoWrite = relativePath;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
CommonCode.SaveAppData(MainWindow.appData, Constants.DATA_FILE_PATH);
|
|
||||||
CommonCode.SaveAppData(MainWindow.appData, Constants.DATA_FILE_BAK_PATH);
|
|
||||||
}).Start();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -4,7 +4,7 @@ using System.Windows;
|
|||||||
|
|
||||||
// 有关程序集的一般信息由以下
|
// 有关程序集的一般信息由以下
|
||||||
// 控制。更改这些特性值可修改
|
// 控制。更改这些特性值可修改
|
||||||
// 与程序集关联的信息。
|
// 与程序集关联的信息。
|
||||||
[assembly: AssemblyTitle("GeekDesk")]
|
[assembly: AssemblyTitle("GeekDesk")]
|
||||||
[assembly: AssemblyDescription("小巧、美观的桌面快速启动工具")]
|
[assembly: AssemblyDescription("小巧、美观的桌面快速启动工具")]
|
||||||
[assembly: AssemblyConfiguration("")]
|
[assembly: AssemblyConfiguration("")]
|
||||||
@@ -49,5 +49,5 @@ using System.Windows;
|
|||||||
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
|
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
|
||||||
//通过使用 "*",如下所示:
|
//通过使用 "*",如下所示:
|
||||||
// [assembly: AssemblyVersion("1.0.*")]
|
// [assembly: AssemblyVersion("1.0.*")]
|
||||||
[assembly: AssemblyVersion("2.5.1.0")]
|
[assembly: AssemblyVersion("2.4.1.5")]
|
||||||
[assembly: AssemblyFileVersion("2.5.1.0")]
|
[assembly: AssemblyFileVersion("2.4.1.5")]
|
||||||
|
|||||||
81
README.md
81
README.md
@@ -1,46 +1,77 @@
|
|||||||
# GeekDesk 极客桌面
|
# GeekDesk 极客桌面
|
||||||
小巧、**美观**的桌面快速启动管理工具
|
小巧、**美观**的桌面快速启动管理工具
|
||||||
|
|
||||||
谈一谈做GeekDesk的原因:
|
———— 大风, 雨夜...
|
||||||
|
「你来了」
|
||||||
|
「我来了」
|
||||||
|
|
||||||
目前的市场上也有一部分桌面图标管理工具, 但是**界面好点的收费**, **免费的界面差**
|
「你究竟想干什么!」
|
||||||
**windows11**都来了, 难道还要用界面停留在**win7时代**的软件吗
|
「我想做一款软件, 这个软件要Cool」
|
||||||
|
|
||||||
所以就萌生了做这款软件的想法, **免费 / 美观 / 高度定制化** 是从GeekDesk诞生开始就有的需求和方向, 未来也会向着这些方向发展
|
|
||||||
目前GeekDesk只有一个人在开发, 大家如果有好的建议也可以提Issue
|
|
||||||
|
|
||||||
另外如果你喜欢 GeekDesk的话, 或许可以为作者购买防脱洗发水
|
|
||||||
<img src="https://z3.ax1x.com/2021/07/20/WYdfmR.jpg" alt="WYdfmR.jpg" border="0" width="400px"/>
|
|
||||||
## 开发框架
|
|
||||||
- wpf
|
|
||||||
- .net 4.7.2
|
|
||||||
- [HandyControl](https://github.com/HandyOrg/HandyControl)
|
|
||||||
|
|
||||||
## 全局热键 鼠标跟随 快速启动 随时随地
|
「什么软件?」
|
||||||
- 支持自定义热键
|
「从最常用的桌面开始吧」
|
||||||
- 支持鼠标跟随
|
|
||||||
<img src="https://z3.ax1x.com/2021/07/19/WJt4hQ.gif" alt="WJt4hQ.gif" border="0" width="800px"/>
|
「哼!现在的软件多入牛毛, 会差你一个吗」
|
||||||
|
「我不知道, 但是我想做」
|
||||||
|
|
||||||
|
「你以为凭你一个人的力量能在这大海里掀起什么波浪吗」
|
||||||
|
「但只要我想就够了, 这是我的梦想!」
|
||||||
|
|
||||||
|
「梦想? 可笑, 这世界哪有什么梦想. 不过是一日三餐, 车子和房!」
|
||||||
|
「我想...就够了...」
|
||||||
|
|
||||||
|
「...」
|
||||||
|
———— 雨停, 狂风仍在呼啸...
|
||||||
|
|
||||||
|
<img src="https://s4.ax1x.com/2021/12/15/TSrwfU.png" a border="0" width="800px"/>
|
||||||
|
|
||||||
|
|
||||||
|
**免费 / 美观 / 高度定制化** 是从GeekDesk诞生开始就有的需求和方向, 未来也会向着这些方向发展
|
||||||
|
|
||||||
|
目前GeekDesk只有一个人在开发所以想法有限, 大家如果有好的建议也可以提Issue
|
||||||
|
|
||||||
|
另外如果你喜欢 GeekDesk的话, 或许可以为作者购买防脱洗发水
|
||||||
|
当然, 点个**Star**也是对作者的激励哦~ 😊😊😊
|
||||||
|
|
||||||
|
|
||||||
|
### GitHub
|
||||||
|
[https://github.com/Demo-Liu/GeekDesk](https://github.com/Demo-Liu/GeekDesk)
|
||||||
|
### 码云
|
||||||
|
[https://gitee.com/demo_liu/GeekDesk](https://gitee.com/demo_liu/GeekDesk)
|
||||||
|
|
||||||
|
<img src="https://z3.ax1x.com/2021/07/20/WYdfmR.jpg" alt="WYdfmR.jpg" border="0" width="400px"/>
|
||||||
|
|
||||||
|
## 全局热键 一键呼出 鼠标跟随
|
||||||
|
- 自定义热键 设置并使用自己习惯的快捷键
|
||||||
|
- 一键呼出 使用鼠标中键呼出
|
||||||
|
- 鼠标跟随 自动追随鼠标位置
|
||||||
|
<img src="https://s4.ax1x.com/2021/12/15/TSlg8f.gif" alt="WJt4hQ.gif" border="0" width="800px"/>
|
||||||
|
|
||||||
## 自定义壁纸
|
## 自定义壁纸
|
||||||
- 随意选择自己喜欢的壁纸
|
- 随意选择自己喜欢的壁纸
|
||||||
|
<img src="https://s4.ax1x.com/2021/12/15/TSNx4H.gif" alt="WJt4hQ.gif" border="0" width="800px"/>
|
||||||
|
|
||||||
[](https://imgtu.com/i/WJlcIs)
|
|
||||||
|
|
||||||
## 毛玻璃等界面效果
|
## 毛玻璃等界面效果
|
||||||
- 背景图片毛玻璃效果
|
- 背景图片毛玻璃效果
|
||||||
- 界面透明度
|
- 界面透明度
|
||||||
- 界面圆角
|
- 界面圆角
|
||||||
<img src="https://z3.ax1x.com/2021/07/19/WGOYSU.gif" alt="WGOYSU.gif" border="0" width="800px"/>
|
<img src="https://s4.ax1x.com/2021/12/15/TSabTO.gif" alt="WGOYSU.gif" border="0" width="800px"/>
|
||||||
|
|
||||||
## 自定义菜单图标
|
## 自定义菜单图标
|
||||||
- 80多个系统图标可供选择
|
- 80多个系统图标可供选择
|
||||||
- 另支持在线导入阿里巴巴icon图标
|
- 另支持在线导入阿里巴巴icon图标
|
||||||
- 篇幅原因,公众号内回复 **自定义图标** 可以查看教程
|
- ~~篇幅原因,公众号内回复 **自定义图标** 可以查看教程~~ 现在软件内已经贴上教程链接啦 也欢迎大家关注我的公众号:blush:
|
||||||
<img src="https://z3.ax1x.com/2021/07/19/WJ3fDU.png" alt="WJ3fDU.png" border="0" width="450px"/>
|
<img src="https://s4.ax1x.com/2021/12/15/TSd1NF.gif" border="0" width="800px"/>
|
||||||
|
|
||||||
## 定时提醒 永不忘记
|
## 定时提醒 永不忘记
|
||||||
<img src="https://z3.ax1x.com/2021/07/19/WJU6df.gif" alt="WJU6df.gif" border="0" width="800px"/>
|
- 快捷键快速新建待办事项
|
||||||
|
<img src="https://s4.ax1x.com/2021/12/15/TSDCvj.gif" alt="WJU6df.gif" border="0" width="800px"/>
|
||||||
|
|
||||||
## LICENSE
|
## 开发框架
|
||||||
- 这是个人开发的程序,任何人可任意修改和免费使用(未做较大功能性改动不允许修改赞赏码,重新修改发布需注明出处)
|
- wpf
|
||||||
- 商用需联系作者
|
- .net 4.7.2
|
||||||
|
- [HandyControl](https://github.com/HandyOrg/HandyControl)
|
||||||
|
|
||||||
|
## Stargazers over time
|
||||||
|
[](https://starchart.cc/Demo-Liu/GeekDesk)
|
||||||
|
|||||||
@@ -1,7 +0,0 @@
|
|||||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
||||||
xmlns:xf="clr-namespace:XamlFlair;assembly=XamlFlair.WPF">
|
|
||||||
<!--组合动画-->
|
|
||||||
|
|
||||||
|
|
||||||
</ResourceDictionary>
|
|
||||||
@@ -1,31 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Diagnostics;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace GeekDesk.Task
|
|
||||||
{
|
|
||||||
internal class ShowSecondTask
|
|
||||||
{
|
|
||||||
|
|
||||||
public static void SHowSecond()
|
|
||||||
{
|
|
||||||
System.Timers.Timer timer = new System.Timers.Timer
|
|
||||||
{
|
|
||||||
Enabled = true,
|
|
||||||
Interval = 5000
|
|
||||||
};
|
|
||||||
timer.Start();
|
|
||||||
timer.Elapsed += Timer_Elapsed;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void Timer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
|
|
||||||
{
|
|
||||||
Process[] pcArr = Process.GetProcessesByName("ShellExperienceHost.exe");
|
|
||||||
Thread.Sleep(1000);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -60,7 +60,7 @@ namespace GeekDesk.Task
|
|||||||
if (Environment.OSVersion.Platform == PlatformID.Win32NT)
|
if (Environment.OSVersion.Platform == PlatformID.Win32NT)
|
||||||
{
|
{
|
||||||
SetProcessWorkingSetSize(System.Diagnostics.Process.GetCurrentProcess().Handle, -1, -1);
|
SetProcessWorkingSetSize(System.Diagnostics.Process.GetCurrentProcess().Handle, -1, -1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#region 内存回收
|
#region 内存回收
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
{
|
{
|
||||||
"title": "GeekDesk版本更新",
|
"title": "GeekDesk版本更新",
|
||||||
"subTitle": "V2.5.11",
|
"subTitle": "V2.4.15",
|
||||||
"msgTitle": "本次更新内容如下",
|
"msgTitle": "本次更新内容如下",
|
||||||
"msg": "['依旧耗费了我大量精力开发,希望大家去给我点个免费的Star', '这个版本有一些优化点, 大家可以自行探索, 另外征集新Logo的设计, 要求美观并能体现\\'极客\\'风格','本次重新打包了程序文件(文件目录更清爽了,注意,这次不要使用覆盖升级(2.5.10可覆盖)), 可以将旧版本根目录下的Data文件复制到新版本根目录, 然后使用新版本启动','修复了2.5.10版本部分相对路径创建导致启动崩溃的bug','增加可拖动图标到其它菜单的功能,取消了拖动时的动画','增加了列表展开动画的开关','增加了数据备份功能','优化大部分动画','优化搜索功能(达到了可只用键盘或只用鼠标启动所需目标)','增加了相对路径(实验性,可能有bug)','增加列表加密功能(实验性,可能有bug)','其它已知问题修复']",
|
"msg": "['PS:又一次的更新, 虽然还有很多需求没有完成, 但仍然耗费了我大量的精力, 没有点Star的兄弟萌, 求个免费Star(GitHub国内某些用户可能进不去), 再给我一点更新的动力!','增加纯色/渐变色背景','增加/优化拾色器功能','增加主面板Logo开关','优化待办任务,现在待办任务快捷键不再是新建待办窗口','增加鼠标滚轮切换菜单功能(需要鼠标指针在菜单栏)','优化搜索功能,增加 快捷键搜索/按键即搜 可选操作','优化贴边隐藏动画, 纵享丝滑了属于是兄弟萌', '其它已知问题修复']",
|
||||||
"githubUrl": "https://github.com/BookerLiu/GeekDesk/releases",
|
"githubUrl": "https://github.com/Demo-Liu/GeekDesk/releases",
|
||||||
"giteeUrl": "https://gitee.com/BookerLiu/GeekDesk/releases",
|
"giteeUrl": "https://gitee.com/BookerLiu/GeekDesk/releases",
|
||||||
"version": "2.5.11"
|
"version": "2.4.15"
|
||||||
}
|
}
|
||||||
@@ -45,7 +45,7 @@ namespace GeekDesk.Util
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
LinearGradientBrush lgb = new LinearGradientBrush();
|
LinearGradientBrush lgb = new LinearGradientBrush();
|
||||||
lgb.Opacity = (double)(Math.Round((decimal)(appConfig.BgOpacity / 100.00), 2));
|
|
||||||
GradientStop gs = new GradientStop
|
GradientStop gs = new GradientStop
|
||||||
{
|
{
|
||||||
Color = (Color)ColorConverter.ConvertFromString(appConfig.GradientBGParam.Color1),
|
Color = (Color)ColorConverter.ConvertFromString(appConfig.GradientBGParam.Color1),
|
||||||
|
|||||||
@@ -1,77 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Windows;
|
|
||||||
using System.Windows.Interop;
|
|
||||||
|
|
||||||
namespace GeekDesk.Util
|
|
||||||
{
|
|
||||||
public class BlurGlassUtil
|
|
||||||
{
|
|
||||||
internal enum AccentState
|
|
||||||
{
|
|
||||||
ACCENT_DISABLED = 1,
|
|
||||||
ACCENT_ENABLE_GRADIENT = 0,
|
|
||||||
ACCENT_ENABLE_TRANSPARENTGRADIENT = 2,
|
|
||||||
ACCENT_ENABLE_BLURBEHIND = 3,
|
|
||||||
ACCENT_INVALID_STATE = 4
|
|
||||||
}
|
|
||||||
|
|
||||||
[StructLayout(LayoutKind.Sequential)]
|
|
||||||
internal struct AccentPolicy
|
|
||||||
{
|
|
||||||
public AccentState AccentState;
|
|
||||||
public int AccentFlags;
|
|
||||||
public int GradientColor;
|
|
||||||
public int AnimationId;
|
|
||||||
}
|
|
||||||
|
|
||||||
[StructLayout(LayoutKind.Sequential)]
|
|
||||||
internal struct WindowCompositionAttributeData
|
|
||||||
{
|
|
||||||
public WindowCompositionAttribute Attribute;
|
|
||||||
public IntPtr Data;
|
|
||||||
public int SizeOfData;
|
|
||||||
}
|
|
||||||
|
|
||||||
internal enum WindowCompositionAttribute
|
|
||||||
{
|
|
||||||
// ...
|
|
||||||
WCA_ACCENT_POLICY = 19
|
|
||||||
// ...
|
|
||||||
}
|
|
||||||
|
|
||||||
[DllImport("user32.dll")]
|
|
||||||
internal static extern int SetWindowCompositionAttribute(IntPtr hwnd, ref WindowCompositionAttributeData data);
|
|
||||||
|
|
||||||
|
|
||||||
public static void EnableBlur(Window window)
|
|
||||||
{
|
|
||||||
WindowInteropHelper windowHelper = new WindowInteropHelper(window);
|
|
||||||
|
|
||||||
AccentPolicy accent = new AccentPolicy
|
|
||||||
{
|
|
||||||
AccentState = AccentState.ACCENT_ENABLE_BLURBEHIND
|
|
||||||
};
|
|
||||||
|
|
||||||
int accentStructSize = Marshal.SizeOf(accent);
|
|
||||||
|
|
||||||
IntPtr accentPtr = Marshal.AllocHGlobal(accentStructSize);
|
|
||||||
Marshal.StructureToPtr(accent, accentPtr, false);
|
|
||||||
|
|
||||||
WindowCompositionAttributeData data = new WindowCompositionAttributeData
|
|
||||||
{
|
|
||||||
Attribute = WindowCompositionAttribute.WCA_ACCENT_POLICY,
|
|
||||||
SizeOfData = accentStructSize,
|
|
||||||
Data = accentPtr
|
|
||||||
};
|
|
||||||
|
|
||||||
SetWindowCompositionAttribute(windowHelper.Handle, ref data);
|
|
||||||
|
|
||||||
Marshal.FreeHGlobal(accentPtr);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,9 +1,5 @@
|
|||||||
using GeekDesk.Constant;
|
using GeekDesk.Constant;
|
||||||
using GeekDesk.Control.Other;
|
|
||||||
using GeekDesk.ViewModel;
|
using GeekDesk.ViewModel;
|
||||||
using HandyControl.Data;
|
|
||||||
using Microsoft.Win32;
|
|
||||||
using Newtonsoft.Json;
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Collections.ObjectModel;
|
using System.Collections.ObjectModel;
|
||||||
@@ -12,7 +8,6 @@ using System.Runtime.InteropServices;
|
|||||||
using System.Runtime.Serialization.Formatters.Binary;
|
using System.Runtime.Serialization.Formatters.Binary;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Media.Imaging;
|
using System.Windows.Media.Imaging;
|
||||||
using static GeekDesk.Control.Other.GlobalMsgNotification;
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 提取一些代码
|
/// 提取一些代码
|
||||||
@@ -33,112 +28,30 @@ namespace GeekDesk.Util
|
|||||||
{
|
{
|
||||||
using (FileStream fs = File.Create(Constants.DATA_FILE_PATH)) { }
|
using (FileStream fs = File.Create(Constants.DATA_FILE_PATH)) { }
|
||||||
appData = new AppData();
|
appData = new AppData();
|
||||||
SaveAppData(appData, Constants.DATA_FILE_PATH);
|
SaveAppData(appData);
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
try
|
using (FileStream fs = new FileStream(Constants.DATA_FILE_PATH, FileMode.Open))
|
||||||
{
|
{
|
||||||
using (FileStream fs = new FileStream(Constants.DATA_FILE_PATH, FileMode.Open))
|
BinaryFormatter bf = new BinaryFormatter();
|
||||||
{
|
appData = bf.Deserialize(fs) as AppData;
|
||||||
BinaryFormatter bf = new BinaryFormatter();
|
|
||||||
appData = bf.Deserialize(fs) as AppData;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
if (File.Exists(Constants.DATA_FILE_BAK_PATH))
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
using (FileStream fs = new FileStream(Constants.DATA_FILE_BAK_PATH, FileMode.Open))
|
|
||||||
{
|
|
||||||
BinaryFormatter bf = new BinaryFormatter();
|
|
||||||
appData = bf.Deserialize(fs) as AppData;
|
|
||||||
}
|
|
||||||
|
|
||||||
DialogMsg msg = new DialogMsg();
|
|
||||||
msg.msg = "不幸的是, GeekDesk当前的数据文件已经损坏, " +
|
|
||||||
"现在已经启用系统自动备份的数据\n\n" +
|
|
||||||
"如果你有较新的备份, " +
|
|
||||||
"请退出GeekDesk, " +
|
|
||||||
"将备份文件重命名为:Data, " +
|
|
||||||
"然后将Data覆盖到GeekDesk的根目录即可\n\n" +
|
|
||||||
"系统上次备份时间: \n" + appData.AppConfig.SysBakTime +
|
|
||||||
"\n\n如果当前数据就是你想要的数据, 那么请不用管它";
|
|
||||||
GlobalMsgNotification gm = new GlobalMsgNotification(msg);
|
|
||||||
HandyControl.Controls.Notification ntf = HandyControl.Controls.Notification.Show(gm, ShowAnimation.Fade, true);
|
|
||||||
gm.ntf = ntf;
|
|
||||||
} catch
|
|
||||||
{
|
|
||||||
MessageBox.Show("不幸的是, GeekDesk当前的数据文件已经损坏\n如果你有备份, 请将备份文件重命名为:Data 然后将Data覆盖到GeekDesk的根目录即可!");
|
|
||||||
Application.Current.Shutdown();
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
} else
|
|
||||||
{
|
|
||||||
MessageBox.Show("不幸的是, GeekDesk当前的数据文件已经损坏\n如果你有备份, 请将备份文件重命名为:Data 然后将Data覆盖到GeekDesk的根目录即可!");
|
|
||||||
Application.Current.Shutdown();
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return appData;
|
return appData;
|
||||||
}
|
}
|
||||||
|
|
||||||
private readonly static object _MyLock = new object();
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 保存app 数据
|
/// 保存app 数据
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="appData"></param>
|
/// <param name="appData"></param>
|
||||||
public static void SaveAppData(AppData appData, string filePath)
|
public static void SaveAppData(AppData appData)
|
||||||
{
|
{
|
||||||
lock (_MyLock)
|
using (FileStream fs = new FileStream(Constants.DATA_FILE_PATH, FileMode.Create))
|
||||||
{
|
{
|
||||||
if (filePath.Equals(Constants.DATA_FILE_BAK_PATH))
|
BinaryFormatter bf = new BinaryFormatter();
|
||||||
{
|
bf.Serialize(fs, appData);
|
||||||
appData.AppConfig.SysBakTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
|
|
||||||
}
|
|
||||||
if (!Directory.Exists(filePath.Substring(0, filePath.LastIndexOf("\\"))))
|
|
||||||
{
|
|
||||||
Directory.CreateDirectory(filePath.Substring(0, filePath.LastIndexOf("\\")));
|
|
||||||
}
|
|
||||||
using (FileStream fs = new FileStream(filePath, FileMode.Create))
|
|
||||||
{
|
|
||||||
BinaryFormatter bf = new BinaryFormatter();
|
|
||||||
bf.Serialize(fs, appData);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public static void SavePassword(string password)
|
|
||||||
{
|
|
||||||
using (StreamWriter sw = new StreamWriter(Constants.PW_FILE_BAK_PATH))
|
|
||||||
{
|
|
||||||
sw.Write(password);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public static void BakAppData()
|
|
||||||
{
|
|
||||||
|
|
||||||
SaveFileDialog sfd = new SaveFileDialog
|
|
||||||
{
|
|
||||||
Title = "备份文件",
|
|
||||||
Filter = "bak文件(*.bak)|*.bak",
|
|
||||||
FileName = "Data-GD-" + DateTime.Now.ToString("yyMMdd") + ".bak",
|
|
||||||
};
|
|
||||||
if (sfd.ShowDialog() == true)
|
|
||||||
{
|
|
||||||
using (FileStream fs = new FileStream(sfd.FileName, FileMode.Create))
|
|
||||||
{
|
|
||||||
BinaryFormatter bf = new BinaryFormatter();
|
|
||||||
bf.Serialize(fs, MainWindow.appData);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -179,7 +92,7 @@ namespace GeekDesk.Util
|
|||||||
// ext = System.IO.Path.GetExtension(path).ToLower();
|
// ext = System.IO.Path.GetExtension(path).ToLower();
|
||||||
//}
|
//}
|
||||||
|
|
||||||
string iconPath;
|
string iconPath = null;
|
||||||
//if (".lnk".Equals(ext))
|
//if (".lnk".Equals(ext))
|
||||||
//{
|
//{
|
||||||
|
|
||||||
@@ -198,21 +111,16 @@ namespace GeekDesk.Util
|
|||||||
BitmapImage bi = ImageUtil.GetBitmapIconByPath(iconPath);
|
BitmapImage bi = ImageUtil.GetBitmapIconByPath(iconPath);
|
||||||
IconInfo iconInfo = new IconInfo
|
IconInfo iconInfo = new IconInfo
|
||||||
{
|
{
|
||||||
Path_NoWrite = path,
|
Path = path,
|
||||||
LnkPath_NoWrite = tempPath,
|
LnkPath = tempPath,
|
||||||
BitmapImage_NoWrite = bi,
|
BitmapImage = bi,
|
||||||
StartArg_NoWrite = FileUtil.GetArgByLnk(tempPath)
|
StartArg = FileUtil.GetArgByLnk(tempPath)
|
||||||
};
|
};
|
||||||
iconInfo.DefaultImage_NoWrite = iconInfo.ImageByteArr;
|
iconInfo.DefaultImage = iconInfo.ImageByteArr;
|
||||||
iconInfo.Name_NoWrite = System.IO.Path.GetFileNameWithoutExtension(tempPath);
|
iconInfo.Name = System.IO.Path.GetFileNameWithoutExtension(tempPath);
|
||||||
if (StringUtil.IsEmpty(iconInfo.Name))
|
if (StringUtil.IsEmpty(iconInfo.Name))
|
||||||
{
|
{
|
||||||
iconInfo.Name_NoWrite = path;
|
iconInfo.Name = path;
|
||||||
}
|
|
||||||
string relativePath = FileUtil.MakeRelativePath(Constants.APP_DIR + "GeekDesk.exe", iconInfo.Path);
|
|
||||||
if (!string.IsNullOrEmpty(relativePath) && !relativePath.Equals(iconInfo.Path))
|
|
||||||
{
|
|
||||||
iconInfo.RelativePath_NoWrite = relativePath;
|
|
||||||
}
|
}
|
||||||
return iconInfo;
|
return iconInfo;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,175 +0,0 @@
|
|||||||
// Copyright (C) Josh Smith - January 2007
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Text;
|
|
||||||
using System.Windows.Documents;
|
|
||||||
using System.Windows;
|
|
||||||
using System.Windows.Media;
|
|
||||||
using System.Windows.Shapes;
|
|
||||||
using System.Windows.Media.Animation;
|
|
||||||
using System.Windows.Controls;
|
|
||||||
|
|
||||||
namespace GeekDesk.Util
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Renders a visual which can follow the mouse cursor,
|
|
||||||
/// such as during a drag-and-drop operation.
|
|
||||||
/// </summary>
|
|
||||||
public class DragAdorner : Adorner
|
|
||||||
{
|
|
||||||
#region Data
|
|
||||||
|
|
||||||
private Rectangle child = null;
|
|
||||||
private double offsetLeft = 0;
|
|
||||||
private double offsetTop = 0;
|
|
||||||
|
|
||||||
#endregion // Data
|
|
||||||
|
|
||||||
#region Constructor
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Initializes a new instance of DragVisualAdorner.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="adornedElement">The element being adorned.</param>
|
|
||||||
/// <param name="size">The size of the adorner.</param>
|
|
||||||
/// <param name="brush">A brush to with which to paint the adorner.</param>
|
|
||||||
public DragAdorner( UIElement adornedElement, Size size, Brush brush )
|
|
||||||
: base( adornedElement )
|
|
||||||
{
|
|
||||||
Rectangle rect = new Rectangle();
|
|
||||||
rect.Fill = brush;
|
|
||||||
rect.Width = size.Width;
|
|
||||||
rect.Height = size.Height;
|
|
||||||
rect.IsHitTestVisible = false;
|
|
||||||
this.child = rect;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion // Constructor
|
|
||||||
|
|
||||||
#region Public Interface
|
|
||||||
|
|
||||||
#region GetDesiredTransform
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Override.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="transform"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public override GeneralTransform GetDesiredTransform( GeneralTransform transform )
|
|
||||||
{
|
|
||||||
GeneralTransformGroup result = new GeneralTransformGroup();
|
|
||||||
result.Children.Add( base.GetDesiredTransform( transform ) );
|
|
||||||
result.Children.Add( new TranslateTransform( this.offsetLeft, this.offsetTop ) );
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion // GetDesiredTransform
|
|
||||||
|
|
||||||
#region OffsetLeft
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets/sets the horizontal offset of the adorner.
|
|
||||||
/// </summary>
|
|
||||||
public double OffsetLeft
|
|
||||||
{
|
|
||||||
get { return this.offsetLeft; }
|
|
||||||
set
|
|
||||||
{
|
|
||||||
this.offsetLeft = value;
|
|
||||||
UpdateLocation();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion // OffsetLeft
|
|
||||||
|
|
||||||
#region SetOffsets
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Updates the location of the adorner in one atomic operation.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="left"></param>
|
|
||||||
/// <param name="top"></param>
|
|
||||||
public void SetOffsets( double left, double top )
|
|
||||||
{
|
|
||||||
this.offsetLeft = left;
|
|
||||||
this.offsetTop = top;
|
|
||||||
this.UpdateLocation();
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion // SetOffsets
|
|
||||||
|
|
||||||
#region OffsetTop
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets/sets the vertical offset of the adorner.
|
|
||||||
/// </summary>
|
|
||||||
public double OffsetTop
|
|
||||||
{
|
|
||||||
get { return this.offsetTop; }
|
|
||||||
set
|
|
||||||
{
|
|
||||||
this.offsetTop = value;
|
|
||||||
UpdateLocation();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion // OffsetTop
|
|
||||||
|
|
||||||
#endregion // Public Interface
|
|
||||||
|
|
||||||
#region Protected Overrides
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Override.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="constraint"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
protected override Size MeasureOverride( Size constraint )
|
|
||||||
{
|
|
||||||
this.child.Measure( constraint );
|
|
||||||
return this.child.DesiredSize;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Override.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="finalSize"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
protected override Size ArrangeOverride( Size finalSize )
|
|
||||||
{
|
|
||||||
this.child.Arrange( new Rect( finalSize ) );
|
|
||||||
return finalSize;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Override.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="index"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
protected override Visual GetVisualChild( int index )
|
|
||||||
{
|
|
||||||
return this.child;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Override. Always returns 1.
|
|
||||||
/// </summary>
|
|
||||||
protected override int VisualChildrenCount
|
|
||||||
{
|
|
||||||
get { return 1; }
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion // Protected Overrides
|
|
||||||
|
|
||||||
#region Private Helpers
|
|
||||||
|
|
||||||
private void UpdateLocation()
|
|
||||||
{
|
|
||||||
AdornerLayer adornerLayer = this.Parent as AdornerLayer;
|
|
||||||
if( adornerLayer != null )
|
|
||||||
adornerLayer.Update( this.AdornedElement );
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion // Private Helpers
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,5 +1,4 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections;
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.Drawing.Imaging;
|
using System.Drawing.Imaging;
|
||||||
@@ -11,30 +10,15 @@ namespace GeekDesk.Util
|
|||||||
{
|
{
|
||||||
public class FileIcon
|
public class FileIcon
|
||||||
{
|
{
|
||||||
static List<string> blurExtsList;
|
|
||||||
static List<int[]> pixelList;
|
|
||||||
static FileIcon() {
|
|
||||||
blurExtsList = new List<string>
|
|
||||||
{
|
|
||||||
".exe",
|
|
||||||
".cer",
|
|
||||||
".lnk",
|
|
||||||
".chm"
|
|
||||||
};
|
|
||||||
pixelList = new List<int[]>
|
|
||||||
{
|
|
||||||
new int[]{ 256 / 4, 256 / 4 },
|
|
||||||
new int[]{ 256 / 2, 256 / 4 },
|
|
||||||
new int[]{ 256 / 4 * 3, 256 / 4 },
|
|
||||||
new int[]{ 256 / 4, 256 / 2 },
|
|
||||||
new int[]{ 256 / 4, 256 / 4 * 3 },
|
|
||||||
new int[]{ 256 / 4 * 3, 256 / 2 },
|
|
||||||
new int[]{ 256 / 4 * 3, 256 / 4 * 3 },
|
|
||||||
new int[]{ 256 / 2, 256 / 4 * 3 },
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
|
private static List<string> GetBlurExts()
|
||||||
|
{
|
||||||
|
List<string> list = new List<string>();
|
||||||
|
list.Add(".exe");
|
||||||
|
list.Add(".cer");
|
||||||
|
list.Add(".lnk");
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
[DllImport("User32.dll")]
|
[DllImport("User32.dll")]
|
||||||
public static extern int PrivateExtractIcons(
|
public static extern int PrivateExtractIcons(
|
||||||
@@ -69,7 +53,7 @@ namespace GeekDesk.Util
|
|||||||
ip = hIcons[0];
|
ip = hIcons[0];
|
||||||
ico = Icon.FromHandle(ip);
|
ico = Icon.FromHandle(ip);
|
||||||
}
|
}
|
||||||
else if (blurExtsList.Contains(ext))
|
else if (GetBlurExts().Contains(ext))
|
||||||
{
|
{
|
||||||
ico = Icon.ExtractAssociatedIcon(filePath);
|
ico = Icon.ExtractAssociatedIcon(filePath);
|
||||||
}
|
}
|
||||||
@@ -77,14 +61,8 @@ namespace GeekDesk.Util
|
|||||||
{
|
{
|
||||||
ip = GetJumboIcon(GetIconIndex(filePath));
|
ip = GetJumboIcon(GetIconIndex(filePath));
|
||||||
ico = Icon.FromHandle(ip);
|
ico = Icon.FromHandle(ip);
|
||||||
if (CheckIsSmallIco(ico.ToBitmap()))
|
|
||||||
{
|
|
||||||
ico = Icon.ExtractAssociatedIcon(filePath);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Bitmap bmp = ico.ToBitmap();
|
Bitmap bmp = ico.ToBitmap();
|
||||||
MemoryStream strm = new MemoryStream();
|
MemoryStream strm = new MemoryStream();
|
||||||
|
|
||||||
@@ -95,7 +73,6 @@ namespace GeekDesk.Util
|
|||||||
myEncoderParameters.Param[0] = myEncoderParameter;
|
myEncoderParameters.Param[0] = myEncoderParameter;
|
||||||
|
|
||||||
bmp.Save(strm, myImageCodecInfo, myEncoderParameters);
|
bmp.Save(strm, myImageCodecInfo, myEncoderParameters);
|
||||||
|
|
||||||
BitmapImage bmpImage = new BitmapImage();
|
BitmapImage bmpImage = new BitmapImage();
|
||||||
bmpImage.BeginInit();
|
bmpImage.BeginInit();
|
||||||
strm.Seek(0, SeekOrigin.Begin);
|
strm.Seek(0, SeekOrigin.Begin);
|
||||||
@@ -105,7 +82,6 @@ namespace GeekDesk.Util
|
|||||||
{
|
{
|
||||||
Shell32.DestroyIcon(ip);
|
Shell32.DestroyIcon(ip);
|
||||||
}
|
}
|
||||||
DeleteObject(bmp.GetHbitmap());
|
|
||||||
return bmpImage.Clone();
|
return bmpImage.Clone();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -122,30 +98,6 @@ namespace GeekDesk.Util
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static bool CheckIsSmallIco(Bitmap bm)
|
|
||||||
{
|
|
||||||
Color color;
|
|
||||||
int count = 0;
|
|
||||||
foreach (int[] arr in pixelList)
|
|
||||||
{
|
|
||||||
color = bm.GetPixel(arr[0], arr[1]);
|
|
||||||
if (color.A == 0)
|
|
||||||
{
|
|
||||||
count++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
DeleteObject(bm.GetHbitmap());
|
|
||||||
if (count >= 6)
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
[System.Runtime.InteropServices.DllImport("gdi32.dll")]
|
|
||||||
public static extern bool DeleteObject(IntPtr onj);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public static int GetIconIndex(string pszFile)
|
public static int GetIconIndex(string pszFile)
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
using IWshRuntimeLibrary;
|
using IWshRuntimeLibrary;
|
||||||
using System;
|
using System;
|
||||||
using System.IO;
|
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
@@ -157,27 +156,5 @@ namespace GeekDesk.Util
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static string MakeRelativePath(string fromPath, string toPath)
|
|
||||||
{
|
|
||||||
string relativePath = null;
|
|
||||||
try
|
|
||||||
{
|
|
||||||
if (string.IsNullOrEmpty(toPath) || string.IsNullOrEmpty(fromPath)) return null;
|
|
||||||
Uri file = new Uri(@toPath);
|
|
||||||
// Must end in a slash to indicate folder
|
|
||||||
Uri folder = new Uri(@fromPath);
|
|
||||||
relativePath =
|
|
||||||
Uri.UnescapeDataString(
|
|
||||||
folder.MakeRelativeUri(file)
|
|
||||||
.ToString()
|
|
||||||
.Replace('/', Path.DirectorySeparatorChar)
|
|
||||||
);
|
|
||||||
} catch (Exception ex)
|
|
||||||
{
|
|
||||||
LogUtil.WriteErrorLog(ex, "建立相对路径出错:fromPath:" + fromPath + ",toPath:" + toPath);
|
|
||||||
}
|
|
||||||
return relativePath;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,892 +0,0 @@
|
|||||||
// Copyright (C) Josh Smith - January 2007
|
|
||||||
using System;
|
|
||||||
using System.Collections.ObjectModel;
|
|
||||||
using System.ComponentModel;
|
|
||||||
using System.Diagnostics;
|
|
||||||
using System.Windows;
|
|
||||||
using System.Windows.Controls;
|
|
||||||
using System.Windows.Controls.Primitives;
|
|
||||||
using System.Windows.Documents;
|
|
||||||
using System.Windows.Media;
|
|
||||||
using System.Windows.Input;
|
|
||||||
using GeekDesk.Util;
|
|
||||||
using GeekDesk.Constant;
|
|
||||||
using HandyControl.Controls;
|
|
||||||
|
|
||||||
namespace GeekDesk.Util
|
|
||||||
{
|
|
||||||
#region ListBoxDragDropManager
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Manages the dragging and dropping of ListBoxItems in a ListBox.
|
|
||||||
/// The ItemType type parameter indicates the type of the objects in
|
|
||||||
/// the ListBox's items source. The ListBox's ItemsSource must be
|
|
||||||
/// set to an instance of ObservableCollection of ItemType, or an
|
|
||||||
/// Exception will be thrown.
|
|
||||||
/// </summary>
|
|
||||||
/// <typeparam name="ItemType">The type of the ListBox's items.</typeparam>
|
|
||||||
public class ListBoxDragDropManager<ItemType> where ItemType : class
|
|
||||||
{
|
|
||||||
#region Data
|
|
||||||
|
|
||||||
bool canInitiateDrag;
|
|
||||||
DragAdorner dragAdorner;
|
|
||||||
double dragAdornerOpacity;
|
|
||||||
int indexToSelect;
|
|
||||||
bool isDragInProgress;
|
|
||||||
ItemType itemUnderDragCursor;
|
|
||||||
ListBox listBox;
|
|
||||||
Point ptMouseDown;
|
|
||||||
bool showDragAdorner;
|
|
||||||
|
|
||||||
#endregion // Data
|
|
||||||
|
|
||||||
#region Constructors
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Initializes a new instance of ListBoxDragManager.
|
|
||||||
/// </summary>
|
|
||||||
public ListBoxDragDropManager()
|
|
||||||
{
|
|
||||||
this.canInitiateDrag = false;
|
|
||||||
this.dragAdornerOpacity = 0.7;
|
|
||||||
this.indexToSelect = -1;
|
|
||||||
this.showDragAdorner = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Initializes a new instance of ListBoxDragManager.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="listBox"></param>
|
|
||||||
public ListBoxDragDropManager( ListBox listBox )
|
|
||||||
: this()
|
|
||||||
{
|
|
||||||
this.ListBox = listBox;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Initializes a new instance of ListBoxDragManager.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="listBox"></param>
|
|
||||||
/// <param name="dragAdornerOpacity"></param>
|
|
||||||
public ListBoxDragDropManager( ListBox listBox, double dragAdornerOpacity )
|
|
||||||
: this( listBox )
|
|
||||||
{
|
|
||||||
this.DragAdornerOpacity = dragAdornerOpacity;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Initializes a new instance of ListBoxDragManager.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="listBox"></param>
|
|
||||||
/// <param name="showDragAdorner"></param>
|
|
||||||
public ListBoxDragDropManager( ListBox listBox, bool showDragAdorner )
|
|
||||||
: this( listBox )
|
|
||||||
{
|
|
||||||
this.ShowDragAdorner = showDragAdorner;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion // Constructors
|
|
||||||
|
|
||||||
#region Public Interface
|
|
||||||
|
|
||||||
#region DragAdornerOpacity
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets/sets the opacity of the drag adorner. This property has no
|
|
||||||
/// effect if ShowDragAdorner is false. The default value is 0.7
|
|
||||||
/// </summary>
|
|
||||||
public double DragAdornerOpacity
|
|
||||||
{
|
|
||||||
get { return this.dragAdornerOpacity; }
|
|
||||||
set
|
|
||||||
{
|
|
||||||
if( this.IsDragInProgress )
|
|
||||||
throw new InvalidOperationException( "Cannot set the DragAdornerOpacity property during a drag operation." );
|
|
||||||
|
|
||||||
if( value < 0.0 || value > 1.0 )
|
|
||||||
throw new ArgumentOutOfRangeException( "DragAdornerOpacity", value, "Must be between 0 and 1." );
|
|
||||||
|
|
||||||
this.dragAdornerOpacity = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion // DragAdornerOpacity
|
|
||||||
|
|
||||||
#region IsDragInProgress
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Returns true if there is currently a drag operation being managed.
|
|
||||||
/// </summary>
|
|
||||||
public bool IsDragInProgress
|
|
||||||
{
|
|
||||||
get { return this.isDragInProgress; }
|
|
||||||
private set { this.isDragInProgress = value; }
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion // IsDragInProgress
|
|
||||||
|
|
||||||
#region ListBox
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets/sets the ListBox whose dragging is managed. This property
|
|
||||||
/// can be set to null, to prevent drag management from occuring. If
|
|
||||||
/// the ListBox's AllowDrop property is false, it will be set to true.
|
|
||||||
/// </summary>
|
|
||||||
public ListBox ListBox
|
|
||||||
{
|
|
||||||
get { return listBox; }
|
|
||||||
set
|
|
||||||
{
|
|
||||||
if( this.IsDragInProgress )
|
|
||||||
throw new InvalidOperationException( "Cannot set the ListBox property during a drag operation." );
|
|
||||||
|
|
||||||
if( this.listBox != null )
|
|
||||||
{
|
|
||||||
#region Unhook Events
|
|
||||||
|
|
||||||
this.listBox.PreviewMouseLeftButtonDown -= LIstBox_PreviewMouseLeftButtonDown;
|
|
||||||
this.listBox.PreviewMouseMove -= LIstBox_PreviewMouseMove;
|
|
||||||
this.listBox.DragOver -= LIstBox_DragOver;
|
|
||||||
this.listBox.DragLeave -= LIstBox_DragLeave;
|
|
||||||
this.listBox.DragEnter -= LIstBox_DragEnter;
|
|
||||||
this.listBox.Drop -= LIstBox_Drop;
|
|
||||||
|
|
||||||
#endregion // Unhook Events
|
|
||||||
}
|
|
||||||
|
|
||||||
this.listBox = value;
|
|
||||||
|
|
||||||
if( this.listBox != null )
|
|
||||||
{
|
|
||||||
if( !this.listBox.AllowDrop )
|
|
||||||
this.listBox.AllowDrop = true;
|
|
||||||
|
|
||||||
#region Hook Events
|
|
||||||
|
|
||||||
this.listBox.PreviewMouseLeftButtonDown += LIstBox_PreviewMouseLeftButtonDown;
|
|
||||||
this.listBox.PreviewMouseMove += LIstBox_PreviewMouseMove;
|
|
||||||
this.listBox.DragOver += LIstBox_DragOver;
|
|
||||||
this.listBox.DragLeave += LIstBox_DragLeave;
|
|
||||||
this.listBox.DragEnter += LIstBox_DragEnter;
|
|
||||||
this.listBox.Drop += LIstBox_Drop;
|
|
||||||
|
|
||||||
#endregion // Hook Events
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion // ListBox
|
|
||||||
|
|
||||||
#region ProcessDrop [event]
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Raised when a drop occurs. By default the dropped item will be moved
|
|
||||||
/// to the target index. Handle this event if relocating the dropped item
|
|
||||||
/// requires custom behavior. Note, if this event is handled the default
|
|
||||||
/// item dropping logic will not occur.
|
|
||||||
/// </summary>
|
|
||||||
public event EventHandler<ProcessDropEventArgs<ItemType>> ProcessDrop;
|
|
||||||
|
|
||||||
#endregion // ProcessDrop [event]
|
|
||||||
|
|
||||||
#region ShowDragAdorner
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets/sets whether a visual representation of the ListBoxItem being dragged
|
|
||||||
/// follows the mouse cursor during a drag operation. The default value is true.
|
|
||||||
/// </summary>
|
|
||||||
public bool ShowDragAdorner
|
|
||||||
{
|
|
||||||
get { return this.showDragAdorner; }
|
|
||||||
set
|
|
||||||
{
|
|
||||||
if( this.IsDragInProgress )
|
|
||||||
throw new InvalidOperationException( "Cannot set the ShowDragAdorner property during a drag operation." );
|
|
||||||
|
|
||||||
this.showDragAdorner = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion // ShowDragAdorner
|
|
||||||
|
|
||||||
#endregion // Public Interface
|
|
||||||
|
|
||||||
#region Event Handling Methods
|
|
||||||
|
|
||||||
#region LIstBox_PreviewMouseLeftButtonDown
|
|
||||||
|
|
||||||
void LIstBox_PreviewMouseLeftButtonDown( object sender, MouseButtonEventArgs e )
|
|
||||||
{
|
|
||||||
if( this.IsMouseOverScrollbar )
|
|
||||||
{
|
|
||||||
// 4/13/2007 - Set the flag to false when cursor is over scrollbar.
|
|
||||||
this.canInitiateDrag = false;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
int index = this.IndexUnderDragCursor;
|
|
||||||
this.canInitiateDrag = index > -1;
|
|
||||||
|
|
||||||
if( this.canInitiateDrag )
|
|
||||||
{
|
|
||||||
// Remember the location and index of the ListBoxItem the user clicked on for later.
|
|
||||||
this.ptMouseDown = MouseUtil.GetMousePosition();
|
|
||||||
//this.ptMouseDown = MouseUtil.GetMousePosition( this.listBox );
|
|
||||||
this.indexToSelect = index;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
this.ptMouseDown = new Point( -10000, -10000 );
|
|
||||||
this.indexToSelect = -1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion // LIstBox_PreviewMouseLeftButtonDown
|
|
||||||
|
|
||||||
#region LIstBox_PreviewMouseMove
|
|
||||||
|
|
||||||
void LIstBox_PreviewMouseMove( object sender, MouseEventArgs e )
|
|
||||||
{
|
|
||||||
if( !this.CanStartDragOperation )
|
|
||||||
return;
|
|
||||||
|
|
||||||
// Select the item the user clicked on.
|
|
||||||
if( this.listBox.SelectedIndex != this.indexToSelect )
|
|
||||||
this.listBox.SelectedIndex = this.indexToSelect;
|
|
||||||
|
|
||||||
// If the item at the selected index is null, there's nothing
|
|
||||||
// we can do, so just return;
|
|
||||||
if( this.listBox.SelectedItem == null )
|
|
||||||
return;
|
|
||||||
|
|
||||||
ListBoxItem itemToDrag = this.GetListBoxItem( this.listBox.SelectedIndex );
|
|
||||||
if( itemToDrag == null )
|
|
||||||
return;
|
|
||||||
|
|
||||||
AdornerLayer adornerLayer = this.ShowDragAdornerResolved ? this.InitializeAdornerLayer( itemToDrag ) : null;
|
|
||||||
|
|
||||||
this.InitializeDragOperation( itemToDrag );
|
|
||||||
this.PerformDragOperation();
|
|
||||||
this.FinishDragOperation( itemToDrag, adornerLayer );
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion // LIstBox_PreviewMouseMove
|
|
||||||
|
|
||||||
#region LIstBox_DragOver
|
|
||||||
|
|
||||||
void LIstBox_DragOver( object sender, DragEventArgs e )
|
|
||||||
{
|
|
||||||
e.Effects = DragDropEffects.Move;
|
|
||||||
|
|
||||||
if ( this.ShowDragAdornerResolved )
|
|
||||||
this.UpdateDragAdornerLocation();
|
|
||||||
|
|
||||||
// Update the item which is known to be currently under the drag cursor.
|
|
||||||
int index = this.IndexUnderDragCursor;
|
|
||||||
this.ItemUnderDragCursor = index < 0 ? null : this.ListBox.Items[index] as ItemType;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion // LIstBox_DragOver
|
|
||||||
|
|
||||||
#region LIstBox_DragLeave
|
|
||||||
|
|
||||||
void LIstBox_DragLeave( object sender, DragEventArgs e )
|
|
||||||
{
|
|
||||||
if( !this.IsMouseOver( this.listBox ) )
|
|
||||||
{
|
|
||||||
if( this.ItemUnderDragCursor != null )
|
|
||||||
this.ItemUnderDragCursor = null;
|
|
||||||
|
|
||||||
if( this.dragAdorner != null )
|
|
||||||
this.dragAdorner.Visibility = Visibility.Collapsed;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion // LIstBox_DragLeave
|
|
||||||
|
|
||||||
#region LIstBox_DragEnter
|
|
||||||
|
|
||||||
void LIstBox_DragEnter( object sender, DragEventArgs e )
|
|
||||||
{
|
|
||||||
if( this.dragAdorner != null && this.dragAdorner.Visibility != Visibility.Visible )
|
|
||||||
{
|
|
||||||
// Update the location of the adorner and then show it.
|
|
||||||
this.UpdateDragAdornerLocation();
|
|
||||||
this.dragAdorner.Visibility = Visibility.Visible;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion // LIstBox_DragEnter
|
|
||||||
|
|
||||||
#region LIstBox_Drop
|
|
||||||
|
|
||||||
void LIstBox_Drop( object sender, DragEventArgs e )
|
|
||||||
{
|
|
||||||
if( this.ItemUnderDragCursor != null )
|
|
||||||
this.ItemUnderDragCursor = null;
|
|
||||||
|
|
||||||
e.Effects = DragDropEffects.None;
|
|
||||||
|
|
||||||
if( !e.Data.GetDataPresent( typeof( ItemType ) ) )
|
|
||||||
return;
|
|
||||||
|
|
||||||
// Get the data object which was dropped.
|
|
||||||
ItemType data = e.Data.GetData( typeof( ItemType ) ) as ItemType;
|
|
||||||
if( data == null )
|
|
||||||
return;
|
|
||||||
|
|
||||||
// Get the ObservableCollection<ItemType> which contains the dropped data object.
|
|
||||||
ObservableCollection<ItemType> itemsSource = this.listBox.ItemsSource as ObservableCollection<ItemType>;
|
|
||||||
if( itemsSource == null )
|
|
||||||
throw new Exception(
|
|
||||||
"A ListBox managed by ListBoxDragManager must have its ItemsSource set to an ObservableCollection<ItemType>." );
|
|
||||||
|
|
||||||
int oldIndex = itemsSource.IndexOf( data );
|
|
||||||
int newIndex = this.IndexUnderDragCursor;
|
|
||||||
|
|
||||||
if( newIndex < 0 )
|
|
||||||
{
|
|
||||||
// The drag started somewhere else, and our ListBox is empty
|
|
||||||
// so make the new item the first in the list.
|
|
||||||
if( itemsSource.Count == 0 )
|
|
||||||
newIndex = 0;
|
|
||||||
|
|
||||||
// The drag started somewhere else, but our ListBox has items
|
|
||||||
// so make the new item the last in the list.
|
|
||||||
else if( oldIndex < 0 )
|
|
||||||
newIndex = itemsSource.Count;
|
|
||||||
|
|
||||||
// The user is trying to drop an item from our ListBox into
|
|
||||||
// our ListBox, but the mouse is not over an item, so don't
|
|
||||||
// let them drop it.
|
|
||||||
else
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Dropping an item back onto itself is not considered an actual 'drop'.
|
|
||||||
if( oldIndex == newIndex )
|
|
||||||
return;
|
|
||||||
|
|
||||||
if( this.ProcessDrop != null )
|
|
||||||
{
|
|
||||||
// Let the client code process the drop.
|
|
||||||
ProcessDropEventArgs<ItemType> args = new ProcessDropEventArgs<ItemType>( itemsSource, data, oldIndex, newIndex, e.AllowedEffects );
|
|
||||||
this.ProcessDrop( this, args );
|
|
||||||
e.Effects = args.Effects;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// Move the dragged data object from it's original index to the
|
|
||||||
// new index (according to where the mouse cursor is). If it was
|
|
||||||
// not previously in the ListBox, then insert the item.
|
|
||||||
if( oldIndex > -1 )
|
|
||||||
{
|
|
||||||
// <20>ⲿҵ<E2B2BF><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
||||||
itemsSource.Move(oldIndex, newIndex);
|
|
||||||
if (MainWindow.appData.AppConfig.IconSortType != SortType.CUSTOM)
|
|
||||||
{
|
|
||||||
MainWindow.appData.AppConfig.IconSortType = SortType.CUSTOM;
|
|
||||||
if (MainWindow.mainWindow.Visibility == Visibility.Collapsed
|
|
||||||
|| MainWindow.mainWindow.Opacity != 1)
|
|
||||||
{
|
|
||||||
Growl.WarningGlobal("<22>ѽ<EFBFBD>ͼ<EFBFBD><CDBC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD>Զ<EFBFBD><D4B6><EFBFBD>!");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Growl.Warning("<22>ѽ<EFBFBD>ͼ<EFBFBD><CDBC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD>Զ<EFBFBD><D4B6><EFBFBD>!", "MainWindowGrowl");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
itemsSource.Insert(newIndex, data);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Set the Effects property so that the call to DoDragDrop will return 'Move'.
|
|
||||||
e.Effects = DragDropEffects.Move;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion // LIstBox_Drop
|
|
||||||
|
|
||||||
#endregion // Event Handling Methods
|
|
||||||
|
|
||||||
#region Private Helpers
|
|
||||||
|
|
||||||
#region CanStartDragOperation
|
|
||||||
|
|
||||||
bool CanStartDragOperation
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
if( Mouse.LeftButton != MouseButtonState.Pressed )
|
|
||||||
return false;
|
|
||||||
|
|
||||||
if( !this.canInitiateDrag )
|
|
||||||
return false;
|
|
||||||
|
|
||||||
if( this.indexToSelect == -1 )
|
|
||||||
return false;
|
|
||||||
|
|
||||||
if( !this.HasCursorLeftDragThreshold )
|
|
||||||
return false;
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion // CanStartDragOperation
|
|
||||||
|
|
||||||
#region FinishDragOperation
|
|
||||||
|
|
||||||
void FinishDragOperation( ListBoxItem draggedItem, AdornerLayer adornerLayer )
|
|
||||||
{
|
|
||||||
// Let the ListBoxItem know that it is not being dragged anymore.
|
|
||||||
ListBoxItemDragState.SetIsBeingDragged( draggedItem, false );
|
|
||||||
|
|
||||||
this.IsDragInProgress = false;
|
|
||||||
|
|
||||||
if( this.ItemUnderDragCursor != null )
|
|
||||||
this.ItemUnderDragCursor = null;
|
|
||||||
|
|
||||||
// Remove the drag adorner from the adorner layer.
|
|
||||||
if( adornerLayer != null )
|
|
||||||
{
|
|
||||||
adornerLayer.Remove( this.dragAdorner );
|
|
||||||
this.dragAdorner = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion // FinishDragOperation
|
|
||||||
|
|
||||||
#region GetListBoxItem
|
|
||||||
|
|
||||||
ListBoxItem GetListBoxItem( int index )
|
|
||||||
{
|
|
||||||
if( this.listBox.ItemContainerGenerator.Status != GeneratorStatus.ContainersGenerated )
|
|
||||||
return null;
|
|
||||||
|
|
||||||
return this.listBox.ItemContainerGenerator.ContainerFromIndex( index ) as ListBoxItem;
|
|
||||||
}
|
|
||||||
|
|
||||||
ListBoxItem GetListBoxItem( ItemType dataItem )
|
|
||||||
{
|
|
||||||
if( this.listBox.ItemContainerGenerator.Status != GeneratorStatus.ContainersGenerated )
|
|
||||||
return null;
|
|
||||||
|
|
||||||
return this.listBox.ItemContainerGenerator.ContainerFromItem( dataItem ) as ListBoxItem;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion // GetListBoxItem
|
|
||||||
|
|
||||||
#region HasCursorLeftDragThreshold
|
|
||||||
|
|
||||||
bool HasCursorLeftDragThreshold
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
if( this.indexToSelect < 0 )
|
|
||||||
return false;
|
|
||||||
|
|
||||||
ListBoxItem item = this.GetListBoxItem( this.indexToSelect );
|
|
||||||
Rect bounds = VisualTreeHelper.GetDescendantBounds( item );
|
|
||||||
Point ptInItem = this.listBox.TranslatePoint( this.ptMouseDown, item );
|
|
||||||
|
|
||||||
// In case the cursor is at the very top or bottom of the ListBoxItem
|
|
||||||
// we want to make the vertical threshold very small so that dragging
|
|
||||||
// over an adjacent item does not select it.
|
|
||||||
double topOffset = Math.Abs( ptInItem.Y );
|
|
||||||
double btmOffset = Math.Abs( bounds.Height - ptInItem.Y );
|
|
||||||
double vertOffset = Math.Min( topOffset, btmOffset );
|
|
||||||
|
|
||||||
double width = SystemParameters.MinimumHorizontalDragDistance * 2;
|
|
||||||
double height = Math.Min( SystemParameters.MinimumVerticalDragDistance, vertOffset ) * 2;
|
|
||||||
Size szThreshold = new Size( width, height );
|
|
||||||
|
|
||||||
Rect rect = new Rect( this.ptMouseDown, szThreshold );
|
|
||||||
rect.Offset( szThreshold.Width / -2, szThreshold.Height / -2 );
|
|
||||||
//Point ptInListBox = MouseUtil.GetMousePosition(this.listBox);
|
|
||||||
Point ptInListBox = MouseUtil.GetMousePosition();
|
|
||||||
return !rect.Contains( ptInListBox );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion // HasCursorLeftDragThreshold
|
|
||||||
|
|
||||||
#region IndexUnderDragCursor
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Returns the index of the ListBoxItem underneath the
|
|
||||||
/// drag cursor, or -1 if the cursor is not over an item.
|
|
||||||
/// </summary>
|
|
||||||
int IndexUnderDragCursor
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
int index = -1;
|
|
||||||
for( int i = 0; i < this.listBox.Items.Count; ++i )
|
|
||||||
{
|
|
||||||
ListBoxItem item = this.GetListBoxItem( i );
|
|
||||||
if( this.IsMouseOver( item ) )
|
|
||||||
{
|
|
||||||
index = i;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return index;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion // IndexUnderDragCursor
|
|
||||||
|
|
||||||
#region InitializeAdornerLayer
|
|
||||||
|
|
||||||
AdornerLayer InitializeAdornerLayer( ListBoxItem itemToDrag )
|
|
||||||
{
|
|
||||||
// Create a brush which will paint the ListBoxItem onto
|
|
||||||
// a visual in the adorner layer.
|
|
||||||
VisualBrush brush = new VisualBrush( itemToDrag );
|
|
||||||
|
|
||||||
// Create an element which displays the source item while it is dragged.
|
|
||||||
this.dragAdorner = new DragAdorner( this.listBox, itemToDrag.RenderSize, brush );
|
|
||||||
|
|
||||||
// Set the drag adorner's opacity.
|
|
||||||
this.dragAdorner.Opacity = this.DragAdornerOpacity;
|
|
||||||
|
|
||||||
AdornerLayer layer = AdornerLayer.GetAdornerLayer( this.listBox );
|
|
||||||
layer.Add( dragAdorner );
|
|
||||||
|
|
||||||
// Save the location of the cursor when the left mouse button was pressed.
|
|
||||||
this.ptMouseDown = MouseUtil.GetMousePosition(this.listBox);
|
|
||||||
//this.ptMouseDown = MouseUtil.GetMousePosition();
|
|
||||||
|
|
||||||
return layer;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion // InitializeAdornerLayer
|
|
||||||
|
|
||||||
#region InitializeDragOperation
|
|
||||||
|
|
||||||
void InitializeDragOperation( ListBoxItem itemToDrag )
|
|
||||||
{
|
|
||||||
// Set some flags used during the drag operation.
|
|
||||||
this.IsDragInProgress = true;
|
|
||||||
this.canInitiateDrag = false;
|
|
||||||
|
|
||||||
// Let the ListBoxItem know that it is being dragged.
|
|
||||||
ListBoxItemDragState.SetIsBeingDragged( itemToDrag, true );
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion // InitializeDragOperation
|
|
||||||
|
|
||||||
#region IsMouseOver
|
|
||||||
|
|
||||||
bool IsMouseOver( Visual target )
|
|
||||||
{
|
|
||||||
// We need to use MouseUtil to figure out the cursor
|
|
||||||
// coordinates because, during a drag-drop operation, the WPF
|
|
||||||
// mechanisms for getting the coordinates behave strangely.
|
|
||||||
|
|
||||||
Rect bounds = VisualTreeHelper.GetDescendantBounds( target );
|
|
||||||
Point mousePos = MouseUtil.GetMousePosition( target );
|
|
||||||
return bounds.Contains( mousePos );
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion // IsMouseOver
|
|
||||||
|
|
||||||
#region IsMouseOverScrollbar
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Returns true if the mouse cursor is over a scrollbar in the ListBox.
|
|
||||||
/// </summary>
|
|
||||||
bool IsMouseOverScrollbar
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
Point ptMouse = MouseUtil.GetMousePosition( this.listBox );
|
|
||||||
HitTestResult res = VisualTreeHelper.HitTest( this.listBox, ptMouse );
|
|
||||||
if( res == null )
|
|
||||||
return false;
|
|
||||||
|
|
||||||
DependencyObject depObj = res.VisualHit;
|
|
||||||
while( depObj != null )
|
|
||||||
{
|
|
||||||
if( depObj is ScrollBar )
|
|
||||||
return true;
|
|
||||||
|
|
||||||
// VisualTreeHelper works with objects of type Visual or Visual3D.
|
|
||||||
// If the current object is not derived from Visual or Visual3D,
|
|
||||||
// then use the LogicalTreeHelper to find the parent element.
|
|
||||||
if( depObj is Visual || depObj is System.Windows.Media.Media3D.Visual3D )
|
|
||||||
depObj = VisualTreeHelper.GetParent( depObj );
|
|
||||||
else
|
|
||||||
depObj = LogicalTreeHelper.GetParent( depObj );
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion // IsMouseOverScrollbar
|
|
||||||
|
|
||||||
#region ItemUnderDragCursor
|
|
||||||
|
|
||||||
ItemType ItemUnderDragCursor
|
|
||||||
{
|
|
||||||
get { return this.itemUnderDragCursor; }
|
|
||||||
set
|
|
||||||
{
|
|
||||||
if( this.itemUnderDragCursor == value )
|
|
||||||
return;
|
|
||||||
|
|
||||||
// The first pass handles the previous item under the cursor.
|
|
||||||
// The second pass handles the new one.
|
|
||||||
for( int i = 0; i < 2; ++i )
|
|
||||||
{
|
|
||||||
if( i == 1 )
|
|
||||||
this.itemUnderDragCursor = value;
|
|
||||||
|
|
||||||
if( this.itemUnderDragCursor != null )
|
|
||||||
{
|
|
||||||
ListBoxItem listBoxItem = this.GetListBoxItem( this.itemUnderDragCursor );
|
|
||||||
if( listBoxItem != null )
|
|
||||||
ListBoxItemDragState.SetIsUnderDragCursor( listBoxItem, i == 1 );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion // ItemUnderDragCursor
|
|
||||||
|
|
||||||
#region PerformDragOperation
|
|
||||||
|
|
||||||
void PerformDragOperation()
|
|
||||||
{
|
|
||||||
ItemType selectedItem = this.listBox.SelectedItem as ItemType;
|
|
||||||
DragDropEffects allowedEffects = DragDropEffects.Move | DragDropEffects.Move | DragDropEffects.Link;
|
|
||||||
if( DragDrop.DoDragDrop( this.listBox, selectedItem, allowedEffects ) != DragDropEffects.None )
|
|
||||||
{
|
|
||||||
// The item was dropped into a new location,
|
|
||||||
// so make it the new selected item.
|
|
||||||
this.listBox.SelectedItem = selectedItem;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion // PerformDragOperation
|
|
||||||
|
|
||||||
#region ShowDragAdornerResolved
|
|
||||||
|
|
||||||
bool ShowDragAdornerResolved
|
|
||||||
{
|
|
||||||
get { return this.ShowDragAdorner && this.DragAdornerOpacity > 0.0; }
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion // ShowDragAdornerResolved
|
|
||||||
|
|
||||||
#region UpdateDragAdornerLocation
|
|
||||||
|
|
||||||
void UpdateDragAdornerLocation()
|
|
||||||
{
|
|
||||||
if( this.dragAdorner != null )
|
|
||||||
{
|
|
||||||
//Point ptCursor = MouseUtil.GetMousePosition(this.ListBox);
|
|
||||||
|
|
||||||
|
|
||||||
Point ptCursor = MouseUtil.GetMousePosition(this.ListBox);
|
|
||||||
|
|
||||||
//double left = ptCursor.X - this.ptMouseDown.X;
|
|
||||||
//double left2 = ptCursor.X;
|
|
||||||
|
|
||||||
ListBoxItem itemBeingDragged = this.GetListBoxItem(this.indexToSelect);
|
|
||||||
|
|
||||||
// 4/13/2007 - Made the top offset relative to the item being dragged.
|
|
||||||
Point itemLoc = itemBeingDragged.TranslatePoint( new Point( 0, 0 ), this.ListBox );
|
|
||||||
double top = itemLoc.Y + ptCursor.Y - this.ptMouseDown.Y;
|
|
||||||
double left = itemLoc.X + ptCursor.X - this.ptMouseDown.X;
|
|
||||||
|
|
||||||
this.dragAdorner.SetOffsets(left, top );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion // UpdateDragAdornerLocation
|
|
||||||
|
|
||||||
#endregion // Private Helpers
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion // ListBoxDragDropManager
|
|
||||||
|
|
||||||
#region ListBoxItemDragState
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Exposes attached properties used in conjunction with the ListBoxDragDropManager class.
|
|
||||||
/// Those properties can be used to allow triggers to modify the appearance of ListBoxItems
|
|
||||||
/// in a ListBox during a drag-drop operation.
|
|
||||||
/// </summary>
|
|
||||||
public static class ListBoxItemDragState
|
|
||||||
{
|
|
||||||
#region IsBeingDragged
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Identifies the ListBoxItemDragState's IsBeingDragged attached property.
|
|
||||||
/// This field is read-only.
|
|
||||||
/// </summary>
|
|
||||||
public static readonly DependencyProperty IsBeingDraggedProperty =
|
|
||||||
DependencyProperty.RegisterAttached(
|
|
||||||
"IsBeingDragged",
|
|
||||||
typeof( bool ),
|
|
||||||
typeof( ListBoxItemDragState ),
|
|
||||||
new UIPropertyMetadata( false ) );
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Returns true if the specified ListBoxItem is being dragged, else false.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="item">The ListBoxItem to check.</param>
|
|
||||||
public static bool GetIsBeingDragged( ListBoxItem item )
|
|
||||||
{
|
|
||||||
return (bool)item.GetValue( IsBeingDraggedProperty );
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Sets the IsBeingDragged attached property for the specified ListBoxItem.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="item">The ListBoxItem to set the property on.</param>
|
|
||||||
/// <param name="value">Pass true if the element is being dragged, else false.</param>
|
|
||||||
internal static void SetIsBeingDragged( ListBoxItem item, bool value )
|
|
||||||
{
|
|
||||||
item.SetValue( IsBeingDraggedProperty, value );
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion // IsBeingDragged
|
|
||||||
|
|
||||||
#region IsUnderDragCursor
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Identifies the ListBoxItemDragState's IsUnderDragCursor attached property.
|
|
||||||
/// This field is read-only.
|
|
||||||
/// </summary>
|
|
||||||
public static readonly DependencyProperty IsUnderDragCursorProperty =
|
|
||||||
DependencyProperty.RegisterAttached(
|
|
||||||
"IsUnderDragCursor",
|
|
||||||
typeof( bool ),
|
|
||||||
typeof( ListBoxItemDragState ),
|
|
||||||
new UIPropertyMetadata( false ) );
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Returns true if the specified ListBoxItem is currently underneath the cursor
|
|
||||||
/// during a drag-drop operation, else false.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="item">The ListBoxItem to check.</param>
|
|
||||||
public static bool GetIsUnderDragCursor( ListBoxItem item )
|
|
||||||
{
|
|
||||||
return (bool)item.GetValue( IsUnderDragCursorProperty );
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Sets the IsUnderDragCursor attached property for the specified ListBoxItem.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="item">The ListBoxItem to set the property on.</param>
|
|
||||||
/// <param name="value">Pass true if the element is underneath the drag cursor, else false.</param>
|
|
||||||
internal static void SetIsUnderDragCursor( ListBoxItem item, bool value )
|
|
||||||
{
|
|
||||||
item.SetValue( IsUnderDragCursorProperty, value );
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion // IsUnderDragCursor
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion // ListBoxItemDragState
|
|
||||||
|
|
||||||
#region ProcessDropEventArgs
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Event arguments used by the ListBoxDragDropManager.ProcessDrop event.
|
|
||||||
/// </summary>
|
|
||||||
/// <typeparam name="ItemType">The type of data object being dropped.</typeparam>
|
|
||||||
public class ProcessDropEventArgs<ItemType> : EventArgs where ItemType : class
|
|
||||||
{
|
|
||||||
#region Data
|
|
||||||
|
|
||||||
ObservableCollection<ItemType> itemsSource;
|
|
||||||
ItemType dataItem;
|
|
||||||
int oldIndex;
|
|
||||||
int newIndex;
|
|
||||||
DragDropEffects allowedEffects = DragDropEffects.None;
|
|
||||||
DragDropEffects effects = DragDropEffects.None;
|
|
||||||
|
|
||||||
#endregion // Data
|
|
||||||
|
|
||||||
#region Constructor
|
|
||||||
|
|
||||||
internal ProcessDropEventArgs(
|
|
||||||
ObservableCollection<ItemType> itemsSource,
|
|
||||||
ItemType dataItem,
|
|
||||||
int oldIndex,
|
|
||||||
int newIndex,
|
|
||||||
DragDropEffects allowedEffects )
|
|
||||||
{
|
|
||||||
this.itemsSource = itemsSource;
|
|
||||||
this.dataItem = dataItem;
|
|
||||||
this.oldIndex = oldIndex;
|
|
||||||
this.newIndex = newIndex;
|
|
||||||
this.allowedEffects = allowedEffects;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion // Constructor
|
|
||||||
|
|
||||||
#region Public Properties
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// The items source of the ListBox where the drop occurred.
|
|
||||||
/// </summary>
|
|
||||||
public ObservableCollection<ItemType> ItemsSource
|
|
||||||
{
|
|
||||||
get { return this.itemsSource; }
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// The data object which was dropped.
|
|
||||||
/// </summary>
|
|
||||||
public ItemType DataItem
|
|
||||||
{
|
|
||||||
get { return this.dataItem; }
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// The current index of the data item being dropped, in the ItemsSource collection.
|
|
||||||
/// </summary>
|
|
||||||
public int OldIndex
|
|
||||||
{
|
|
||||||
get { return this.oldIndex; }
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// The target index of the data item being dropped, in the ItemsSource collection.
|
|
||||||
/// </summary>
|
|
||||||
public int NewIndex
|
|
||||||
{
|
|
||||||
get { return this.newIndex; }
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// The drag drop effects allowed to be performed.
|
|
||||||
/// </summary>
|
|
||||||
public DragDropEffects AllowedEffects
|
|
||||||
{
|
|
||||||
get { return allowedEffects; }
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// The drag drop effect(s) performed on the dropped item.
|
|
||||||
/// </summary>
|
|
||||||
public DragDropEffects Effects
|
|
||||||
{
|
|
||||||
get { return effects; }
|
|
||||||
set { effects = value; }
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion // Public Properties
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion // ProcessDropEventArgs
|
|
||||||
}
|
|
||||||
@@ -12,10 +12,7 @@ namespace GeekDesk.Util
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
Exception ex = exception as Exception;
|
Exception ex = exception as Exception;
|
||||||
if (!Directory.Exists(Constants.ERROR_FILE_PATH.Substring(0, Constants.ERROR_FILE_PATH.LastIndexOf("\\"))))
|
|
||||||
{
|
|
||||||
Directory.CreateDirectory(Constants.ERROR_FILE_PATH.Substring(0, Constants.ERROR_FILE_PATH.LastIndexOf("\\")));
|
|
||||||
}
|
|
||||||
using (FileStream fs = File.Open(Constants.ERROR_FILE_PATH, FileMode.OpenOrCreate, FileAccess.ReadWrite))
|
using (FileStream fs = File.Open(Constants.ERROR_FILE_PATH, FileMode.OpenOrCreate, FileAccess.ReadWrite))
|
||||||
{
|
{
|
||||||
fs.Seek(0, SeekOrigin.End);
|
fs.Seek(0, SeekOrigin.End);
|
||||||
@@ -61,10 +58,6 @@ namespace GeekDesk.Util
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (!Directory.Exists(Constants.LOG_FILE_PATH.Substring(0, Constants.LOG_FILE_PATH.LastIndexOf("\\"))))
|
|
||||||
{
|
|
||||||
Directory.CreateDirectory(Constants.LOG_FILE_PATH.Substring(0, Constants.LOG_FILE_PATH.LastIndexOf("\\")));
|
|
||||||
}
|
|
||||||
using (FileStream fs = File.Open(Constants.LOG_FILE_PATH, FileMode.OpenOrCreate, FileAccess.ReadWrite))
|
using (FileStream fs = File.Open(Constants.LOG_FILE_PATH, FileMode.OpenOrCreate, FileAccess.ReadWrite))
|
||||||
{
|
{
|
||||||
fs.Seek(0, SeekOrigin.End);
|
fs.Seek(0, SeekOrigin.End);
|
||||||
|
|||||||
@@ -1,32 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace GeekDesk.Util
|
|
||||||
{
|
|
||||||
internal class MD5Util
|
|
||||||
{
|
|
||||||
|
|
||||||
public static string CreateMD5(string input)
|
|
||||||
{
|
|
||||||
// Use input string to calculate MD5 hash
|
|
||||||
using (System.Security.Cryptography.MD5 md5 = System.Security.Cryptography.MD5.Create())
|
|
||||||
{
|
|
||||||
byte[] inputBytes = System.Text.Encoding.ASCII.GetBytes(input);
|
|
||||||
byte[] hashBytes = md5.ComputeHash(inputBytes);
|
|
||||||
|
|
||||||
//return Convert.ToHexString(hashBytes); // .NET 5 +
|
|
||||||
|
|
||||||
//Convert the byte array to hexadecimal string prior to.NET 5
|
|
||||||
StringBuilder sb = new System.Text.StringBuilder();
|
|
||||||
for (int i = 0; i < hashBytes.Length; i++)
|
|
||||||
{
|
|
||||||
sb.Append(hashBytes[i].ToString("X2"));
|
|
||||||
}
|
|
||||||
return sb.ToString();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -25,8 +25,8 @@ namespace GeekDesk.Util
|
|||||||
{
|
{
|
||||||
private static Window window;//定义使用该方法的窗体
|
private static Window window;//定义使用该方法的窗体
|
||||||
|
|
||||||
private static readonly int hideTime = 65;
|
private static readonly int hideTime = 50;
|
||||||
private static readonly int showTime = 15;
|
private static readonly int showTime = 30;
|
||||||
|
|
||||||
private static int animalTime;
|
private static int animalTime;
|
||||||
|
|
||||||
@@ -77,7 +77,8 @@ namespace GeekDesk.Util
|
|||||||
#region 窗体贴边隐藏功能
|
#region 窗体贴边隐藏功能
|
||||||
private static void HideWindow(object o, EventArgs e)
|
private static void HideWindow(object o, EventArgs e)
|
||||||
{
|
{
|
||||||
if (RunTimeStatus.MARGIN_HIDE_AND_OTHER_SHOW
|
if (window.Visibility != Visibility.Visible
|
||||||
|
|| RunTimeStatus.MARGIN_HIDE_AND_OTHER_SHOW
|
||||||
|| RunTimeStatus.LOCK_APP_PANEL) return;
|
|| RunTimeStatus.LOCK_APP_PANEL) return;
|
||||||
|
|
||||||
double screenLeft = SystemParameters.VirtualScreenLeft;
|
double screenLeft = SystemParameters.VirtualScreenLeft;
|
||||||
@@ -97,7 +98,7 @@ namespace GeekDesk.Util
|
|||||||
|
|
||||||
//鼠标不在窗口上
|
//鼠标不在窗口上
|
||||||
if ((mouseX < windowLeft || mouseX > windowLeft + windowWidth
|
if ((mouseX < windowLeft || mouseX > windowLeft + windowWidth
|
||||||
|| mouseY < windowTop || mouseY > windowTop + windowHeight) && !IS_HIDE && window.Visibility == Visibility.Visible)
|
|| mouseY < windowTop || mouseY > windowTop + windowHeight) && !IS_HIDE)
|
||||||
{
|
{
|
||||||
//上方隐藏条件
|
//上方隐藏条件
|
||||||
if (windowTop <= screenTop)
|
if (windowTop <= screenTop)
|
||||||
@@ -125,9 +126,8 @@ namespace GeekDesk.Util
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (mouseX >= windowLeft && mouseX <= windowLeft + windowWidth
|
else if (mouseX >= windowLeft && mouseX <= windowLeft + windowWidth
|
||||||
&& mouseY >= windowTop && mouseY <= windowTop + windowHeight && IS_HIDE && window.Visibility != Visibility.Visible)
|
&& mouseY >= windowTop && mouseY <= windowTop + windowHeight && IS_HIDE)
|
||||||
{
|
{
|
||||||
window.Show();
|
|
||||||
//上方显示
|
//上方显示
|
||||||
if (windowTop <= screenTop - showMarginWidth)
|
if (windowTop <= screenTop - showMarginWidth)
|
||||||
{
|
{
|
||||||
@@ -189,7 +189,6 @@ namespace GeekDesk.Util
|
|||||||
double windowTop = window.Top;
|
double windowTop = window.Top;
|
||||||
double windowLeft = window.Left;
|
double windowLeft = window.Left;
|
||||||
|
|
||||||
window.Visibility = Visibility.Visible;
|
|
||||||
//左侧显示
|
//左侧显示
|
||||||
if (windowLeft <= screenLeft - showMarginWidth)
|
if (windowLeft <= screenLeft - showMarginWidth)
|
||||||
{
|
{
|
||||||
@@ -227,30 +226,17 @@ namespace GeekDesk.Util
|
|||||||
{
|
{
|
||||||
App.Current.Dispatcher.Invoke(() =>
|
App.Current.Dispatcher.Invoke(() =>
|
||||||
{
|
{
|
||||||
|
|
||||||
switch (hideType)
|
|
||||||
{
|
|
||||||
case HideType.LEFT_SHOW:
|
|
||||||
to -= 20;
|
|
||||||
break;
|
|
||||||
case HideType.RIGHT_SHOW:
|
|
||||||
to += 20;
|
|
||||||
break;
|
|
||||||
case HideType.TOP_SHOW:
|
|
||||||
to -= 20;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
double abs = Math.Abs(Math.Abs(to) - Math.Abs(from));
|
double abs = Math.Abs(Math.Abs(to) - Math.Abs(from));
|
||||||
|
double subLen = abs / hideTime;
|
||||||
|
|
||||||
if (hideType <= HideType.RIGHT_SHOW)
|
if ((int)hideType <= 3)
|
||||||
{
|
{
|
||||||
animalTime = showTime;
|
animalTime = showTime;
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
animalTime = hideTime;
|
animalTime = hideTime;
|
||||||
}
|
}
|
||||||
double subLen = abs / animalTime;
|
|
||||||
int count = 0;
|
int count = 0;
|
||||||
while (count < animalTime)
|
while (count < animalTime)
|
||||||
{
|
{
|
||||||
@@ -281,20 +267,81 @@ namespace GeekDesk.Util
|
|||||||
|
|
||||||
switch (hideType)
|
switch (hideType)
|
||||||
{
|
{
|
||||||
|
case HideType.LEFT_HIDE:
|
||||||
|
window.Left = to;
|
||||||
|
break;
|
||||||
|
case HideType.LEFT_SHOW:
|
||||||
|
window.Left = to - 20;
|
||||||
|
break;
|
||||||
|
case HideType.RIGHT_HIDE:
|
||||||
|
window.Left = to;
|
||||||
|
break;
|
||||||
|
case HideType.RIGHT_SHOW:
|
||||||
|
window.Left = to + 20;
|
||||||
|
break;
|
||||||
case HideType.TOP_HIDE:
|
case HideType.TOP_HIDE:
|
||||||
window.Top = to;
|
window.Top = to;
|
||||||
break;
|
break;
|
||||||
case HideType.TOP_SHOW:
|
case HideType.TOP_SHOW:
|
||||||
window.Top = to;
|
window.Top = to - 20;
|
||||||
break;
|
break;
|
||||||
default:
|
|
||||||
window.Left = to;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if (hideType > HideType.RIGHT_SHOW)
|
|
||||||
{
|
|
||||||
window.Visibility = Visibility.Collapsed;
|
|
||||||
}
|
}
|
||||||
|
//double toTemp = to;
|
||||||
|
//double leftT = 0;
|
||||||
|
//double topT = 0;
|
||||||
|
//switch (hideType)
|
||||||
|
//{
|
||||||
|
// case HideType.LEFT_HIDE:
|
||||||
|
// to += leftT;
|
||||||
|
// break;
|
||||||
|
// case HideType.LEFT_SHOW:
|
||||||
|
// to -= leftT;
|
||||||
|
// break;
|
||||||
|
// case HideType.RIGHT_HIDE:
|
||||||
|
// to -= leftT;
|
||||||
|
// break;
|
||||||
|
// case HideType.RIGHT_SHOW:
|
||||||
|
// to += leftT;
|
||||||
|
// break;
|
||||||
|
// case HideType.TOP_HIDE:
|
||||||
|
// to += topT;
|
||||||
|
// break;
|
||||||
|
// case HideType.TOP_SHOW:
|
||||||
|
// to -= topT;
|
||||||
|
// break;
|
||||||
|
//}
|
||||||
|
//DoubleAnimation da = new DoubleAnimation
|
||||||
|
//{
|
||||||
|
// From = from,
|
||||||
|
// To = to,
|
||||||
|
// Duration = new Duration(TimeSpan.FromMilliseconds(hideTime))
|
||||||
|
//};
|
||||||
|
//// 如果是显示 则贴屏幕侧不显示阴影
|
||||||
|
//bool isShow = false;
|
||||||
|
//int shadowWidthTemp = Constants.SHADOW_WIDTH;
|
||||||
|
//if (hideType <= HideType.RIGHT_SHOW)
|
||||||
|
//{
|
||||||
|
// isShow = true;
|
||||||
|
// if (hideType == HideType.RIGHT_SHOW)
|
||||||
|
// {
|
||||||
|
// shadowWidthTemp = -shadowWidthTemp;
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
//da.Completed += (s, e) =>
|
||||||
|
//{
|
||||||
|
// if ("Top".Equals(property.Name))
|
||||||
|
// {
|
||||||
|
// window.Top = isShow ? toTemp - shadowWidthTemp : toTemp;
|
||||||
|
// }
|
||||||
|
// else
|
||||||
|
// {
|
||||||
|
// window.Left = isShow ? toTemp - shadowWidthTemp : toTemp;
|
||||||
|
// }
|
||||||
|
// window.BeginAnimation(property, null);
|
||||||
|
//};
|
||||||
|
|
||||||
|
//Timeline.SetDesiredFrameRate(da, 60);
|
||||||
|
//window.BeginAnimation(property, da);
|
||||||
});
|
});
|
||||||
}).Start();
|
}).Start();
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Media;
|
|
||||||
|
|
||||||
namespace GeekDesk.Util
|
namespace GeekDesk.Util
|
||||||
{
|
{
|
||||||
@@ -28,27 +27,5 @@ namespace GeekDesk.Util
|
|||||||
GetCursorPos(ref w32Mouse);
|
GetCursorPos(ref w32Mouse);
|
||||||
return new Point(w32Mouse.X, w32Mouse.Y);
|
return new Point(w32Mouse.X, w32Mouse.Y);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static Point GetMousePosition(Visual relativeTo)
|
|
||||||
{
|
|
||||||
Win32Point mouse = new Win32Point();
|
|
||||||
GetCursorPos(ref mouse);
|
|
||||||
|
|
||||||
// Using PointFromScreen instead of Dan Crevier's code (commented out below)
|
|
||||||
// is a bug fix created by William J. Roberts. Read his comments about the fix
|
|
||||||
// here: http://www.codeproject.com/useritems/ListViewDragDropManager.asp?msg=1911611#xx1911611xx
|
|
||||||
return relativeTo.PointFromScreen(new Point((double)mouse.X, (double)mouse.Y));
|
|
||||||
|
|
||||||
#region Commented Out
|
|
||||||
//System.Windows.Interop.HwndSource presentationSource =
|
|
||||||
// (System.Windows.Interop.HwndSource)PresentationSource.FromVisual( relativeTo );
|
|
||||||
//ScreenToClient( presentationSource.Handle, ref mouse );
|
|
||||||
//GeneralTransform transform = relativeTo.TransformToAncestor( presentationSource.RootVisual );
|
|
||||||
//Point offset = transform.Transform( new Point( 0, 0 ) );
|
|
||||||
//return new Point( mouse.X - offset.X, mouse.Y - offset.Y );
|
|
||||||
#endregion // Commented Out
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,37 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Windows.Input;
|
|
||||||
|
|
||||||
namespace GeekDesk.Util
|
|
||||||
{
|
|
||||||
public class RelayCommand : ICommand
|
|
||||||
{
|
|
||||||
private readonly Predicate<object> _canExecute;
|
|
||||||
private readonly Action<object> _execute;
|
|
||||||
|
|
||||||
public RelayCommand(Predicate<object> canExecute, Action<object> execute)
|
|
||||||
{
|
|
||||||
_canExecute = canExecute;
|
|
||||||
_execute = execute;
|
|
||||||
}
|
|
||||||
|
|
||||||
public event EventHandler CanExecuteChanged
|
|
||||||
{
|
|
||||||
add => CommandManager.RequerySuggested += value;
|
|
||||||
remove => CommandManager.RequerySuggested -= value;
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool CanExecute(object parameter)
|
|
||||||
{
|
|
||||||
return _canExecute(parameter);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Execute(object parameter)
|
|
||||||
{
|
|
||||||
_execute(parameter);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -21,7 +21,7 @@ namespace GeekDesk.Util
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 随鼠标位置显示面板
|
/// 随鼠标位置显示面板
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static void Show(Window window, MousePosition position, double widthOffset = 0, double heightOffset = 0)
|
public static void Show(Window window, MousePosition position, double widthOffset = 0, double heightOffset = 0, bool visibility = true)
|
||||||
{
|
{
|
||||||
//获取鼠标位置
|
//获取鼠标位置
|
||||||
System.Windows.Point p = MouseUtil.GetMousePosition();
|
System.Windows.Point p = MouseUtil.GetMousePosition();
|
||||||
@@ -101,6 +101,11 @@ namespace GeekDesk.Util
|
|||||||
{
|
{
|
||||||
window.Top = p.Y - afterHeight;
|
window.Top = p.Y - afterHeight;
|
||||||
}
|
}
|
||||||
|
if (visibility)
|
||||||
|
{
|
||||||
|
window.Opacity = 0;
|
||||||
|
window.Visibility = Visibility.Visible;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -93,79 +93,8 @@ namespace GeekDesk.ViewModel
|
|||||||
|
|
||||||
private SearchType searchType;
|
private SearchType searchType;
|
||||||
|
|
||||||
private string sysBakTime; //系统自动备份时间
|
|
||||||
|
|
||||||
private string menuPassword; //锁菜单密码
|
|
||||||
|
|
||||||
private string passwordHint; //密码提示
|
|
||||||
|
|
||||||
private bool? isShow;
|
|
||||||
|
|
||||||
private bool itemSpradeAnimation; //列表展开动画
|
|
||||||
|
|
||||||
#region GetSet
|
#region GetSet
|
||||||
public bool ItemSpradeAnimation
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return itemSpradeAnimation;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
itemSpradeAnimation = value;
|
|
||||||
OnPropertyChanged("ItemSpradeAnimation");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool? IsShow
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return isShow;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
isShow = value;
|
|
||||||
OnPropertyChanged("IsShow");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public string PasswordHint
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return passwordHint;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
passwordHint = value;
|
|
||||||
OnPropertyChanged("PasswordHint");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public string MenuPassword
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return menuPassword;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
menuPassword = value;
|
|
||||||
OnPropertyChanged("MenuPassword");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public string SysBakTime
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return sysBakTime;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
sysBakTime = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public SearchType SearchType
|
public SearchType SearchType
|
||||||
{
|
{
|
||||||
@@ -969,7 +898,7 @@ namespace GeekDesk.ViewModel
|
|||||||
private void OnPropertyChanged(string propertyName)
|
private void OnPropertyChanged(string propertyName)
|
||||||
{
|
{
|
||||||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
||||||
CommonCode.SaveAppData(MainWindow.appData, Constants.DATA_FILE_PATH);
|
CommonCode.SaveAppData(MainWindow.appData);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using GeekDesk.Constant;
|
using GeekDesk.Util;
|
||||||
using GeekDesk.Util;
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.ObjectModel;
|
using System.Collections.ObjectModel;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
@@ -89,7 +88,7 @@ namespace GeekDesk.ViewModel
|
|||||||
private void OnPropertyChanged(string propertyName)
|
private void OnPropertyChanged(string propertyName)
|
||||||
{
|
{
|
||||||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
||||||
CommonCode.SaveAppData(MainWindow.appData, Constants.DATA_FILE_PATH);
|
CommonCode.SaveAppData(MainWindow.appData);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using GeekDesk.Constant;
|
using GeekDesk.Util;
|
||||||
using GeekDesk.Util;
|
|
||||||
using System;
|
using System;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
|
|
||||||
@@ -70,7 +69,7 @@ namespace GeekDesk.ViewModel
|
|||||||
private void OnPropertyChanged(string propertyName)
|
private void OnPropertyChanged(string propertyName)
|
||||||
{
|
{
|
||||||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
||||||
CommonCode.SaveAppData(MainWindow.appData, Constants.DATA_FILE_PATH);
|
CommonCode.SaveAppData(MainWindow.appData);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,36 +24,9 @@ namespace GeekDesk.ViewModel
|
|||||||
private string startArg; //启动参数
|
private string startArg; //启动参数
|
||||||
private string lnkPath;
|
private string lnkPath;
|
||||||
|
|
||||||
private string relativePath; //相对路径
|
|
||||||
|
|
||||||
private IconType iconType = IconType.OTHER;
|
private IconType iconType = IconType.OTHER;
|
||||||
|
|
||||||
|
|
||||||
public string RelativePath_NoWrite
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return relativePath;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
relativePath = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public string RelativePath
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return relativePath;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
relativePath = value;
|
|
||||||
OnPropertyChanged("RelativePath");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public string LnkPath_NoWrite
|
public string LnkPath_NoWrite
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
@@ -205,14 +178,6 @@ namespace GeekDesk.ViewModel
|
|||||||
set
|
set
|
||||||
{
|
{
|
||||||
name = value;
|
name = value;
|
||||||
if (StringUtil.IsEmpty(Path))
|
|
||||||
{
|
|
||||||
content = Name + "\n使用次数: " + Count;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
content = Path + "\n" + Name + "\n使用次数: " + Count;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -246,14 +211,6 @@ namespace GeekDesk.ViewModel
|
|||||||
set
|
set
|
||||||
{
|
{
|
||||||
path = value;
|
path = value;
|
||||||
if (StringUtil.IsEmpty(Path))
|
|
||||||
{
|
|
||||||
content = Name + "\n使用次数: " + Count;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
content = Path + "\n" + Name + "\n使用次数: " + Count;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -346,7 +303,7 @@ namespace GeekDesk.ViewModel
|
|||||||
private void OnPropertyChanged(string propertyName)
|
private void OnPropertyChanged(string propertyName)
|
||||||
{
|
{
|
||||||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
||||||
CommonCode.SaveAppData(MainWindow.appData, Constants.DATA_FILE_PATH);
|
CommonCode.SaveAppData(MainWindow.appData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -20,22 +20,8 @@ namespace GeekDesk.ViewModel
|
|||||||
private string menuGeometry; //菜单几何图标
|
private string menuGeometry; //菜单几何图标
|
||||||
private string geometryColor; //几何图标颜色
|
private string geometryColor; //几何图标颜色
|
||||||
private ObservableCollection<IconInfo> iconList = new ObservableCollection<IconInfo>();
|
private ObservableCollection<IconInfo> iconList = new ObservableCollection<IconInfo>();
|
||||||
private bool isEncrypt; //是否加密
|
|
||||||
|
|
||||||
|
|
||||||
public bool IsEncrypt
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return isEncrypt;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
isEncrypt = value;
|
|
||||||
OnPropertyChanged("IsEncrypt");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public string MenuGeometry
|
public string MenuGeometry
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
@@ -148,7 +134,7 @@ namespace GeekDesk.ViewModel
|
|||||||
private void OnPropertyChanged(string propertyName)
|
private void OnPropertyChanged(string propertyName)
|
||||||
{
|
{
|
||||||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
||||||
CommonCode.SaveAppData(MainWindow.appData, Constants.DATA_FILE_PATH);
|
CommonCode.SaveAppData(MainWindow.appData);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -133,7 +133,7 @@ namespace GeekDesk.ViewModel
|
|||||||
private void OnPropertyChanged(string propertyName)
|
private void OnPropertyChanged(string propertyName)
|
||||||
{
|
{
|
||||||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
||||||
CommonCode.SaveAppData(MainWindow.appData, Constants.DATA_FILE_PATH);
|
CommonCode.SaveAppData(MainWindow.appData);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,10 +3,7 @@
|
|||||||
<package id="CommonServiceLocator" version="2.0.6" targetFramework="net452" requireReinstallation="true" />
|
<package id="CommonServiceLocator" version="2.0.6" targetFramework="net452" requireReinstallation="true" />
|
||||||
<package id="HandyControl" version="3.3.0" targetFramework="net472" />
|
<package id="HandyControl" version="3.3.0" targetFramework="net472" />
|
||||||
<package id="KeyMouseHook" version="1.0.6" targetFramework="net472" developmentDependency="true" />
|
<package id="KeyMouseHook" version="1.0.6" targetFramework="net472" developmentDependency="true" />
|
||||||
<package id="Microsoft.Build.Tasks.Git" version="1.0.0" targetFramework="net472" developmentDependency="true" />
|
|
||||||
<package id="Microsoft.Extensions.Logging.Abstractions" version="2.1.1" targetFramework="net472" />
|
<package id="Microsoft.Extensions.Logging.Abstractions" version="2.1.1" targetFramework="net472" />
|
||||||
<package id="Microsoft.SourceLink.Common" version="1.0.0" targetFramework="net472" developmentDependency="true" />
|
|
||||||
<package id="Microsoft.SourceLink.GitHub" version="1.0.0" targetFramework="net472" developmentDependency="true" />
|
|
||||||
<package id="MouseKeyHook" version="5.6.0" targetFramework="net472" />
|
<package id="MouseKeyHook" version="5.6.0" targetFramework="net472" />
|
||||||
<package id="Newtonsoft.Json" version="13.0.1" targetFramework="net472" />
|
<package id="Newtonsoft.Json" version="13.0.1" targetFramework="net472" />
|
||||||
<package id="NPinyin.Core" version="3.0.0" targetFramework="net472" />
|
<package id="NPinyin.Core" version="3.0.0" targetFramework="net472" />
|
||||||
@@ -16,8 +13,5 @@
|
|||||||
<package id="System.Drawing.Common" version="6.0.0-preview.6.21352.12" targetFramework="net472" />
|
<package id="System.Drawing.Common" version="6.0.0-preview.6.21352.12" targetFramework="net472" />
|
||||||
<package id="System.Memory" version="4.5.4" targetFramework="net472" />
|
<package id="System.Memory" version="4.5.4" targetFramework="net472" />
|
||||||
<package id="System.Numerics.Vectors" version="4.5.0" targetFramework="net472" />
|
<package id="System.Numerics.Vectors" version="4.5.0" targetFramework="net472" />
|
||||||
<package id="System.Reactive" version="5.0.0" targetFramework="net472" />
|
|
||||||
<package id="System.Runtime.CompilerServices.Unsafe" version="4.5.3" targetFramework="net472" />
|
<package id="System.Runtime.CompilerServices.Unsafe" version="4.5.3" targetFramework="net472" />
|
||||||
<package id="System.Threading.Tasks.Extensions" version="4.5.4" targetFramework="net472" />
|
|
||||||
<package id="XamlFlair.WPF" version="1.2.13" targetFramework="net472" />
|
|
||||||
</packages>
|
</packages>
|
||||||
Reference in New Issue
Block a user