private void notifyMessage(NotifyEventArgs notifyEventArgs) { switch (notifyEventArgs.EventData) { case "Domain-Up": { if ( !isConnecting && serverInfo == null ) { isConnecting = true; try { DomainInformation domainInfo = simiasWebService.GetDomainInformation(notifyEventArgs.Message); Connecting connecting = new Connecting( this.ifWebService, simiasWebService, simiasManager, domainInfo ); connecting.StartPosition = FormStartPosition.CenterScreen; if ( connecting.ShowDialog() != DialogResult.OK ) { serverInfo = new ServerInfo(this.ifWebService, simiasManager, domainInfo, connecting.Password); serverInfo.Closed += new EventHandler(serverInfo_Closed); serverInfo.Show(); ShellNotifyIcon.SetForegroundWindow(serverInfo.Handle); } else { try { bool update = CheckForClientUpdate(domainInfo.ID); if (update) { ShutdownTrayApp(null); } } catch { } domainInfo.Authenticated = true; preferences.UpdateDomainStatus(new Domain(domainInfo)); globalProperties.AddDomainToUIList(domainInfo); globalProperties.updateifListViewDomainStatus(domainInfo.ID, true); } } catch (Exception ex) { MessageBox.Show(string.Format("Exception here: {0}--{1}", ex.Message, ex.StackTrace)); } isConnecting = false; } break; } } }
public bool loginToDomain(Domain domain) { bool result = false; if (domain != null) { Connecting connecting = new Connecting(this.ifWebService, simiasWebService, simiasManager, domain.DomainInfo); if (connecting.ShowDialog() == DialogResult.OK) { result = true; } if (!result) { ServerInfo serverInfo = new ServerInfo(this.ifWebService, simiasManager, domain.DomainInfo, connecting.Password); serverInfo.ShowDialog(); result = serverInfo.DomainInfo.Authenticated; serverInfo.Dispose(); } connecting.Dispose(); } if (result) { domain.DomainInfo.Authenticated = true; FormsTrayApp.globalProp().updateifListViewDomainStatus(domain.DomainInfo.ID, true); FormsTrayApp.globalProp().AddDomainToUIList(domain.DomainInfo); FormsTrayApp.globalProp().UpdateiFolderStatus(domain.DomainInfo.Authenticated, domain.DomainInfo.ID); } return result; }
private bool login(int itemIndex) { bool result = false; ListViewItem lvi = accounts.Items[itemIndex]; Domain domain = (Domain)lvi.Tag; if (domain != null) { Connecting connecting = new Connecting(this.ifWebService, simiasWebService, simiasManager, domain.DomainInfo); if (connecting.ShowDialog() == DialogResult.OK) { result = true; } if (!result) { ServerInfo serverInfo = new ServerInfo(this.ifWebService, simiasManager, domain.DomainInfo, connecting.Password); serverInfo.ShowDialog(); result = serverInfo.DomainInfo.Authenticated; serverInfo.Dispose(); } connecting.Dispose(); } if (result) { domain.DomainInfo.Authenticated = true; FormsTrayApp.globalProp().updateifListViewDomainStatus(domain.DomainInfo.ID, true); FormsTrayApp.globalProp().AddDomainToUIList(domain.DomainInfo); lvi.Tag = domain; } return result; }
private bool authenticate() { bool result = false; Connecting connecting = new Connecting( this.ifWebService, simiasWebService, simiasManager, domainInfo, password.Text, rememberPassword.Checked ); if ( connecting.ShowDialog() == DialogResult.OK ) { result = true; } return result; }
public bool ConnectToServer() { bool result = false; Connecting connecting = new Connecting( this.ifWebService, simiasWebService, simiasManager, serverPage.ServerAddress, identityPage.Username, identityPage.Password, serverPage.DefaultServer, identityPage.RememberPassword ); connecting.EnterpriseConnect += new Novell.FormsTrayApp.Connecting.EnterpriseConnectDelegate(connecting_EnterpriseConnect); if ( connecting.ShowDialog() == DialogResult.OK ) { result = true; domainInfo = connecting.DomainInformation; this.defaultiFolderPage.DomainInfo = this.domainInfo; this.defaultiFolderPage.defaultPath = this.GetDefaultPath(this.identityPage.Username, this.defaultiFolderPage.DomainInfo.Name); this.defaultiFolderPage.defaultPath += "\\" + Resource.GetString("DefaultDirName") + "_" + this.identityPage.Username; Novell.FormsTrayApp.FormsTrayApp.globalProp().updateifListViewDomainStatus(domainInfo.ID, domainInfo.Authenticated); if (true == domainInfo.Authenticated) { Novell.FormsTrayApp.FormsTrayApp.globalProp().AddDomainToUIList(domainInfo); } } return result; }
private void ShowWaitDialog() { waitWindow = new Connecting(); waitWindow.ShowDialog(); }