/// <summary> /// 取数据Collection /// </summary> /// <param name="doc"></param> /// <returns></returns> public static CMModelCollection GetCollection(Document doc) { Collection = VLDelegateHelper.DelegateTryCatch( () => { string data = ExtensibleStorageHelper.GetData(doc, CStorageEntity, CStorageEntity.FieldOfData); return(new CMModelCollection(data)); }, () => { return(new CMModelCollection("")); } ); return(Collection); }
/// <summary> /// 保存Collection /// </summary> /// <param name="doc"></param> public static bool SaveCollection(Document doc) { if (Collection == null) { return(false); } var data = Collection.ToData(); return(VLDelegateHelper.DelegateTryCatch( () => { ExtensibleStorageHelper.SetData(doc, CStorageEntity, CStorageEntity.FieldOfData, data); return true; }, () => { ExtensibleStorageHelper.RemoveStorage(doc, CStorageEntity); ExtensibleStorageHelper.SetData(doc, CStorageEntity, CStorageEntity.FieldOfData, data); return false; } )); }