Browse Source

:technologist: 配置文件控制公众号显示

liufei 3 years ago
parent
commit
cbaeb71a0c

+ 1 - 0
App.config

@@ -62,6 +62,7 @@
 	  <!--<add key="GiteeUpdateUrl" value="file:///D:/WorkSpace/workspace-VS/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">

+ 6 - 3
Control/UserControls/Config/AboutControl.xaml

@@ -32,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>

+ 9 - 0
Control/UserControls/Config/AboutControl.xaml.cs

@@ -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);