8 Commits

Author SHA1 Message Date
liufei
cbaeb71a0c 🧑‍💻 配置文件控制公众号显示 2022-06-17 10:20:36 +08:00
liufei
b8a6c9b91d 🚑 更新信息 2022-06-17 10:05:34 +08:00
liufei
001d807bb3 🐛 修复了某些路径无法建立相对路径导致程序启动崩溃的bug 2022-06-17 10:03:35 +08:00
liufei
240008ce2c :bug:修改提示 2022-06-15 17:40:43 +08:00
liufei
8f043ffd05 ♻️ 优化贴边隐藏的动画时间 2022-06-14 11:49:46 +08:00
liufei
6e58afcdea ♻️ 优化动画及部分样式 2022-06-14 10:37:24 +08:00
liufei
896dc26f11 🐛 修复路径可能为空导致创建相对路径报错的问题 2022-06-14 09:48:13 +08:00
liufei
d44cc90100 💥 2.5.10 2022-06-13 20:59:31 +08:00
19 changed files with 192 additions and 152 deletions

View File

@@ -54,14 +54,15 @@
</assemblyBinding> </assemblyBinding>
</runtime> </runtime>
<appSettings> <appSettings>
<add key="Version" value="2.4.17" /> <add key="Version" value="2.5.11" />
<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:///C:/Users/Fei/Desktop/GeekDesk/Update.json" />--> <!--<add key="GiteeUpdateUrl" value="file:///D:/WorkSpace/workspace-VS/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">

View File

@@ -4,6 +4,7 @@
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"
@@ -16,7 +17,11 @@
<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" Width="400" Height="100"/> <Image Source="/Resource/Image/About.png"
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"/>
@@ -27,18 +32,21 @@
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 Subject="公众号" Visibility="Visible" Status="抓几个娃" Margin="0,0,5,0" Color="#04913B"> <hc:Shield x:Name="PublicWeChatPanel" 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>

View File

@@ -16,6 +16,15 @@ 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);

View File

@@ -84,15 +84,7 @@
</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"/>

View File

@@ -306,14 +306,6 @@ namespace GeekDesk.Control.UserControls.Config
} }
} }
private void Animation_Checked(object sender, RoutedEventArgs e)
{
if (MainWindow.mainWindow.Visibility == Visibility.Collapsed)
{
appConfig.IsShow = true;
}
appConfig.IsShow = null;
}
/// <summary> /// <summary>

View File

@@ -110,7 +110,25 @@
<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">
@@ -120,7 +138,7 @@
</CheckBox> </CheckBox>
</hc:UniformSpacingPanel> </hc:UniformSpacingPanel>
<hc:UniformSpacingPanel Spacing="10" Margin="5,5,0,0" Grid.ColumnSpan="4"> <hc:UniformSpacingPanel Spacing="10" Margin="5,10,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">

View File

@@ -157,5 +157,16 @@ 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;
}
} }
} }

View File

@@ -311,7 +311,11 @@ namespace GeekDesk.Control.UserControls.PannelCard
{ {
if (RunTimeStatus.IS_MENU_EDIT) return; if (RunTimeStatus.IS_MENU_EDIT) return;
MainWindow.mainWindow.RightCard.WrapUFG.Visibility = Visibility.Collapsed; if (appData.AppConfig.ItemSpradeAnimation)
{
//是否启用列表展开动画
MainWindow.mainWindow.RightCard.WrapUFG.Visibility = Visibility.Collapsed;
}
//设置对应菜单的图标列表 //设置对应菜单的图标列表
if (MenuListBox.SelectedIndex == -1) if (MenuListBox.SelectedIndex == -1)

View File

@@ -112,11 +112,11 @@
</hc:Card.ContextMenu> </hc:Card.ContextMenu>
<hc:DialogContainer> <hc:DialogContainer>
<Grid> <Grid>
<ot:PasswordDialog xf:Animations.Primary="{xf:Animate BasedOn={StaticResource FadeInAndGrowHorizontally}, Event=Visibility}" <ot:PasswordDialog xf:Animations.Primary="{xf:Animate BasedOn={StaticResource FadeInAndGrowHorizontally}, Event=Visibility, Duration=50, Delay=0}"
x:Name="PDDialog" x:Name="PDDialog"
Panel.ZIndex="99" Panel.ZIndex="99"
IsVisibleChanged="PDDialog_IsVisibleChanged" IsVisibleChanged="PDDialog_IsVisibleChanged"
Margin="0,-100,0,0"/> Margin="0,-100,0,0"/>
<StackPanel Panel.ZIndex="1" Margin="0,-10,-0,0"/> <StackPanel Panel.ZIndex="1" Margin="0,-10,-0,0"/>
<WrapPanel Orientation="Horizontal" <WrapPanel Orientation="Horizontal"
VirtualizingPanel.VirtualizationMode="Recycling" VirtualizingPanel.VirtualizationMode="Recycling"

View File

@@ -110,7 +110,7 @@
</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 FadeInAndSlideFromLeft}, Event=Visibility}"> <UniformGrid x:Name="UFG" xf:Animations.Primary="{xf:Animate BasedOn={StaticResource FadeIn}, Event=Visibility, Delay=0}">
<!--<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>

