コード例 #1
0
ファイル: SdtBockExtension.cs プロジェクト: yarivat/Admin
        public static void Update(this DocumentFormat.OpenXml.Wordprocessing.Tag tag, object value, IDictionary <string, object> settings, MainDocumentPart mainPart)
        {
            ABlock block = GetBlock(tag, value);

            try
            {
                block.Update(tag, value, settings, mainPart);
            }
            catch (Exception exception)
            {
                throw new DuradosException("Could not update the block: " + tag.Val, exception);
            }
        }
コード例 #2
0
ファイル: SdtBockExtension.cs プロジェクト: yarivat/Admin
        public static ABlock GetBlock(this DocumentFormat.OpenXml.Wordprocessing.Tag tag, object value)
        {
            BlockType blockType = ABlock.GetBlockType(tag, value);

            switch (blockType)
            {
            case BlockType.Table:
                return(new TableBlock());

            case BlockType.Rich:
                return(new RichTextBlock());

            default:
                return(new TextBlock());
            }
        }