Exemplo n.º 1
0
        /// <summary>
        /// Event Handler for ServerInfo load event
        /// </summary>
        private void ServerInfo_Load(object sender, System.EventArgs e)
        {
            // Load the application icon.
            try
            {
                this.Icon    = new Icon(Path.Combine(Application.StartupPath, @"res\ifolder_16.ico"));
                banner.Image = Image.FromFile(Path.Combine(Application.StartupPath, @"res\ifolder-banner.png"));


                bannerFill.SizeMode = PictureBoxSizeMode.StretchImage;
                bannerFill.Image    = Image.FromFile(Path.Combine(Application.StartupPath, @"res\ifolder-banner-scaler.png"));
            }
            catch
            {
                // Ignore.
            }

            try
            {
                simiasWebService     = new SimiasWebService();
                simiasWebService.Url = simiasManager.WebServiceUri.ToString() + "/Simias.asmx";
                LocalService.Start(simiasWebService, simiasManager.WebServiceUri, simiasManager.DataPath);

                if (domainInfo != null)
                {
                    serverName.Text = domainInfo.Name;
                    userName.Text   = domainInfo.MemberName;
                }
            }
            catch (Exception ex)
            {
                Novell.iFolderCom.MyMessageBox mmb = new Novell.iFolderCom.MyMessageBox(resourceManager.GetString("domainInfoReadError"), string.Empty, ex.Message, MyMessageBoxButtons.OK, MyMessageBoxIcon.Error);
                mmb.ShowDialog();
            }
        }
Exemplo n.º 2
0
 private void ShutdownTrayApp(Exception ex)
 {
     if (preferences != null)
     preferences.Hide();
        if (globalProperties != null)
     globalProperties.Hide();
        if (syncLog != null)
     syncLog.Hide();
     if (infolog != null)
         infolog.Hide();
        Cursor.Current = Cursors.WaitCursor;
        if (shellNotifyIcon != null)
        {
     shellNotifyIcon.Text = resourceManager.GetString("iFolderServicesStopping");
     shellNotifyIcon.Icon = shutdownIcon;
        }
        if (ex != null)
        {
     Novell.iFolderCom.MyMessageBox mmb = new MyMessageBox(resourceManager.GetString("fatalErrorMessage"), resourceManager.GetString("fatalErrorTitle"), ex.Message, MyMessageBoxButtons.OK, MyMessageBoxIcon.Error);
     mmb.ShowDialog();
        }
        simiasRunning = false;
     iFolderComponent.SimiasRunning = false;
        try
        {
     if (eventClient != null)
     {
      eventClient.Deregister();
     }
     if(this.MachineShutdown() == false && globalProperties.MachineShutdown() == false && preferences.MachineShutdown() == false && syncLog.MachineShutdown() == false)
     {
      simiasManager.Stop();
     }
     if ((worker != null) && worker.IsAlive)
     {
      worker.Abort();
     }
        }
        catch
        {
        }
        Cursor.Current = Cursors.Default;
        Application.Exit();
 }
Exemplo n.º 3
0
 private void removeAccount_Click(object sender, System.EventArgs e)
 {
     ListViewItem lvi = accounts.SelectedItems[0];
     Domain domain = (Domain)lvi.Tag;
     if (domain == null)
     {
         newAccountLvi = null;
         lvi.Remove();
         updatePassword = updateEnabled = updateHost = false;
         addAccount.Enabled = true;
     }
     else
     {
         RemoveAccount removeAccount = new RemoveAccount(domain.DomainInfo);
         if (removeAccount.ShowDialog() == DialogResult.Yes)
         {
             try
             {
                 simiasWebService.LeaveDomain(domain.ID, !removeAccount.RemoveAll);
                 lvi.Remove();
                 string defaultDomainID = null;
                 if (domain.Equals(currentDefaultDomain))
                 {
                     defaultDomainID = simiasWebService.GetDefaultDomainID();
                 }
                 if (RemoveDomain != null)
                 {
                     RemoveDomain(this, new DomainRemoveEventArgs(domain.DomainInfo, defaultDomainID));
                 }
                 if (defaultDomainID != null)
                 {
                     foreach (ListViewItem item in accounts.Items)
                     {
                         Domain d = (Domain)item.Tag;
                         if (d.ID.Equals(defaultDomainID))
                         {
                             currentDefaultDomain = d;
                             break;
                         }
                     }
                 }
                 updatePassword = updateEnabled = updateHost = false;
             }
             catch (Exception ex)
             {
                 MyMessageBox mmb = new MyMessageBox(resourceManager.GetString("removeAccountError"), resourceManager.GetString("accountErrorTitle"), ex.Message, MyMessageBoxButtons.OK, MyMessageBoxIcon.Error);
                 mmb.ShowDialog();
                 mmb.Dispose();
             }
         }
         DomainInformation[] domains;
         System.Threading.Thread.Sleep(2000);
         domains = this.simiasWebService.GetDomains(false);
         if (domains.Length.Equals(0))
         {
             if (((GlobalProperties)FormsTrayApp.globalProp()).Visible)
                 ((GlobalProperties)FormsTrayApp.globalProp()).Hide();
         }
         removeAccount.Dispose();
     }
 }
Exemplo n.º 4
0
 private void Preferences_VisibleChanged(object sender, System.EventArgs e)
 {
     if (this.Visible)
     {
         accounts.Items.Clear();
         successful = true;
         DomainInformation[] domains;
         try
         {
             domains = simiasWebService.GetDomains(true);
             foreach (DomainInformation di in domains)
             {
                 AddDomainToList(di);
             }
         }
         catch (Exception ex)
         {
             Novell.iFolderCom.MyMessageBox mmb = new MyMessageBox(resourceManager.GetString("readAccountsError"), resourceManager.GetString("accountErrorTitle"), ex.Message, MyMessageBoxButtons.OK, MyMessageBoxIcon.Error);
             mmb.ShowDialog();
             mmb.Dispose();
         }
         apply.Enabled = false;
         autoStart.Checked = IsRunEnabled();
         notifyShared.Checked = NotifyShareEnabled;
         notifyCollisions.Checked = NotifyCollisionEnabled;
         notifyJoins.Checked = NotifyJoinEnabled;
         startInTrayIcon.Checked = HideiFolderInTray;
         hideSyncLog.Checked = HideSyncLogWindow;
         hidenotification.Checked = HidePolicyVoilationNotification;
         displayConfirmation.Checked = iFolderComponent.DisplayConfirmationEnabled;
         displayTrayIcon.Checked = !(iFolderComponent.DisplayTrayIconEnabled);
         notifyCheckbox.Checked = false;
         policylistbox.ClearSelected();
         if (NotifyPolicyQouta)
             policylistbox.SelectedIndex = (int)policyVoilation.QuotaVoliation;
         if (NotifyPolicySize)
             policylistbox.SelectedIndex = (int)policyVoilation.FileSizeVoilation;
         if (NotifyPolicyType)
             policylistbox.SelectedIndex = (int)policyVoilation.FileTypeVoilation;
         if (NotifyPathLong)
             policylistbox.SelectedIndex = (int)policyVoilation.LongPath;
         if (NotifyIOPermission)
             policylistbox.SelectedIndex = (int)policyVoilation.PremissionUnavailable;
         if (NotifyDiskFull)
             policylistbox.SelectedIndex = (int)policyVoilation.DiskFullVoilation;
         try
         {
             int syncInterval = ifWebService.GetDefaultSyncInterval();
             minimumSeconds = (!syncInterval.Equals(System.Threading.Timeout.Infinite) &&
                 (syncInterval < (int)defaultMinimumSeconds)) ? (decimal)syncInterval : defaultMinimumSeconds;
             displaySyncInterval(syncInterval);
         }
         catch (Exception ex)
         {
             Novell.iFolderCom.MyMessageBox mmb = new MyMessageBox(resourceManager.GetString("readSyncError"), resourceManager.GetString("PreferencesErrorTitle"), ex.Message, MyMessageBoxButtons.OK, MyMessageBoxIcon.Error);
             mmb.ShowDialog();
             mmb.Dispose();
         }
         Activate();
     }
 }