View File

@@ -49,7 +49,7 @@
<Prefer32Bit>false</Prefer32Bit> <Prefer32Bit>false</Prefer32Bit>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget> <PlatformTarget>x64</PlatformTarget>
<DebugType>pdbonly</DebugType> <DebugType>pdbonly</DebugType>
<Optimize>true</Optimize> <Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath> <OutputPath>bin\Release\</OutputPath>
@@ -57,6 +57,8 @@
<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>
@@ -263,6 +265,7 @@
<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="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" />

View File

@@ -185,7 +185,7 @@ namespace GeekDesk
{ {
ShowApp(); ShowApp();
} }
//ShowSecondTask.SHowSecond();
//给任务栏图标一个名字 //给任务栏图标一个名字
BarIcon.Text = Constants.MY_NAME; BarIcon.Text = Constants.MY_NAME;
@@ -426,17 +426,6 @@ namespace GeekDesk
// return; // return;
//} //}
MainWindow.mainWindow.Activate();
mainWindow.Show();
//mainWindow.Visibility = Visibility.Visible;
if (appData.AppConfig.AppAnimation)
{
appData.AppConfig.IsShow = true;
} else
{
appData.AppConfig.IsShow = null;
}
if (MarginHide.ON_HIDE) if (MarginHide.ON_HIDE)
{ {
//修改贴边隐藏状态为未隐藏 //修改贴边隐藏状态为未隐藏
@@ -453,6 +442,18 @@ namespace GeekDesk
ShowWindowFollowMouse.Show(mainWindow, MousePosition.CENTER, 0, 0); ShowWindowFollowMouse.Show(mainWindow, MousePosition.CENTER, 0, 0);
} }
MainWindow.mainWindow.Activate();
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); //FadeStoryBoard(1, (int)CommonEnum.WINDOW_ANIMATION_TIME, Visibility.Visible);

View File

@@ -49,5 +49,5 @@ using System.Windows;
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值 //可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示: //通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.4.1.7")] [assembly: AssemblyVersion("2.5.1.0")]
[assembly: AssemblyFileVersion("2.4.1.7")] [assembly: AssemblyFileVersion("2.5.1.0")]

31
Task/ShowSecondTask.cs Normal file
View File

@@ -0,0 +1,31 @@
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);
}
}
}

View File

@@ -1,9 +1,9 @@
{ {
"title": "GeekDesk版本更新", "title": "GeekDesk版本更新",
"subTitle": "V2.4.16", "subTitle": "V2.5.11",
"msgTitle": "本次更新内容如下", "msgTitle": "本次更新内容如下",
"msg": "['兄弟萌求Star, 求Star, 由于功能越来越多, 之后的更新我会测试一周再发布, 尽量做到没有BUG, 见谅', '这个版本没有功能性改变, 主要是为了修复上个版本的bug', '修复无法修改菜单名称的问题', '修复通过任务栏图标打开拾色器, 图标菜单消失问题']", "msg": "['依旧耗费了我大量精力开发,希望大家去给我点个免费的Star', '这个版本有一些优化点, 大家可以自行探索, 另外征集新Logo的设计, 要求美观并能体现\\'极客\\'风格','本次重新打包了程序文件(文件目录更清爽了,注意,这次不要使用覆盖升级(2.5.10可覆盖)), 可以将旧版本根目录下的Data文件复制到新版本根目录, 然后使用新版本启动','修复了2.5.10版本部分相对路径创建导致启动崩溃的bug','增加可拖动图标到其它菜单的功能,取消了拖动时的动画','增加了列表展开动画的开关','增加了数据备份功能','优化大部分动画','优化搜索功能(达到了可只用键盘或只用鼠标启动所需目标)','增加了相对路径(实验性,可能有bug)','增加列表加密功能(实验性,可能有bug)','其它已知问题修复']",
"githubUrl": "https://github.com/BookerLiu/GeekDesk/releases", "githubUrl": "https://github.com/BookerLiu/GeekDesk/releases",
"giteeUrl": "https://gitee.com/BookerLiu/GeekDesk/releases", "giteeUrl": "https://gitee.com/BookerLiu/GeekDesk/releases",
"version": "2.4.16" "version": "2.5.11"
} }

