/* public Parser.IWorkspaceIndexer Indexer { get { return _indexer; } }*/ #endregion #region Public Methods public bool CloseWorkspace() { if (WorkspaceOpen == false) return true; if (RequiresSave && SaveOrDiscardWorkspace() == false) { return false; } _documentCache.Reset(); _workspace = null; CurrentWorkspaceModified = false; OnWorkspaceChanged(WorkspaceChangeOperation.Closed); return true; }
public void NewWorkspace(string name) { if (CloseWorkspace() == false) { return; } try { IFileHandle file = JadeCore.Services.Provider.FileService.MakeFileHandle(FilePath.MakeTemporaryFilePath()); _workspace = new JadeCore.Workspace.Workspace(name, file.Path); CurrentWorkspaceModified = true; OnWorkspaceChanged(WorkspaceChangeOperation.Created); } catch(Exception) { _workspace = null; throw; } }
public void OpenWorkspace(FilePath path) { if (CloseWorkspace() == false) { return; } try { if(path.Exists == false) { return; } string extention = path.Extention.ToLower(); if (extention == ".sln") { _workspace = JadeCore.Persistence.Workspace.VisualStudioImport.Reader.Read(path, JadeCore.Services.Provider.FileService); } else if (extention == ".jws") { _workspace = JadeCore.Persistence.Workspace.Reader.Read(path, JadeCore.Services.Provider.FileService); } _recentFiles.Add(path.Str); OnWorkspaceChanged(WorkspaceChangeOperation.Opened); } catch(Exception) { _workspace = null; throw; } }
public WorkspaceTree(JadeCore.Workspace.IWorkspace workspace) : base(null, workspace) { _data = workspace; this.Expanded = true; }