Exemplo n.º 5
0
 private bool acceptiFolder(iFolderWeb ifolder, string path, out bool added, bool mergeFolder)
 {
     bool download = false;
     bool result = true;
     bool repeatFlag = false;
     added = true;
     if (GetDriveType(Path.GetPathRoot(path)) == DRIVE_FIXED)
     {
         if (Win32Security.AccessAllowed(path))
         {
             try
             {
                 if (ifolder.encryptionAlgorithm == null || ifolder.encryptionAlgorithm == "")
                 {
                     download = true;
                 }
                 else
                 {
                     string passphrasecheck = null;
                     passphrasecheck = simiasWebService.GetPassPhrase(ifolder.DomainID);
                     if (passphrasecheck == null || passphrasecheck == "")
                     {
                         VerifyPassphraseDialog vpd = new VerifyPassphraseDialog(ifolder.DomainID, simiasWebService);
                         vpd.ShowDialog();
                         download = vpd.PassphraseStatus;
                     }
                     else
                     {
                         download = true;
                     }
                 }
                 if (download)
                 {
                     Cursor = Cursors.WaitCursor;
                     if (mergeFolder == true)
                     {
             string mergediFolder = path;
             if(System.IO.Path.GetFileName(mergediFolder) != ifolder.Name)
             {
              throw new Exception("FolderDoesNotExist");
             }
                         if (Directory.Exists(mergediFolder) == false)
                         {
                             throw new Exception("PathDoesNotExist");
                         }
                         if (ifWebService.IsiFolder(mergediFolder) == true)
                         {
                             throw new Exception("AtOrInsideCollectionPath");
                         }
                         ifWebService.MergeiFolder(ifolder.DomainID, ifolder.ID, mergediFolder);
                         Cursor = Cursors.Default;
                     }
                     else
                     {
                          DirectoryInfo di = new DirectoryInfo(path);
                         if (di.Name == ifolder.Name)
                         {
                             path = Directory.GetParent(path).ToString();
                         }
                         if( System.IO.Directory.Exists( Path.Combine(path,ifolder.Name)) )
                         {
                             MyMessageBox mmb = new MyMessageBox(Resources.OkMergeCancel,Resources.Folderexists, String.Empty, MyMessageBoxButtons.OKCancel, MyMessageBoxIcon.Question, MyMessageBoxDefaultButton.Button1);
                       if (mmb.ShowDialog() == DialogResult.OK)
                 {
                                 ifWebService.MergeiFolder(ifolder.DomainID, ifolder.ID, Path.Combine(path, ifolder.Name));
                             }
                             else
                                 return false;
                }
                   else
                       ifWebService.AcceptiFolderInvitation(ifolder.DomainID, ifolder.ID, path);
                         Cursor = Cursors.Default;
                     }
                 }
                 else
                 {
                     result = true;
                     added = false;
                 }
             }
             catch (Exception ex)
             {
                 Cursor = Cursors.Default;
                 added = false;
                 MyMessageBox mmb;
                 if (ex.Message.IndexOf("260") != -1)
                 {
                     mmb = new MyMessageBox("The iFolder path is too long for the File System. Download failed", "Path Too Long", string.Empty, MyMessageBoxButtons.OK, MyMessageBoxIcon.Error);
                     mmb.ShowDialog();
                     repeatFlag = true;
                 }
                 else if (ex.Message.IndexOf("PathExists") != -1)
                 {
                     mmb = new MyMessageBox(TrayApp.Properties.Resources.pathExistsError, TrayApp.Properties.Resources.pathInvalidErrorTitle, string.Empty, MyMessageBoxButtons.OK, MyMessageBoxIcon.Error);
                     mmb.ShowDialog();
                 }
                 else if (ex.Message.IndexOf("AtOrInsideStorePath") != -1)
                 {
                     mmb = new MyMessageBox(TrayApp.Properties.Resources.pathInStoreError, TrayApp.Properties.Resources.pathInvalidErrorTitle, string.Empty, MyMessageBoxButtons.OK, MyMessageBoxIcon.Error);
                     mmb.ShowDialog();
                 }
                 else if (ex.Message.IndexOf("AtOrInsideCollectionPath") != -1)
                 {
                     mmb = new MyMessageBox(TrayApp.Properties.Resources.pathIniFolderError, TrayApp.Properties.Resources.pathInvalidErrorTitle, string.Empty, MyMessageBoxButtons.OK, MyMessageBoxIcon.Error);
                     mmb.ShowDialog();
                 }
                 else if (ex.Message.IndexOf("IncludesWinDirPath") != -1)
                 {
                     mmb = new MyMessageBox(TrayApp.Properties.Resources.pathIncludesWinDirError, TrayApp.Properties.Resources.pathInvalidErrorTitle, string.Empty, MyMessageBoxButtons.OK, MyMessageBoxIcon.Error);
                     mmb.ShowDialog();
                 }
                 else if (ex.Message.IndexOf("IncludesProgFilesPath") != -1)
                 {
                     mmb = new MyMessageBox(TrayApp.Properties.Resources.PathIncludesProgFilesDirError, TrayApp.Properties.Resources.pathInvalidErrorTitle, string.Empty, MyMessageBoxButtons.OK, MyMessageBoxIcon.Error);
                     mmb.ShowDialog();
                 }
                 else if (ex.Message.IndexOf("PathDoesNotExist") != -1)
                 {
                     mmb = new MyMessageBox(TrayApp.Properties.Resources.PathDoesNotExist, TrayApp.Properties.Resources.pathInvalidErrorTitle, ex.Message, MyMessageBoxButtons.OK, MyMessageBoxIcon.Error);
                     mmb.ShowDialog();
                 }
                 else if (ex.Message.IndexOf("FolderDoesNotExist") != -1)
                 {
                     mmb = new MyMessageBox(TrayApp.Properties.Resources.FolderDoesNotExistError, TrayApp.Properties.Resources.FolderDoesNotExistErrorTitle, TrayApp.Properties.Resources.FolderDoesNotExistErrorDesc, MyMessageBoxButtons.OK, MyMessageBoxIcon.Error);
                     mmb.ShowDialog();
                 }
                 else
                 {
                     mmb = new MyMessageBox(TrayApp.Properties.Resources.acceptError, string.Empty, ex.Message, MyMessageBoxButtons.OK, MyMessageBoxIcon.Error);
                     mmb.ShowDialog();
                 }
                 if (!repeatFlag)
                     result = false;
             }
         }
         else
         {
             result = false;
             MyMessageBox mmb = new MyMessageBox(TrayApp.Properties.Resources.accessDenied, string.Empty, string.Empty, MyMessageBoxButtons.OK, MyMessageBoxIcon.Error);
             mmb.ShowDialog();
         }
     }
     else
     {
         MessageBox.Show(TrayApp.Properties.Resources.networkPath, TrayApp.Properties.Resources.pathInvalidErrorTitle);
         result = false;
     }
     return result;
 }
Exemplo n.º 6
0
 public bool AcceptiFolder(iFolderWeb ifolder, out bool added, bool mergeFolder)
 {
     bool result = false;
     added = false;
     if (ifolder.MigratediFolder > 0)
     {
         if (MigrationWindow.OldiFoldersPresent() == true)
         {
             System.Resources.ResourceManager resManager = new System.Resources.ResourceManager(typeof(FormsTrayApp));
             MyMessageBox mmb = new MyMessageBox(resManager.GetString("MigrationMergePrompt.Text"), resManager.GetString("MigrationAlert"), "", MyMessageBoxButtons.OKCancel, MyMessageBoxIcon.Question);
             DialogResult res = mmb.ShowDialog();
             if (res == DialogResult.OK)
             {
                 Novell.FormsTrayApp.MigrationWindow migrationWindow = new MigrationWindow(this.ifWebService, this.simiasWebService);
                 migrationWindow.Merge = true;
                 migrationWindow.iFolderName = ifolder.Name;
                 migrationWindow.ShowDialog();
                 string loc = migrationWindow.iFolderLocation;
                 string uName = migrationWindow.UserName;
                 if (loc == null || uName == null)
                 {
                     return false;
                 }
                 else
                 {
                     result = acceptiFolder(ifolder, loc, out added, true);
                     if (result == true)
                     {
                         MigrationWindow.RemoveRegistryForUser(uName);
                     }
                 }
                 return result;
             }
         }
     }
        string selectedPath = string.Empty;
        FolderBrowserDialog browserDialog = new FolderBrowserDialog();
        Cursor.Current = Cursors.WaitCursor;
        while (true)
        {
     browserDialog.ShowNewFolderButton = true;
     browserDialog.SelectedPath = selectedPath;
         if (!mergeFolder)
         {
             browserDialog.Description = string.Format(TrayApp.Properties.Resources.acceptDescription, ifolder.Name);
         }
         else
         {
             browserDialog.Description = string.Format(TrayApp.Properties.Resources.mergeDescription, ifolder.Name);
         }
     DialogResult dialogResult = browserDialog.ShowDialog();
     if ( dialogResult == DialogResult.OK )
     {
      browserDialog.Dispose();
      Invalidate();
      Update();
             result = acceptiFolder(ifolder, browserDialog.SelectedPath, out added, mergeFolder);
             if (result && !added)
             {
                 break;
             }
      else if ( result )
      {
                 if (!mergeFolder)
                     DownloadPath = browserDialog.SelectedPath + ifolder.Name;
                 else
                     DownloadPath = browserDialog.SelectedPath;
       break;
      }
     }
     else
     {
      browserDialog.Dispose();
      break;
     }
        }
        Cursor.Current = Cursors.Default;
     refreshAll();
        return result;
 }
