// ---------------------------------------------------------------------
        //
        // Internal Methods
        //
        // ---------------------------------------------------------------------

        #region Internal Methods

        /// <summary>
        /// Converts an xaml content to rtf content.
        /// </summary>
        /// <param name="xamlContent">
        /// The source xaml text content to be converted into Rtf content.
        /// </param>
        /// <returns>
        /// Well-formed representing rtf equivalent string for the source xaml content.
        /// </returns>
        internal string ConvertXamlToRtf(string xamlContent)
        {
            // Check the parameter validation
            if (xamlContent == null)
            {
                throw new ArgumentNullException("xamlContent");
            }

            string rtfContent = string.Empty;

            if (xamlContent != string.Empty)
            {
                // Creating the converter that process the content data from Xaml to Rtf
                XamlToRtfWriter xamlToRtfWriter = new XamlToRtfWriter(xamlContent);

                // Set WpfPayload package that contained the image for the specified Xaml
                if (WpfPayload != null)
                {
                    xamlToRtfWriter.WpfPayload = WpfPayload;
                }

                // Process the converting from xaml to rtf
                xamlToRtfWriter.Process();

                // Set rtf content that representing resulting from Xaml to Rtf converting.
                rtfContent = xamlToRtfWriter.Output;
            }

            return rtfContent;
        }
示例#2
0
            //------------------------------------------------------
            // 
            //  Constructors
            // 
            //----------------------------------------------------- 

            #region Constructors 

            /// <summary>
            ///
            /// </summary> 
            internal XamlIn(XamlToRtfWriter writer, string xaml)
            { 
                _writer = writer; 
                _xaml = xaml;
 
                _parser = new XamlToRtfParser(_xaml);

                _parser.SetCallbacks(this, this);
 
                _bGenListTables = true;
            }