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();
|
}
|
}
|
}
|
}
|