Exemplo n.º 7
0
 void MoreInitialization()
 {
     this.fileExitDlg = new MyMessageBox(TrayApp.Properties.Resources.exitMessage,
         TrayApp.Properties.Resources.exitTitle,
         string.Empty,
         MyMessageBoxButtons.YesNo,
         MyMessageBoxIcon.Question);
     try
     {
         smallImageList = new ImageList();
         smallImageList.ImageSize = new Size(32, 32);
         smallImageList.ColorDepth = ColorDepth.Depth32Bit;
         smallImageList.TransparentColor = Color.Black;
         smallImageList.Images.Add(Bitmap.FromFile(Path.Combine(Application.StartupPath, @"res\newifolder32.png")));
         smallImageList.Images.Add(Bitmap.FromFile(Path.Combine(Application.StartupPath, @"res\ifolder-sync32.png")));
         smallImageList.Images.Add(Bitmap.FromFile(Path.Combine(Application.StartupPath, @"res\ifolder-download32.png")));
         smallImageList.Images.Add(Bitmap.FromFile(Path.Combine(Application.StartupPath, @"res\ifolder-upload32.png")));
         smallImageList.Images.Add(Bitmap.FromFile(Path.Combine(Application.StartupPath, @"res\ifolder-waiting32.png")));
         smallImageList.Images.Add(Bitmap.FromFile(Path.Combine(Application.StartupPath, @"res\ifolder-conflict32.png")));
         smallImageList.Images.Add(Bitmap.FromFile(Path.Combine(Application.StartupPath, @"res\ifolder-error32.png")));
         smallImageList.Images.Add(Bitmap.FromFile(Path.Combine(Application.StartupPath, @"res\encrypt-ilock32.png")));
         smallImageList.Images.Add(Bitmap.FromFile(Path.Combine(Application.StartupPath, @"res\ifolder_user_32.png")));
         smallImageList.Images.Add(Bitmap.FromFile(Path.Combine(Application.StartupPath, @"res\ifolder-warning32.png")));
         toolStripBtnCreate.Image = Bitmap.FromFile(Path.Combine(Application.StartupPath, @"res\ifolder48.png"));
         toolStripBtnDelete.Image = Bitmap.FromFile(Path.Combine(Application.StartupPath, @"res\delete_48.png"));
         toolStripBtnDownload.Image = Bitmap.FromFile(Path.Combine(Application.StartupPath, @"res\ifolder-download48.png"));
         toolStripBtnMerge.Image = Bitmap.FromFile(Path.Combine(Application.StartupPath, @"res\merge48.png"));
         toolStripBtnResolve.Image = Bitmap.FromFile(Path.Combine(Application.StartupPath, @"res\ifolder-conflict48.png"));
         toolStripBtnRevert.Image = Bitmap.FromFile(Path.Combine(Application.StartupPath, @"res\revert48.png"));
         toolStripBtnShare.Image = Bitmap.FromFile(Path.Combine(Application.StartupPath, @"res\share48.png"));
         toolStripBtnSyncNow.Image = Bitmap.FromFile(Path.Combine(Application.StartupPath, @"res\ifolder-sync48.png"));
         toolStipBtnChangeView.Image = Bitmap.FromFile(Path.Combine(Application.StartupPath, @"res\change_view_48.png"));
     }
     catch { }
     listView1.LargeImageList = largeImageList;
     listView1.SmallImageList = smallImageList;
     System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(GlobalProperties));
     this.ApplyResources1(resources, this.menuAction, "menuAction");
     this.ApplyResources1(resources, this.menuActionCreate, "menuActionCreate");
     this.ApplyResources1(resources, this.menuActionAccept, "menuActionAccept");
     this.ApplyResources1(resources, this.menuActionMerge, "menuActionMerge");
     this.ApplyResources1(resources, this.menuActionRemove, "menuActionRemove");
     this.ApplyResources1(resources, this.menuItem7, "menuItem7");
     this.ApplyResources1(resources, this.menuActionOpen, "menuActionOpen");
     this.ApplyResources1(resources, this.menuActionShare, "menuActionShare");
     this.ApplyResources1(resources, this.menuActionResolve, "menuActionResolve");
     this.ApplyResources1(resources, this.menuActionSync, "menuActionSync");
     this.ApplyResources1(resources, this.menuActionRevert, "menuActionRevert");
     this.ApplyResources1(resources, this.menuActionProperties, "menuActionProperties");
     this.ApplyResources1(resources, this.menuItem4, "menuItem4");
     this.ApplyResources1(resources, this.migrationMenuItem, "migrationMenuItem");
     this.ApplyResources1(resources, this.migrationMenuSubItem, "migrationMenuSubItem");
     this.ApplyResources1(resources, this.menuSeparator, "menuSeparator");
     this.ApplyResources1(resources, this.menuActionClose, "menuActionClose");
     this.ApplyResources1(resources, this.menuActionExit, "menuActionExit");
     this.ApplyResources1(resources, this.menuEdit, "menuEdit");
     this.ApplyResources1(resources, this.menuViewAccounts, "menuViewAccounts");
     this.ApplyResources1(resources, this.menuEditPrefs, "menuEditPrefs");
     this.ApplyResources1(resources, this.menuView, "menuView");
     this.ApplyResources1(resources, this.menuViewRefresh, "menuViewRefresh");
     this.ApplyResources1(resources, this.menuItem1, "menuItem1");
     this.ApplyResources1(resources, this.menuViewLog, "menuViewLog");
     this.ApplyResources1(resources, this.menuItem3, "menuItem3");
     this.ApplyResources1(resources, this.menuViewAvailable, "menuViewAvailable");
     this.ApplyResources1(resources, this.menuSecurity, "menuSecurity");
     this.ApplyResources1(resources, this.menuRecoverKeys, "menuRecoverKeys");
     this.ApplyResources1(resources, this.menuResetPassphrase, "menuResetPassphrase");
     this.ApplyResources1(resources, this.menuResetPassword, "menuResetPassword");
     this.ApplyResources1(resources, this.menuHelp, "menuHelp");
     this.ApplyResources1(resources, this.menuHelpHelp, "menuHelpHelp");
     this.ApplyResources1(resources, this.menuHelpAbout, "menuHelpAbout");
 }
Exemplo n.º 8
0
 private void menuRevert_Click(object sender, System.EventArgs e)
 {
     Cursor.Current = Cursors.WaitCursor;
        try
        {
     iFolderWeb ifolder = ((iFolderObject)selectedItem.Tag).iFolderWeb;
     bool IsMaster = (ifolder.CurrentUserID == ifolder.OwnerID);
         IsDomainMaster = IsMaster;
     RevertiFolder revertiFolder = new RevertiFolder();
     if( !IsMaster )
      revertiFolder.removeFromServer.Text = TrayApp.Properties.Resources.AlsoRemoveMembership;
         revertiFolder.removeFromServer.Enabled = simiasWebService.GetDomainInformation(ifolder.DomainID).Authenticated;
         if ( revertiFolder.ShowDialog() == DialogResult.Yes )
     {
      Invalidate();
      Update();
      Cursor.Current = Cursors.WaitCursor;
             if (revertiFolder.RemoveFromServer)
                  ((iFolderObject)selectedItem.Tag).iFolderState = iFolderState.RevertAndDelete;
      iFolderWeb newiFolder = ifWebService.RevertiFolder(ifolder.ID);
      Win32Window.ShChangeNotify(Win32Window.SHCNE_UPDATEITEM, Win32Window.SHCNF_PATHW, ifolder.UnManagedPath, IntPtr.Zero);
      if (newiFolder != null)
      {
       acceptedFolders.Remove(newiFolder.ID);
       if ( revertiFolder.RemoveFromServer )
       {
                     selectediFolderID = newiFolder.ID;
                     selectedDomainID = newiFolder.DomainID;
            Thread revertiFolderThread;
            revertiFolderThread = new Thread(new ThreadStart(RemoveiFolderFromServer));
            revertiFolderThread.Name = "RevertAndDeleteiFolder";
            revertiFolderThread.CurrentUICulture = Thread.CurrentThread.CurrentUICulture;
            revertiFolderThread.IsBackground = true;
            revertiFolderThread.Priority = ThreadPriority.BelowNormal;
                     revertiFolderThread.Start();
       }
       else
       {
        {
                         this.removeTileListViewItem((TileListViewItem)ht[newiFolder.ID]);
                         iFolderObject ifolderobj = new iFolderObject(newiFolder, iFolderState.Normal);
                         addiFolderToListView(ifolderobj);
                         updateView();
        }
       }
      }
     }
     revertiFolder.Dispose();
        }
        catch (Exception ex)
        {
     Cursor.Current = Cursors.Default;
     Novell.iFolderCom.MyMessageBox mmb =
             new MyMessageBox(TrayApp.Properties.Resources.iFolderRevertError,
                 TrayApp.Properties.Resources.revertErrorTitle,
                 ex.Message,
                 MyMessageBoxButtons.OK,
                 MyMessageBoxIcon.Error);
     mmb.ShowDialog();
     mmb.Dispose();
        }
        Cursor.Current = Cursors.Default;
 }
Exemplo n.º 9
0
 private void PerformResetPassword(string domainid, string oldpassword, string newpassword)
 {
     string title = null;
     string message = null;
     System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(ResetPassword));
     int result = this.ifws.ChangePassword(domainid, oldpassword, newpassword);
     if (result == 0)
     {
         try
         {
             if (this.rememberPassword.Checked == true)
             {
                 this.simiasWebservice.SetDomainCredentials(domainid, newpassword, CredentialType.Basic);
             }
             else
             {
                 this.simiasWebservice.SetDomainCredentials(domainid, null, CredentialType.None);
             }
         }
         catch { }
         title = resources.GetString("ResetPasswordTitle");
         message = resources.GetString("Resetpasswordsuccess");
         MyMessageBox mb = new MyMessageBox(message, title, "", MyMessageBoxButtons.OK, MyMessageBoxIcon.Information);
         mb.ShowDialog();
         mb.Dispose();
         this.success = true;
         this.Dispose();
         this.Close();
         return;
     }
     title = resources.GetString("Errorchangingpassword");
     switch (result)
     {
         case 1:
             message = resources.GetString("IncorrectOldPassword");
             break;
         case 2:
             message = resources.GetString("Failedtoresetpassword");
             break;
         case 3:
             message = resources.GetString("LoginDisabled");
             break;
         case 4:
             message = resources.GetString("Useraccountexpired");
             break;
         case 5:
             message = resources.GetString("Usercannotchangepassword");
             break;
         case 6:
             message = resources.GetString("Userpasswordexpired");
             break;
         case 7:
             message = resources.GetString("Minimumpasswordlengthrestrictionnotmet");
             break;
         case 8:
             message = resources.GetString("Usernotfoundinsimias");
             break;
         default:
             message = resources.GetString("Errorchangingpassword");
             break;
     }
     message = resources.GetString("Couldnotchangepassword") + message;
     MyMessageBox mb1 = new MyMessageBox(message, title, "", MyMessageBoxButtons.OK, MyMessageBoxIcon.Error);
     mb1.ShowDialog();
     mb1.Dispose();
     this.success = false;
 }
