private void NewSession() { try { var defaultsessionfile = Path.Combine(Core.Classes.Settings.SessionFolder, "Default.xml"); var session = new PhotoSession(); // copy session with default name if (File.Exists(defaultsessionfile)) { session = ServiceProvider.Settings.LoadSession(defaultsessionfile); session.Files.Clear(); } var editSession = new EditSession(session); editSession.Owner = ServiceProvider.PluginManager.SelectedWindow as Window; ServiceProvider.Settings.ApplyTheme(editSession); if (editSession.ShowDialog() == true) { ServiceProvider.Settings.Add(editSession.Session); ServiceProvider.Settings.DefaultSession = editSession.Session; } } catch (Exception ex) { Log.Error("Error create session ", ex); ServiceProvider.WindowsManager.ExecuteCommand(WindowsCmdConsts.MainWnd_Message, "Error create session " + ex.Message); } }
private void LoginButton_MouseDown(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Right) { EditSession form = new EditSession(); form.ShowDialog(); RefreshUserData(); } else if (e.Button == MouseButtons.Left) { if (!User.islogin) { UI.BLoginForm loginForm = new UI.BLoginForm { StartPosition = FormStartPosition.CenterScreen }; loginForm.Show(); loginForm.Login(); } else if (Environment.OSVersion.Platform == PlatformID.Win32NT) { UserInfoForm uf = new UserInfoForm(); uf.ShowDialog(); } else { QRLogin form = new QRLogin(); form.ShowDialog(); RefreshUserData(); } } }
private void EditSession() { try { EditSession editSession = new EditSession(ServiceProvider.Settings.DefaultSession); editSession.Owner = ServiceProvider.PluginManager.SelectedWindow as Window; editSession.ShowDialog(); ServiceProvider.Settings.Save(ServiceProvider.Settings.DefaultSession); } catch (Exception ex) { Log.Error("Error refresh session ", ex); ServiceProvider.WindowsManager.ExecuteCommand(WindowsCmdConsts.MainWnd_Message, ex.Message); } }