本文整理汇总了C#中Novell.iFolder.iFolderMsgDialog类的典型用法代码示例。如果您正苦于以下问题:C# iFolderMsgDialog类的具体用法?C# iFolderMsgDialog怎么用?C# iFolderMsgDialog使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
iFolderMsgDialog类属于Novell.iFolder命名空间,在下文中一共展示了iFolderMsgDialog类的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);
}
}
}
示例2: 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;
}
示例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;
}
示例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();
}
}
}
示例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;
}
//.........这里部分代码省略.........
示例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;
}
示例7: OnRemoveUser
private void OnRemoveUser(object o, EventArgs args)
{
TreeModel tModel;
TreeSelection tSelect = UserTreeView.Selection;
if(tSelect.CountSelectedRows() > 0)
{
iFolderMsgDialog dialog = new iFolderMsgDialog(
topLevelWindow,
iFolderMsgDialog.DialogType.Question,
iFolderMsgDialog.ButtonSet.YesNo,
"",
Util.GS("Remove the selected users?"),
Util.GS("This will remove the selected users from this iFolder. They will no longer be able to synchronize files with this iFolder."));
int rc = dialog.Run();
dialog.Hide();
dialog.Destroy();
if(rc == -8)
{
Queue iterQueue;
Array treePaths = tSelect.GetSelectedRows(out tModel);
iterQueue = new Queue();
foreach(TreePath tPath in treePaths)
{
TreeIter iter;
if(UserTreeStore.GetIter(out iter, tPath))
{
iterQueue.Enqueue(iter);
}
}
while(iterQueue.Count > 0)
{
TreeIter iter = (TreeIter) iterQueue.Dequeue();
iFolderUser user =
(iFolderUser) tModel.GetValue(iter, 0);
try
{
ifws.RemoveiFolderUser(ifolder.ID,
user.UserID);
UserTreeStore.Remove(ref iter);
curUsers.Remove(user.UserID);
}
catch(Exception e)
{
iFolderExceptionDialog ied =
new iFolderExceptionDialog(
topLevelWindow, e);
ied.Run();
ied.Hide();
ied.Destroy();
ied = null;
}
}
}
}
}
示例8: OnIconViewDragDataReceived
private void OnIconViewDragDataReceived(object o, DragDataReceivedArgs args)
{
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, true);
break;
case (uint) DragTargetType.UriList:
UriList uriList = new UriList(args.SelectionData);
if (uriList.Count == 1)
{
string path = null;
try
{
path = uriList.ToLocalPaths()[0];
}
catch
{
return;
}
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, 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;
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
{
if( algorithm != null)
{
DomainInformation domainInfo = domainController.GetDomain(selectedDomain);
if( !domainInfo.Authenticated)
{
DisplayLoginMesg();
continue;
}
bool passPhraseStatus = false;
bool passphraseStatus = false;
try
{
passphraseStatus = simws.IsPassPhraseSet(selectedDomain);
}
catch(Exception)
{
DisplayLoginMesg();
continue;
}
if(passphraseStatus == true)
{
string passphrasecheck = simws.GetPassPhrase(selectedDomain);
if( passphrasecheck == null || passphrasecheck =="")
{
Debug.PrintLine(" passphrase not entered at login");
passPhraseStatus = ShowVerifyDialog(selectedDomain, simws);
}
else
{
passPhraseStatus = true;
}
}
else
{
passPhraseStatus = ShowEnterPassPhraseDialog(selectedDomain, simws);
}
//.........这里部分代码省略.........
示例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;
}
示例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);
}
}
示例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);
}
}
示例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();
//.........这里部分代码省略.........
示例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();
}
示例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)
//.........这里部分代码省略.........
示例15: OnRealizeWidget
protected void OnRealizeWidget(object o, EventArgs args)
{
if (ConflictTreeView.Selection != null)
{
ConflictTreeView.Selection.SelectPath(new TreePath("0"));
}
if (ifolder.CurrentUserRights == "ReadOnly")
{
iFolderMsgDialog dg = new iFolderMsgDialog(
this,
iFolderMsgDialog.DialogType.Warning,
iFolderMsgDialog.ButtonSet.Ok,
"",
Util.GS("You have read only access"),
Util.GS("Your ability to resolve conflicts is limited because you have read-only access to this iFolder. Name conflicts must be renamed locally. File conflicts will be overwritten by the version of the file on the server."));
dg.Run();
dg.Hide();
dg.Destroy();
}
}