| | |
| | | using System.Windows; |
| | | using System.Windows.Controls; |
| | | using SolidWorks.Interop.swconst; |
| | | using PdmSwPlugin.Common.Setting; |
| | | using System.Threading.Tasks; |
| | | using PdmSwPlugin.Common.Util.Http; |
| | | using System.Collections.Generic; |
| | | |
| | | namespace PdmSwPlugin.Main |
| | | { |
| | |
| | | this.logout = logout; |
| | | InitializeComponent(); |
| | | userLabel.Content = $"欢迎您,{PdmUser.LoginUser?.realname}"; |
| | | configLabel.Content = CustomerSetting.Instance["historyFlag"]; |
| | | } |
| | | |
| | | private SldWorks swApp; |
| | |
| | | logout(); |
| | | } |
| | | } |
| | | |
| | | private void Refresh_Click(object sender, RoutedEventArgs e) |
| | | { |
| | | configLabel.Content = "刷新中..."; |
| | | Task.Run(() => |
| | | { |
| | | try |
| | | { |
| | | Result<Dictionary<string, string>> res = HttpClientCreator.PostSyncAction<Dictionary<string, string>>("openApi/wpf/refreshConfig", null); |
| | | Dictionary<string, string> setting = res.HandleResult(); |
| | | CustomerSetting.Set(setting); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | |
| | | } |
| | | finally |
| | | { |
| | | Dispatcher.Invoke(() => |
| | | { |
| | | configLabel.Content = CustomerSetting.Instance["historyFlag"]; |
| | | }); |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | } |