コード例 #1
0
        private string GetLockingValue(SdtTagLockingType lockingType)
        {
            var attributeType = lockingType.GetType().GetField(lockingType.ToString());
            var attribute     = (LockValueAttribute)Attribute.GetCustomAttribute(attributeType, typeof(LockValueAttribute));

            return(attribute.Value);
        }
コード例 #2
0
 public XElement GetLockingElement(SdtTagLockingType lockingType)
 {
     return(new XElement(
                this.lokingElementName,
                new XAttribute(WordMl.ValAttributeName, this.GetLockingValue(lockingType))));
 }
コード例 #3
0
        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)));
        }
コード例 #4
0
        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));
        }
コード例 #5
0
 private string GetLockingValue(SdtTagLockingType lockingType)
 {
     var attributeType = lockingType.GetType().GetField(lockingType.ToString());
     var attribute = (LockValueAttribute)Attribute.GetCustomAttribute(attributeType, typeof(LockValueAttribute));
     return attribute.Value;
 }
コード例 #6
0
 public XElement GetLockingElement(SdtTagLockingType lockingType)
 {
     return new XElement(
         this.lokingElementName,
         new XAttribute(WordMl.ValAttributeName, this.GetLockingValue(lockingType)));
 }