Exemplo n.º 10
0
 private void btnReset_Click(object sender, System.EventArgs e)
 {
     string title;
     string message;
     System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(ResetPassword));
     if( this.newPassword.Text != this.confirmPassword.Text )
     {
         title = resources.GetString("Errorchangingpassword");
         message = resources.GetString("PasswordsDoesNotMatch");
         MyMessageBox mb1 = new MyMessageBox(message, title, "", MyMessageBoxButtons.OK, MyMessageBoxIcon.Error);
         mb1.ShowDialog();
         mb1.Dispose();
         this.success = false;
         return;
     }
     else if (this.newPassword.Text == this.oldpassword.Text)
     {
         title = resources.GetString("Errorchangingpassword");
         message = resources.GetString("PasswordsSame");
         MyMessageBox mb1 = new MyMessageBox(message, title, "", MyMessageBoxButtons.OK, MyMessageBoxIcon.Error);
         mb1.ShowDialog();
         mb1.Dispose();
         this.success = false;
         return;
     }
        try
        {
     DomainItem domainItem = (DomainItem)this.DomainComboBox.SelectedItem;
     this.domainID = domainItem.ID;
     System.Resources.ResourceManager resManager = new System.Resources.ResourceManager(typeof(Connecting));
         this.PerformResetPassword(this.domainID, this.oldpassword.Text, this.newPassword.Text);
        }
        catch(Exception ex)
        {
     MessageBox.Show(Resource.GetString("ResetError") , Resource.GetString("ResetTitle") );
     this.success = false;
        }
 }
Exemplo n.º 11
0
 private bool Import_func()
 {
     try
     {
         string onetimepp = null;
         this.simiasWebService.ImportiFoldersCryptoKeys(selectedDomain.ID, this.newPassphrase.Text, onetimepp, this.outputFilePath);
         bool rememberOption = this.simiasWebService.GetRememberOption(selectedDomain.ID);
         this.simiasWebService.StorePassPhrase(selectedDomain.ID, "", CredentialType.None, false);
         this.simiasWebService.StorePassPhrase(selectedDomain.ID, this.newPassphrase.Text, CredentialType.Basic, rememberOption);
     }
     catch (Exception ex)
     {
         MyMessageBox mmb = new MyMessageBox(TrayApp.Properties.Resources.importErrorMesg, TrayApp.Properties.Resources.wizardText, null, MyMessageBoxButtons.OK, MyMessageBoxIcon.Error);
         mmb.ShowDialog();
         return false;
     }
     return true;
 }
Exemplo n.º 12
0
 private bool Export_func()
 {
     try
     {
         GetDefaultPath(selectedDomain.Name);
         this.simiasWebService.ExportiFoldersCryptoKeys(selectedDomain.ID, inputFilePath);
     }
     catch (Exception ex)
     {
         MyMessageBox mmb = new MyMessageBox(TrayApp.Properties.Resources.unableToExportMesg, TrayApp.Properties.Resources.wizardText, null, MyMessageBoxButtons.OK, MyMessageBoxIcon.Error);
         mmb.ShowDialog();
         return false;
     }
     return true;
 }
Exemplo n.º 13
0
 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();
        }
 }
Exemplo n.º 14
0
 private void apply_Click(object sender, System.EventArgs e)
 {
     this.processChanges();
        try
        {
     connectToWebService();
     string id = currentiFolder.ID;
     currentiFolder = null;
     currentiFolder = ifWebService.GetiFolder(id);
        }
        catch (Exception ex)
        {
     MyMessageBox mmb = new MyMessageBox(resourceManager.GetString("iFolderReadError"), resourceManager.GetString("errorTitle"), ex.Message, MyMessageBoxButtons.OK, MyMessageBoxIcon.Error);
     mmb.ShowDialog();
        }
 }
Exemplo n.º 15
0
 private void btnReset_Click(object sender, System.EventArgs e)
 {
     try
        {
     DomainItem domainItem = (DomainItem)this.DomainComboBox.SelectedItem;
     this.domainID = domainItem.ID;
     System.Resources.ResourceManager resManager = new System.Resources.ResourceManager(typeof(Connecting));
     string publicKey = null;
     string ragent = null;
         Status status = null;
         try
         {
             status = simws.ValidatePassPhrase(this.domainID, this.passPhrase.Text);
       if(status.statusCode == StatusCodes.PassPhraseInvalid)
       {
     status = simws.ValidatePassPhrase(this.domainID, this.newPassphrase.Text);
       }
         }
         catch (Exception ex)
         {
             System.Resources.ResourceManager resMgr = new System.Resources.ResourceManager(typeof(VerifyPassphraseDialog));
             MessageBox.Show(resMgr.GetString("ValidatePPError"), ex.Message);
         }
         if (status.statusCode == StatusCodes.PassPhraseInvalid)
         {
             MessageBox.Show(Resource.GetString("InvalidCurrentPPText") , Resource.GetString("ResetTitle") );
             this.success = false;
             return;
         }
         if (this.recoveryAgentCombo.SelectedItem != null && (string)this.recoveryAgentCombo.SelectedItem != TrayApp.Properties.Resources.serverDefaultRA)
         {
             byte[] CertificateObj = this.simws.GetRACertificateOnClient(this.DomainID, (string)this.recoveryAgentCombo.SelectedItem);
             System.Security.Cryptography.X509Certificates.X509Certificate cert = new System.Security.Cryptography.X509Certificates.X509Certificate(CertificateObj);
             MyMessageBox mmb = new MyMessageBox(string.Format(resManager.GetString("verifyCert"), (string)this.recoveryAgentCombo.SelectedItem), resManager.GetString("verifyCertTitle"), cert.ToString(true), MyMessageBoxButtons.YesNo, MyMessageBoxIcon.Question, MyMessageBoxDefaultButton.Button2);
             DialogResult messageDialogResult = mmb.ShowDialog();
             mmb.Dispose();
             mmb.Close();
             if (messageDialogResult != DialogResult.Yes)
                 return;
             else
             {
                 ragent = (string)this.recoveryAgentCombo.SelectedItem;
                 publicKey = Convert.ToBase64String(cert.GetPublicKey());
             }
         }
         else
         {
             ragent = "DEFAULT";
             DomainInformation domainInfo = (DomainInformation)this.simws.GetDomainInformation(this.DomainID);
             string memberUID = domainInfo.MemberUserID;
             publicKey = this.ifws.GetDefaultServerPublicKey(this.DomainID, memberUID);
         }
     status = this.simws.ReSetPassPhrase(this.DomainID, this.passPhrase.Text , this.newPassphrase.Text, ragent, publicKey);
     if( status.statusCode == StatusCodes.Success)
     {
      simws.StorePassPhrase(this.DomainID, "", CredentialType.None, false);
      simws.StorePassPhrase(this.DomainID, this.newPassphrase.Text, CredentialType.Basic, this.rememberPassphrase.Checked);
      MyMessageBox mb = new MyMessageBox(string.Format(Resource.GetString("ResetSuccess")), Resource.GetString("ResetTitle"), "", MyMessageBoxButtons.OK, MyMessageBoxIcon.Information);
      mb.ShowDialog();
      mb.Dispose();
      this.success = true;
      this.Dispose();
      this.Close();
     }
     else
     {
      MessageBox.Show(Resource.GetString("ResetError") , Resource.GetString("ResetTitle") );
      this.success = false;
     }
        }
        catch(Exception ex)
        {
     MessageBox.Show(Resource.GetString("ResetError") , Resource.GetString(ex.Message) );
     this.success = false;
        }
 }
Exemplo n.º 16
0
 void menuResetPassword_Click(object sender, EventArgs e)
 {
     ResetPassword resetPasswordWindow = new ResetPassword(this.simiasWebService, this.ifWebService);
     if (resetPasswordWindow.DomainCount > 0)
         resetPasswordWindow.ShowDialog();
     else
     {
         System.Resources.ResourceManager Resource = new System.Resources.ResourceManager(typeof(FormsTrayApp));
         Novell.iFolderCom.MyMessageBox mmb =
             new MyMessageBox(Resource.GetString("NoLoggedInDomainsPasswordText"),
                 Resource.GetString("ResetPasswordError"),
                 "",
                 MyMessageBoxButtons.OK,
                 MyMessageBoxIcon.Error);
         mmb.ShowDialog();
         mmb.Dispose();
     }
 }
Exemplo n.º 17
0
 internal override int ValidatePage(int currentIndex)
 {
     bool status = false;
     System.Resources.ResourceManager resourceManager = new System.Resources.ResourceManager(typeof(CreateiFolder));
        if( this.CreateDefault.Checked == false)
     status = true;
        else if( upload )
        {
         if (ifws.GetLimitPolicyStatus(domainInfo.ID) == 1)
         {
             iFolderWeb ifolder = null;
             ifolder = CreateDefaultiFolder(this.sslCheckButton.Checked);
             if (ifolder != null)
             {
                 status = true;
                 this.simws.DefaultAccount(domainInfo.ID, ifolder.ID);
             }
         }
         else
         {
             MyMessageBox mmb = new MyMessageBox(resourceManager.GetString("ifolderlimiterror"), resourceManager.GetString("errorTitle"), string.Empty, MyMessageBoxButtons.OK, MyMessageBoxIcon.Error);
             mmb.ShowDialog();
             status = true;
         }
        }
        else
        {
     iFolderWeb ifolder= this.ifws.GetMinimaliFolder( this.defaultiFolderID, 1 );
     if( ifolder != null)
     {
      status = DownloadiFolder(ifolder);
     }
     else
     {
      status = false;
     }
        }
        if( status == true)
     return base.ValidatePage (currentIndex);
        else
     return currentIndex;
 }
