Quellcode durchsuchen

:beers: 为改名做准备, 之后我叫BookerLiu :beers:

liufei vor 3 Jahren
Ursprung
Commit
cbffdada7a

+ 7 - 6
App.config

@@ -49,12 +49,13 @@
     </assemblyBinding>
   </runtime>
   <appSettings>
-    <add key="Version" value="2.4.15" />
-    <add key="GitHubUrl" value="https://github.com/Demo-Liu/GeekDesk" />
-    <add key="GiteeUrl" value="https://gitee.com/demo_liu/GeekDesk/tree/master" />
-    <add key="GitHubUpdateUrl" value="https://demo-liu.github.io/GeekDesk/Update.json" />
-    <add key="GiteeUpdateUrl" value="https://demo-liu.github.io/GeekDesk/Update.json" />
-    <add key="ClientSettingsProvider.ServiceUri" value="" />
+      <add key="Version" value="2.4.15" />
+      <add key="GitHubUrl" value="https://github.com/BookerLiu/GeekDesk" />
+      <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="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="ClientSettingsProvider.ServiceUri" value="" />
 	<add key="CustomIconTeachUrl" value="https://mp.weixin.qq.com/s/LxoHAekho9HBVl4FRw_Law" />
   </appSettings>
   <system.web>

+ 2 - 2
Control/UserControls/Config/AboutControl.xaml

@@ -26,13 +26,13 @@
                                MouseEnter="SC_MouseEnter"
                                MouseLeave="SC_MouseLeave"
                                Command="hc:ControlCommands.OpenLink" 
-                               CommandParameter="https://github.com/Demo-Liu/GeekDesk"
+                               CommandParameter="https://github.com/BookerLiu/GeekDesk"
                                Margin="0,0,10,0" Color="#24292F"/>
                     <hc:Shield Subject="Gitee" Visibility="Visible" Status="Star"
                                MouseEnter="SC_MouseEnter"
                                MouseLeave="SC_MouseLeave"
                                Command="hc:ControlCommands.OpenLink" 
-                               CommandParameter="https://gitee.com/demo_liu/GeekDesk" 
+                               CommandParameter="https://gitee.com/BookerLiu/GeekDesk" 
                                Margin="0,0,10,0" Color="#C71D23"/>
 
 

+ 17 - 9
Control/Windows/UpdateWindow.xaml

@@ -22,16 +22,24 @@
             <StackPanel HorizontalAlignment="Center">
                 <hc:Card BorderThickness="0" Effect="{DynamicResource EffectShadow2}" Margin="20,20,20,0">
                     <!--Card 的内容部分-->
-                    <Border CornerRadius="4,4,0,0" Height="260">
-                        <StackPanel>
-                            <TextBlock Margin="10" x:Name="MsgTitle" TextWrapping="Wrap" FontSize="16" HorizontalAlignment="Left" Style="{DynamicResource TextBlockLargeBold}" Text="测试"/>
-                            <StackPanel x:Name="MsgPanel">
-                                <hc:ScrollViewer x:Name="MsgBar"  HorizontalScrollBarVisibility="Visible"  IsInertiaEnabled="True" Margin="10" Width="430">
-                                    <TextBlock  Width="430" FontSize="15" LineHeight="22" x:Name="Msg" TextWrapping="Wrap" VerticalAlignment="Center" Text="测试"/>
+                        <Border CornerRadius="4,4,0,0">
+                            <StackPanel>
+                            <hc:SimplePanel VerticalAlignment="Center">
+                                <TextBlock Margin="10" x:Name="MsgTitle" TextWrapping="Wrap" FontSize="16" HorizontalAlignment="Left" Style="{DynamicResource TextBlockLargeBold}" Text="测试"/>
+                                <Button HorizontalAlignment="Right" Margin="0,0,10,0" 
+                                        Content="去点个Star" Click="StarBtnClick" 
+                                        Style="{StaticResource Btn1}"
+                                        hc:IconElement.Geometry="M718.565517 863.126069c-7.344552 0-15.077517-2.189241-22.987034-6.285241L512 760.337655l-183.613793 96.503173c-18.785103 9.851586-37.499586 7.521103-48.16331-5.12-5.12-6.10869-10.557793-17.125517-7.485794-35.345656l35.063173-204.411586L159.249655 467.155862c-12.747034-12.393931-17.584552-27.153655-13.241379-40.430345 4.343172-13.312 16.913655-22.386759 34.568827-24.929103l205.223725-29.837242 91.806896-185.979586c7.874207-15.995586 20.409379-25.140966 34.392276-25.140965 13.947586 0 26.482759 9.145379 34.392276 25.140965l91.771586 185.979586 205.259035 29.837242c17.619862 2.577655 30.190345 11.652414 34.498206 24.964414 4.378483 13.27669-0.529655 28.001103-13.241379 40.430344l-148.51531 144.807725 35.063172 204.411586c3.10731 18.149517-2.365793 29.272276-7.485793 35.345655a32.273655 32.273655 0 0 1-25.176276 11.369931z"
+                                        />
+                            </hc:SimplePanel>
+                                <hc:Divider LineStrokeDashArray="3,3" LineStroke="Black" Margin="20,0,20,0"/>
+                                <hc:ScrollViewer BorderThickness="0" Margin="0,5,1,5" Height="225">
+                                    <StackPanel x:Name="MsgPanel">
+                                            <TextBlock  Width="430" FontSize="15" LineHeight="25" x:Name="Msg" TextWrapping="Wrap" VerticalAlignment="Center" Text="测试"/>
+                                    </StackPanel>
                                 </hc:ScrollViewer>
                             </StackPanel>
-                        </StackPanel>
-                    </Border>
+                        </Border>
                     <!--Card 的尾部部分-->
                     <hc:Card.Footer>
                         <StackPanel Margin="10" Width="520">
