public WorkspaceFolder(TreeNodeBase parent, JadeCore.Workspace.IFolder data) : base(data.Name, parent) { _data = data; foreach (JadeCore.Workspace.IFolder f in _data.Folders) { WorkspaceFolder folder = new WorkspaceFolder(this, f); AddChildFolder(f); } foreach (JadeCore.Workspace.IItem item in _data.Items) { if (item is JadeCore.Project.IProject) { AddChildProject(item as JadeCore.Project.IProject); } } }
protected void Initialise(Workspace workspace) { _workspace = workspace; foreach (JadeData.Workspace.IFolder f in _data.Folders) { WorkspaceFolder folder = new WorkspaceFolder(this, f); folder.Initialise(_workspace); AddChildFolder(f); } foreach (JadeData.Workspace.IItem item in _data.Items) { if (item is JadeData.Project.IProject) { AddChildProject(item as JadeData.Project.IProject); //AddChildProject(new Project(_workspace, this, item as JadeData.Project.IProject)); } } }
private void AddChildFolder(JadeCore.Workspace.IFolder f) { WorkspaceFolder folder = new WorkspaceFolder(this, f); Children.Add(folder); }
private void AddChildFolder(JadeData.Workspace.IFolder f) { WorkspaceFolder folder = new WorkspaceFolder(this, f); folder.Initialise(_workspace); folder.RemoveCommand.Attach(param => OnRemoveFolder(param), param => CanDoRemoveFolder(param)); Children.Add(folder); }
private bool CanDoRemoveFolder(WorkspaceFolder folder) { return true; }
private void OnRemoveFolder(WorkspaceFolder folder) { if (JadeControls.GuiUtils.ConfirmYNAction("Do you want remove Folder " + folder.DisplayName + "?") == false) return; if (Children.Contains(folder) && _data.RemoveFolder(folder.DisplayName)) { Children.Remove(folder); _workspace.Modified = true; OnPropertyChanged("Children"); return; } }