Ejemplo n.º 1
0
        /// <summary>
        /// Generate XML that represents this expression node, and children. Used for diagnostics.
        /// </summary>
        public string ToXml( )
        {
            ExpressionXmlContext ctx  = new ExpressionXmlContext( );
            XDocument            xDoc = new XDocument(
                new XDeclaration("1.0", "UTF-16", null),
                GetXElement(ctx));

            using (TextWriter tw = new StringWriter( ))
            {
                xDoc.Save(tw);
                return(tw.ToString( ));
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Return an XElement for XML generation.
        /// </summary>
        /// <param name="context">XML generation context.</param>
        internal XElement GetXElement(ExpressionXmlContext context)
        {
            var res = context.CheckElement(this, () =>
                                           new XElement(GetType( ).Name,
                                                        new XAttribute("resultType", ResultType?.ToString( ) ?? "null"),
                                                        context.CreateList("Arguments", Arguments, n => n.GetXElement(context))));

            if (res.Name == "Ref")
            {
                return(res);
            }

            if (InputType != null)
            {
                res.Add(new XAttribute("inputType", InputType));
            }

            OnGetXElement(res, context);
            return(res);
        }
 /// <summary>
 /// Override for class-specific XML generation.
 /// </summary>
 /// <param name="element">The element that represents this node, to which attributes and children should be added.</param>
 /// <param name="context">XML generation context.</param>
 protected override void OnGetXElement(XElement element, ExpressionXmlContext context)
 {
     element.Add(new XAttribute("direction", Direction));
     element.Add(new XAttribute("relationshipId", RelationshipId));
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Override for class-specific XML generation.
 /// </summary>
 /// <param name="element">The element that represents this node, to which attributes and children should be added.</param>
 /// <param name="context">XML generation context.</param>
 protected override void OnGetXElement(XElement element, ExpressionXmlContext context)
 {
     element.Add(context.CreateList("ChildContainer", ChildContainer.ChildEntityNodes, n => n.GetXElement(context)));
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Override for class-specific XML generation.
 /// </summary>
 /// <param name="element">The element that represents this node, to which attributes and children should be added.</param>
 /// <param name="context">XML generation context.</param>
 protected virtual void OnGetXElement(XElement element, ExpressionXmlContext context)
 {
 }