示例#1
0
 private void ParseBody()
 {
     try
     {
         using (Parser parser = new Parser(m_mainDocPart.GetContent(), new BodyConsumer(Context), Consumer))
         {
             parser.EmitContextStart();
             parser.Parse();
             //this appears to be unnecessary now - not sure what it was for in the first place
         //    parser.EmitContextEnd(true, true, true);
         }
     }
     catch (Exception e)
     {
         throw new FcsException("Failure parsing the main body of the document", e);
     }
 }
示例#2
0
        private void ParseFontTable()
        {
            try
            {
                if (Context.FontTable == null)
                    Context.FontTable = new FontTable();
                using (Parser parser = new Parser(GetPartData(ContentTypes.FontTable), new fonts_Handler(Context.FontTable, Context), Consumer))
                {
                    parser.Parse();
                }
            }
            catch (Exception e)
            {
                throw new FcsException("Failure parsing the font information of the document", e);
            }

        }
示例#3
0
        private void ParseStyleSheet()
        {
            try
            {
                using (Parser parser = new Parser(GetPartData(ContentTypes.Styles), new styles_Handler(Context.StyleSheet, Context), Consumer))
                {
                    parser.Parse();
                    Context.ResolveStylesWithForwardBasedOnReference();
                }
            }
            catch (Exception e)
            {
                throw new FcsException("Failure parsing the stylesheet information of the document", e);
            }


        }
示例#4
0
        private void ParseThemes()
        {
            try
            {
                Stream partData = GetPartData( ContentTypes.Themes );

                if( partData == null )
                {
                    return;
                }
            
                using( Parser parser = new Parser( partData, new theme_Handler( Context.ThemeTable, Context ), Consumer ) )
                {
                    parser.Parse();
                }                
            }
            catch (Exception e)
            {
                throw new FcsException("Failure parsing the stylesheet information of the document", e);
            }


        }
示例#5
0
        private void ParseNumbering()
        {
            try
            {
                Stream inStream = GetPartData(ContentTypes.Numbering);
                if (inStream == null)
                    return;

                if (Context.ListInformation == null)
                    Context.ListInformation = new ListInformation();

                using (Parser parser = new Parser(inStream, new numbering_Handler(Context.ListInformation, Context), Consumer))
                {
                    parser.Parse();
                    return;
                }
            }
            catch (Exception e)
            {
                throw new FcsException("Failure parsing the list numbering information of the document", e);
            }

        }
示例#6
0
 private void ParseStream(Stream inStream, XMLConsumer handler)
 {
     using (Parser parser = new Parser(inStream, handler , Consumer))
     {
         parser.Parse();
     }
 }