/// <summary> /// 取数据Collection /// </summary> /// <param name="doc"></param> /// <returns></returns> public static PBPAModelCollection GetCollection(Document doc) { Collection = DelegateHelper.DelegateTryCatch( () => { string data = ExtensibleStorageHelper.GetData(doc, CStorageEntity, CStorageEntity.FieldOfData); return(new PBPAModelCollection(data)); }, () => { return(new PBPAModelCollection("")); } ); return(Collection); }
private void RegenerateAllFor_Prefix(Document doc, PBPAModelCollection collection, PBPATargetType targetType, PBPALocationType locationType) { string prefix = GetPrefix(targetType, locationType); var dataToChange = collection.Data.Where(c => c.TargetType == targetType && c.LocationType == locationType).ToList(); for (int i = dataToChange.Count - 1; i >= 0; i--) { var model = dataToChange[i]; model.Document = doc; model.IsRegenerate = true; model.AnnotationPrefix = prefix; var element = doc.GetElement(model.TargetId); element.GetParameters(PBPAContext.SharedParameterPL).FirstOrDefault().Set(model.GetFull_L(element)); if (!PBPAContext.Creator.Regenerate(model)) { collection.Data.Remove(model); } } }