示例#1
0
        public void ToAml(XmlWriter writer, AmlWriterSettings settings)
        {
            var innProvider = (InnovatorQueryProvider)_provider;
            var query       = innProvider.Translate(this._expression);

            query.ToAml(writer, settings);
        }
示例#2
0
 public void ToAml(XmlWriter writer, AmlWriterSettings settings)
 {
     if (Settings?.ModifyQuery == null)
     {
         QueryItem.ToAml(writer, settings);
     }
     else
     {
         var item = AmlContext.FromXml(QueryItem).AssertItem();
         Settings.ModifyQuery.Invoke(item);
         item.ToAml(writer, settings);
     }
 }
示例#3
0
 public void ToAml(XmlWriter writer, AmlWriterSettings settings)
 {
     writer.WriteStartElement("Item");
     writer.WriteAttributeString("type", Type);
     writer.WriteAttributeString("id", Id);
     writer.WriteAttributeString("action", "edit");
     writer.WriteAttributeString("doGetItem", "0");
     writer.WriteElementString("x", _context.Format(Position.X));
     writer.WriteElementString("y", _context.Format(Position.Y));
     if (Segments.Any())
     {
         writer.WriteElementString("segments", Segments.GroupConcat("|", p => $"{p.X},{p.Y}"));
     }
     writer.WriteEndElement();
 }
示例#4
0
        /// <summary>
        /// Write the node to the specified <see cref="XmlWriter" /> as AML
        /// </summary>
        /// <param name="writer"><see cref="XmlWriter" /> to write the node to</param>
        /// <param name="settings">Settings controlling how the node is written</param>
        public void ToAml(XmlWriter writer, AmlWriterSettings settings)
        {
            var elems = (_content as IEnumerable)?.OfType <IReadOnlyElement>()?.ToArray();

            if (elems?.Length == 1)
            {
                elems[0].ToAml(writer, settings);
                return;
            }

            var ex = _content as ServerException;

            if (ex != null)
            {
                ex.ToAml(writer, settings);
            }
            else
            {
                writer.WriteStartElement("SOAP-ENV", "Envelope", "http://schemas.xmlsoap.org/soap/envelope/");
                writer.WriteStartElement("SOAP-ENV", "Body", "http://schemas.xmlsoap.org/soap/envelope/");
                writer.WriteStartElement("Result");
                var items = _content as IEnumerable <IReadOnlyItem>;
                if (items != null)
                {
                    foreach (var item in items)
                    {
                        item.ToAml(writer, settings);
                    }
                }
                else if (_content != null)
                {
                    writer.WriteString(_conn.AmlContext.LocalizationContext.Format(_content));
                }
                writer.WriteEndElement();
                if (Message.Exists)
                {
                    Message.ToAml(writer, settings);
                }
                writer.WriteEndElement();
                writer.WriteEndElement();
            }
        }
示例#5
0
        /// <summary>
        /// To the aml.
        /// </summary>
        /// <param name="writer">The writer.</param>
        /// <param name="settings">The settings.</param>
        public override void ToAml(XmlWriter writer, AmlWriterSettings settings)
        {
            if (Xml != null)
            {
                Xml.WriteTo(writer);
                return;
            }

            if (nodeList != null)
            {
                var parentItem = nodeList[0].SelectSingleNode("ancestor::Item");
                if (parentItem != null)
                {
                    nodeList[0].ParentNode.WriteTo(writer);
                    return;
                }
            }

            dom.WriteTo(writer);
            return;
        }
示例#6
0
 public virtual void ToAml(XmlWriter writer, AmlWriterSettings settings)
 {
     AssertXml().WriteTo(writer);
 }
示例#7
0
 public void ToAml(XmlWriter writer, AmlWriterSettings settings)
 {
     _result.ToAml(writer, settings);
 }
示例#8
0
        /// <summary>
        /// Write the query to the specified <see cref="XmlWriter" /> as AML
        /// </summary>
        /// <param name="writer"><see cref="XmlWriter" /> to write the node to</param>
        /// <param name="settings">Settings controlling how the node is written</param>
        public void ToAml(XmlWriter writer, AmlWriterSettings settings)
        {
            var visitor = new AmlVisitor(Context, writer);

            visitor.Visit(this);
        }
示例#9
0
 public override void ToAml(XmlWriter writer, AmlWriterSettings settings)
 {
     _relElment.WriteTo(writer);
 }