private string GetLockingValue(SdtTagLockingType lockingType) { var attributeType = lockingType.GetType().GetField(lockingType.ToString()); var attribute = (LockValueAttribute)Attribute.GetCustomAttribute(attributeType, typeof(LockValueAttribute)); return(attribute.Value); }
public XElement GetLockingElement(SdtTagLockingType lockingType) { return(new XElement( this.lokingElementName, new XAttribute(WordMl.ValAttributeName, this.GetLockingValue(lockingType)))); }
public static XElement CreateDynamicContentElement(IEnumerable <XElement> contentElements, string id, SdtTagLockingType lockingType = SdtTagLockingType.Unlocked) { var locker = new DynamicContentLocker(); return(new XElement( WordMl.SdtName, new XElement( WordMl.SdtPrName, new XElement( WordMl.WordMlNamespace + "alias", new XAttribute(WordMl.ValAttributeName, "DynamicContent")), new XElement( WordMl.TagName, new XAttribute(WordMl.ValAttributeName, "DynamicContent")), new XElement(WordMl.IdName, new XAttribute(WordMl.ValAttributeName, id)), //new XElement( // WordMl.WordMlNamespace + "lock", new XAttribute(WordMl.ValAttributeName, "sdtContentLocked"))), locker.GetLockingElement(lockingType)), new XElement(WordMl.SdtContentName, contentElements))); }
public static XElement CreateDynamicContentElement(IEnumerable <XElement> contentElements, XElement tagElement, SdtTagLockingType lockingType = SdtTagLockingType.Unlocked) { var tagId = tagElement.Element(WordMl.SdtPrName).Element(WordMl.IdName).Attribute(WordMl.ValAttributeName).Value; return(CreateDynamicContentElement(contentElements, tagId, lockingType)); }
private string GetLockingValue(SdtTagLockingType lockingType) { var attributeType = lockingType.GetType().GetField(lockingType.ToString()); var attribute = (LockValueAttribute)Attribute.GetCustomAttribute(attributeType, typeof(LockValueAttribute)); return attribute.Value; }
public XElement GetLockingElement(SdtTagLockingType lockingType) { return new XElement( this.lokingElementName, new XAttribute(WordMl.ValAttributeName, this.GetLockingValue(lockingType))); }