Exemplo n.º 1
0
        /// <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);
        }
Exemplo n.º 2
0
 /// <summary>
 /// 工厂方法:获得唯一实例
 /// </summary>
 /// <returns>返回代码管理器的唯一实例</returns>
 public static CodeManager getInstance()
 {
     return(synObject == null ? synObject = new CodeManager() : synObject);
 }
Exemplo n.º 3
0
 /// <summary>
 /// 重新指定唯一单例的内存位置
 /// 用于存取文件时
 /// </summary>
 /// <param name="newAlloc">新的单例引用</param>
 public static void setSynObj(CodeManager newAlloc)
 {
     synObject = newAlloc;
 }
Exemplo n.º 4
0
 /// <summary>
 /// 刷新引用
 /// </summary>
 public void refreshRef()
 {
     this.symbolMana = SymbolManager.getInstance();
     this.codeMana   = CodeManager.getInstance();
 }
Exemplo n.º 5
0
 /// <summary>
 /// 重新指定唯一单例的内存位置
 /// 用于存取文件时
 /// </summary>
 /// <param name="newAlloc">新的单例引用</param>
 public static void setSynObj(CodeManager newAlloc)
 {
     synObject = newAlloc;
 }
Exemplo n.º 6
0
 /// <summary>
 /// 工厂方法:获得唯一实例
 /// </summary>
 /// <returns>返回代码管理器的唯一实例</returns>
 public static CodeManager getInstance()
 {
     return synObject == null ? synObject = new CodeManager() : synObject;
 }
Exemplo n.º 7
0
 /// <summary>
 /// 烧毁整棵代码树
 /// </summary>
 public void clear()
 {
     synObject = null;
 }