View File

@@ -159,30 +159,23 @@ namespace GeekDesk.Util
public static string MakeRelativePath(string fromPath, string toPath) public static string MakeRelativePath(string fromPath, string toPath)
{ {
//if (string.IsNullOrEmpty(fromPath)) throw new ArgumentNullException("fromPath"); string relativePath = null;
//if (string.IsNullOrEmpty(toPath)) throw new ArgumentNullException("toPath"); try
{
//Uri fromUri = new Uri(fromPath); if (string.IsNullOrEmpty(toPath) || string.IsNullOrEmpty(fromPath)) return null;
//Uri toUri = new Uri(toPath); Uri file = new Uri(@toPath);
// Must end in a slash to indicate folder
//if (fromUri.Scheme != toUri.Scheme) { return toPath; } // path can't be made relative. Uri folder = new Uri(@fromPath);
relativePath =
//Uri relativeUri = fromUri.MakeRelativeUri(toUri); Uri.UnescapeDataString(
//string relativePath = Uri.UnescapeDataString(relativeUri.ToString()); folder.MakeRelativeUri(file)
.ToString()
//if (toUri.Scheme.Equals("file", StringComparison.InvariantCultureIgnoreCase)) .Replace('/', Path.DirectorySeparatorChar)
//{ );
// relativePath = relativePath.Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar); } catch (Exception ex)
//} {
Uri file = new Uri(@toPath); LogUtil.WriteErrorLog(ex, "建立相对路径出错:fromPath:" + fromPath + ",toPath:" + toPath);
// Must end in a slash to indicate folder }
Uri folder = new Uri(@fromPath);
string relativePath =
Uri.UnescapeDataString(
folder.MakeRelativeUri(file)
.ToString()
.Replace('/', Path.DirectorySeparatorChar)
);
return relativePath; return relativePath;
} }

View File

@@ -25,8 +25,8 @@ namespace GeekDesk.Util
{ {
private static Window window;//定义使用该方法的窗体 private static Window window;//定义使用该方法的窗体
private static readonly int hideTime = 50; private static readonly int hideTime = 65;
private static readonly int showTime = 30; private static readonly int showTime = 15;
private static int animalTime; private static int animalTime;
@@ -127,7 +127,7 @@ 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.Visibility != Visibility.Visible)
{ {
window.Visibility = Visibility.Visible; window.Show();
//上方显示 //上方显示
if (windowTop <= screenTop - showMarginWidth) if (windowTop <= screenTop - showMarginWidth)
{ {
@@ -227,17 +227,30 @@ namespace GeekDesk.Util
{ {
App.Current.Dispatcher.Invoke(() => App.Current.Dispatcher.Invoke(() =>
{ {
double abs = Math.Abs(Math.Abs(to) - Math.Abs(from));
double subLen = abs / hideTime;
if ((int)hideType <= 3) 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));
if (hideType <= HideType.RIGHT_SHOW)
{ {
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)
{ {
@@ -268,86 +281,20 @@ 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 - 20; window.Top = to;
break; break;
default:
window.Left = to;
break;
} }
if (hideType > HideType.RIGHT_SHOW) if (hideType > HideType.RIGHT_SHOW)
{ {
window.Visibility = Visibility.Collapsed; 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();

View File

@@ -101,8 +101,22 @@ namespace GeekDesk.ViewModel
private bool? isShow; private bool? isShow;
private bool itemSpradeAnimation; //列表展开动画
#region GetSet #region GetSet
public bool ItemSpradeAnimation
{
get
{
return itemSpradeAnimation;
}
set
{
itemSpradeAnimation = value;
OnPropertyChanged("ItemSpradeAnimation");
}
}
public bool? IsShow public bool? IsShow
{ {
get get

View File

@@ -205,6 +205,14 @@ namespace GeekDesk.ViewModel
set set
{ {
name = value; name = value;
if (StringUtil.IsEmpty(Path))
{
content = Name + "\n使用次数: " + Count;
}
else
{
content = Path + "\n" + Name + "\n使用次数: " + Count;
}
} }
} }
@@ -238,6 +246,14 @@ namespace GeekDesk.ViewModel
set set
{ {
path = value; path = value;
if (StringUtil.IsEmpty(Path))
{
content = Name + "\n使用次数: " + Count;
}
else
{
content = Path + "\n" + Name + "\n使用次数: " + Count;
}
} }
} }