当前位置: 首页>>代码示例>>C#>>正文


C# iFolderMsgDialog.Run方法代码示例

本文整理汇总了C#中Novell.iFolder.iFolderMsgDialog.Run方法的典型用法代码示例。如果您正苦于以下问题:C# iFolderMsgDialog.Run方法的具体用法?C# iFolderMsgDialog.Run怎么用?C# iFolderMsgDialog.Run使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Novell.iFolder.iFolderMsgDialog的用法示例。


在下文中一共展示了iFolderMsgDialog.Run方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OnDefaultAccountToggled

 public void OnDefaultAccountToggled(object o, EventArgs args)
 {
     if (DefaultAccountButton.HasFocus)
        {
     if (!DefaultAccountButton.Active) return;
     try
     {
      domainController.SetDefaultDomain(domain.ID);
     }
     catch (Exception e)
     {
      iFolderMsgDialog dg = new iFolderMsgDialog(
       this,
       iFolderMsgDialog.DialogType.Error,
       iFolderMsgDialog.ButtonSet.Ok,
       "",
       Util.GS("Could not make this account the default"),
       Util.GS("There was an error making this account the default."),
       e.Message);
      dg.Run();
      dg.Hide();
      dg.Destroy();
      DefaultAccountButton.Toggled -= new EventHandler(OnDefaultAccountToggled);
      DefaultAccountButton.Active = !DefaultAccountButton.Active;
      DefaultAccountButton.Toggled -= new EventHandler(OnDefaultAccountToggled);
     }
        }
 }
开发者ID:RoDaniel,项目名称:featurehouse,代码行数:28,代码来源:BonjourAccountDialog.cs

示例2: PassphraseHelper

 private static bool PassphraseHelper( EnterPassPhraseDialog epd, string DomainID, SimiasWebService simws)
 {
     bool status = false;
       int result;
     do
     {
       result = epd.Run();
      if(result == (int)ResponseType.Cancel || result == (int) ResponseType.DeleteEvent)
      {
         epd.Hide();
       return false;
     }
       if( epd.PassPhrase != epd.RetypedPassPhrase )
       {
        iFolderMsgDialog dialog = new iFolderMsgDialog(
     null,
     iFolderMsgDialog.DialogType.Error,
     iFolderMsgDialog.ButtonSet.None,
     Util.GS("passphrase mismatch"),
     Util.GS("The passphrase and retyped passphrase are not same"),
        Util.GS("Please enter the passphrase again"));
        dialog.Run();
        dialog.Hide();
        dialog.Destroy();
        dialog = null;
       }
     else
     {
         break;
     }
     }while( result != (int)ResponseType.Cancel );
       if( result != (int)ResponseType.Cancel || result != (int) ResponseType.DeleteEvent)
       {
        string publicKey = null;
        if( epd.RecoveryAgent != null && epd.RecoveryAgent != "Server_Default")
        {
     byte [] RACertificateObj = DomainController.GetDomainController().GetRACertificate(DomainID, epd.RecoveryAgent);
     if( RACertificateObj != null && RACertificateObj.Length != 0)
     {
      System.Security.Cryptography.X509Certificates.X509Certificate Cert = new System.Security.Cryptography.X509Certificates.X509Certificate(RACertificateObj);
      CertificateDialog dlg = new CertificateDialog(Cert.ToString(true));
      if (!Util.RegisterModalWindow(dlg))
      {
       dlg.Destroy();
       dlg = null;
       return false;
      }
      int res = dlg.Run();
      dlg.Hide();
      dlg.Destroy();
      dlg = null;
      if( res == (int)ResponseType.Ok)
      {
       publicKey = Convert.ToBase64String(Cert.GetPublicKey());
      }
      else
      {
                 status = false;
           simws.StorePassPhrase(DomainID, "", CredentialType.None, false);
       return ShowEnterPassPhraseDialog(DomainID, simws);
      }
     }
         status = SetPassPhrase( epd, DomainID, publicKey, simws );
         epd.Hide();
         return status;
        }
       else
       {
      DomainInformation domainInfo = (DomainInformation)simws.GetDomainInformation(DomainID);
                 string memberID = domainInfo.MemberUserID;
       iFolderWebService ifWebService = DomainController.GetiFolderService();
      publicKey = ifWebService.GetDefaultServerPublicKey(DomainID,memberID);
                 status = SetPassPhrase(epd,DomainID,publicKey,simws);
                 epd.Hide();
                 return status;
       }
       }
     else
     {
     epd.Hide();
     }
     return true;
 }
