chr
2024-10-09 1f645778ae80a3a8801b8bb4d0fcf8feb244ad43
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
using PdmSwPlugin.Common.Entity.System;
using PdmSwPlugin.Common.Interface;
using SolidWorks.Interop.sldworks;
using System;
using System.Windows;
using System.Windows.Controls;
using SolidWorks.Interop.swconst;
 
namespace PdmSwPlugin.Main
{
    /// <summary>
    /// MainTab.xaml 的交互逻辑
    /// </summary>
    public partial class MainTab : UserControl, ISwAppSetter
    {
        private Action logout;
        public MainTab(Action logout)
        {
            this.logout = logout;
            InitializeComponent();
            userLabel.Content = $"欢迎您,{PdmUser.LoginUser?.realname}";
        }
 
        private SldWorks swApp;
        public SldWorks SwApp => swApp;
 
        public void SetSwApp(SldWorks SwApp)
        {
            this.swApp = SwApp;
        }
 
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            if (SwApp.SendMsgToUser2("确定退出登录吗?", (int)swMessageBoxIcon_e.swMbWarning,
                (int)swMessageBoxBtn_e.swMbYesNo) == (int)swMessageBoxResult_e.swMbHitYes)
            {
                logout();
            }
        }
    }
}