Пример #1
0
        private WorkSpaceItem GetWorkspace(string currentWorkSpaceName)
        {
            WorkSpaceItem workSpaceItem = App.Configuration.WorkSpaces.Where(x => x.Name == currentWorkSpaceName).FirstOrDefault();

            if (workSpaceItem == null)
            {
                workSpaceItem = CreateWorkspace(currentWorkSpaceName);
            }
            return(workSpaceItem);
        }
Пример #2
0
        public WorkSpaceItem CreateWorkspace(string currentWorkSpaceName)
        {
            App.Configuration.CurrentWorkSpaceName = currentWorkSpaceName;
            var workSpaceItem = new WorkSpaceItem()
            {
                Name = currentWorkSpaceName
            };

            App.Configuration.WorkSpaces.Add(workSpaceItem);
            return(workSpaceItem);
        }
Пример #3
0
        public WorkSpaceItem CloneWorkspace(string newName)
        {
            WorkSpaceItem spaceItem = GetWorkspace(App.Configuration.CurrentWorkSpaceName);

            App.Configuration.CurrentWorkSpaceName = newName;
            var workSpaceItem = ObjectCopier.Clone <WorkSpaceItem>(spaceItem);

            App.Configuration.WorkSpaces.Add(workSpaceItem);
            workSpaceItem.Name = newName;

            return(workSpaceItem);
        }