开发者ID:RoDaniel,项目名称:featurehouse,代码行数:83,代码来源:iFolderWindow.cs

示例3: AskRemoveMembership

 private int AskRemoveMembership(iFolderHolder holder)
 {
     int rc = 0;
        iFolderMsgDialog dialog = new iFolderMsgDialog(
     this,
     iFolderMsgDialog.DialogType.Question,
     iFolderMsgDialog.ButtonSet.YesNo,
     "",
     string.Format(Util.GS("Remove your membership from \"{0}\"?"),
      holder.iFolder.Name),
     Util.GS("This removes your membership from the iFolder and removes the iFolder from your list."));
        rc = dialog.Run();
        dialog.Hide();
        dialog.Destroy();
        return rc;
 }
开发者ID:RoDaniel,项目名称:featurehouse,代码行数:16,代码来源:iFolderWindow.cs

示例4: RemoveSelectedFolderHandler

 private void RemoveSelectedFolderHandler()
 {
     iFolderHolder holder = iFoldersIconView.SelectedFolder;
        if (holder != null)
        {
     iFolderMsgDialog dialog = new iFolderMsgDialog(
      this,
      iFolderMsgDialog.DialogType.Question,
      iFolderMsgDialog.ButtonSet.YesNo,
      "",
      Util.GS("Revert this iFolder back to a normal folder?"),
      Util.GS("The folder will still be on your computer, but it will no longer synchronize with the iFolder Server."));
     CheckButton deleteFromServerCB;
     DomainInformation domain =
      domainController.GetDomain(holder.iFolder.DomainID);
     if (domain == null || domain.MemberUserID == holder.iFolder.OwnerID)
      deleteFromServerCB = new CheckButton(Util.GS("Also _delete this iFolder from the server"));
     else
      deleteFromServerCB = new CheckButton(Util.GS("Also _remove my membership from this iFolder"));
     dialog.ExtraWidget = deleteFromServerCB;
     int rc = dialog.Run();
     dialog.Hide();
     dialog.Destroy();
     if(rc == -8)
     {
      try
      {
       iFolderHolder subHolder =
        ifdata.RevertiFolder(holder.iFolder.ID);
       if (deleteFromServerCB.Active)
       {
        if (subHolder == null)
     ifdata.DeleteiFolder(holder.iFolder.ID);
        else
     ifdata.DeleteiFolder(subHolder.iFolder.ID);
       }
       iFoldersIconView.UnselectAll();
      }
      catch(Exception e)
      {
       iFolderExceptionDialog ied =
        new iFolderExceptionDialog(
     this,
     e);
       ied.Run();
       ied.Hide();
       ied.Destroy();
      }
      UpdateSensitivity();
     }
        }
 }
开发者ID:RoDaniel,项目名称:featurehouse,代码行数:52,代码来源:iFolderWindow.cs

