public string ToLaTeX() { //if (Value == 0) // return "0"; var valueText = Value.GetLaTeXNumber(); var basisText = TermId.ToString().GetLaTeXBasisName(); return($@"\left( {valueText} \right) {basisText}"); }
/// <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(); }
/// <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(); }