public Connecting( iFolderWebService ifws, SimiasWebService simiasWebService, Manager simiasManager, DomainInformation domainInfo, string password, bool rememberPassword ) : this(ifws, simiasWebService, simiasManager, domainInfo, password) { this.updatePasswordPreference = true; this.rememberPassword = rememberPassword; this.autoAccountEnabled = false; }
public ServerDetails(SimiasWebService simiasWebService, iFolderWebService ifolderWebService, Domain domain) { InitializeComponent(); this.simiasWebService = simiasWebService; ifWebService = ifolderWebService; this.domain = domain; }
public SinglePageWizard(iFolderWebService ifws, SimiasWebService simws) { InitializeComponent(); this.ifWebService = ifws; this.simiasWebService = simws; SinglePageWizard.log = iFolderLogManager.GetLogger(typeof(SinglePageWizard)); }
public ResetPassphrase(SimiasWebService simws, iFolderWebService ifws) { InitializeComponent(); this.simws = simws; this.ifws = ifws; GetLoggedInDomains(); }
public EnterPassphrasePage(iFolderWebService ifws, SimiasWebService simws, Manager simiasManager) { InitializeComponent(); this.simiasWebService = simws; this.ifolderWebService = ifws; this.simiasManager = simiasManager; }
public MigrationWindow(iFolderWebService ifWebService, SimiasWebService simiasWebService) { windowActive = false; this.ifWebService = ifWebService; this.simiasWebService = simiasWebService; InitializeComponent(); }
public DefaultiFolderPage(iFolderWebService ifws, SimiasWebService simws, DomainInformation domainInfo ) { this.resManager = new System.Resources.ResourceManager(typeof(Novell.FormsTrayApp.FormsTrayApp)); InitializeComponent(); this.simws = simws; this.domainInfo = domainInfo; this.ifws = ifws; }
public Connecting( iFolderWebService ifws, SimiasWebService simiasWebService, Manager simiasManager, string server, string user, string password, bool defaultServer, bool rememberPassword ) : this(ifws, simiasWebService, simiasManager, password) { UriBuilder UriSchemeForServer = new UriBuilder(server); this.server = UriSchemeForServer.Uri.Authority; this.user = user; this.defaultServer = defaultServer; this.rememberPassword = rememberPassword; this.autoAccountEnabled = false; }
public iFolderComponent() { try { connectToWebService(); } catch (WebException e) { ifWebService = null; if (e.Status == WebExceptionStatus.ProtocolError) { LocalService.ClearCredentials(); } } catch { } }
public ServerInfo(iFolderWebService ifws, Manager simiasManager, DomainInformation domainInfo, string password) { InitializeComponent(); this.domainInfo = domainInfo; this.simiasManager = simiasManager; this.ifWebService = ifws; if (password != null) { this.password.Text = password; rememberPassword.Checked = true; } int delta = calculateSize(serverLabel2, 0); delta = calculateSize(userLabel2, delta); delta = calculateSize(passwordLabel2, delta); if (delta > 0) { serverLabel2.Width = userLabel2.Width = passwordLabel2.Width += delta; int temp = serverName.Left; serverName.Left = userName.Left = this.password.Left = rememberPassword.Left = serverLabel2.Left + serverLabel2.Width; serverName.Width = userName.Width = this.password.Width = rememberPassword.Width -= serverName.Left - temp; } }
public Connecting( iFolderWebService ifws, SimiasWebService simiasWebService, Manager simiasManager, string server, string user, string password, bool defaultServer, bool rememberPassword ) : this(ifws, simiasWebService, simiasManager, password) { server = server.Trim(); if(!server.StartsWith("http")) { server = string.Format("https://{0}",server); } UriBuilder UriSchemeForServer = new UriBuilder(server); string serverName = UriSchemeForServer.Uri.Authority; if (UriSchemeForServer.Scheme != Uri.UriSchemeHttps) { UriSchemeForServer.Scheme = Uri.UriSchemeHttps; } if (UriSchemeForServer.Port == 80) { UriSchemeForServer.Port = 443; } this.server = UriSchemeForServer.ToString(); this.user = user; this.defaultServer = defaultServer; this.rememberPassword = rememberPassword; this.autoAccountEnabled = false; }
public ExportKeyPage(iFolderWebService ifws, SimiasWebService simws) { InitializeComponent(); this.simiasWebService = simws; this.ifWebService = ifws; }
public Connecting(iFolderWebService ifws, SimiasWebService simiasWebService, Manager simiasManager, DomainInformation domainInfo) : this(ifws, simiasWebService, simiasManager, domainInfo, null) { this.autoAccountEnabled = false; }
public SinglePageWizard(iFolderWebService ifws, SimiasWebService simws) { InitializeComponent(); this.ifWebService = ifws; this.simiasWebService = simws; }
public Connecting( iFolderWebService ifws, SimiasWebService simiasWebService, Manager simiasManager, DomainInformation domainInfo, string password ) : this(ifws, simiasWebService, simiasManager, password) { this.domainInfo = domainInfo; this.autoAccountEnabled = false; }
private void FormsTrayApp_Load(object sender, System.EventArgs e) { if (shutdown) { this.Close(); } else { try { if (!Preferences.HideiFolderInTray) { ShowStartupScreen(); } Environment.CurrentDirectory = Application.StartupPath; for (int i = 0; i < 3; i++) { Process[] processArray = Process.GetProcessesByName("simias"); foreach (Process proc in processArray) { if (proc != null) { simiasManager.Stop(); } } } ifWebService = null; simiasWebService = null; eventQueue = new Queue(); workEvent = new AutoResetEvent(false); eventClient = new IProcEventClient(new IProcEventError(errorHandler), null); preferences = new Preferences(ifWebService, simiasWebService, simiasManager); preferences.EnterpriseConnect += new Novell.FormsTrayApp.Preferences.EnterpriseConnectDelegate(preferences_EnterpriseConnect); preferences.ChangeDefaultDomain += new Novell.FormsTrayApp.Preferences.ChangeDefaultDomainDelegate(preferences_EnterpriseConnect); preferences.RemoveDomain += new Novell.FormsTrayApp.Preferences.RemoveDomainDelegate(preferences_RemoveDomain); preferences.ShutdownTrayApp += new Novell.FormsTrayApp.Preferences.ShutdownTrayAppDelegate(preferences_ShutdownTrayApp); preferences.UpdateDomain += new Novell.FormsTrayApp.Preferences.UpdateDomainDelegate(preferences_UpdateDomain); preferences.DisplayiFolderDialog += new Novell.FormsTrayApp.Preferences.DisplayiFolderDialogDelegate(preferences_DisplayiFolderDialog); preferences.CreateControl(); IntPtr handle = preferences.Handle; syncLog = new SyncLog(); syncLog.CreateControl(); handle = syncLog.Handle; infolog = new SyncLog(); infolog.Customize(); globalProperties = new GlobalProperties(ifWebService, simiasWebService, eventClient); globalProperties.RemoveDomain += new Novell.FormsTrayApp.GlobalProperties.RemoveDomainDelegate(globalProperties_RemoveDomain); globalProperties.PreferenceDialog = preferences; globalProperties.SyncLogDialog = syncLog; globalProperties.CreateControl(); handle = globalProperties.Handle; if (RegularStart) { DelayedStart(); } else { try { LogInit(); } catch { } shellNotifyIcon.Text = resourceManager.GetString("iFolderServices"); shellNotifyIcon.Icon = trayIcon; SimiasTimer = new System.Windows.Forms.Timer(); SimiasTimer.Interval = 120000; SimiasTimer.Tick += new EventHandler(SimiasTimer_Tick); SimiasTimer.Start(); } } catch (Exception ex) { MessageBox.Show(string.Format("Exception: {0}--{1}", ex.Message, ex.StackTrace)); ShutdownTrayApp(ex); } finally { CloseStartupScreen(); } } }
public Preferences(iFolderWebService ifolderWebService, SimiasWebService simiasWebService, Manager simiasManager) { InitializeComponent(); defaultInterval.TextChanged += new EventHandler(defaultInterval_ValueChanged); ifWebService = ifolderWebService; this.simiasWebService = simiasWebService; this.simiasManager = simiasManager; { } int delta = calculateSize(label1, 0); if (delta > 0) { groupBox1.Height += 8 * (int)Math.Ceiling((float)delta / (float)label1.Width); } this.StartPosition = FormStartPosition.CenterScreen; }
public AccountWizard( iFolderWebService ifWebService, SimiasWebService simiasWebService, Manager simiasManager, bool firstAccount, Preferences prefs ) { this.simiasManager = simiasManager; this.simiasWebService = simiasWebService; this.ifWebService = ifWebService; this.prefs = prefs; InitializeComponent(); this.welcomePage = new WelcomePage(); this.serverPage = new ServerPage( firstAccount ); this.identityPage = new IdentityPage(); this.verifyPage = new VerifyPage( firstAccount ); this.completionPage = new CompletionPage(); this.defaultiFolderPage = new DefaultiFolderPage(this.ifWebService, this.simiasWebService, this.domainInfo); this.welcomePage.DescriptionText = Resource.GetString("WelcomePageDescription"); this.welcomePage.ActionText = Resource.GetString("WelcomePageAction"); this.welcomePage.Location = new System.Drawing.Point(0, 0); this.welcomePage.Name = Resource.GetString("WelcomePageName"); this.welcomePage.Size = new System.Drawing.Size(496, 304); this.welcomePage.TabIndex = 1; this.welcomePage.WelcomeTitle = Resource.GetString("WelcomePageTitle"); this.serverPage.HeaderTitle = Resource.GetString("ServerPageHeaderTitle"); this.serverPage.Location = new System.Drawing.Point(0, 0); this.serverPage.Name = Resource.GetString("ServerPageName"); this.serverPage.Size = new System.Drawing.Size(496, 304); this.serverPage.TabIndex = 1; this.identityPage.HeaderTitle = Resource.GetString("IdentityPageHeaderTitle"); this.identityPage.Location = new System.Drawing.Point(0, 0); this.identityPage.Name = Resource.GetString("IdentityPageName"); this.identityPage.Size = new System.Drawing.Size(496, 304); this.identityPage.TabIndex = 1; this.verifyPage.HeaderTitle = Resource.GetString("VerifyPageHeaderTitle"); this.verifyPage.Location = new System.Drawing.Point(0, 0); this.verifyPage.Name = Resource.GetString("VerifyPageName"); this.verifyPage.Size = new System.Drawing.Size(496, 304); this.verifyPage.TabIndex = 1; this.defaultiFolderPage.Name = "defaultiFolderPage"; this.defaultiFolderPage.Location = new System.Drawing.Point(0, 0); this.defaultiFolderPage.Size = new System.Drawing.Size(496, 304); this.defaultiFolderPage.HeaderTitle = Resource.GetString("DefaultiFolder"); this.completionPage.DescriptionText = Resource.GetString("CompletionPageDT"); this.completionPage.Location = new System.Drawing.Point(0, 0); this.completionPage.Name = "completionPage"; this.completionPage.Size = new System.Drawing.Size(496, 304); this.completionPage.TabIndex = 1; this.completionPage.WelcomeTitle = Resource.GetString("CompletionPageWT"); this.Controls.Add(this.welcomePage); this.Controls.Add(this.serverPage); this.Controls.Add(this.identityPage); this.Controls.Add(this.verifyPage); this.Controls.Add(this.defaultiFolderPage); this.Controls.Add(this.completionPage); try { this.Icon = new Icon(Path.Combine(Application.StartupPath, @"res\ifolder_16.ico")); } catch {} pages = new BaseWizardPage[maxPages]; pages[0] = this.welcomePage; pages[1] = this.serverPage; pages[2] = this.identityPage; pages[3] = this.verifyPage; pages[4] = this.defaultiFolderPage; pages[5] = this.completionPage; try { Image image = Image.FromFile(Path.Combine(Application.StartupPath, @"res\ifolder_account_wiz.png")); this.welcomePage.Watermark = image; this.completionPage.Watermark = image; image = Image.FromFile(Path.Combine(Application.StartupPath, @"res\ifolder-add-account48.png")); this.serverPage.Thumbnail = image; this.verifyPage.Thumbnail = image; this.identityPage.Thumbnail = image; this.defaultiFolderPage.Thumbnail = image; } catch {} foreach (BaseWizardPage page in pages) { page.Hide(); } pages[0].ActivatePage(0); }
public Connecting(iFolderWebService ifws, SimiasWebService simiasWebService, Manager simiasManager, string serv, string username, string pass, bool defAcct, bool remPass, bool certprompt) { this.simiasWebService = simiasWebService; this.simiasManager = simiasManager; this.ifWebService = ifws; UriBuilder UriSchemeForServer = new UriBuilder(serv); this.server = UriSchemeForServer.Host; this.user = username; this.defaultServer = defAcct; this.rememberPassword = remPass; this.password = pass; this.autoAccountEnabled = true; promptForInvalidCert = certprompt; displayMessageDelegate = new DisplayMessageDelegate(displayMessage); }
public DomainSelectionPage(iFolderWebService ifws, SimiasWebService simws) { InitializeComponent(); this.ifWebService = ifws; this.simiasWebService = simws; }
private Connecting( iFolderWebService ifws, SimiasWebService simiasWebService, Manager simiasManager, string password ) { this.simiasWebService = simiasWebService; this.simiasManager = simiasManager; this.password = password; this.ifWebService = ifws; displayMessageDelegate = new DisplayMessageDelegate( displayMessage ); connectDoneDelegate = new ConnectDoneDelegate( connectDone ); InitializeComponent(); }
public EnterPassphraseDialog(string domainID, SimiasWebService simws, iFolderWebService ifws) : this(domainID, simws) { this.ifws = ifws; }
public KeyRecoveryWizard(iFolderWebService ifWebService, SimiasWebService simiasWebService,Manager simiasManager) { this.simiasWebService = simiasWebService; this.ifWebService = ifWebService; this.simiasManager = simiasManager; InitializeComponent(); this.domainSelectionPage = new DomainSelectionPage(this.ifWebService,this.simiasWebService); this.enterPassphrasePage = new EnterPassphrasePage(this.ifWebService,this.simiasWebService,this.simiasManager); this.infoPage = new InfoPage(); this.selectionPage = new SelectionPage(); this.singleWizPage = new SinglePageWizard(this.ifWebService, this.simiasWebService); this.importKeyPage = new ImportKeyPage(this.ifWebService, this.simiasWebService); this.finalPage = new FinalPage(); this.exportKeyPage = new ExportKeyPage(this.ifWebService, this.simiasWebService); this.emailPage = new EmailPage(); this.domainSelectionPage.HeaderTitle = TrayApp.Properties.Resources.domainSelectionPageTitle; this.domainSelectionPage.Location = new System.Drawing.Point(0, 0); this.domainSelectionPage.Name = TrayApp.Properties.Resources.domainSelectionPageName; this.domainSelectionPage.Size = new System.Drawing.Size(496, 304); this.domainSelectionPage.TabIndex = 1; this.enterPassphrasePage.HeaderTitle = TrayApp.Properties.Resources.setNewPassphraseTitle; this.enterPassphrasePage.Location = new System.Drawing.Point(0, 0); this.enterPassphrasePage.Name = TrayApp.Properties.Resources.enterPassphrasePageName; this.enterPassphrasePage.Size = new System.Drawing.Size(496, 304); this.enterPassphrasePage.TabIndex = 1; this.infoPage.HeaderTitle = TrayApp.Properties.Resources.infoPageTitle; this.infoPage.Location = new System.Drawing.Point(0, 0); this.infoPage.Name = TrayApp.Properties.Resources.infoPageName; this.infoPage.Size = new System.Drawing.Size(496, 304); this.infoPage.TabIndex = 1; this.selectionPage.HeaderTitle = TrayApp.Properties.Resources.selectionPageTitle; this.selectionPage.Location = new System.Drawing.Point(0, 0); this.selectionPage.Name = TrayApp.Properties.Resources.selectionPageName; this.selectionPage.Size = new System.Drawing.Size(496, 304); this.selectionPage.TabIndex = 1; this.singleWizPage.HeaderTitle = TrayApp.Properties.Resources.setNewPassphraseTitle; this.singleWizPage.Location = new System.Drawing.Point(0, 0); this.singleWizPage.Name = TrayApp.Properties.Resources.singleWizPageName; this.singleWizPage.Size = new System.Drawing.Size(496, 304); this.singleWizPage.TabIndex = 1; this.importKeyPage.HeaderTitle = TrayApp.Properties.Resources.setNewPassphraseTitle; this.importKeyPage.Location = new System.Drawing.Point(0, 0); this.importKeyPage.Name = TrayApp.Properties.Resources.importPageName; this.importKeyPage.Size = new System.Drawing.Size(496, 304); this.importKeyPage.TabIndex = 1; this.finalPage.HeaderTitle = TrayApp.Properties.Resources.finalPageTitle; this.finalPage.Location = new System.Drawing.Point(0, 0); this.finalPage.Name = TrayApp.Properties.Resources.finalPageName; this.finalPage.Size = new System.Drawing.Size(496, 304); this.finalPage.TabIndex = 1; this.exportKeyPage.HeaderTitle = TrayApp.Properties.Resources.exportPageTitle; this.exportKeyPage.Location = new System.Drawing.Point(0, 0); this.exportKeyPage.Name = TrayApp.Properties.Resources.exportPageName; this.exportKeyPage.Size = new System.Drawing.Size(496, 304); this.exportKeyPage.TabIndex = 1; this.emailPage.HeaderTitle = TrayApp.Properties.Resources.emailPageTitle; this.emailPage.Location = new System.Drawing.Point(0, 0); this.emailPage.Name = TrayApp.Properties.Resources.emailPageName; this.emailPage.Size = new System.Drawing.Size(496, 304); this.emailPage.TabIndex = 1; this.Controls.Add(this.domainSelectionPage); this.Controls.Add(this.enterPassphrasePage); this.Controls.Add(this.infoPage); this.Controls.Add(this.selectionPage); this.Controls.Add(this.singleWizPage); this.Controls.Add(this.importKeyPage); this.Controls.Add(this.finalPage); this.Controls.Add(this.exportKeyPage); this.Controls.Add(this.emailPage); this.BackColor = System.Drawing.Color.Gainsboro; try { this.Icon = new Icon(Path.Combine(Application.StartupPath, @"res\ifolder_16.ico")); } catch { } pages = new BaseWizardPage[maxPages]; pages[0] = this.domainSelectionPage; pages[1] = this.enterPassphrasePage; pages[2] = this.infoPage; pages[3] = this.selectionPage; pages[4] = this.singleWizPage; pages[5] = this.importKeyPage; pages[6] = this.finalPage; pages[7] = this.exportKeyPage; pages[8] = this.emailPage; try { Image image = Image.FromFile(System.IO.Path.Combine(Application.StartupPath, @"res\ifolder48.png")); this.domainSelectionPage.Thumbnail = image; this.enterPassphrasePage.Thumbnail = image; this.infoPage.Thumbnail = image; this.selectionPage.Thumbnail = image; this.singleWizPage.Thumbnail = image; this.importKeyPage.Thumbnail = image; this.finalPage.Thumbnail = image; this.exportKeyPage.Thumbnail = image; this.emailPage.Thumbnail = image; } catch { } foreach (BaseWizardPage page in pages) { page.Hide(); } bool result = GetLoggedInDomains(); if(result == true) domainSelectionPage.ActivatePage(0); }
public static bool AdvancedConflictResolver(iFolderWebService ifWebService, iFolderWeb selectedItem) { const string assemblyName = @"lib\plugins\EnhancedConflictResolution.dll"; const string enhancedConflictResolverClass = "Novell.EnhancedConflictResolution.EnhancedConflictResolver"; const string showConflictResolverMethod = "Show"; System.Object[] args = new System.Object[3]; try { if (assemblyName != null) { Assembly idAssembly = Assembly.LoadFrom(assemblyName); if (idAssembly != null) { Type type = idAssembly.GetType(enhancedConflictResolverClass); if (null != type) { args[0] = ifWebService; args[1] = Application.StartupPath; args[2] = selectedItem; System.Object enhancedConflictResolver = Activator.CreateInstance(type, args); try { MethodInfo method = type.GetMethod(showConflictResolverMethod, Type.EmptyTypes); if (null != method) { method.Invoke(enhancedConflictResolver, null); return true; } } catch (Exception e) { FormsTrayApp.log.Info("Message {0}, type {1}, trace {2} ", e.Message, e.GetType(), e.StackTrace); } } } } } catch (Exception ex) { FormsTrayApp.log.Info("Message {0}, type {1}, trace {2} ", ex.Message, ex.GetType(), ex.StackTrace); } return false; }
public GlobalProperties(iFolderWebService ifolderWebService, SimiasWebService simiasWebService, IProcEventClient eventClient) { syncCollectionDelegate = new SyncCollectionDelegate(syncCollection); syncFileDelegate = new SyncFileDelegate(syncFile); createChangeEventDelegate = new CreateChangeEventDelegate(createChangeEvent); deleteEventDelegate = new DeleteEventDelegate(deleteEvent); addDomainToListDelegate = new AddDomainToListDelegate(AddDomainToList); refreshiFoldersDelegate = new RefreshiFoldersDelegate(refreshiFoldersInvoke); InitializeComponent(); MoreInitialization(); PluginEnhancedMenu(); infoMessage = new NoiFolderMessage(); panel2.Controls.Add(infoMessage); progressBar1.Visible = false; ifWebService = ifolderWebService; this.simiasWebService = simiasWebService; this.eventClient = eventClient; eventClient.SetEvent(IProcEventAction.AddCollectionSync, new IProcEventHandler(global_collectionSyncHandler)); eventClient.SetEvent(IProcEventAction.AddFileSync, new IProcEventHandler(global_fileSyncHandler)); updateEnterpriseTimer = new System.Timers.Timer(1000); updateEnterpriseTimer.AutoReset = false; updateEnterpriseTimer.Elapsed += new System.Timers.ElapsedEventHandler(updateEnterpriseTimer_Elapsed); ht = new Hashtable(); progressBar1.Minimum = 0; this.StartPosition = FormStartPosition.CenterScreen; try { this.Icon = new Icon(Path.Combine(Application.StartupPath, @"res\ifolder_16.ico")); largeImageList = new ImageList(); largeImageList.ImageSize = new Size(48, 48); largeImageList.ColorDepth = ColorDepth.Depth32Bit; largeImageList.TransparentColor = Color.Black; largeImageList.Images.Add(Bitmap.FromFile(Path.Combine(Application.StartupPath, @"res\ifolder48.png"))); largeImageList.Images.Add(Bitmap.FromFile(Path.Combine(Application.StartupPath, @"res\ifolder-sync48.png"))); largeImageList.Images.Add(Bitmap.FromFile(Path.Combine(Application.StartupPath, @"res\ifolder-download48.png"))); largeImageList.Images.Add(Bitmap.FromFile(Path.Combine(Application.StartupPath, @"res\ifolder-upload48.png"))); largeImageList.Images.Add(Bitmap.FromFile(Path.Combine(Application.StartupPath, @"res\ifolder-waiting48.png"))); largeImageList.Images.Add(Bitmap.FromFile(Path.Combine(Application.StartupPath, @"res\ifolder-conflict48.png"))); largeImageList.Images.Add(Bitmap.FromFile(Path.Combine(Application.StartupPath, @"res\ifolder-error48.png"))); largeImageList.Images.Add(Bitmap.FromFile(Path.Combine(Application.StartupPath, @"res\encrypt_ilock_48.gif"))); largeImageList.Images.Add(Bitmap.FromFile(Path.Combine(Application.StartupPath, @"res\ifolder_user_48.png"))); largeImageList.Images.Add(Bitmap.FromFile(Path.Combine(Application.StartupPath, @"res\ifolder-warning48.png"))); iFolderView.LargeImageList = largeImageList; } catch { } }
private void refreshData() { newOwnerLvi = null; int tmpSyncVal = 0; Cursor = Cursors.WaitCursor; updateDiskQuotaDisplay(); lastSync.Text = currentiFolder.LastSyncTime; syncInterval.Value = (decimal)currentiFolder.SyncInterval; autoSync.Checked = currentiFolder.SyncInterval != Timeout.Infinite; switch (currentiFolder.Role) { case "Master": syncUnits.Visible = autoSync.Visible = syncInterval.Visible = true; syncNow.Enabled = false; syncLabel.Text = resourceManager.GetString("syncLabel.Text"); break; case "Slave": syncUnits.Visible = autoSync.Visible = syncInterval.Visible = false; syncNow.Enabled = true; string units; if (currentiFolder.EffectiveSyncInterval <= 0) { try { tmpSyncVal = ifWebService.GetDefaultSyncInterval(); } catch { } } else { tmpSyncVal = currentiFolder.EffectiveSyncInterval; } decimal syncValue = ConvertSecondsToTimeUnit(tmpSyncVal, out units); syncLabel.Text = string.Format(resourceManager.GetString("slaveSyncInterval"), syncValue, resourceManager.GetString(units)); break; } try { SyncSize syncSize = ifWebService.CalculateSyncSize(currentiFolder.ID); objectCount.Text = syncSize.SyncNodeCount.ToString(); } catch { if (currentiFolder.Role.Equals("Master")) { objectCount.Text = "0"; } else { objectCount.Text = resourceManager.GetString("unknown"); } } shareWith.Items.Clear(); shareWith.BeginUpdate(); try { lock (subscrHT) { subscrHT.Clear(); } lock (userIDHT) { userIDHT.Clear(); } connectToWebService(); iFolderUser[] ifolderUsers = ifWebService.GetiFolderUsers(currentiFolder.ID); foreach (iFolderUser ifolderUser in ifolderUsers) { if (ifolderUser.UserID.Equals(currentiFolder.CurrentUserID)) { currentUser = ifolderUser; } ListViewItem lvitem = addiFolderUserToListView(ifolderUser); if (ifolderUser.UserID.Equals(currentiFolder.OwnerID)) { ownerLvi = lvitem; } } shareWith.Items[0].Selected = true; } catch (WebException ex) { MyMessageBox mmb = new MyMessageBox(resourceManager.GetString("memberReadError"), resourceManager.GetString("errorTitle"), ex.Message, MyMessageBoxButtons.OK, MyMessageBoxIcon.Error); mmb.ShowDialog(); if (ex.Status == WebExceptionStatus.ConnectFailure) { ifWebService = null; } } catch (Exception ex) { MyMessageBox mmb = new MyMessageBox(resourceManager.GetString("memberReadError"), resourceManager.GetString("errorTitle"), ex.Message, MyMessageBoxButtons.OK, MyMessageBoxIcon.Error); mmb.ShowDialog(); } shareWith.EndUpdate(); add.Enabled = currentUser != null ? currentUser.Rights.Equals("Admin") : false; if( this.currentiFolder.encryptionAlgorithm != null && this.currentiFolder.encryptionAlgorithm != "") { this.add.Enabled = false; } setLimit.Visible = limitEdit.Visible = false; limitLabel.Visible = limit.Visible = !setLimit.Visible; this.ssl.Enabled = currentUser != null ? currentUser.UserID.Equals(currentiFolder.OwnerID) : false; if (this.DomainUrl.StartsWith(Uri.UriSchemeHttps)) { this.ssl.Checked = true; this.ssl.Enabled = false; } Cursor = Cursors.Default; }
public void StartSimias() { try { DateTime starttime = DateTime.Now; simiasManager.Start(); if (simiasManager.WebServiceUri == null || simiasManager.DataPath == null) { simiasManager.Start(); if (simiasManager.WebServiceUri == null || simiasManager.DataPath == null) { MessageBox.Show("Unable to start xsp web service, iFolder will not be able to work, restart the application.", "iFolder", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } } SetWebServiceInformation(simiasManager.WebServiceUri, simiasManager.DataPath); ifWebService = new iFolderWebService(); ifWebService.Url = simiasManager.WebServiceUri + "/iFolder.asmx"; simiasWebService = new SimiasWebService(); simiasWebService.Url = simiasManager.WebServiceUri + "/Simias.asmx"; LocalService.Start(simiasWebService, simiasManager.WebServiceUri, simiasManager.DataPath); LocalService.Start(ifWebService, simiasManager.WebServiceUri, simiasManager.DataPath); eventClient.Register(); if (!eventError) { eventClient.SetEvent(IProcEventAction.AddNodeChanged, new IProcEventHandler(trayApp_nodeEventHandler)); eventClient.SetEvent(IProcEventAction.AddNodeCreated, new IProcEventHandler(trayApp_nodeEventHandler)); eventClient.SetEvent(IProcEventAction.AddNodeDeleted, new IProcEventHandler(trayApp_nodeEventHandler)); eventClient.SetEvent(IProcEventAction.AddCollectionSync, new IProcEventHandler(trayApp_collectionSyncHandler)); eventClient.SetEvent(IProcEventAction.AddFileSync, new IProcEventHandler(trayApp_fileSyncHandler)); eventClient.SetEvent(IProcEventAction.AddNotifyMessage, new IProcEventHandler(trayApp_notifyMessageHandler)); } this.globalProperties.iFWebService = ifWebService; this.globalProperties.Simws = simiasWebService; this.globalProperties.EventClient = eventClient; this.globalProperties.simManager = simiasManager; this.preferences.ifolderWebService = ifWebService; this.preferences.Simws = simiasWebService; this.preferences.simManager = simiasManager; DateTime endtime = DateTime.Now; simiasRunning = true; iFolderComponent.SimiasRunning = true; simiasStarting = false; iFolderComponent.SimiasStarting = false; } catch (Exception ex) { MessageBox.Show(string.Format("Exception in starting simias: {0}--{1}", ex.Message, ex.StackTrace)); } }
private void connectToWebService() { if (ifWebService == null) { RegistryKey regKey = Registry.CurrentUser.OpenSubKey(@"SOFTWARE\Novell\iFolder"); if (regKey != null) { string webServiceUri = regKey.GetValue("WebServiceUri") as string; string simiasDataPath = regKey.GetValue("SimiasDataPath") as string; if ((webServiceUri != null) && (simiasDataPath != null)) { ifWebService = new iFolderWebService(); ifWebService.Url = webServiceUri + "/iFolder.asmx"; LocalService.Start(ifWebService, new Uri(webServiceUri), simiasDataPath); } regKey.Close(); } } }
private void processChanges() { Cursor = Cursors.WaitCursor; if (newOwnerLvi != null) { try { connectToWebService(); ShareListMember oldOwner = (ShareListMember)ownerLvi.Tag; ShareListMember newOwner = (ShareListMember)newOwnerLvi.Tag; if(ifWebService.CanOwnerBeChanged(newOwner.iFolderUser.UserID,currentiFolder.DomainID)) { ifWebService.ChangeOwner(currentiFolder.ID, newOwner.iFolderUser.UserID, oldOwner.iFolderUser.Rights); oldOwner.Changed = newOwner.Changed = false; } else { MyMessageBox mmb = new MyMessageBox(String.Format(resourceManager.GetString("ifolderlimiterror"), currentiFolder.Name,newOwner.iFolderUser.Name), resourceManager.GetString("errorTitle"), string.Empty, MyMessageBoxButtons.OK, MyMessageBoxIcon.Error); mmb.ShowDialog(); } } catch (WebException e) { MyMessageBox mmb = new MyMessageBox(resourceManager.GetString("changeOwnerError"), resourceManager.GetString("saveErrorTitle"), e.Message, MyMessageBoxButtons.OK, MyMessageBoxIcon.Error); mmb.ShowDialog(); if (e.Status == WebExceptionStatus.ConnectFailure) { ifWebService = null; } } catch (Exception e) { if (e.Message.IndexOf("Invalid iFolderID") == -1) { MyMessageBox mmb = new MyMessageBox(resourceManager.GetString("changeOwnerError"), resourceManager.GetString("saveErrorTitle"), e.Message, MyMessageBoxButtons.OK, MyMessageBoxIcon.Error); mmb.ShowDialog(); } } } foreach (ListViewItem lvitem in shareWith.Items) { ShareListMember slMember = (ShareListMember)lvitem.Tag; try { connectToWebService(); if (slMember.Added) { slMember.iFolderUser = ifWebService.AddAndInviteUser( currentiFolder.ID, slMember.iFolderUser.Name, slMember.iFolderUser.FirstName, slMember.iFolderUser.Surname, slMember.iFolderUser.UserID, null, slMember.iFolderUser.Rights); lvitem.Tag = slMember; updateListViewItem(lvitem); lock (subscrHT) { subscrHT.Add(slMember.iFolderUser.ID, lvitem); } slMember.Added = false; } else if (slMember.Changed) { ifWebService.SetUserRights(currentiFolder.ID, slMember.iFolderUser.UserID, slMember.iFolderUser.Rights); slMember.Changed = false; } } catch (WebException e) { MyMessageBox mmb = new MyMessageBox(string.Format(resourceManager.GetString("memberCommitError"), slMember.Name), resourceManager.GetString("saveErrorTitle"), e.Message, MyMessageBoxButtons.OK, MyMessageBoxIcon.Error); mmb.ShowDialog(); if (e.Status == WebExceptionStatus.ConnectFailure) { ifWebService = null; } } catch (Exception e) { if (e.Message.IndexOf("Invalid iFolderID") == -1) { MyMessageBox mmb = new MyMessageBox(string.Format(resourceManager.GetString("memberCommitError"), slMember.Name), resourceManager.GetString("saveErrorTitle"), e.Message, MyMessageBoxButtons.OK, MyMessageBoxIcon.Error); mmb.ShowDialog(); } } } if (removedList != null) { foreach (ShareListMember slMember in removedList) { try { connectToWebService(); ifWebService.RemoveiFolderUser(currentiFolder.ID, slMember.iFolderUser.UserID); } catch (WebException e) { MyMessageBox mmb = new MyMessageBox(resourceManager.GetString("removeError"), resourceManager.GetString("saveErrorTitle"), e.Message, MyMessageBoxButtons.OK, MyMessageBoxIcon.Error); mmb.ShowDialog(); if (e.Status == WebExceptionStatus.ConnectFailure) { ifWebService = null; } } catch (Exception e) { if (e.Message.IndexOf("Invalid iFolderID") == -1) { MyMessageBox mmb = new MyMessageBox(resourceManager.GetString("removeError"), resourceManager.GetString("saveErrorTitle"), e.Message, MyMessageBoxButtons.OK, MyMessageBoxIcon.Error); mmb.ShowDialog(); } } } removedList.Clear(); } try { connectToWebService(); if ((currentiFolder.SyncInterval != (int)syncInterval.Value) || (autoSync.Checked != (currentiFolder.SyncInterval != System.Threading.Timeout.Infinite))) { ifWebService.SetiFolderSyncInterval(currentiFolder.ID, autoSync.Checked ? (int)syncInterval.Value : Timeout.Infinite); } updateDiskQuotaDisplay(); if (currentiFolder.ssl != ssl.Checked) { ifWebService.SetiFolderSecureSync(currentiFolder.ID, ssl.Checked); } } catch (WebException e) { MyMessageBox mmb = new MyMessageBox(resourceManager.GetString("policyCommitError"), resourceManager.GetString("saveErrorTitle"), e.Message, MyMessageBoxButtons.OK, MyMessageBoxIcon.Error); mmb.ShowDialog(); if (e.Status == WebExceptionStatus.ConnectFailure) { ifWebService = null; } } catch (Exception e) { if (e.Message.IndexOf("Invalid iFolderID") == -1) { MyMessageBox mmb = new MyMessageBox(resourceManager.GetString("policyCommitError"), resourceManager.GetString("saveErrorTitle"), e.Message, MyMessageBoxButtons.OK, MyMessageBoxIcon.Error); mmb.ShowDialog(); } } apply.Enabled = false; Cursor = Cursors.Default; }
private void iFolderAdvanced_Load(object sender, EventArgs e) { string helpFile = Path.Combine(Path.Combine(Path.Combine(loadPath, "help"), GetLanguageDirectory()), @"sharewith.html"); if (!File.Exists(helpFile)) { helpFile = Path.Combine(loadPath, @"help\en\sharewith.html"); } if (File.Exists(helpFile)) { helpProvider1.HelpNamespace = helpFile; } try { shareWith.SmallImageList = new ImageList(); string basePath = loadPath != null ? Path.Combine(loadPath, "res") : Path.Combine(Application.StartupPath, "res"); shareWith.SmallImageList.Images.Add(new Icon(Path.Combine(basePath, "ifolder_me_card.ico"))); shareWith.SmallImageList.Images.Add(new Icon(Path.Combine(basePath, "ifolder_contact_card.ico"))); shareWith.SmallImageList.Images.Add(new Icon(Path.Combine(basePath, "inviteduser.ico"))); this.Text = this.currentiFolder.Name + " " + resourceManager.GetString("properties"); this.Icon = new Icon(Path.Combine(basePath, @"ifolder_16.ico")); this.pictureBox1.Image = Image.FromFile(System.IO.Path.Combine(loadPath, @"res\ifolder48.png")); this.iFolderName.Text = this.currentiFolder.Name; if (this.currentiFolder.Name.Length > 20) this.iFolderName.Text = this.currentiFolder.Name.Substring(0,20) + "..."; if (this.currentiFolder.UnManagedPath.ToString().Length > 30) this.iFolderLocation.Text = ((string)this.currentiFolder.UnManagedPath).Substring(0,30); else this.iFolderLocation.Text = ((string)this.currentiFolder.UnManagedPath).ToString(); this.iFolderOwner.Text = this.currentiFolder.Owner; this.iFolderAccount.Text = this.domainName; this.ssl.Checked = this.currentiFolder.ssl; } catch {} subscrHT = new Hashtable(); userIDHT = new Hashtable(); if (eventClient == null) { eventClient = new IProcEventClient(new IProcEventError(errorHandler), null); existingEventClient = false; eventClient.Register(); } if (!eventError) { eventClient.SetEvent(IProcEventAction.AddNodeChanged, new IProcEventHandler(nodeEventHandler)); eventClient.SetEvent(IProcEventAction.AddNodeCreated, new IProcEventHandler(nodeEventHandler)); eventClient.SetEvent(IProcEventAction.AddNodeDeleted, new IProcEventHandler(nodeEventHandler)); eventClient.SetEvent(IProcEventAction.AddCollectionSync, new IProcEventHandler(collectionSyncHandler)); eventClient.SetEvent(IProcEventAction.AddFileSync, new IProcEventHandler(fileSyncHandler)); } try { connectToWebService(); refreshData(); } catch (WebException ex) { MyMessageBox mmb = new MyMessageBox(resourceManager.GetString("iFolderReadError"), resourceManager.GetString("errorTitle"), ex.Message, MyMessageBoxButtons.OK, MyMessageBoxIcon.Error); mmb.ShowDialog(); if (ex.Status == WebExceptionStatus.ConnectFailure) { ifWebService = null; } } catch (Exception ex) { MyMessageBox mmb = new MyMessageBox(resourceManager.GetString("iFolderReadError"), resourceManager.GetString("errorTitle"), ex.Message, MyMessageBoxButtons.OK, MyMessageBoxIcon.Error); mmb.ShowDialog(); } }