Beispiel #1
0
        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);
                }
            }
        }
Beispiel #2
0
        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));
                }
            }
        }
Beispiel #3
0
 private void AddChildFolder(JadeCore.Workspace.IFolder f)
 {
     WorkspaceFolder folder = new WorkspaceFolder(this, f);
     Children.Add(folder);
 }
Beispiel #4
0
 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);
 }
Beispiel #5
0
 private bool CanDoRemoveFolder(WorkspaceFolder folder)
 {
     return true;
 }
Beispiel #6
0
        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;
            }
        }