Exemplo n.º 1
0
        public OXMLMathRunWrap(string text)
        {
            _text = text;

            XMLRun = new M.Run();

                RunProperties runProperties4 = new RunProperties();
                RunFonts runFonts4 = new RunFonts(){ Ascii = "Cambria Math", HighAnsi = "Cambria Math" };
                Languages languages4 = new Languages(){ Val = "en-US" };

                runProperties4.Append(runFonts4);
                runProperties4.Append(languages4);
                M.Text text3 = new M.Text();
                text3.Text = text;

            XMLRun.Append(runProperties4);
            if (text != "") XMLRun.Append(text3);
        }
        //.....................................................................
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        private OpxM.Run mathMINUS( )
        {
            OpxM.Run mathrun = new OpxM.Run( );

            //OpxM.RunProperties propertiesRUN = new OpxM.RunProperties( );
            //OpxM.Style headingStyle = new OpxM.Style( ) { Val = OpxM.StyleValues.Plain };
            //propertiesRUN.Append( headingStyle );

            //RunProperties runProperties6 = new RunProperties( );
            //RunFonts runFonts4 = new RunFonts( ) { Ascii = "Cambria Math", HighAnsi = "Cambria Math", EastAsia = "Cambria Math", ComplexScript = "Cambria Math" };
            //runProperties6.Append( runFonts4 );

            //OpxM.Text text3 = new OpxM.Text( );
            //text3.Text = "-";

            mathrun.Append(this.PlainStyleValue( ));
            mathrun.Append(this.CambriaFont( ));
            mathrun.Append(this.SimpleMathText("-"));

            return(mathrun);
        }
        //.....................................................................
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        private OpxM.Run mathPM( )
        {
            OpxM.Run mathrun = new OpxM.Run( );

            //OpxM.RunProperties runProperties8 = new OpxM.RunProperties( );
            //OpxM.Style style3 = new OpxM.Style( ) { Val = OpxM.StyleValues.Plain };
            //runProperties8.Append( style3 );

            //RunProperties propertiesRUN = new RunProperties( );
            //RunFonts runFonts6 = new RunFonts( ) { Ascii = "Cambria Math", HighAnsi = "Cambria Math", EastAsia = "Cambria Math", ComplexScript = "Cambria Math" };
            //propertiesRUN.Append( runFonts6 );

            //OpxM.Text text5 = new OpxM.Text( );
            //text5.Text = "±";

            mathrun.Append(this.PlainStyleValue( ));
            mathrun.Append(this.CambriaFont( ));
            mathrun.Append(this.SimpleMathText("±"));

            return(mathrun);
        }
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        private static M.Superscript MakeScriptUpper( )
        {
            M.Superscript superscript1 = new M.Superscript( );

            M.SuperscriptProperties superscriptProperties1 = new M.SuperscriptProperties( );

            M.ControlProperties controlProperties3 = new M.ControlProperties( );

            RunProperties runProperties10 = new RunProperties( );
            RunFonts      runFonts8       = new RunFonts( )
            {
                Ascii = "Cambria Math", HighAnsi = "Cambria Math"
            };
            Italic italic2 = new Italic( );

            runProperties10.Append(runFonts8);
            runProperties10.Append(italic2);

            controlProperties3.Append(runProperties10);

            superscriptProperties1.Append(controlProperties3);

            M.Base base2 = new M.Base( );

            M.Run run6 = new M.Run( );

            RunProperties runProperties11 = new RunProperties( );
            RunFonts      runFonts9       = new RunFonts( )
            {
                Ascii = "Cambria Math", HighAnsi = "Cambria Math"
            };

            runProperties11.Append(runFonts9);
            M.Text text6 = new M.Text( );
            text6.Text = "x";

            run6.Append(runProperties11);
            run6.Append(text6);

            base2.Append(run6);

            M.SuperArgument superArgument2 = new M.SuperArgument( );

            M.Run run7 = new M.Run( );

            RunProperties runProperties12 = new RunProperties( );
            RunFonts      runFonts10      = new RunFonts( )
            {
                Ascii = "Cambria Math", HighAnsi = "Cambria Math"
            };

            runProperties12.Append(runFonts10);
            M.Text text7 = new M.Text( );
            text7.Text = "3";

            run7.Append(runProperties12);
            run7.Append(text7);

            superArgument2.Append(run7);

            superscript1.Append(superscriptProperties1);
            superscript1.Append(base2);
            superscript1.Append(superArgument2);
            return(superscript1);
        }