public bool Login(ExtendedApplicationBase app) { LoginWindow login = new LoginWindow(app); var dialogResult = login.ShowDialog(); return(dialogResult.HasValue && dialogResult.Value); }
protected override bool OnStartup(StartupEventArgs e) { _app = new ExtendedApplication(); ExtendedApplicationBase.Current = _app; _app.Run(); return(false); }
public bool Authenticate(ExtendedApplicationBase app) { AuthenticationWindow loadingWindow = new AuthenticationWindow(); loadingWindow.Show(); var account = app.Properties[app.PROPERTY_ACCOUNT]; var password = app.Properties[app.PROPERTY_PASSWORD]; if (account == null || password == null) { loadingWindow.Close(); return(false); } if (Authenticate(account.ToString(), password.ToString())) { //1. 获取用户信息 UserWorkRequest request = new UserWorkRequest(); var identity = new Identity(account.ToString(), true); app.Context.User = new Principal(request, identity); Thread.Sleep(5000); loadingWindow.Close(); return(true); } loadingWindow.Close(); return(false); }
public bool Authenticate(ExtendedApplicationBase app) { var account = app.Data[app.PROPERTY_ACCOUNT]; var password = app.Data[app.PROPERTY_PASSWORD]; if (account == null || password == null) { return(false); } using (var work = new UnitOfWork()) { var user = work.UserRepository.GetUserByName(account.ToString()); if (user != null && user.Password == password.ToString()) { UserWorkRequest request = new UserWorkRequest(); var identity = new Identity(account.ToString(), true); app.Context.User = new Principal(request, identity); return(true); } } return(false); }
public bool Login(ExtendedApplicationBase app) { LoginWindow login = new LoginWindow(); login.ShowDialog(); return(true); }
public void Execute(ExtendedApplicationBase app) { var mainWindow = new DockingMainWindow(); app.MainWindow = mainWindow; mainWindow.ShowDialog(); app.ExitEx(); }
public bool Loading(ExtendedApplicationBase app, string name) { var resource = new ResourceDictionary() { Source = new Uri("pack://application:,,,/HeaviSoft.Documentor.Theme;component/Themes/Generic.xaml") }; app.Resources.MergedDictionaries.Add(resource); return(true); }
public bool Loading(ExtendedApplicationBase app, string name) { ResourceDictionary resource = new ResourceDictionary() { Source = new Uri("pack://application:,,,/HeaviSoft.FrameworkBase.Theme;component/Themes/Generic.xaml") }; //(ResourceDictionary)Application.LoadComponent(new Uri("pack://application:,,,/HeaviSoft.FrameworkBase.Theme;component/Themes/Generic.xaml")); app.Resources.MergedDictionaries.Add(resource); return(true); }
public bool Login(ExtendedApplicationBase app) { var loginWindow = new LoginWindow(app); var result = loginWindow.ShowDialog(); if (result.HasValue && result.Value) { return(true); } return(false); }
public bool Login(ExtendedApplicationBase app) { var user = new User() { Name = "test", Password = EncryptHelper.DES3Encrypt("test") }; using (var unitOfWork = new UnitOfWork()) { if (unitOfWork.UserRepository.GetUserByName(user.Name) == null) { unitOfWork.UserRepository.Add(user); } } return(true); }
public void LoginFailed(ExtendedApplicationBase app, object message) { MessageBoxHelper.Info("Tips", message); }
public void LoginSuccessed(ExtendedApplicationBase app, object message) { }
public LoginWindow(ExtendedApplicationBase app) { InitializeComponent(); this._app = app; }
public void LoginSuccessed(ExtendedApplicationBase app, object message) { throw new NotImplementedException(); }
public void Login(ExtendedApplicationBase app) { LoginWindow loginWindow = new LoginWindow(); loginWindow.ShowDialog(); }
public bool UnLoading(ExtendedApplicationBase app, string name) { throw new NotImplementedException(); }
public void LoginFailed(ExtendedApplicationBase app, object message) { MessageBox.Show(message.ToString()); }
public bool Loaded(ExtendedApplicationBase app, string name) { return(true); }