@@ -47,7 +55,7 @@
                     </hc:Card.Footer>
                 </hc:Card>
                 <hc:UniformSpacingPanel Spacing="100" HorizontalAlignment="Center" Margin="0,10,0,0">
-                    <Button Content="暂不更新" Click="Close_Click" />
+                    <Button Content="暂不更新" Click="Close_Click" Style="{StaticResource Btn1}"/>
                     <Button Content="前往更新" Click="Confirm_Click" Style="{StaticResource Btn1}"/>
                 </hc:UniformSpacingPanel>
             </StackPanel>

+ 61 - 1
Control/Windows/UpdateWindow.xaml.cs

@@ -6,6 +6,7 @@ using Newtonsoft.Json.Linq;
 using System;
 using System.Configuration;
 using System.Diagnostics;
+using System.Net;
 using System.Windows;
 using System.Windows.Input;
 
@@ -82,7 +83,11 @@ namespace GeekDesk.Control.Windows
                     packageUrl = giteeUrl;
                     break;
             }
-            Process.Start(packageUrl);
+            Process.Start(new ProcessStartInfo("cmd", $"/c start {packageUrl}")
+            {
+                UseShellExecute = false,
+                CreateNoWindow = true
+            });
             this.Close();
         }
 
@@ -94,6 +99,7 @@ namespace GeekDesk.Control.Windows
                 window = new UpdateWindow(jo);
             }
             window.Show();
+            window.Activate();
             Keyboard.Focus(window);
         }
 
@@ -105,5 +111,59 @@ namespace GeekDesk.Control.Windows
                 this.Close();
             }
         }
+
+        private void StarBtnClick(object sender, RoutedEventArgs e)
+        {
+
+            string githubUrl = ConfigurationManager.AppSettings["GitHubUrl"];
+            string giteeUrl = ConfigurationManager.AppSettings["GiteeUrl"];
+
+            if(!ReqGitUrl(githubUrl))
+            {
+                if (!ReqGitUrl(giteeUrl))
+                {
+                    OpenLinkUrl(githubUrl);
+                } else
+                {
+                    OpenLinkUrl(giteeUrl);
+                }
+            } else
+            {
+                OpenLinkUrl(githubUrl);
+            }
+        }
+
+
+        private bool ReqGitUrl(String url)
+        {
+            HttpWebResponse myResponse = null;
+            try
+            {
+                ServicePointManager.Expect100Continue = true;
+                ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
+                //创建Web访问对  象
+                WebRequest myRequest = WebRequest.Create(url);
+
+                myRequest.ContentType = "text/plain; charset=utf-8";
+                //通过Web访问对象获取响应内容
+                myResponse = (HttpWebResponse)myRequest.GetResponse();
+            }
+            catch 
+            {
+                return false;
+            }
+
+            return myResponse != null && myResponse.StatusCode == HttpStatusCode.OK;
+        }
+
+        private void OpenLinkUrl(String url)
+        {
+            Process.Start(new ProcessStartInfo("cmd", $"/c start {url}")
+            {
+                UseShellExecute = false,
+                CreateNoWindow = true
+            });
+        }
+
     }
 }

+ 5 - 0
GeekDesk.csproj

@@ -473,4 +473,9 @@
     </BootstrapperPackage>
   </ItemGroup>
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+  <ProjectExtensions>
+    <VisualStudio>
+      <UserProperties update_1json__JsonSchema="https://typedoc.org/schema.json" />
+    </VisualStudio>
+  </ProjectExtensions>
 </Project>

+ 1 - 1
Properties/AssemblyInfo.cs

@@ -8,7 +8,7 @@ using System.Windows;
 [assembly: AssemblyTitle("GeekDesk")]
 [assembly: AssemblyDescription("小巧、美观的桌面快速启动工具")]
 [assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("Demo-Liu")]
+[assembly: AssemblyCompany("BookerLiu")]
 [assembly: AssemblyProduct("GeekDesk")]
 [assembly: AssemblyCopyright("Copyright ©  2021")]
 [assembly: AssemblyTrademark("")]

+ 4 - 4
Update.json

@@ -1,9 +1,9 @@
 {
 	"title": "GeekDesk版本更新",
-	"subTitle": "V2.4.14",
+	"subTitle": "V2.4.15",
 	"msgTitle": "本次更新内容如下",
-	"msg": "['这次更新间隔比较久, 一个是工作比较忙, 另一个是因为老毛病颈椎病犯了, 但新版本总归是来了','增加图标排序功能','增加鼠标悬停切换菜单','增加搜索功能,显示界面后按下Ctrl+F','其它已知问题修复','老规矩兄弟萌, 我用爱发电, 你们点免费Star']",
+	"msg": "['PS:又一次的更新, 虽然还有很多需求没有完成, 但仍然耗费了我大量的精力, 没有点Star的兄弟萌, 求个免费Star(GitHub国内某些用户可能进不去), 再给我一点更新的动力!','增加纯色/渐变色背景','增加/优化拾色器功能','增加主面板Logo开关','优化待办任务,现在待办任务快捷键不再是新建待办窗口','增加鼠标滚轮切换菜单功能(需要鼠标指针在菜单栏)','优化搜索功能,增加 快捷键搜索/按键即搜 可选操作','优化贴边隐藏动画, 纵享丝滑了属于是兄弟萌', '其它已知问题修复']",
 	"githubUrl": "https://github.com/Demo-Liu/GeekDesk/releases",
-	"giteeUrl": "https://gitee.com/demo_liu/GeekDesk/releases",
-	"version": "2.4.14"
+	"giteeUrl": "https://gitee.com/BookerLiu/GeekDesk/releases",
+	"version": "2.4.15"
 }