private LoginInfo PromptUserForLogin(string serverName, string password) { global::Controls.LoadingDialog.HideDialog(); Forms.LoginForm loginForm = new CallButler.Manager.Forms.LoginForm(); // Populate our recent servers list //if (Properties.Settings.Default.RecentServers != null) //{ string[] recentServers = new string[Properties.Settings.Default.RecentServers.Count]; Properties.Settings.Default.RecentServers.CopyTo(recentServers, 0); loginForm.RecentServers = recentServers; //} loginForm.ServerName = serverName; if (password != null && password.Length > 0) { loginForm.Password = password; loginForm.SavePassword = true; } if (loginForm.ShowDialog(this) == DialogResult.OK) { LoginInfo loginInfo = new LoginInfo(); loginInfo.Port = Properties.Settings.Default.TcpManagementPort; if (loginForm.ServerName != null) { string[] serverParams = loginForm.ServerName.Split(':'); if (serverParams.Length > 1) { int.TryParse(serverParams[1], out loginInfo.Port); } loginInfo.Server = serverParams[0]; } loginInfo.Password = loginForm.Password; loginInfo.SavePassword = loginForm.SavePassword; return(loginInfo); } return(null); }
public MainForm() { InitializeComponent(); System.Reflection.Assembly a = System.Reflection.Assembly.GetExecutingAssembly(); Version appVersion = a.GetName().Version; string appVersionString = appVersion.ToString(); if (Properties.Settings.Default.ApplicationVersion != appVersion.ToString()) { Properties.Settings.Default.Upgrade(); Properties.Settings.Default.ApplicationVersion = appVersionString; Properties.Settings.Default.Save(); } if (Properties.Settings.Default.ManagementInterfaceType == WOSI.CallButler.ManagementInterface.CallButlerManagementInterfaceType.Hosted) { Forms.LoginForm loginForm = new CallButler.Manager.Forms.LoginForm(); if (loginForm.ShowDialog(this) != DialogResult.OK) { Environment.Exit(0); } } RemotingExceptionManager.RemoteManagementError += new EventHandler(RemotingExceptionManager_RemoteManagementError); RemotingExceptionManager.ConnectionError += new EventHandler(RemotingExceptionManager_ConnectionError); RemotingExceptionManager.AuthenticationError += new EventHandler(RemotingExceptionManager_AuthenticationError); WOSI.Utilities.TimeZoneInfo[] tzInfo = WOSI.Utilities.TimeUtils.GetSystemTimeZones(); // Load our plugins PluginManager.LoadPlugins(WOSI.Utilities.FileUtils.GetApplicationRelativePath(Properties.Settings.Default.PluginsPath)); global::Controls.LoadingDialog.HideDialog(); InitializeUI(); ProcessLogin(Properties.Settings.Default.CallButlerServer, false); this.BringToFront(); }
public MainForm() { InitializeComponent(); System.Reflection.Assembly a = System.Reflection.Assembly.GetExecutingAssembly(); Version appVersion = a.GetName().Version; string appVersionString = appVersion.ToString(); if (Properties.Settings.Default.ApplicationVersion != appVersion.ToString()) { Properties.Settings.Default.Upgrade(); Properties.Settings.Default.ApplicationVersion = appVersionString; Properties.Settings.Default.Save(); } if (Properties.Settings.Default.ManagementInterfaceType == WOSI.CallButler.ManagementInterface.CallButlerManagementInterfaceType.Hosted) { Forms.LoginForm loginForm = new CallButler.Manager.Forms.LoginForm(); if (loginForm.ShowDialog(this) != DialogResult.OK) { Environment.Exit(0); } } RemotingExceptionManager.RemoteManagementError += new EventHandler(RemotingExceptionManager_RemoteManagementError); RemotingExceptionManager.ConnectionError += new EventHandler(RemotingExceptionManager_ConnectionError); RemotingExceptionManager.AuthenticationError += new EventHandler(RemotingExceptionManager_AuthenticationError); WOSI.Utilities.TimeZoneInfo[] tzInfo = WOSI.Utilities.TimeUtils.GetSystemTimeZones(); // Load our plugins PluginManager.LoadPlugins(WOSI.Utilities.FileUtils.GetApplicationRelativePath(Properties.Settings.Default.PluginsPath)); global::Controls.LoadingDialog.HideDialog(); InitializeUI(); ProcessLogin(Properties.Settings.Default.CallButlerServer, false); this.BringToFront(); }
private LoginInfo PromptUserForLogin(string serverName, string password) { global::Controls.LoadingDialog.HideDialog(); Forms.LoginForm loginForm = new CallButler.Manager.Forms.LoginForm(); // Populate our recent servers list //if (Properties.Settings.Default.RecentServers != null) //{ string[] recentServers = new string[Properties.Settings.Default.RecentServers.Count]; Properties.Settings.Default.RecentServers.CopyTo(recentServers, 0); loginForm.RecentServers = recentServers; //} loginForm.ServerName = serverName; if (password != null && password.Length > 0) { loginForm.Password = password; loginForm.SavePassword = true; } if (loginForm.ShowDialog(this) == DialogResult.OK) { LoginInfo loginInfo = new LoginInfo(); loginInfo.Port = Properties.Settings.Default.TcpManagementPort; if (loginForm.ServerName != null) { string[] serverParams = loginForm.ServerName.Split(':'); if (serverParams.Length > 1) { int.TryParse(serverParams[1], out loginInfo.Port); } loginInfo.Server = serverParams[0]; } loginInfo.Password = loginForm.Password; loginInfo.SavePassword = loginForm.SavePassword; return loginInfo; } return null; }