public static void ResolveThemeColorData(ParsingContext context, ColorDefinition in_cd, bool indexOnly)
 {
     if ( context != null && 
          context.ThemeTable != null &&
         !String.IsNullOrEmpty(in_cd.ThemeName))
     {
         foreach (ColorDefinition cd in context.ThemeTable.Colors)
         {
             if (in_cd.ThemeName == cd.ThemeName)
             {
                 if (indexOnly)
                 {
                     in_cd.ColourTableIndex = cd.ColourTableIndex;
                 }
                 else
                 {
                     in_cd.ColourTableIndex = cd.ColourTableIndex;
                     in_cd.RGBColor = cd.RGBColor;
                     in_cd.Red = cd.Red;
                     in_cd.Green = cd.Green;
                     in_cd.Blue = cd.Blue;
                 }
                 break;
             }
         }
     }
 }
Esempio n. 2
0
        protected override void Start()
        {
            if (Source == null || Source.Data == null)
                throw new FcsException("The source data stream for the Docx reader is missing");

            Open();

            m_Context = new ParsingContext();
        }
Esempio n. 3
0
 public ParsingContext Duplicate()
 {
     ParsingContext result = new ParsingContext();
     result.SetDefaultStartContext();
     result.ListInformation = this.ListInformation;
     result.FontTable = this.FontTable;
     result.StyleSheet = this.StyleSheet;
     result.ThemeTable = this.ThemeTable;
     result.ParsingBody = this.ParsingBody;
     result.m_DocumentDefaultFormatting = m_DocumentDefaultFormatting;
     result.SetDocumentDefaultContext();
     return result;
 }
 XMLConsumer ConsumerFactory(ParsingContext context)
 {
     return new comments_Handler(context);
 }
 public themeFontDefinition_Handler(ParsingContext context)
     : base(context)
 {
     m_dataObject = new ThemeFontDefinition();
 }
 public themeFontDefinition_Handler(ThemeFontDefinition dataObject, ParsingContext context)
     : base(context)
 {
     m_dataObject = dataObject;
 }
        public static void ResolveShading(ParsingContext context, ShadingDefinition target)
        {
            if (!target.PatternColor.IsAllDefaults())
            {
                HandlerSupportUtilities.UpdateColorDefinitionRGB(target.PatternColor, true);
                HandlerSupportUtilities.ResolveThemeColorData(context, target.PatternColor, false);
            }

            if (!target.FillColor.IsAllDefaults())
            {
                HandlerSupportUtilities.UpdateColorDefinitionRGB(target.FillColor, false);
                HandlerSupportUtilities.ResolveThemeColorData(context, target.FillColor, false);
            }
        }
        public static void ResolveBorderColourProperties(ParsingContext context, BorderDefinition borders)
        {
            if (borders.Top != null &&
                borders.Top.ColorInfo != null)
            {
                HandlerSupportUtilities.UpdateColorDefinitionRGB(borders.Top.ColorInfo, true);
                HandlerSupportUtilities.ResolveThemeColorData(context, borders.Top.ColorInfo, false); 
            }

            if (borders.Left != null &&
                borders.Left.ColorInfo != null)
            {
                HandlerSupportUtilities.UpdateColorDefinitionRGB(borders.Left.ColorInfo, true);
                HandlerSupportUtilities.ResolveThemeColorData(context, borders.Left.ColorInfo, false);
            }

            if (borders.Bottom != null &&
                borders.Bottom.ColorInfo != null)
            {
                HandlerSupportUtilities.UpdateColorDefinitionRGB(borders.Bottom.ColorInfo, true);
                HandlerSupportUtilities.ResolveThemeColorData(context, borders.Bottom.ColorInfo, false);
            }

            if (borders.Right != null &&
                borders.Right.ColorInfo != null)
            {
                HandlerSupportUtilities.UpdateColorDefinitionRGB(borders.Right.ColorInfo, true);
                HandlerSupportUtilities.ResolveThemeColorData(context, borders.Right.ColorInfo, false);
            }

            if(borders.BorderBar != null &&
                borders.BorderBar.ColorInfo != null)
            {
                HandlerSupportUtilities.UpdateColorDefinitionRGB(borders.BorderBar.ColorInfo, true);
                HandlerSupportUtilities.ResolveThemeColorData(context, borders.BorderBar.ColorInfo, false);
            }

            if (borders.Box != null &&
                borders.Box.ColorInfo != null)
            {
                HandlerSupportUtilities.UpdateColorDefinitionRGB(borders.Box.ColorInfo, true);
                HandlerSupportUtilities.ResolveThemeColorData(context, borders.Box.ColorInfo, false);
            }

            if (borders.Between != null &&
                borders.Between.ColorInfo != null)
            {
                HandlerSupportUtilities.UpdateColorDefinitionRGB(borders.Between.ColorInfo, true);
                HandlerSupportUtilities.ResolveThemeColorData(context, borders.Between.ColorInfo, false);
            }

            if (borders.VerticalInside != null &&
                borders.VerticalInside.ColorInfo != null)
            {
                HandlerSupportUtilities.UpdateColorDefinitionRGB(borders.VerticalInside.ColorInfo, true);
                HandlerSupportUtilities.ResolveThemeColorData(context, borders.VerticalInside.ColorInfo, false);
            }

            if (borders.HorizontalInside != null &&
                borders.HorizontalInside.ColorInfo != null)
            {
                HandlerSupportUtilities.UpdateColorDefinitionRGB(borders.HorizontalInside.ColorInfo, true);
                HandlerSupportUtilities.ResolveThemeColorData(context, borders.HorizontalInside.ColorInfo, false);
            }

            if (borders.TopLeftToBottomRight != null &&
                borders.TopLeftToBottomRight.ColorInfo != null)
            {
                HandlerSupportUtilities.UpdateColorDefinitionRGB(borders.TopLeftToBottomRight.ColorInfo, true);
                HandlerSupportUtilities.ResolveThemeColorData(context, borders.TopLeftToBottomRight.ColorInfo, false);
            }

            if (borders.TopRightToBottomLeft != null &&
                borders.TopRightToBottomLeft.ColorInfo != null)
            {
                HandlerSupportUtilities.UpdateColorDefinitionRGB(borders.TopRightToBottomLeft.ColorInfo, true);
                HandlerSupportUtilities.ResolveThemeColorData(context, borders.TopRightToBottomLeft.ColorInfo, false);
            }

        }
Esempio n. 9
0
 public BodyConsumer(ParsingContext context)
     : base(context)
 {
 }
 public FootnoteEndnoteSeparatorConsumer(ParsingContext context)
     : base(context)
 {
 }
 public FootnotesEndnotesConsumer(ParsingContext context)
     : base(context)
 {
 }
Esempio n. 12
0
 public DocumentInfoConsumer(ParsingContext context)
     : base(context)
 {
 }