Exemplo n.º 18
0
 private void menuShare_Click(object sender, System.EventArgs e)
 {
     TileListViewItem selected = (TileListViewItem)selectedItem;
       iFolderWeb curriFolder = ((iFolderObject)selected.Tag).iFolderWeb;
       if (curriFolder.encryptionAlgorithm != null && curriFolder.encryptionAlgorithm != "")
       {
           MyMessageBox cannotShareDialog = new MyMessageBox(TrayApp.Properties.Resources.cannotShareMessage, TrayApp.Properties.Resources.cannotShareTitle, string.Empty, MyMessageBoxButtons.OK, MyMessageBoxIcon.Warning);
           cannotShareDialog.ShowDialog();
       }
       else
       {
                  invokeiFolderProperties( selectedItem, 1 );
       }
 }
Exemplo n.º 19
0
 private void DisplayErrorMesg( Exception ex)
 {
     MyMessageBox mmb;
        string message;
        System.Resources.ResourceManager resourceManager =new System.Resources.ResourceManager(typeof(CreateiFolder));
        System.Resources.ResourceManager resourcemanager = new System.Resources.ResourceManager(typeof(GlobalProperties));
        string caption = resourceManager.GetString("pathInvalidErrorTitle");
        if (ex.Message.IndexOf("InvalidCharactersPath") != -1)
        {
     message = resourceManager.GetString("invalidCharsError");
        }
        else if (ex.Message.IndexOf("AtOrInsideStorePath") != -1)
        {
     message = resourceManager.GetString("pathInStoreError");
        }
        else if (ex.Message.IndexOf("ContainsStorePath") != -1)
        {
     message = resourceManager.GetString("pathContainsStoreError");
        }
        else if (ex.Message.IndexOf("SystemDirectoryPath") != -1)
        {
     message = resourceManager.GetString("systemDirError");
        }
        else if (ex.Message.IndexOf("SystemDrivePath") != -1)
        {
     message = resourceManager.GetString("systemDriveError");
        }
        else if (ex.Message.IndexOf("IncludesWinDirPath") != -1)
        {
     message = resourceManager.GetString("winDirError");
        }
        else if (ex.Message.IndexOf("IncludesProgFilesPath") != -1)
        {
     message = resourceManager.GetString("progFilesDirError");
        }
        else if (ex.Message.IndexOf("ContainsCollectionPath") != -1)
        {
     message = resourceManager.GetString("containsiFolderError");
        }
        else if (ex.Message.IndexOf("AtOrInsideCollectionPath") != -1)
        {
     message = resourceManager.GetString("pathIniFolderError");
        }
        else if (ex.Message.IndexOf("RootOfDrivePath") != -1)
        {
     message = resourceManager.GetString("rootDriveError");
        }
        else if (ex.Message.IndexOf("NotFixedDrivePath") != -1)
        {
     message = resourceManager.GetString("networkPathError");
        }
        else if (ex.Message.IndexOf("PathExists") != -1)
        {
     message = resourcemanager.GetString("pathExistsError");
        }
        else if( this.upload == true)
        {
     message = resourceManager.GetString("iFolderCreateError");
     caption = resourceManager.GetString("errorTitle");
        }
        else
        {
     message = resourceManager.GetString("acceptError");
     caption = resourceManager.GetString("errorTitle");
        }
        mmb = new MyMessageBox(message, caption, string.Empty, MyMessageBoxButtons.OK, MyMessageBoxIcon.Error);
        mmb.ShowDialog();
 }
Exemplo n.º 20
0
 private void synciFolder(string iFolderID)
 {
     try
        {
     ifWebService.SynciFolderNow(iFolderID);
        }
        catch (Exception ex)
        {
     Novell.iFolderCom.MyMessageBox mmb = new
             MyMessageBox(TrayApp.Properties.Resources.syncError,
             TrayApp.Properties.Resources.syncErrorTitle,
             ex.Message, MyMessageBoxButtons.OK,
             MyMessageBoxIcon.Error);
     mmb.ShowDialog();
     mmb.Dispose();
        }
 }
Exemplo n.º 21
0
 private bool DownloadiFolder(iFolderWeb defaultiFolder)
 {
     bool status = false;
     if (defaultiFolder.encryptionAlgorithm == null || defaultiFolder.encryptionAlgorithm == "")
     {
         status = true;
     }
     else
     {
         string passphrasecheck = null;
         passphrasecheck = simws.GetPassPhrase(domainInfo.ID);
         if (passphrasecheck == null || passphrasecheck == "")
         {
             VerifyPassphraseDialog vpd = new VerifyPassphraseDialog(domainInfo.ID, this.simws);
             vpd.ShowDialog();
             status = vpd.PassphraseStatus;
         }
         else
         {
             status = true;
         }
     }
     if (status == true)
     {
         try
         {
             string downloadpath = this.LocationEntry.Text;
             DirectoryInfo di = new DirectoryInfo(downloadpath);
             if (di.Name == defaultiFolder.Name)
             {
                 downloadpath = Directory.GetParent(this.LocationEntry.Text).ToString();
                 di = new DirectoryInfo(downloadpath);
             }
             di.Create();
             iFolderWeb ifolder = null;
             if (System.IO.Directory.Exists(Path.Combine(downloadpath, defaultiFolder.Name)))
             {
                 MyMessageBox mmb = new MyMessageBox(resManager.GetString("selectoption"), resManager.GetString("alreadyexists"), String.Empty, MyMessageBoxButtons.OKCancel, MyMessageBoxIcon.Question, MyMessageBoxDefaultButton.Button1);
                 if (mmb.ShowDialog() == DialogResult.OK)
                 {
                     ifolder = this.ifws.MergeiFolder(defaultiFolder.DomainID, defaultiFolder.ID, Path.Combine(downloadpath, defaultiFolder.Name));
                 }
                 else
                     return false;
             }
             else
                 ifolder = this.ifws.AcceptiFolderInvitation(defaultiFolder.DomainID, defaultiFolder.ID, downloadpath);
             AccountWizard wiz = (AccountWizard)this.Parent;
             if (ifolder != null && wiz != null)
             {
                 wiz.GlobalProps.AddiFolderToAcceptediFolders(ifolder, null, downloadpath);
             }
             wiz.UpdateDisplay(ifolder, Path.Combine(downloadpath, ifolder.Name));
         }
         catch (Exception ex)
         {
             DisplayErrorMesg(ex);
             return false;
         }
         return true;
     }
     else return status;
 }
Exemplo n.º 22
0
 public void refreshiFolders(string search)
 {
     if (search == null) search = "";
     search = this.toolStripBtnFilter.Text;
        Cursor.Current = Cursors.WaitCursor;
        Hashtable oldHt = new Hashtable();
     Hashtable tempHt = new Hashtable();
        lock(ht)
        {
     foreach ( TileListViewItem tlvi in ht.Values )
     {
      iFolderObject ifolderObject = (iFolderObject)tlvi.Tag;
      tempHt.Add( ifolderObject.ID, ifolderObject.iFolderState );
     }
        }
        try
        {
     panel2.SuspendLayout();
         if (selectedItem != null)
             updateMenus((iFolderObject)selectedItem.Tag);
         else
             updateMenus(null);
     foreach (iFolderWeb ifolder in ifolderArray)
     {
      if( search != null && ((String)ifolder.Name).ToLower().IndexOf(search.ToLower(),
                 0, ((String)ifolder.Name).Length) < 0)
       continue;
      iFolderState state = iFolderState.Normal;
        if (tempHt.Contains(ifolder.ID))
              {
                 state = (iFolderState)tempHt[ifolder.ID];
              }
             else
              {
                 iFolderObject ifobj = new iFolderObject(ifolder, state);
                 addiFolderToListView(ifobj);
                 ifobj = null;
               }
               oldHt.Add(ifolder.ID, state);
               if (this.acceptedFolders.Contains(ifolder.ID))
               {
                   this.acceptedFolders.Remove(ifolder.ID);
               }
         }
     foreach( System.Object obj in this.acceptedFolders.Values)
     {
      TileListViewItem tlv = (TileListViewItem)obj;
      iFolderObject ifobj = (iFolderObject)tlv.Tag;
      if( search != null && ((String)ifobj.iFolderWeb.Name).ToLower().IndexOf(search.ToLower(),
                 0, ((String)ifobj.iFolderWeb.Name).Length) < 0)
       continue;
      ifobj.iFolderWeb.IsSubscription = false;
      ifobj.iFolderState = iFolderState.Initial;
      addiFolderToListView( ifobj );
             oldHt.Add(ifobj.ID, ifobj.iFolderState);
     }
         string[] ifolders = new string[ht.Count];
         ht.Keys.CopyTo(ifolders, 0);
         foreach (string ifolderid in ifolders)
         {
            if (oldHt.ContainsKey(ifolderid) == false)
             {
                 removeTileListViewItem((TileListViewItem)ht[ifolderid]);
             }
         }
        }
        catch (Exception ex)
        {
     Novell.iFolderCom.MyMessageBox mmb =
             new MyMessageBox(TrayApp.Properties.Resources.iFolderError,
             TrayApp.Properties.Resources.iFolderErrorTitle,
             ex.Message, MyMessageBoxButtons.OK,
             MyMessageBoxIcon.Information);
     mmb.ShowDialog();
     mmb.Dispose();
        }
        iFolderView.Items.Sort();
        foreach (iFoldersListView ifListView in iFolderListViews.Values)
        {
     ifListView.FinalizeUpdate();
        }
        updateView();
        panel2.ResumeLayout();
     DomainsListUpdate();
     DomainsListUpdateComboBox();
        inRefresh = false;
     oldHt = null;
        Cursor.Current = Cursors.Default;
     if (!thumbnailView)
     {
         showiFolderinListView();
     }
        this.refreshTimer.Start();
 }
