public static bool HasContactMeta(IEDoc2File file) { List<IEDoc2MetaObjType> metaObjTypeList = null; file.GetFileMetaData(file.FileLastVerId, out metaObjTypeList); if (metaObjTypeList != null) { return metaObjTypeList.Any(x => x.TypeId == ContactMetaTypeId); } return false; }
public static string GetMetaValue(IEDoc2File file, int metaTypeId, int metaAttrId) { int result = 0; if (file == null) { throw new Exception("file null"); } List<IEDoc2MetaObjType> metaObjTypeList; result = file.GetFileMetaData(file.FileLastVerId, out metaObjTypeList); if (result != 0) { throw new Exception("GetFileMetaData result" + result); } if (metaObjTypeList == null) { throw new Exception("metaObjTypeList null"); } IEDoc2MetaObjType objType = metaObjTypeList.Find(x => x.TypeId == metaTypeId); if (objType == null) { throw new Exception("objType null,this._metaTypeId:" + metaTypeId); } IEDoc2MetaValue validMonthMetaValue = objType.EDoc2MetaValueList.Find(x => x.AttrId == metaAttrId); if (validMonthMetaValue == null) { throw new Exception("validMonthMetaValue null, metaAttrId:" + metaAttrId); } else { return validMonthMetaValue.AttrValue; } }