/// <summary>
/// Constructor
/// </summary>
public Edit(EditType type, CmisRepoCredentials credentials, string name, string remotePath, List <string> ignores, string localPath)
{
FolderName = name;
this.Credentials = credentials;
this.remotePath = remotePath;
this.Ignores = new List <string>(ignores);
this.localPath = localPath;
this.type = type;
this.backgroundWorker.WorkerSupportsCancellation = true;
this.backgroundWorker.DoWork += CheckPassword;
this.backgroundWorker.RunWorkerCompleted += PasswordChecked;
CreateTreeView();
LoadEdit();
switch (type)
{
case EditType.EditFolder:
// GUI workaround to remove ignore folder {{
//tab.SelectedItem = tabItemSelection;
//break;
// GUI workaround to remove ignore folder }}
case EditType.EditCredentials:
tab.SelectedItem = tabItemCredentials;
break;
default:
break;
}
this.Title = Properties_Resources.EditTitle;
this.Description = "";
this.ShowAll();
// Defines how to show the setup window.
Controller.OpenWindowEvent += delegate
{
Dispatcher.BeginInvoke((Action) delegate
{
Show();
Activate();
BringIntoView();
});
};
Controller.CloseWindowEvent += delegate
{
Close();
};
finishButton.Click += delegate
{
Ignores = NodeModelUtils.GetIgnoredFolder(repo);
Credentials.Password = passwordBox.Password;
Controller.SaveFolder();
Controller.CloseWindow();
};
cancelButton.Click += delegate
{
Controller.CloseWindow();
};
Closed += delegate
{
Controller.CleanWindow();
};
}