Exemplo n.º 23
0
 private void menuImportKeys_Select(object sender, EventArgs e)
 {
     ImportKeysDialog importKeys = new ImportKeysDialog(this.simiasWebService,this.ifWebService);
        if( importKeys.DomainCount > 0)
     importKeys.ShowDialog();
        else
        {
     System.Resources.ResourceManager Resource = new System.Resources.ResourceManager(typeof(FormsTrayApp));
     Novell.iFolderCom.MyMessageBox mmb = new MyMessageBox(Resource.GetString("NoLoggedInDomainsTextForImport"), Resource.GetString("ImportKeysError"), "", MyMessageBoxButtons.OK, MyMessageBoxIcon.Error);
     mmb.ShowDialog();
     mmb.Dispose();
        }
 }
Exemplo n.º 24
0
 private void btnOk_Click(object sender, System.EventArgs e)
 {
     System.Resources.ResourceManager resManager = new System.Resources.ResourceManager(typeof(Connecting));
        if( this.Passphrase.Text == this.RetypePassphrase.Text)
        {
     string publicKey = null;
     string ragent = null;
     if( this.RecoveryAgentCombo.SelectedItem != null && (string)this.RecoveryAgentCombo.SelectedItem != Resource.GetString("NoneText"))
     {
      byte[] CertificateObj = this.simws.GetRACertificateOnClient(this.DomainID, (string)this.RecoveryAgentCombo.SelectedItem);
      System.Security.Cryptography.X509Certificates.X509Certificate cert = new System.Security.Cryptography.X509Certificates.X509Certificate(CertificateObj);
      MyMessageBox mmb = new MyMessageBox( string.Format(resManager.GetString("verifyCert"), (string)this.RecoveryAgentCombo.SelectedItem), resManager.GetString("verifyCertTitle"), cert.ToString(true), MyMessageBoxButtons.YesNo, MyMessageBoxIcon.Question, MyMessageBoxDefaultButton.Button2);
      DialogResult messageDialogResult = mmb.ShowDialog();
      mmb.Dispose();
      mmb.Close();
      if( messageDialogResult != DialogResult.Yes )
       return;
      else
      {
       ragent = (string)this.RecoveryAgentCombo.SelectedItem;
       publicKey = Convert.ToBase64String(cert.GetPublicKey());
      }
     }
     else
     {
      MyMessageBox mmb = new MyMessageBox( resManager.GetString("NoCertWarning"), resManager.GetString("NoCertTitle"), "", MyMessageBoxButtons.YesNo, MyMessageBoxIcon.Question, MyMessageBoxDefaultButton.Button2);
      DialogResult messageDialogResult = mmb.ShowDialog();
      mmb.Dispose();
      mmb.Close();
      if( messageDialogResult != DialogResult.Yes )
       return;
     }
     Status passPhraseStatus = null;
     try
     {
      passPhraseStatus = simws.SetPassPhrase( DomainID, this.Passphrase.Text, ragent, publicKey);
     }
     catch(Exception ex)
     {
      MessageBox.Show( Resource.GetString("IsPassphraseSetException")+ex.Message);
     }
     if(passPhraseStatus.statusCode == StatusCodes.Success)
     {
      simws.StorePassPhrase( DomainID, this.Passphrase.Text, CredentialType.Basic, this.savePassphrase.Checked);
             status = true;
      Novell.iFolderCom.MyMessageBox mmb = new MyMessageBox(Resource.GetString("SetPassphraseSuccess"), resourceManager.GetString("$this.Text"), "", MyMessageBoxButtons.OK, MyMessageBoxIcon.Information);
      mmb.ShowDialog();
      mmb.Dispose();
      this.Dispose();
      this.Close();
     }
     else
     {
      status = false;
      Novell.iFolderCom.MyMessageBox mmb = new MyMessageBox(Resource.GetString("IsPassphraseSetException"), resourceManager.GetString("$this.Text"), "", MyMessageBoxButtons.OK, MyMessageBoxIcon.Error);
      mmb.ShowDialog();
      mmb.Dispose();
     }
        }
        else
        {
     status = false;
        }
 }
Exemplo n.º 25
0
 private void menuOpen_Click(object sender, System.EventArgs e)
 {
     if ( selectedItem != null )
        {
     iFolderWeb ifolder = ((iFolderObject)selectedItem.Tag).iFolderWeb;
     try
     {
      Process.Start(ifolder.UnManagedPath);
     }
     catch (Exception ex)
     {
      Novell.iFolderCom.MyMessageBox mmb =
                 new MyMessageBox(string.Format(TrayApp.Properties.Resources.iFolderOpenError, ifolder.Name),
                     TrayApp.Properties.Resources.openErrorTitle,
                     ex.Message,
                     MyMessageBoxButtons.OK,
                     MyMessageBoxIcon.Error);
      mmb.ShowDialog();
      mmb.Dispose();
     }
        }
 }
Exemplo n.º 26
0
 private bool processChanges()
 {
     bool result = true;
     Cursor.Current = Cursors.WaitCursor;
     if (autoStart.Checked != IsRunEnabled())
     {
         setAutoRunValue(!autoStart.Checked);
     }
     NotifyShareEnabled = notifyShared.Checked;
     NotifyCollisionEnabled = notifyCollisions.Checked;
     NotifyJoinEnabled = notifyJoins.Checked;
     HideiFolderInTray = startInTrayIcon.Checked;
     HideSyncLogWindow = hideSyncLog.Checked;
     HidePolicyVoilationNotification = hidenotification.Checked;
     iFolderComponent.DisplayConfirmationEnabled = displayConfirmation.Checked;
     iFolderComponent.DisplayTrayIconEnabled = !(displayTrayIcon.Checked);
     if (displayTrayIcon.Checked)
         FormsTrayApp.SetTrayIconStatus(false);
     else
         FormsTrayApp.SetTrayIconStatus(true);
     try
     {
         ListBox.SelectedIndexCollection selectedIndex = policylistbox.SelectedIndices;
         if (notifyCheckbox.Checked)
         {
             NotifyPolicyQouta = false;
             NotifyPolicySize = false;
             NotifyPolicyType = false;
             NotifyDiskFull = false;
             NotifyIOPermission = false;
             NotifyPathLong = false;
             foreach (int index in selectedIndex)
             {
                 switch (index)
                 {
                     case (int)policyVoilation.QuotaVoliation:
                         NotifyPolicyQouta = true;
                         break;
                     case (int)policyVoilation.FileSizeVoilation:
                         NotifyPolicySize = true;
                         break;
                     case (int)policyVoilation.FileTypeVoilation:
                         NotifyPolicyType = true;
                         break;
                     case (int)policyVoilation.DiskFullVoilation:
                         NotifyDiskFull = true;
                         break;
                     case (int)policyVoilation.PremissionUnavailable:
                         NotifyIOPermission = true;
                         break;
                     case (int)policyVoilation.LongPath:
                         NotifyPathLong = true;
                         break;
                     default:
                         FormsTrayApp.log.Debug("invalid index");
                         break;
                 }
             }
         }
         decimal syncValueInSeconds;
         if (((string)timeUnit.SelectedItem).Equals(resourceManager.GetString("days")))
         {
             syncValueInSeconds = defaultInterval.Value * 86400;
         }
         else if (((string)timeUnit.SelectedItem).Equals(resourceManager.GetString("hours")))
         {
             syncValueInSeconds = defaultInterval.Value * 3600;
         }
         else if (((string)timeUnit.SelectedItem).Equals(resourceManager.GetString("minutes")))
         {
             syncValueInSeconds = defaultInterval.Value * 60;
         }
         else
         {
             syncValueInSeconds = defaultInterval.Value;
         }
         int currentInterval = ifWebService.GetDefaultSyncInterval();
         if ((!syncValueInSeconds.Equals((decimal)currentInterval)) ||
             (autoSync.Checked != (currentInterval != System.Threading.Timeout.Infinite)))
         {
             try
             {
                 ifWebService.SetDefaultSyncInterval(autoSync.Checked ? (int)syncValueInSeconds : System.Threading.Timeout.Infinite);
                 if (autoSync.Checked)
                 {
                     displaySyncInterval((int)syncValueInSeconds);
                 }
             }
             catch (Exception ex)
             {
                 result = false;
                 Novell.iFolderCom.MyMessageBox mmb = new MyMessageBox(resourceManager.GetString("saveSyncError"), resourceManager.GetString("PreferencesErrorTitle"), ex.Message, MyMessageBoxButtons.OK, MyMessageBoxIcon.Error);
                 mmb.ShowDialog();
                 mmb.Dispose();
             }
         }
     }
     catch (Exception ex)
     {
         result = false;
         Novell.iFolderCom.MyMessageBox mmb = new MyMessageBox(resourceManager.GetString("readSyncError"), resourceManager.GetString("PreferencesErrorTitle"), ex.Message, MyMessageBoxButtons.OK, MyMessageBoxIcon.Error);
         mmb.ShowDialog();
         mmb.Dispose();
     }
     Cursor.Current = Cursors.Default;
     return result;
 }
