Exemple #1
0
        public string ToLaTeX()
        {
            //if (Value == 0)
            //    return "0";

            var valueText = Value.GetLaTeXNumber();
            var basisText = TermId.ToString().GetLaTeXBasisName();

            return($@"\left( {valueText} \right) {basisText}");
        }
Exemple #2
0
        /// <summary>
        ///     Writes the Xml of a logical OR.
        /// </summary>
        /// <param name="writer">An XmlWriter for a logical OR.</param>
        public override void WriteXml(XmlWriter writer)
        {
            _ = writer ?? throw new ArgumentNullException(nameof(writer));

            writer.WriteStartElement(AuthorizationConstants.Elements.LogicalOr,
                                     AuthorizationConstants.Namespaces.Xmlns);

            if (TermId != null)
            {
                writer.WriteAttributeString(AuthorizationConstants.Attributes.TermId, TermId.ToString());
            }

            writer.WriteAttributeString(AuthorizationConstants.Attributes.Evaluates, XmlConvert.ToString(Evaluates));

            foreach (Term eval in this)
            {
                eval.WriteXml(writer);
            }

            writer.WriteEndElement();
        }
Exemple #3
0
        /// <summary>
        ///     Writes the Xml of a evaluation rule.
        /// </summary>
        /// <param name="writer">An XmlWriter for the evaluation rule.</param>
        public override void WriteXml(XmlWriter writer)
        {
            _ = writer ?? throw new ArgumentNullException(nameof(writer));

            writer.WriteStartElement(AuthorizationConstants.Elements.Rule, AuthorizationConstants.Namespaces.Xmlns);

            if (Issuer != null)
            {
                writer.WriteAttributeString(AuthorizationConstants.Attributes.Issuer, Issuer);
            }

            if (TermId != null)
            {
                writer.WriteAttributeString(AuthorizationConstants.Attributes.TermId, TermId.ToString());
            }

            writer.WriteAttributeString(AuthorizationConstants.Attributes.Evaluates, XmlConvert.ToString(Evaluates));

            Operation.WriteXml(writer);

            MatchExpression.WriteXml(writer);

            writer.WriteEndElement();
        }