示例#1
0
 internal void WriteInnerXmlCoreTo(XmlWriter writer, SerializationContext serializationContext)
 {
     writer.WriteAttributeString("SelectAllProperties", this.m_selectAllProperties ? "true" : "false");
     writer.WriteStartElement("Properties");
     foreach (string current in this.m_properties.Keys)
     {
         ClientQueryProperty clientQueryProperty = this.m_properties[current];
         writer.WriteStartElement("Property");
         writer.WriteAttributeString("Name", current);
         if (clientQueryProperty.ScalarPropertySet)
         {
             writer.WriteAttributeString("ScalarProperty", clientQueryProperty.ScalarProperty ? "true" : "false");
         }
         if (clientQueryProperty.SelectAllSet)
         {
             writer.WriteAttributeString("SelectAll", clientQueryProperty.SelectAll ? "true" : "false");
         }
         if (clientQueryProperty.Query != null)
         {
             clientQueryProperty.Query.WriteInnerXmlTo(writer, serializationContext);
         }
         writer.WriteEndElement();
     }
     writer.WriteEndElement();
     if (this.m_isChildItemQuery && this.m_childItemFilterSb != null)
     {
         writer.WriteStartElement("QueryableExpression");
         this.m_childItemFilterSb.WriteContentAsRawXml(writer);
         writer.WriteEndElement();
         if (this.m_childItemFilterSerializationContext != null)
         {
             serializationContext.MergeFrom(this.m_childItemFilterSerializationContext);
         }
     }
 }
示例#2
0
        public ClientQueryInternal SelectSubQuery(ClientQueryInternal subQuery)
        {
            if (string.IsNullOrEmpty(subQuery.Name))
            {
                throw new ArgumentException("subQuery", Resources.GetString("RequestEmptyQueryName"));
            }
            ClientQueryProperty clientQueryProperty = null;

            if (this.m_properties.TryGetValue(subQuery.Name, out clientQueryProperty))
            {
                if (clientQueryProperty.ScalarPropertySet && clientQueryProperty.ScalarProperty)
                {
                    throw ClientUtility.CreateArgumentException("subQuery");
                }
                if (clientQueryProperty.Query != null && clientQueryProperty.Query != subQuery)
                {
                    throw ClientUtility.CreateArgumentException("subQuery");
                }
                clientQueryProperty.Query = subQuery;
            }
            else
            {
                clientQueryProperty              = new ClientQueryProperty();
                clientQueryProperty.Query        = subQuery;
                this.m_properties[subQuery.Name] = clientQueryProperty;
            }
            return(this);
        }
示例#3
0
        internal ClientQueryInternal GetSubQuery(string name)
        {
            if (string.IsNullOrEmpty(name))
            {
                throw new ArgumentNullException("name");
            }
            ClientQueryProperty clientQueryProperty = null;

            if (this.m_properties.TryGetValue(name, out clientQueryProperty))
            {
                return(clientQueryProperty.Query);
            }
            return(null);
        }
示例#4
0
        public ClientQueryInternal SelectWithAll(string propertyName)
        {
            if (string.IsNullOrEmpty(propertyName))
            {
                throw new ArgumentException("propertyName", Resources.GetString("RequestEmptyQueryName"));
            }
            ClientQueryProperty clientQueryProperty = null;

            if (!this.m_properties.TryGetValue(propertyName, out clientQueryProperty))
            {
                clientQueryProperty             = new ClientQueryProperty();
                this.m_properties[propertyName] = clientQueryProperty;
            }
            clientQueryProperty.SelectAll    = true;
            clientQueryProperty.SelectAllSet = true;
            return(this);
        }