Exemplo n.º 27
0
 private void menuRecoverKeys_Click(object sender, EventArgs e)
 {
     KeyRecoveryWizard kr = new KeyRecoveryWizard(this.ifWebService, this.simiasWebService, this.simiasManager);
     if (kr.GetLoggedInDomains() == true)
     {
         kr.ShowDialog();
     }
     else
     {
         System.Resources.ResourceManager Resource =
             new System.Resources.ResourceManager(typeof(FormsTrayApp));
         Novell.iFolderCom.MyMessageBox mmb =
             new MyMessageBox(Resource.GetString("NoLoggedInDomainsText"),
                 Resource.GetString("ResetError"),
                 "",
                 MyMessageBoxButtons.OK,
                 MyMessageBoxIcon.Error);
         mmb.ShowDialog();
         mmb.Dispose();
     }
 }
Exemplo n.º 28
0
 private void InitializeComponent()
 {
     this.components = new System.ComponentModel.Container();
        System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(FormsTrayApp));
        this.contextMenu1 = new System.Windows.Forms.ContextMenu();
        this.menuTools = new System.Windows.Forms.MenuItem();
        this.menuStoreBrowser = new System.Windows.Forms.MenuItem();
        this.menuEventLogReader = new System.Windows.Forms.MenuItem();
        this.menuSeparator1 = new System.Windows.Forms.MenuItem();
        this.menuProperties = new System.Windows.Forms.MenuItem();
        this.menuAccounts = new System.Windows.Forms.MenuItem();
        this.menuSyncLog = new System.Windows.Forms.MenuItem();
        this.menuItem1 = new System.Windows.Forms.MenuItem();
        this.menuPreferences = new System.Windows.Forms.MenuItem();
        this.menuHelp = new System.Windows.Forms.MenuItem();
        this.menuAbout = new System.Windows.Forms.MenuItem();
        this.menuHideTrayIcon = new System.Windows.Forms.MenuItem();
        this.menuItem10 = new System.Windows.Forms.MenuItem();
        this.menuExit = new System.Windows.Forms.MenuItem();
        this.syncAnimateTimer = new System.Windows.Forms.Timer(this.components);
        this.contextMenu1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
                this.menuTools,
                this.menuSeparator1,
                this.menuProperties,
                this.menuAccounts,
                this.menuSyncLog,
                this.menuItem1,
                this.menuPreferences,
                this.menuHelp,
                this.menuAbout,
                 this.menuHideTrayIcon,
                this.menuItem10,
                this.menuExit});
        this.contextMenu1.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("contextMenu1.RightToLeft")));
        this.menuTools.Enabled = ((bool)(resources.GetObject("menuTools.Enabled")));
        this.menuTools.Index = 0;
        this.menuTools.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
                this.menuStoreBrowser,
                this.menuEventLogReader});
        this.menuTools.Shortcut = ((System.Windows.Forms.Shortcut)(resources.GetObject("menuTools.Shortcut")));
        this.menuTools.ShowShortcut = ((bool)(resources.GetObject("menuTools.ShowShortcut")));
        this.menuTools.Text = resources.GetString("menuTools.Text");
        this.menuTools.Visible = ((bool)(resources.GetObject("menuTools.Visible")));
        this.menuStoreBrowser.Enabled = ((bool)(resources.GetObject("menuStoreBrowser.Enabled")));
        this.menuStoreBrowser.Index = 0;
        this.menuStoreBrowser.Shortcut = ((System.Windows.Forms.Shortcut)(resources.GetObject("menuStoreBrowser.Shortcut")));
        this.menuStoreBrowser.ShowShortcut = ((bool)(resources.GetObject("menuStoreBrowser.ShowShortcut")));
        this.menuStoreBrowser.Text = resources.GetString("menuStoreBrowser.Text");
        this.menuStoreBrowser.Visible = ((bool)(resources.GetObject("menuStoreBrowser.Visible")));
        this.menuStoreBrowser.Click += new System.EventHandler(this.menuStoreBrowser_Click);
        this.menuEventLogReader.Enabled = ((bool)(resources.GetObject("menuEventLogReader.Enabled")));
        this.menuEventLogReader.Index = 1;
        this.menuEventLogReader.Shortcut = ((System.Windows.Forms.Shortcut)(resources.GetObject("menuEventLogReader.Shortcut")));
        this.menuEventLogReader.ShowShortcut = ((bool)(resources.GetObject("menuEventLogReader.ShowShortcut")));
        this.menuEventLogReader.Text = resources.GetString("menuEventLogReader.Text");
        this.menuEventLogReader.Visible = ((bool)(resources.GetObject("menuEventLogReader.Visible")));
        this.menuEventLogReader.Click += new System.EventHandler(this.menuEventLogReader_Click);
        this.menuSeparator1.Enabled = ((bool)(resources.GetObject("menuSeparator1.Enabled")));
        this.menuSeparator1.Index = 1;
        this.menuSeparator1.Shortcut = ((System.Windows.Forms.Shortcut)(resources.GetObject("menuSeparator1.Shortcut")));
        this.menuSeparator1.ShowShortcut = ((bool)(resources.GetObject("menuSeparator1.ShowShortcut")));
        this.menuSeparator1.Text = resources.GetString("menuSeparator1.Text");
        this.menuSeparator1.Visible = ((bool)(resources.GetObject("menuSeparator1.Visible")));
        this.menuProperties.DefaultItem = true;
        this.menuProperties.Enabled = ((bool)(resources.GetObject("menuProperties.Enabled")));
        this.menuProperties.Index = 2;
        this.menuProperties.Shortcut = ((System.Windows.Forms.Shortcut)(resources.GetObject("menuProperties.Shortcut")));
        this.menuProperties.ShowShortcut = ((bool)(resources.GetObject("menuProperties.ShowShortcut")));
        this.menuProperties.Text = resources.GetString("menuProperties.Text");
        this.menuProperties.Visible = ((bool)(resources.GetObject("menuProperties.Visible")));
        this.menuProperties.Click += new System.EventHandler(this.menuProperties_Click);
        this.menuAccounts.Enabled = ((bool)(resources.GetObject("menuAccounts.Enabled")));
        this.menuAccounts.Index = 3;
        this.menuAccounts.Shortcut = ((System.Windows.Forms.Shortcut)(resources.GetObject("menuAccounts.Shortcut")));
        this.menuAccounts.ShowShortcut = ((bool)(resources.GetObject("menuAccounts.ShowShortcut")));
        this.menuAccounts.Text = resources.GetString("menuAccounts.Text");
        this.menuAccounts.Visible = ((bool)(resources.GetObject("menuAccounts.Visible")));
        this.menuAccounts.Click += new System.EventHandler(this.menuAccounts_Click);
        this.menuSyncLog.Enabled = ((bool)(resources.GetObject("menuSyncLog.Enabled")));
        this.menuSyncLog.Index = 4;
        this.menuSyncLog.Shortcut = ((System.Windows.Forms.Shortcut)(resources.GetObject("menuSyncLog.Shortcut")));
        this.menuSyncLog.ShowShortcut = ((bool)(resources.GetObject("menuSyncLog.ShowShortcut")));
        this.menuSyncLog.Text = resources.GetString("menuSyncLog.Text");
        this.menuSyncLog.Visible = ((bool)(resources.GetObject("menuSyncLog.Visible")));
        this.menuSyncLog.Click += new System.EventHandler(this.menuSyncLog_Click);
        this.menuItem1.Enabled = ((bool)(resources.GetObject("menuItem1.Enabled")));
        this.menuItem1.Index = 5;
        this.menuItem1.Shortcut = ((System.Windows.Forms.Shortcut)(resources.GetObject("menuItem1.Shortcut")));
        this.menuItem1.ShowShortcut = ((bool)(resources.GetObject("menuItem1.ShowShortcut")));
        this.menuItem1.Text = resources.GetString("menuItem1.Text");
        this.menuItem1.Visible = ((bool)(resources.GetObject("menuItem1.Visible")));
        this.menuPreferences.Enabled = ((bool)(resources.GetObject("menuPreferences.Enabled")));
        this.menuPreferences.Index = 6;
        this.menuPreferences.Shortcut = ((System.Windows.Forms.Shortcut)(resources.GetObject("menuPreferences.Shortcut")));
        this.menuPreferences.ShowShortcut = ((bool)(resources.GetObject("menuPreferences.ShowShortcut")));
        this.menuPreferences.Text = resources.GetString("menuPreferences.Text");
        this.menuPreferences.Visible = ((bool)(resources.GetObject("menuPreferences.Visible")));
        this.menuPreferences.Click += new System.EventHandler(this.menuPreferences_Click);
        this.menuHelp.Enabled = ((bool)(resources.GetObject("menuHelp.Enabled")));
        this.menuHelp.Index = 7;
        this.menuHelp.Shortcut = ((System.Windows.Forms.Shortcut)(resources.GetObject("menuHelp.Shortcut")));
        this.menuHelp.ShowShortcut = ((bool)(resources.GetObject("menuHelp.ShowShortcut")));
        this.menuHelp.Text = resources.GetString("menuHelp.Text");
        this.menuHelp.Visible = ((bool)(resources.GetObject("menuHelp.Visible")));
        this.menuHelp.Click += new System.EventHandler(this.menuHelp_Click);
        this.menuAbout.Enabled = ((bool)(resources.GetObject("menuAbout.Enabled")));
        this.menuAbout.Index = 8;
        this.menuAbout.Shortcut = ((System.Windows.Forms.Shortcut)(resources.GetObject("menuAbout.Shortcut")));
        this.menuAbout.ShowShortcut = ((bool)(resources.GetObject("menuAbout.ShowShortcut")));
        this.menuAbout.Text = resources.GetString("menuAbout.Text");
        this.menuAbout.Visible = ((bool)(resources.GetObject("menuAbout.Visible")));
        this.menuAbout.Click += new System.EventHandler(this.menuAbout_Click);
      this.menuHideTrayIcon.Enabled = ((bool)(resources.GetObject("menuHideTrayIcon.Enabled")));
      this.menuHideTrayIcon.Index = 9;
      this.menuHideTrayIcon.Shortcut = ((System.Windows.Forms.Shortcut)(resources.GetObject("menuHideTrayIcon.Shortcut")));
      this.menuHideTrayIcon.ShowShortcut = ((bool)(resources.GetObject("menuHideTrayIcon.ShowShortcut")));
      this.menuHideTrayIcon.Text = resources.GetString("menuHideTrayIcon.Text");
     this.menuHideTrayIcon.Visible = ((bool)(resources.GetObject("menuHideTrayIcon.Visible")));
      this.menuHideTrayIcon.Click += new System.EventHandler(this.menuHideTrayIcon_Click);
        this.menuItem10.Enabled = ((bool)(resources.GetObject("menuItem10.Enabled")));
        this.menuItem10.Index = 10;
        this.menuItem10.Shortcut = ((System.Windows.Forms.Shortcut)(resources.GetObject("menuItem10.Shortcut")));
        this.menuItem10.ShowShortcut = ((bool)(resources.GetObject("menuItem10.ShowShortcut")));
        this.menuItem10.Text = resources.GetString("menuItem10.Text");
        this.menuItem10.Visible = ((bool)(resources.GetObject("menuItem10.Visible")));
        this.menuExit.Enabled = ((bool)(resources.GetObject("menuExit.Enabled")));
        this.menuExit.Index = 11;
        this.menuExit.Shortcut = ((System.Windows.Forms.Shortcut)(resources.GetObject("menuExit.Shortcut")));
        this.menuExit.ShowShortcut = ((bool)(resources.GetObject("menuExit.ShowShortcut")));
        this.menuExit.Text = resources.GetString("menuExit.Text");
        this.menuExit.Visible = ((bool)(resources.GetObject("menuExit.Visible")));
        this.menuExit.Click += new System.EventHandler(this.menuExit_Click);
     msb = new MyMessageBox(resourceManager.GetString("exitMessage"), resourceManager.GetString("exitTitle"), string.Empty, MyMessageBoxButtons.YesNo, MyMessageBoxIcon.Question);
     String basepath = Path.Combine(Application.StartupPath, "res");
     Icon icon = new Icon(Path.Combine(basepath, "ifolder_16.ico"));
     msb.Icon = icon;
        this.syncAnimateTimer.Tick += new System.EventHandler(this.syncAnimateTimer_Tick);
        this.AccessibleDescription = resources.GetString("$this.AccessibleDescription");
        this.AccessibleName = resources.GetString("$this.AccessibleName");
        this.AutoScaleBaseSize = ((System.Drawing.Size)(resources.GetObject("$this.AutoScaleBaseSize")));
        this.AutoScroll = ((bool)(resources.GetObject("$this.AutoScroll")));
        this.AutoScrollMargin = ((System.Drawing.Size)(resources.GetObject("$this.AutoScrollMargin")));
        this.AutoScrollMinSize = ((System.Drawing.Size)(resources.GetObject("$this.AutoScrollMinSize")));
        this.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("$this.BackgroundImage")));
        this.ClientSize = ((System.Drawing.Size)(resources.GetObject("$this.ClientSize")));
        this.Enabled = ((bool)(resources.GetObject("$this.Enabled")));
        this.Font = ((System.Drawing.Font)(resources.GetObject("$this.Font")));
        this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
        this.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("$this.ImeMode")));
        this.Location = ((System.Drawing.Point)(resources.GetObject("$this.Location")));
        this.MaximumSize = ((System.Drawing.Size)(resources.GetObject("$this.MaximumSize")));
        this.MinimumSize = ((System.Drawing.Size)(resources.GetObject("$this.MinimumSize")));
        this.Name = "FormsTrayApp";
        this.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("$this.RightToLeft")));
        this.StartPosition = ((System.Windows.Forms.FormStartPosition)(resources.GetObject("$this.StartPosition")));
        this.Text = resources.GetString("$this.Text");
 }
