//.....................................................................
        /// <summary>
        ///
        /// </summary>
        /// <param name="strTextName"></param>
        /// <param name="parameter"></param>
        /// <returns></returns>
        public static M.MathFunction MakeMathFunction(string strTextName, params OpenXmlElement[] parameter)
        {
            M.MathFunction mathFunc = new M.MathFunction( );

            //---------------------------------------------
            M.FunctionProperties funcProperties = new M.FunctionProperties( );
            funcProperties.Append(OpenDocxMathExprs.MakeControlProperties( ));

            //---------------------------------------------
            M.FunctionName funcNaming = OpenDocxMathExprs.MakeFunctionName(strTextName);

            //---------------------------------------------
            M.DelimiterProperties delimProperties = new M.DelimiterProperties( );
            delimProperties.Append(OpenDocxMathExprs.MakeControlProperties(true));

            M.Base mathBaseParms = new M.Base( );
            foreach (OpenXmlElement value in parameter)
            {
                mathBaseParms.Append(value);
            }

            M.Delimiter delimiter = new M.Delimiter( );
            delimiter.Append(delimProperties);
            delimiter.Append(mathBaseParms);

            M.Base funcBase = new M.Base( );
            funcBase.Append(delimiter);

            //---------------------------------------------
            mathFunc.Append(funcProperties);
            mathFunc.Append(funcNaming);
            mathFunc.Append(funcBase);

            return(mathFunc);
        }
        //.....................................................................
        /// <summary>
        ///
        /// </summary>
        /// <param name="value"></param>
        /// <returns></returns>
        public static M.Base MakeMathBase(string value)
        {
            M.Base mathbase = new M.Base( );

            mathbase.Append(OpenDocxMathExprs.MakeMathRun(value));

            return(mathbase);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Чистый класс, добавление базы осуществляется через XMLBase
        /// </summary>
        public OXMLMathDelimiterWrap()
        {
            XMLDelimiter = new M.Delimiter();

            XMLBase = new M.Base();

            XMLDelimiter.Append(OXMLMathControlPropertiesWrap.DefaultDelimiterProperties());
            XMLDelimiter.Append(XMLBase);
        }
Ejemplo n.º 4
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>
        /// <param name="strBase"></param>
        /// <param name="strDegree"></param>
        /// <returns></returns>
        public static M.Radical MakeMathRadical(string strBase, string strDegree)
        {
            M.Radical radical = new M.Radical( );

            M.RadicalProperties properties = new M.RadicalProperties( );
            properties.Append(OpenDocxMathExprs.MakeControlProperties(true));

            M.Base mathBAS = OpenDocxMathExprs.MakeMathBase(strBase);

            M.Degree mathDEG = OpenDocxMathExprs.MakeMathDegree(strDegree);

            radical.Append(properties);
            radical.Append(mathBAS);
            radical.Append(mathDEG);

            return(radical);
        }
        private static M.SubSuperscript MakeScriptBoth( )
        {
            M.SubSuperscript subSuperscript1 = new M.SubSuperscript( );

            M.SubSuperscriptProperties subSuperscriptProperties1 = new M.SubSuperscriptProperties( );

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

            M.Base base1 = OpenDocxMathExprs.MakeMathBase("A");      // new M.Base( );

            //---------------------------------------------
            M.SubArgument subArgument1 = OpenDocxMathExprs.MakeScriptArgumentLower("i");

            M.SuperArgument superArgument1 = OpenDocxMathExprs.MakeScriptArgumentUpper("w");

            //---------------------------------------------
            subSuperscript1.Append(subSuperscriptProperties1);
            subSuperscript1.Append(base1);
            subSuperscript1.Append(subArgument1);
            subSuperscript1.Append(superArgument1);

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