示例5: OnIconViewDragDataReceived

 private void OnIconViewDragDataReceived(object o, DragDataReceivedArgs args)
 {
     Console.WriteLine("OnIconViewDragDataReceived: {0}", (DragTargetType)args.Info);
        bool bFolderCreated = false;
        switch (args.Info)
        {
     case (uint) DragTargetType.iFolderID:
      string ifolderID =
       System.Text.Encoding.UTF8.GetString(args.SelectionData.Data);
      iFolderHolder holder = ifdata.GetAvailableiFolder(ifolderID);
      if (holder != null)
       DownloadiFolder(holder);
      break;
     case (uint) DragTargetType.UriList:
      UriList uriList = new UriList(args.SelectionData);
      if (uriList.Count == 1)
      {
       string path = uriList.ToLocalPaths()[0];
        DomainInformation[] domains = domainController.GetDomains();
        if (domains.Length <= 0) return;
        string domainID = domains[0].ID;
        DomainInformation defaultDomain = domainController.GetDefaultDomain();
        if (defaultDomain != null)
     domainID = defaultDomain.ID;
        DragCreateDialog cd = new DragCreateDialog(this, domains, domainID, path);
        cd.TransientFor = this;
        int rc = 0;
        do
        {
     rc = cd.Run();
     cd.Hide();
     if (rc == (int)ResponseType.Ok)
     {
      try
      {
       string selectedFolder = cd.iFolderPath.Trim();
       string selectedDomain = cd.DomainID;
       string parentDir = System.IO.Path.GetDirectoryName( selectedFolder );
       if ( ( parentDir == null ) || ( parentDir == String.Empty ) )
       {
        iFolderMsgDialog dg = new iFolderMsgDialog(
     this,
     iFolderMsgDialog.DialogType.Warning,
     iFolderMsgDialog.ButtonSet.Ok,
     "",
     Util.GS("Invalid folder specified"),
     Util.GS("An invalid folder was specified"));
        dg.Run();
        dg.Hide();
        dg.Destroy();
        continue;
       }
       iFolderHolder ifHolder = null;
       try
       {
        ifHolder =
     ifdata.CreateiFolder(selectedFolder,
       selectedDomain);
       }
       catch(Exception e)
       {
        if (DisplayCreateOrSetupException(e))
        {
     continue;
        }
       }
       if(ifHolder == null)
        throw new Exception("Simias returned null");
       rc = 0;
       Util.LastCreatedPath = ifHolder.iFolder.UnManagedPath;
       if(ClientConfig.Get(ClientConfig.KEY_SHOW_CREATION,
       "true") == "true")
       {
        iFolderCreationDialog dlg =
     new iFolderCreationDialog(ifHolder.iFolder);
        dlg.TransientFor = this;
        int createRC;
        do
        {
     createRC = dlg.Run();
     if(createRC == (int)Gtk.ResponseType.Help)
     {
      Util.ShowHelp("myifolders.html", this);
     }
        }while(createRC != (int)Gtk.ResponseType.Ok);
        dlg.Hide();
        if(dlg.HideDialog)
        {
     ClientConfig.Set(
      ClientConfig.KEY_SHOW_CREATION, "false");
        }
        cd.Destroy();
        cd = null;
       }
      }
      catch (Exception e)
      {
       Console.WriteLine(e.Message);
       continue;
      }
//.........这里部分代码省略.........
开发者ID:RoDaniel,项目名称:featurehouse,代码行数:101,代码来源:iFolderWindow.cs

示例6: SaveServerAddress

 private bool SaveServerAddress()
 {
     string serverAddress = ServerAddressEntry.Text;
        string username = domain.MemberName;
        string password = domainController.GetDomainPassword(domain.ID);
        bServerAddressChanged = false;
        bool bHostAddressUpdated = false;
        if (serverAddress == null || serverAddress.Trim().Length == 0)
        {
     iFolderMsgDialog dg =
      new iFolderMsgDialog(
       this,
       iFolderMsgDialog.DialogType.Error,
       iFolderMsgDialog.ButtonSet.Ok,
       "",
       Util.GS("Server address cannot be empty"),
       Util.GS("Please enter an address for the server."));
     dg.Run();
     dg.Hide();
     dg.Destroy();
     ServerAddressEntry.Changed -= new EventHandler(OnServerAddressChanged);
     ServerAddressEntry.Text = GetHostUrl(domain.HostUrl);
     ServerAddressEntry.Changed += new EventHandler(OnServerAddressChanged);
     return bHostAddressUpdated;
        }
        if (password == null || password.Trim().Length == 0)
        {
     Entry tempPasswordEntry = new Entry();
     tempPasswordEntry.Visibility = false;
     iFolderMsgDialog dg =
      new iFolderMsgDialog(
       this,
       iFolderMsgDialog.DialogType.Info,
       iFolderMsgDialog.ButtonSet.OkCancel,
       "",
       Util.GS("Please enter your password"),
       Util.GS("Your password is required to change the address of the server."));
     dg.ExtraWidget = tempPasswordEntry;
     tempPasswordEntry.GrabFocus();
     tempPasswordEntry.ActivatesDefault = true;
     dg.TransientFor = this;
     int rc = dg.Run();
     password = tempPasswordEntry.Text;
     dg.Hide();
     dg.Destroy();
     if ((ResponseType)rc == ResponseType.Cancel)
     {
      ServerAddressEntry.Changed -= new EventHandler(OnServerAddressChanged);
      ServerAddressEntry.Text = GetHostUrl(domain.HostUrl);
      ServerAddressEntry.Changed += new EventHandler(OnServerAddressChanged);
      return bHostAddressUpdated;
     }
     if (password == null || password.Trim().Length == 0)
     {
      ServerAddressEntry.Changed -= new EventHandler(OnServerAddressChanged);
      ServerAddressEntry.Text = GetHostUrl(domain.HostUrl);
      ServerAddressEntry.Changed += new EventHandler(OnServerAddressChanged);
      return bHostAddressUpdated;
     }
        }
        serverAddress = serverAddress.Trim();
        Exception hostAddressUpdateException = null;
        try
        {
     if (domainController.UpdateDomainHostAddress(domain.ID, serverAddress, username, password) != null)
     {
      bHostAddressUpdated = true;
     }
        }
        catch(Exception e)
        {
     hostAddressUpdateException = e;
        }
        if (!bHostAddressUpdated)
        {
     iFolderMsgDialog dg = new iFolderMsgDialog(
      this,
      iFolderMsgDialog.DialogType.Error,
      iFolderMsgDialog.ButtonSet.Ok,
      "",
      Util.GS("Unable to modify the server address"),
      Util.GS("An error was encountered while attempting to modify the server address.  Please verify the address and your password are correct."),
      hostAddressUpdateException == null ? null : hostAddressUpdateException.Message);
     dg.Run();
     dg.Hide();
     dg.Destroy();
     ServerAddressEntry.Changed -= new EventHandler(OnServerAddressChanged);
     ServerAddressEntry.Text = GetHostUrl(domain.HostUrl);
     ServerAddressEntry.Changed += new EventHandler(OnServerAddressChanged);
        }
        return bHostAddressUpdated;
 }
开发者ID:RoDaniel,项目名称:featurehouse,代码行数:92,代码来源:EnterpriseAccountDialog.cs

示例7: OnEnableAccountToggled

 public void OnEnableAccountToggled(object o, EventArgs args)
 {
     if (EnableAccountButton.HasFocus)
        {
     if (EnableAccountButton.Active != domain.Active)
     {
      try
      {
       if (EnableAccountButton.Active)
       {
        domainController.ActivateDomain(domain.ID);
       }
       else
       {
        domainController.InactivateDomain(domain.ID);
       }
      }
      catch(Exception e)
      {
       string header;
       string message;
       if (EnableAccountButton.Active)
       {
        header = Util.GS("Could not enable this account");
        message = Util.GS("There was an error enabling this account.");
       }
       else
       {
        header = Util.GS("Could not disable this account");
        message = Util.GS("There was an error disabling this account.");
       }
       iFolderMsgDialog dg = new iFolderMsgDialog(
        this,
        iFolderMsgDialog.DialogType.Error,
        iFolderMsgDialog.ButtonSet.Ok,
        "",
        header,
        message,
        e.Message);
       dg.Run();
       dg.Hide();
       dg.Destroy();
       EnableAccountButton.Toggled -= new EventHandler(OnEnableAccountToggled);
       EnableAccountButton.Active = !EnableAccountButton.Active;
       EnableAccountButton.Toggled -= new EventHandler(OnEnableAccountToggled);
      }
     }
        }
 }
开发者ID:RoDaniel,项目名称:featurehouse,代码行数:49,代码来源:EnterpriseAccountDialog.cs

示例8: RenameFileHandler

 protected void RenameFileHandler(object o, EventArgs args)
 {
     string newFileName = nameConflictEntry.Text;
        TreeModel tModel;
        ConflictHolder ch = null;
        TreeSelection tSelect = ConflictTreeView.Selection;
        if (tSelect.CountSelectedRows() == 1)
        {
     Array treePaths = tSelect.GetSelectedRows(out tModel);
     TreeIter iter;
     if (ConflictTreeStore.GetIter(out iter, (TreePath)treePaths.GetValue(0)))
     {
      ch = (ConflictHolder) tModel.GetValue(iter, 0);
      Conflict lnc = ch.LocalNameConflict;
      Conflict snc = ch.ServerNameConflict;
      try
      {
       if (snc != null && ifolder.CurrentUserRights == "ReadOnly")
       {
        ifws.RenameAndResolveConflict(snc.iFolderID,
         snc.ConflictID,
         newFileName);
       }
       else
       {
        if (lnc != null)
        {
     if(newFileName == oldFileName)
     {
      iFolderMsgDialog dg = new iFolderMsgDialog(
       this,
       iFolderMsgDialog.DialogType.Error,
       iFolderMsgDialog.ButtonSet.Ok,
       "",
       Util.GS("Name Already Exists"),
       Util.GS("The specified name already exists.  Please choose a different name."),
       null);
      dg.Run();
      dg.Hide();
      dg.Destroy();
      return;
     }
        Conflict[] conflictList = ifws.GetiFolderConflicts(lnc.iFolderID);
        ifws.ResolveNameConflict(lnc.iFolderID,lnc.ConflictID,newFileName);
        foreach(Conflict con in conflictList)
                                                 {
                                                        if(con != null && con.IsNameConflict && con.ServerName != null)
                                                        if(String.Compare(lnc.LocalFullPath,con.ServerFullPath,true)== 0) {
       if (ifolder.CurrentUserRights == "ReadOnly")
       {
      ifws.RenameAndResolveConflict(con.iFolderID,con.ConflictID,con.ServerName);
      break;
       }
                                                     else
       {
      ifws.ResolveNameConflict(con.iFolderID,con.ConflictID,con.ServerName);
      break;
       }
                                                        }
                                            }
        ifws.SynciFolderNow(lnc.iFolderID);
        }
        if (snc != null)
        {
     if(newFileName != oldFileName)
     {
      iFolderMsgDialog dg = new iFolderMsgDialog(
       this,
       iFolderMsgDialog.DialogType.Error,
       iFolderMsgDialog.ButtonSet.Ok,
       "",
       Util.GS("Name Already Exists"),
       Util.GS("The specified name already exists.  Please choose a different name."),
       null);
      dg.Run();
      dg.Hide();
      dg.Destroy();
      return;
     }
     ifws.ResolveNameConflict(snc.iFolderID,
        snc.ConflictID,
        ch.Name);
        }
       }
       ConflictTreeStore.Remove(ref iter);
      }
      catch (Exception e)
      {
       bool bKnownError = true;
       string headerText = Util.GS("iFolder Conflict Error");
       string errText = Util.GS("An error was encountered while resolving the conflict.");
       if (e.Message.IndexOf("Malformed") >= 0)
       {
        headerText = Util.GS("Invalid Characters in Name");
        errText = string.Format(Util.GS("The specified name contains invalid characters.  Please choose a different name and try again.\n\nNames must not contain any of these characters: {0}"),
      simws.GetInvalidSyncFilenameChars());
       }
       else if (e.Message.IndexOf("already exists") >= 0)
       {
        headerText = Util.GS("Name Already Exists");
//.........这里部分代码省略.........
开发者ID:RoDaniel,项目名称:featurehouse,代码行数:101,代码来源:iFolderConflictDialog.cs

示例9: Migrate2xClickedHandler

 private void Migrate2xClickedHandler(object o, EventArgs args)
 {
     bool if2Present = true;
                 string str = Mono.Unix.UnixEnvironment.EffectiveUser.HomeDirectory;
                 if(!System.IO.Directory.Exists(str+"/.novell/ifolder"))
        {
     if2Present = false;
                 }
        else
        {
                  string[] dirs;
                  dirs = System.IO.Directory.GetDirectories(str+"/.novell/ifolder");
                  str = str+"/.novell/ifolder";
     int i;
                  for(i=0;i<dirs.Length;i++)
                  {
                          if(dirs[i] != str+"/reg" && dirs[i] != str+"/Save")
                          {
       break;
                          }
     }
     if( i == dirs.Length)
      if2Present = false;
                 }
        if( if2Present == false)
        {
     iFolderMsgDialog NoiF2Dialog = new iFolderMsgDialog(
     null,
     iFolderMsgDialog.DialogType.Info,
     iFolderMsgDialog.ButtonSet.Ok,
     Util.GS("iFolder Migration"),
     Util.GS("There is no iFolder 2.x data present on this computer."),Util.GS(" "));
     NoiF2Dialog.Run();
     NoiF2Dialog.Hide();
     NoiF2Dialog.Destroy();
     return;
        }
        MigrationWindow migrationWindow = new MigrationWindow(this, ifws, simws);
        migrationWindow.ShowAll();
        return;
 }
开发者ID:RoDaniel,项目名称:featurehouse,代码行数:41,代码来源:iFolderWindow.cs

示例10: ImportClicked

 private void ImportClicked( object o, EventArgs args)
 {
     DomainInformation[] domains = this.domainController.GetLoggedInDomains();
        if( domains == null)
        {
     iFolderMsgDialog dialog = new iFolderMsgDialog(
                                                                                                         null,
                                                                                                         iFolderMsgDialog.DialogType.Error,
                                                                                                         iFolderMsgDialog.ButtonSet.None,
                                                                                                         Util.GS("No Logged-In domains"),
                                                                                                         Util.GS("There are no logged-in domains for importing keys."),
                                                                                                         Util.GS("For importing keys the domain should be connected. Log on to the domain and try."));
      dialog.Run();
                          dialog.Hide();
                          dialog.Destroy();
                          dialog = null;
      return;
     }
        ImportKeysDialog import = new ImportKeysDialog(ifws, simws);
        import.TransientFor = this;
        int result = import.Run();
        string fileName = import.FileName;
        string domainID = import.Domain;
        string OneTimePassphrase = import.OneTimePP;
        string NewPassphrase = import.PassPhrase;
        import.Hide();
        import.Destroy();
        if( result == (int)ResponseType.Ok)
        {
     try
     {
      this.simws.ImportiFoldersCryptoKeys( domainID, NewPassphrase, OneTimePassphrase, fileName);
      bool rememberOption = this.simws.GetRememberOption(domainID);
      simws.StorePassPhrase(domainID, "", CredentialType.None, false);
      simws.StorePassPhrase(domainID, NewPassphrase, CredentialType.Basic, rememberOption);
      iFolderMsgDialog dialog = new iFolderMsgDialog(
      null,
      iFolderMsgDialog.DialogType.Info,
      iFolderMsgDialog.ButtonSet.None,
      Util.GS("Import Decrypted Keys"),
      Util.GS("Successfully imported the keys and changed the passphrase"),
      Util.GS("Use your new passphrase from now"));
      dialog.Run();
      dialog.Hide();
      dialog.Destroy();
      dialog = null;
     }
     catch(Exception)
     {
      iFolderMsgDialog dialog = new iFolderMsgDialog(
       null,
       iFolderMsgDialog.DialogType.Error,
       iFolderMsgDialog.ButtonSet.None,
       Util.GS("Import Decrypted Keys"),
       Util.GS("Error importing the keys."),
       Util.GS(""));
       dialog.Run();
       dialog.Hide();
       dialog.Destroy();
       dialog = null;
     }
        }
        else if( result == (int)ResponseType.Help)
        {
     Util.ShowHelp("managingpassphrse.html", this);
        }
 }
开发者ID:RoDaniel,项目名称:featurehouse,代码行数:67,代码来源:iFolderWindow.cs

示例11: ExportClicked

 private void ExportClicked( object o, EventArgs args)
 {
     ExportKeysDialog export = new ExportKeysDialog(ifws, simws);
        export.TransientFor = this;
        int res = export.Run();
        string fileName = export.FileName;
        string domainID = export.Domain;
        export.Hide();
        export.Destroy();
        if( res == (int)ResponseType.Ok)
        {
     try
     {
      this.simws.ExportiFoldersCryptoKeys(domainID, fileName);
      iFolderMsgDialog dialog = new iFolderMsgDialog(
      null,
      iFolderMsgDialog.DialogType.Info,
      iFolderMsgDialog.ButtonSet.None,
      Util.GS("Export Encrypted Keys"), Util.GS("Successfully exported the keys."),
      Util.GS("File name:")+fileName);
      dialog.Run();
      dialog.Hide();
      dialog.Destroy();
      dialog = null;
     }
     catch(Exception ex)
     {
      iFolderMsgDialog dialog = new iFolderMsgDialog(
       null,
       iFolderMsgDialog.DialogType.Error,
       iFolderMsgDialog.ButtonSet.None,
       Util.GS("Export Encrypted Keys"),
       Util.GS(ex.Message),
       Util.GS(""));
       dialog.Run();
       dialog.Hide();
       dialog.Destroy();
       dialog = null;
     }
        }
        else if( res == (int)ResponseType.Help)
        {
     Util.ShowHelp("managingpassphrse.html", this);
        }
 }
开发者ID:RoDaniel,项目名称:featurehouse,代码行数:45,代码来源:iFolderWindow.cs

示例12: DownloadiFolder

 private void DownloadiFolder(iFolderHolder holder, bool merge)
 {
     if( holder.iFolder.encryptionAlgorithm != null && holder.iFolder.encryptionAlgorithm != "")
        {
     if( IsPassPhraseAvailable(holder.iFolder.DomainID) == false)
     {
      return;
     }
        }
        if (holder != null && holder.iFolder.IsSubscription)
        {
     string newPath = "";
     int rc = 0;
      if( holder.iFolder.MigratediFolder > 0 )
      {
       if( MigrationDialog.CanBeMigrated(holder.iFolder.Name) )
       {
        iFolderMsgDialog dlg = new iFolderMsgDialog( null, iFolderMsgDialog.DialogType.Info, iFolderMsgDialog.ButtonSet.OkCancel,
                                                                                         Util.GS("Migration Alert"), Util.GS("The iFolder you have selected for downloading is a migrated iFolder.") , Util.GS("There are 2.x iFolders on your local machine. Do you want to merge this iFolder with any of the 2.x iFolders?") );
        int res = dlg.Run();
        dlg.Hide();
        dlg.Destroy();
        if( res == (int)ResponseType.Ok)
        {
     bool cancelled = false;
     do
     {
      bool result = MergeWithLocaliFolder( holder, out cancelled);
      if( result == true || cancelled == true)
       return;
     }while(cancelled == false);
        }
       }
      }
     do
     {
      iFolderAcceptDialog iad =
      new iFolderAcceptDialog(holder.iFolder, Util.LastSetupPath, merge);
      iad.TransientFor = this;
      rc = iad.Run();
      newPath = ParseAndReplaceTildeInPath(iad.Path);
      iad.Hide();
      iad.Destroy();
      if(rc != -5)
      return;
      try
      {
       if(merge == true)
       {
        String folderPath = newPath;
        if( System.IO.Path.GetFileName(folderPath) != holder.iFolder.Name)
        {
     throw new Exception("FolderDoesNotExist");
        }
        if( ifws.IsiFolder(folderPath))
        {
     throw new Exception("AtOrInsideCollectionPath");
        }
       }
       if( merge )
       {
        ifdata.AcceptiFolderInvitation(
        holder.iFolder.ID,
        holder.iFolder.DomainID,
        newPath,
        merge);
       }
       else
       {
        string downloadpath = newPath;
        System.IO.DirectoryInfo dir = new System.IO.DirectoryInfo(downloadpath);
                                   if(dir.Name == holder.iFolder.Name)
        {
                                           downloadpath = System.IO.Directory.GetParent(newPath).ToString();
     dir = new System.IO.DirectoryInfo(downloadpath);
        }
                                   if( System.IO.Directory.Exists( downloadpath+"/"+holder.iFolder.Name))
                                   {
                                           iFolderMsgDialog DownloadMergeDialog = new iFolderMsgDialog(
                                           null,
                                           iFolderMsgDialog.DialogType.Info,
                                           iFolderMsgDialog.ButtonSet.OkCancel,
                                           Util.GS("A folder with the same name already exists."),
                                           string.Format(Util.GS("Click Ok to merge the folder or Cancel to select a different location")),null);
                                           int rc1 = DownloadMergeDialog.Run();
                                           DownloadMergeDialog.Hide();
                                           DownloadMergeDialog.Destroy();
                                           if ((ResponseType)rc1 == ResponseType.Ok)
                                    {
                                                   ifdata.AcceptiFolderInvitation( holder.iFolder.ID, holder.iFolder.DomainID, System.IO.Path.Combine(downloadpath,holder.iFolder.Name),true);
                                           }
     else
      continue;
        }
        else
                                           ifdata.AcceptiFolderInvitation( holder.iFolder.ID, holder.iFolder.DomainID, downloadpath);
       }
       if( ifolderlistview.Visible )
                         GLib.Idle.Add(UpdateListViewItemsMainThread); else
        iFoldersIconView.UnselectAll();
//.........这里部分代码省略.........
开发者ID:RoDaniel,项目名称:featurehouse,代码行数:101,代码来源:iFolderWindow.cs

示例13: DisplayLoginMesg

 private void DisplayLoginMesg()
 {
     iFolderMsgDialog dlg = new iFolderMsgDialog(null, iFolderMsgDialog.DialogType.Error, iFolderMsgDialog.ButtonSet.Ok,
      Util.GS("iFolder Error"), Util.GS("Error creating iFolder"),
      Util.GS("You should be logged-in to the domain for creating encrypted iFolders."));
        dlg.Run();
        dlg.Hide();
        dlg.Destroy();
 }
开发者ID:RoDaniel,项目名称:featurehouse,代码行数:9,代码来源:iFolderWindow.cs

示例14: CreateNewiFolder

 private void CreateNewiFolder()
 {
     DomainInformation[] domains = domainController.GetDomains();
        if (domains.Length <= 0) return;
        string domainID = domains[0].ID;
        DomainInformation defaultDomain = domainController.GetDefaultDomain();
        if (defaultDomain != null)
     domainID = defaultDomain.ID;
        CreateDialog cd = new CreateDialog(this, domains, domainID, Util.LastCreatedPath, ifws);
        cd.TransientFor = this;
        int rc = 0;
        do
        {
     rc = cd.Run();
     cd.Hide();
     if (rc == (int)ResponseType.Ok)
     {
      try
      {
       string selectedFolder = cd.iFolderPath.Trim();
       string selectedDomain = cd.DomainID;
       bool SSL = cd.ssl;
       string algorithm = cd.EncryptionAlgorithm;
       if (selectedFolder == String.Empty)
       {
        iFolderMsgDialog dg = new iFolderMsgDialog(
     this,
     iFolderMsgDialog.DialogType.Warning,
     iFolderMsgDialog.ButtonSet.Ok,
     "",
     Util.GS("Invalid folder specified"),
     Util.GS("An invalid folder was specified."));
        dg.Run();
        dg.Hide();
        dg.Destroy();
        continue;
       }
       string parentDir = System.IO.Path.GetDirectoryName( selectedFolder );
       if ( ( parentDir == null ) || ( parentDir == String.Empty ) )
       {
        iFolderMsgDialog dg = new iFolderMsgDialog(
     this,
     iFolderMsgDialog.DialogType.Warning,
     iFolderMsgDialog.ButtonSet.Ok,
     "",
     Util.GS("Invalid folder specified"),
     Util.GS("An invalid folder was specified"));
        dg.Run();
        dg.Hide();
        dg.Destroy();
        continue;
       }
       if(ifws.GetLimitPolicyStatus(selectedDomain) != 1 )
                                         {
                                                 iFolderMsgDialog dg = new iFolderMsgDialog(
                                                         this,
                                                         iFolderMsgDialog.DialogType.Warning,
                                                         iFolderMsgDialog.ButtonSet.Ok,
                                                         "",
                                                         Util.GS("Error"),
                                                         Util.GS("Folder could not be created as you are exceeding the limit of ifolders set by your Administrator."));
                                                 dg.Run();
                                                 dg.Hide();
                                                 dg.Destroy();
                                                 continue;
                                         }
       string name = selectedFolder.Substring(parentDir.Length + 1);
       if (name == null || name == String.Empty)
       {
        iFolderMsgDialog dg = new iFolderMsgDialog(
     this,
     iFolderMsgDialog.DialogType.Warning,
     iFolderMsgDialog.ButtonSet.Ok,
     "",
     Util.GS("Invalid folder specified"),
     Util.GS("The folder you've specified is invalid.  Please remove the trailing separator character (/) and try again."));
        dg.Run();
        dg.Hide();
        dg.Destroy();
        continue;
       }
       selectedFolder = ParseAndReplaceTildeInPath(selectedFolder);
       iFolderHolder ifHolder = null;
       try
       {
        if( algorithm != null)
        {
     bool passPhraseStatus = false;
     bool passphraseStatus = false;
     DomainInformation domainInfo = domainController.GetDomain(selectedDomain);
     if( !domainInfo.Authenticated)
     {
      DisplayLoginMesg();
      continue;
     }
     try
     {
                       passphraseStatus = simws.IsPassPhraseSet(selectedDomain);
     }
     catch(Exception)
//.........这里部分代码省略.........
开发者ID:RoDaniel,项目名称:featurehouse,代码行数:101,代码来源:iFolderWindow.cs

示例15: SetPassPhrase

 private static bool SetPassPhrase( EnterPassPhraseDialog epd, string DomainID, string publicKey, SimiasWebService simws )
 {
     bool status;
     Status passPhraseStatus = null;
       if(epd.RecoveryAgent != null && epd.RecoveryAgent != Util.GS("Server_Default"))
      passPhraseStatus = simws.SetPassPhrase( DomainID, epd.PassPhrase, epd.RecoveryAgent, publicKey);
      else
        passPhraseStatus = simws.SetPassPhrase( DomainID, epd.PassPhrase, "DEFAULT", publicKey);
     if(passPhraseStatus.statusCode == StatusCodes.Success)
     {
     status = true;
     simws.StorePassPhrase( DomainID, epd.PassPhrase, CredentialType.Basic, epd.ShouldSavePassPhrase);
     }
     else
     {
     status = false;
     iFolderMsgDialog dialog = new iFolderMsgDialog(
         null,
         iFolderMsgDialog.DialogType.Error,
         iFolderMsgDialog.ButtonSet.None,
         Util.GS("Error setting the PassPhrase"),
         Util.GS("Unable to set the passphrase"),
         Util.GS("Please try again"));
     dialog.Run();
     dialog.Hide();
     dialog.Destroy();
     dialog = null;
     }
     return status;
 }
开发者ID:RoDaniel,项目名称:featurehouse,代码行数:30,代码来源:iFolderWindow.cs


注:本文中的Novell.iFolder.iFolderMsgDialog.Run方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。