Exemplo n.º 29
0
 private void menuRemove_Click(object sender, System.EventArgs e)
 {
     if ( selectedItem != null )
        {
     iFolderWeb ifolder = ((iFolderObject)selectedItem.Tag).iFolderWeb;
     MyMessageBox mmb = null;
     if( ifolder.CurrentUserID == ifolder.OwnerID)
     {
      mmb = new Novell.iFolderCom.MyMessageBox(
       string.Format( TrayApp.Properties.Resources.deleteiFolder, ifolder.Name ),
       TrayApp.Properties.Resources.removeTitle,
       string.Empty,
       MyMessageBoxButtons.YesNo,
       MyMessageBoxIcon.Question,
       MyMessageBoxDefaultButton.Button2);
     }
     else
     {
      mmb = new Novell.iFolderCom.MyMessageBox(
        TrayApp.Properties.Resources.RemoveMembershipMesg,
       string.Format(TrayApp.Properties.Resources.RemoveMembershipTitle, ifolder.Name ),
       string.Empty,
       MyMessageBoxButtons.YesNo,
       MyMessageBoxIcon.Question,
       MyMessageBoxDefaultButton.Button2);
     }
     if (mmb.ShowDialog() == DialogResult.Yes)
         {
      try
      {
                 Invalidate();
                 Update();
       if( ifolder.CurrentUserID == ifolder.OwnerID)
       {
        ifWebService.DeleteiFolder(ifolder.DomainID, ifolder.ID);
       }
       ifWebService.DeclineiFolderInvitation(ifolder.DomainID, ifolder.ID);
       lock (ht)
       {
        removeTileListViewItem( selectedItem );
       }
      }
      catch (Exception ex)
      {
       mmb = new MyMessageBox(TrayApp.Properties.Resources.declineError, TrayApp.Properties.Resources.errorTitle, ex.Message, MyMessageBoxButtons.OK, MyMessageBoxIcon.Error);
       mmb.ShowDialog();
      }
     }
        mmb.Dispose();
        }
 }
Exemplo n.º 30
0
 public static bool CheckForClientUpdate(string domainID)
 {
     bool updateStarted = false;
        string version = instance.ifWebService.CheckForUpdatedClient(domainID);
        if ( version != null )
        {
     MyMessageBox mmb = new MyMessageBox(string.Format(resourceManager.GetString("clientUpgradePrompt"), version), resourceManager.GetString("clientUpgradeTitle"), string.Empty, MyMessageBoxButtons.YesNo, MyMessageBoxIcon.Question);
     DialogResult result = mmb.ShowDialog();
     if ( result == DialogResult.Yes )
     {
      if ( updateStarted == false )
      {
       mmb = new MyMessageBox(resourceManager.GetString("clientUpgradeFailure"), resourceManager.GetString("upgradeErrorTitle"), string.Empty, MyMessageBoxButtons.OK, MyMessageBoxIcon.Information);
       mmb.ShowDialog();
      }
     }
        }
        return updateStarted;
 }
Exemplo n.º 31
0
 private void add_Click(object sender, System.EventArgs e)
 {
     bool SharingIsDisabled = ifWebService.GetDisableSharingPolicy(currentUser.UserID, currentiFolder.ID, currentiFolder.OwnerID, currentiFolder.DomainID);
        if( SharingIsDisabled == true)
        {
     Picker picker = new Picker();
     picker.LoadPath = loadPath;
     picker.iFolderWebService = ifWebService;
     picker.Ht = userIDHT;
     picker.CurrentUser = currentUser;
     picker.DomainID = currentiFolder.DomainID;
     if (ownerLvi != null)
     {
      picker.CurrentOwner = newOwnerLvi == null ? ((ShareListMember)ownerLvi.Tag).iFolderUser : ((ShareListMember)newOwnerLvi.Tag).iFolderUser;
     }
     picker.CreateControl();
     DialogResult result = picker.ShowDialog();
     if (result == DialogResult.OK)
     {
      Cursor.Current = Cursors.WaitCursor;
      shareWith.SelectedItems.Clear();
      apply.Enabled = true;
      foreach (ListViewItem lvi in picker.AddedUsers)
      {
       iFolderUser user = picker.GetiFolderUserFromListViewItem(lvi);
       ListViewItem lvitem;
       lock (userIDHT)
       {
        lvitem = (ListViewItem)userIDHT[user.UserID];
       }
       if (lvitem == null)
       {
                     user.Rights = "ReadOnly";
        user.State = inviting;
        addiFolderUserToListView(user);
       }
      }
      foreach (iFolderUser ifUser in picker.RemovedList)
      {
       lock (subscrHT)
       {
        ListViewItem lvi = (ListViewItem)subscrHT[ifUser.ID];
        if (lvi != null)
        {
     if (removedList == null)
     {
      removedList = new ArrayList();
     }
     removedList.Add(lvi.Tag);
     lvi.Remove();
     subscrHT.Remove(ifUser.ID);
        }
        else
        {
     lock (userIDHT)
     {
      lvi = (ListViewItem)userIDHT[ifUser.UserID];
      if (lvi != null)
      {
       lvi.Remove();
      }
     }
        }
       }
       lock (userIDHT)
       {
        userIDHT.Remove(ifUser.UserID);
       }
      }
      Cursor.Current = Cursors.Default;
     }
        }
        else
        {
     MyMessageBox mmb = new MyMessageBox(resourceManager.GetString("DisableSharingError"), resourceManager.GetString("PolicyViolation"), string.Empty, MyMessageBoxButtons.OK, MyMessageBoxIcon.Information);
     mmb.ShowDialog();
        }
 }