public bool Login(ExtendedApplicationBase app)
        {
            LoginWindow login        = new LoginWindow(app);
            var         dialogResult = login.ShowDialog();

            return(dialogResult.HasValue && dialogResult.Value);
        }
Esempio n. 2
0
 protected override bool OnStartup(StartupEventArgs e)
 {
     _app = new ExtendedApplication();
     ExtendedApplicationBase.Current = _app;
     _app.Run();
     return(false);
 }
Esempio n. 3
0
        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);
        }
Esempio n. 5
0
        public bool Login(ExtendedApplicationBase app)
        {
            LoginWindow login = new LoginWindow();

            login.ShowDialog();

            return(true);
        }
Esempio n. 6
0
        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);
        }
Esempio n. 8
0
        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);
        }
Esempio n. 9
0
        public bool Login(ExtendedApplicationBase app)
        {
            var loginWindow = new LoginWindow(app);
            var result      = loginWindow.ShowDialog();

            if (result.HasValue && result.Value)
            {
                return(true);
            }

            return(false);
        }
Esempio n. 10
0
        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);
        }
Esempio n. 11
0
 public void LoginFailed(ExtendedApplicationBase app, object message)
 {
     MessageBoxHelper.Info("Tips", message);
 }
Esempio n. 12
0
 public void LoginSuccessed(ExtendedApplicationBase app, object message)
 {
 }
Esempio n. 13
0
 public LoginWindow(ExtendedApplicationBase app)
 {
     InitializeComponent();
     this._app = app;
 }
Esempio n. 14
0
 public void LoginSuccessed(ExtendedApplicationBase app, object message)
 {
     throw new NotImplementedException();
 }
Esempio n. 15
0
        public void Login(ExtendedApplicationBase app)
        {
            LoginWindow loginWindow = new LoginWindow();

            loginWindow.ShowDialog();
        }
Esempio n. 16
0
 public bool UnLoading(ExtendedApplicationBase app, string name)
 {
     throw new NotImplementedException();
 }
Esempio n. 17
0
 public void LoginFailed(ExtendedApplicationBase app, object message)
 {
     MessageBox.Show(message.ToString());
 }
Esempio n. 18
0
 public bool Loaded(ExtendedApplicationBase app, string name)
 {
     return(true);
 }