Ejemplo n.º 1
0
        /// <summary>
        /// Чистый класс, добавление аргумента и базы осуществляется через XMLSuperArgument, XMLBase
        /// </summary>
        public OXMLMathSuperscriptWrap()
        {
            XMLSuperscript = new M.Superscript();

            XMLBase = new M.Base();
            XMLSuperArgument = new M.SuperArgument();

            XMLSuperscript.Append(OXMLMathControlPropertiesWrap.DefaultSuperscriptProperties());
            XMLSuperscript.Append(XMLBase);
            XMLSuperscript.Append(XMLSuperArgument);
        }
        //.....................................................................
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public static M.Superscript MakeScriptUpper(string mathBase, string mathArgm)
        {
            M.SuperscriptProperties properties = new M.SuperscriptProperties( );

            properties.Append(OpenDocxMathExprs.MakeControlProperties(true));

            //---------------------------------------------
            M.Superscript script = new M.Superscript( );

            script.Append(properties);

            script.Append(OpenDocxMathExprs.MakeMathBase(mathBase));
            script.Append(OpenDocxMathExprs.MakeScriptArgumentUpper(mathArgm));

            return(script);
        }
        private static M.Fraction MakeRun3( )
        {
            M.SubSuperscript upperSCR = MakeScriptBoth( );

            M.Superscript lowerSCR = OpenDocxMathExprs.MakeScriptUpper("x", "3");     //.ma MakeScriptUpper( );

            return(OpenDocxMathExprs.MakeFraction(upperSCR, lowerSCR));

            //M.Fraction fraction1 = new M.Fraction( );

            //M.FractionProperties fractionProperties1 = HansOpenDocx.MakeFractionProperties( );

            //M.Numerator numerator1 = new M.Numerator( );
            //numerator1.Append( upperSCR );

            //M.Denominator denominator1 = new M.Denominator( );
            //denominator1.Append( lowerSCR );

            //fraction1.Append( fractionProperties1 );
            //fraction1.Append( numerator1 );
            //fraction1.Append( denominator1 );

            //return fraction1;
        }
        //.....................................................................
        /// <summary>
        /// 分子
        /// </summary>
        /// <returns></returns>
        private OpxM.Numerator mathNumer_B_B2_4AC( )
        {
            OpxM.Numerator numerator1 = new OpxM.Numerator( );

            OpxM.Run run3 = mathMINUS( );

            OpxM.Run run4 = mathB( );
            OpxM.Run run5 = mathPM( );

            //.....................................................................
            OpxM.Radical radical1 = new OpxM.Radical( );

            OpxM.RadicalProperties radicalProperties1 = new OpxM.RadicalProperties( );

            OpxM.HideDegree hideDegree1 = new OpxM.HideDegree( )
            {
                Val = OpxM.BooleanValues.One
            };

            OpxM.ControlProperties controlProperties2 = new OpxM.ControlProperties( );
            //RunProperties runProperties10 = CambriaFont2( );
            controlProperties2.Append(CambriaFont2( ));

            radicalProperties1.Append(hideDegree1);
            radicalProperties1.Append(controlProperties2);

            //---------------------------------------------
            OpxM.Degree degree1 = new OpxM.Degree( );

            OpxM.Base base1 = new OpxM.Base( );

            OpxM.Superscript superscript1 = new OpxM.Superscript( );

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

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

            //RunProperties runProperties11 = new RunProperties( );
            //RunFonts runFonts = new RunFonts( ) { Ascii = "Cambria Math", HighAnsi = "Cambria Math", EastAsia = "Cambria Math" };
            //runProperties11.Append( runFonts );

            controlProperties3.Append(this.CambriaFont2( ));

            superscriptProperties1.Append(controlProperties3);

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

            //---------------------------------------------
            OpxM.Run run6 = mathB2( );

            base2.Append(run6);

            OpxM.SuperArgument superArgument1 = new OpxM.SuperArgument( );

            //---------------------------------------------
            OpxM.Run run7 = mathCP2( );

            //---------------------------------------------
            superArgument1.Append(run7);

            superscript1.Append(superscriptProperties1);
            superscript1.Append(base2);
            superscript1.Append(superArgument1);

            OpxM.Run run8 = mathCN4( );
            OpxM.Run run9 = mathAC( );

            //---------------------------------------------
            base1.Append(superscript1);

            base1.Append(run8);
            base1.Append(run9);

            radical1.Append(radicalProperties1);
            radical1.Append(degree1);
            radical1.Append(base1);

            numerator1.Append(run3);
            numerator1.Append(run4);
            numerator1.Append(run5);
            numerator1.Append(radical1);

            return(numerator1);
        }
        /// <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);
        }