/// <summary> /// 保存一个项目 /// </summary> /// <param name="filePath">文件路径</param> /// <returns>操作成功与否</returns> public bool save(string filePath) { bool sflag = true; try { this.serialization(CodeManager.getInstance(), filePath); } catch { sflag = false; } return(sflag); }
/// <summary> /// 工厂方法:获得唯一实例 /// </summary> /// <returns>返回代码管理器的唯一实例</returns> public static CodeManager getInstance() { return(synObject == null ? synObject = new CodeManager() : synObject); }
/// <summary> /// 重新指定唯一单例的内存位置 /// 用于存取文件时 /// </summary> /// <param name="newAlloc">新的单例引用</param> public static void setSynObj(CodeManager newAlloc) { synObject = newAlloc; }
/// <summary> /// 刷新引用 /// </summary> public void refreshRef() { this.symbolMana = SymbolManager.getInstance(); this.codeMana = CodeManager.getInstance(); }
/// <summary> /// 工厂方法:获得唯一实例 /// </summary> /// <returns>返回代码管理器的唯一实例</returns> public static CodeManager getInstance() { return synObject == null ? synObject = new CodeManager() : synObject; }
/// <summary> /// 烧毁整棵代码树 /// </summary> public void clear() { synObject = null; }