diff --git a/GeneratedSchemaLibraries/Microsoft Search/Microsoft.Search.Query.xsd.cs b/GeneratedSchemaLibraries/Microsoft Search/Microsoft.Search.Query.xsd.cs new file mode 100644 index 0000000..c928b01 --- /dev/null +++ b/GeneratedSchemaLibraries/Microsoft Search/Microsoft.Search.Query.xsd.cs @@ -0,0 +1,5733 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Microsoft.Search.Query.Schemas { + using System; + using System.Collections; + using System.Collections.Generic; + using System.ComponentModel; + using System.IO; + using System.Linq; + using System.Diagnostics; + using System.Xml; + using System.Xml.Schema; + using System.Xml.Linq; + using Xml.Schema.Linq; + + + /// + /// + /// Regular expression: (Query) + /// + /// + public partial class QueryPacket : XTypedElement, IXMetaData { + + public void Save(string xmlFile) { + XTypedServices.Save(xmlFile, Untyped); + } + + public void Save(System.IO.TextWriter tw) { + XTypedServices.Save(tw, Untyped); + } + + public void Save(System.Xml.XmlWriter xmlWriter) { + XTypedServices.Save(xmlWriter, Untyped); + } + + public static QueryPacket Load(string xmlFile) { + return XTypedServices.Load(xmlFile); + } + + public static QueryPacket Load(System.IO.TextReader xmlFile) { + return XTypedServices.Load(xmlFile); + } + + public static QueryPacket Parse(string xml) { + return XTypedServices.Parse(xml); + } + + public static explicit operator QueryPacket(XElement xe) { return XTypedServices.ToXTypedElement(xe,LinqToXsdTypeManager.Instance as ILinqToXsdTypeManager); } + + public override XTypedElement Clone() { + return XTypedServices.CloneXTypedElement(this); + } + + /// + /// + /// Regular expression: (Query) + /// + /// + public QueryPacket() { + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + [EditorBrowsable(EditorBrowsableState.Never)] + protected internal static readonly System.Xml.Linq.XName QueryXName = System.Xml.Linq.XName.Get("Query", "urn:Microsoft.Search.Query"); + + /// + /// + /// Occurrence: required + /// + /// + /// Regular expression: (Query) + /// + /// + public virtual QueryLocalType Query { + get { + XElement x = this.GetElement(QueryXName); + return ((QueryLocalType)(x)); + } + set { + this.SetElement(QueryXName, value); + } + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + [EditorBrowsable(EditorBrowsableState.Never)] + protected internal static readonly System.Xml.Linq.XName revisionXName = System.Xml.Linq.XName.Get("revision", ""); + + /// + /// + /// Occurrence: optional + /// + /// + public virtual System.Int32? revision { + get { + XAttribute x = this.Attribute(revisionXName); + if ((x == null)) { + return null; + } + return XTypedServices.ParseValue(x, XmlSchemaType.GetBuiltInSimpleType(XmlTypeCode.Int).Datatype); + } + set { + this.SetAttribute(revisionXName, value, XmlSchemaType.GetBuiltInSimpleType(XmlTypeCode.Int).Datatype); + } + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + [EditorBrowsable(EditorBrowsableState.Never)] + protected internal static readonly System.Xml.Linq.XName buildXName = System.Xml.Linq.XName.Get("build", ""); + + /// + /// + /// Occurrence: optional + /// + /// + public virtual string build { + get { + XAttribute x = this.Attribute(buildXName); + if ((x == null)) { + return null; + } + return XTypedServices.ParseValue(x, XmlSchemaType.GetBuiltInSimpleType(XmlTypeCode.String).Datatype); + } + set { + this.SetAttribute(buildXName, value, XmlSchemaType.GetBuiltInSimpleType(XmlTypeCode.String).Datatype); + } + } + + private static readonly System.Xml.Linq.XName xName = System.Xml.Linq.XName.Get("QueryPacket", "urn:Microsoft.Search.Query"); + + static QueryPacket() { + BuildElementDictionary(); + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + private static Dictionary localElementDictionary = new Dictionary(); + + private static void BuildElementDictionary() { + localElementDictionary.Add(QueryXName, typeof(QueryLocalType)); + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + Dictionary IXMetaData.LocalElementsDictionary { + get { + return localElementDictionary; + } + } + + ContentModelEntity IXMetaData.GetContentModel() { + return ContentModelEntity.Default; + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + System.Xml.Linq.XName IXMetaData.SchemaName { + get { + return xName; + } + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + SchemaOrigin IXMetaData.TypeOrigin { + get { + return SchemaOrigin.Element; + } + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + ILinqToXsdTypeManager IXMetaData.TypeManager { + get { + return LinqToXsdTypeManager.Instance; + } + } + + /// + /// + /// Regular expression: (QueryId?, Context?, Range?, Properties?, SortByProperties?, ImplicitAndBehavior?, RelevanceModel?, EnableStemming?, TrimDuplicates?, IncludeSpecialTermResults?, PreQuerySuggestions?, HighlightQuerySuggestions?, CapitalizeFirstLetters?, ResultProvider?, ResubmitFlags?, EnableSpellcheck?, UserContext?, FindSimilar?, IncludeRefinementResults?, RefinementFilters?, IgnoreAllNoiseQuery?, IncludeRelevantResults?, IncludeHighConfidenceResults?) + /// + /// + public partial class QueryLocalType : XTypedElement, IXMetaData { + + public static explicit operator QueryLocalType(XElement xe) { return XTypedServices.ToXTypedElement(xe,LinqToXsdTypeManager.Instance as ILinqToXsdTypeManager); } + + public override XTypedElement Clone() { + return XTypedServices.CloneXTypedElement(this); + } + + /// + /// + /// Regular expression: (QueryId?, Context?, Range?, Properties?, SortByProperties?, ImplicitAndBehavior?, RelevanceModel?, EnableStemming?, TrimDuplicates?, IncludeSpecialTermResults?, PreQuerySuggestions?, HighlightQuerySuggestions?, CapitalizeFirstLetters?, ResultProvider?, ResubmitFlags?, EnableSpellcheck?, UserContext?, FindSimilar?, IncludeRefinementResults?, RefinementFilters?, IgnoreAllNoiseQuery?, IncludeRelevantResults?, IncludeHighConfidenceResults?) + /// + /// + public QueryLocalType() { + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + [EditorBrowsable(EditorBrowsableState.Never)] + protected internal static readonly System.Xml.Linq.XName QueryIdXName = System.Xml.Linq.XName.Get("QueryId", "urn:Microsoft.Search.Query"); + + /// + /// + /// If this element is present, it must be returned in the response from the Query Web service. + /// + /// + /// Occurrence: optional + /// + /// + /// Regular expression: (QueryId?, Context?, Range?, Properties?, SortByProperties?, ImplicitAndBehavior?, RelevanceModel?, EnableStemming?, TrimDuplicates?, IncludeSpecialTermResults?, PreQuerySuggestions?, HighlightQuerySuggestions?, CapitalizeFirstLetters?, ResultProvider?, ResubmitFlags?, EnableSpellcheck?, UserContext?, FindSimilar?, IncludeRefinementResults?, RefinementFilters?, IgnoreAllNoiseQuery?, IncludeRelevantResults?, IncludeHighConfidenceResults?) + /// + /// + public virtual QueryId QueryId { + get { + XElement x = this.GetElement(QueryIdXName); + if ((x == null)) { + return null; + } + return ((QueryId)(x)); + } + set { + this.SetElement(QueryIdXName, value); + } + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + [EditorBrowsable(EditorBrowsableState.Never)] + protected internal static readonly System.Xml.Linq.XName ContextXName = System.Xml.Linq.XName.Get("Context", "urn:Microsoft.Search.Query"); + + /// + /// + /// Occurrence: optional + /// + /// + /// Regular expression: (QueryId?, Context?, Range?, Properties?, SortByProperties?, ImplicitAndBehavior?, RelevanceModel?, EnableStemming?, TrimDuplicates?, IncludeSpecialTermResults?, PreQuerySuggestions?, HighlightQuerySuggestions?, CapitalizeFirstLetters?, ResultProvider?, ResubmitFlags?, EnableSpellcheck?, UserContext?, FindSimilar?, IncludeRefinementResults?, RefinementFilters?, IgnoreAllNoiseQuery?, IncludeRelevantResults?, IncludeHighConfidenceResults?) + /// + /// + public virtual Context Context { + get { + XElement x = this.GetElement(ContextXName); + if ((x == null)) { + return null; + } + return ((Context)(x)); + } + set { + this.SetElement(ContextXName, value); + } + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + [EditorBrowsable(EditorBrowsableState.Never)] + protected internal static readonly System.Xml.Linq.XName RangeXName = System.Xml.Linq.XName.Get("Range", "urn:Microsoft.Search.Query"); + + /// + /// + /// Occurrence: optional + /// + /// + /// Regular expression: (QueryId?, Context?, Range?, Properties?, SortByProperties?, ImplicitAndBehavior?, RelevanceModel?, EnableStemming?, TrimDuplicates?, IncludeSpecialTermResults?, PreQuerySuggestions?, HighlightQuerySuggestions?, CapitalizeFirstLetters?, ResultProvider?, ResubmitFlags?, EnableSpellcheck?, UserContext?, FindSimilar?, IncludeRefinementResults?, RefinementFilters?, IgnoreAllNoiseQuery?, IncludeRelevantResults?, IncludeHighConfidenceResults?) + /// + /// + public virtual Range Range { + get { + XElement x = this.GetElement(RangeXName); + if ((x == null)) { + return null; + } + return ((Range)(x)); + } + set { + this.SetElement(RangeXName, value); + } + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + [EditorBrowsable(EditorBrowsableState.Never)] + protected internal static readonly System.Xml.Linq.XName PropertiesXName = System.Xml.Linq.XName.Get("Properties", "urn:Microsoft.Search.Query"); + + /// + /// + /// Occurrence: optional + /// + /// + /// Regular expression: (QueryId?, Context?, Range?, Properties?, SortByProperties?, ImplicitAndBehavior?, RelevanceModel?, EnableStemming?, TrimDuplicates?, IncludeSpecialTermResults?, PreQuerySuggestions?, HighlightQuerySuggestions?, CapitalizeFirstLetters?, ResultProvider?, ResubmitFlags?, EnableSpellcheck?, UserContext?, FindSimilar?, IncludeRefinementResults?, RefinementFilters?, IgnoreAllNoiseQuery?, IncludeRelevantResults?, IncludeHighConfidenceResults?) + /// + /// + public virtual Properties Properties { + get { + XElement x = this.GetElement(PropertiesXName); + if ((x == null)) { + return null; + } + return ((Properties)(x)); + } + set { + this.SetElement(PropertiesXName, value); + } + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + [EditorBrowsable(EditorBrowsableState.Never)] + protected internal static readonly System.Xml.Linq.XName SortByPropertiesXName = System.Xml.Linq.XName.Get("SortByProperties", "urn:Microsoft.Search.Query"); + + /// + /// + /// If no managed properties are specified for sorting results, by default the results will be sorted by Rank. + /// + /// + /// Occurrence: optional + /// + /// + /// Regular expression: (QueryId?, Context?, Range?, Properties?, SortByProperties?, ImplicitAndBehavior?, RelevanceModel?, EnableStemming?, TrimDuplicates?, IncludeSpecialTermResults?, PreQuerySuggestions?, HighlightQuerySuggestions?, CapitalizeFirstLetters?, ResultProvider?, ResubmitFlags?, EnableSpellcheck?, UserContext?, FindSimilar?, IncludeRefinementResults?, RefinementFilters?, IgnoreAllNoiseQuery?, IncludeRelevantResults?, IncludeHighConfidenceResults?) + /// + /// + public virtual SortByProperties SortByProperties { + get { + XElement x = this.GetElement(SortByPropertiesXName); + if ((x == null)) { + return null; + } + return ((SortByProperties)(x)); + } + set { + this.SetElement(SortByPropertiesXName, value); + } + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + [EditorBrowsable(EditorBrowsableState.Never)] + protected internal static readonly System.Xml.Linq.XName ImplicitAndBehaviorXName = System.Xml.Linq.XName.Get("ImplicitAndBehavior", "urn:Microsoft.Search.Query"); + + /// + /// + /// This element applies to the Query Web method, and only when using the Keyword Query Syntax Reference. The only format that is supported is the Microsoft.Search.Response.Document format. + /// + /// + /// Occurrence: optional + /// + /// + /// Regular expression: (QueryId?, Context?, Range?, Properties?, SortByProperties?, ImplicitAndBehavior?, RelevanceModel?, EnableStemming?, TrimDuplicates?, IncludeSpecialTermResults?, PreQuerySuggestions?, HighlightQuerySuggestions?, CapitalizeFirstLetters?, ResultProvider?, ResubmitFlags?, EnableSpellcheck?, UserContext?, FindSimilar?, IncludeRefinementResults?, RefinementFilters?, IgnoreAllNoiseQuery?, IncludeRelevantResults?, IncludeHighConfidenceResults?) + /// + /// + public virtual ImplicitAndBehavior ImplicitAndBehavior { + get { + XElement x = this.GetElement(ImplicitAndBehaviorXName); + if ((x == null)) { + return null; + } + return ((ImplicitAndBehavior)(x)); + } + set { + this.SetElement(ImplicitAndBehaviorXName, value); + } + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + [EditorBrowsable(EditorBrowsableState.Never)] + protected internal static readonly System.Xml.Linq.XName RelevanceModelXName = System.Xml.Linq.XName.Get("RelevanceModel", "urn:Microsoft.Search.Query"); + + /// + /// + /// Occurrence: optional + /// + /// + /// Regular expression: (QueryId?, Context?, Range?, Properties?, SortByProperties?, ImplicitAndBehavior?, RelevanceModel?, EnableStemming?, TrimDuplicates?, IncludeSpecialTermResults?, PreQuerySuggestions?, HighlightQuerySuggestions?, CapitalizeFirstLetters?, ResultProvider?, ResubmitFlags?, EnableSpellcheck?, UserContext?, FindSimilar?, IncludeRefinementResults?, RefinementFilters?, IgnoreAllNoiseQuery?, IncludeRelevantResults?, IncludeHighConfidenceResults?) + /// + /// + public virtual RelevanceModel RelevanceModel { + get { + XElement x = this.GetElement(RelevanceModelXName); + if ((x == null)) { + return null; + } + return ((RelevanceModel)(x)); + } + set { + this.SetElement(RelevanceModelXName, value); + } + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + [EditorBrowsable(EditorBrowsableState.Never)] + protected internal static readonly System.Xml.Linq.XName EnableStemmingXName = System.Xml.Linq.XName.Get("EnableStemming", "urn:Microsoft.Search.Query"); + + /// + /// + /// When using the FAST Query Language, it is also possible to control stemming more precisely inside the query string. + /// + /// + /// Occurrence: optional + /// + /// + /// Regular expression: (QueryId?, Context?, Range?, Properties?, SortByProperties?, ImplicitAndBehavior?, RelevanceModel?, EnableStemming?, TrimDuplicates?, IncludeSpecialTermResults?, PreQuerySuggestions?, HighlightQuerySuggestions?, CapitalizeFirstLetters?, ResultProvider?, ResubmitFlags?, EnableSpellcheck?, UserContext?, FindSimilar?, IncludeRefinementResults?, RefinementFilters?, IgnoreAllNoiseQuery?, IncludeRelevantResults?, IncludeHighConfidenceResults?) + /// + /// + public virtual EnableStemming EnableStemming { + get { + XElement x = this.GetElement(EnableStemmingXName); + if ((x == null)) { + return null; + } + return ((EnableStemming)(x)); + } + set { + this.SetElement(EnableStemmingXName, value); + } + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + [EditorBrowsable(EditorBrowsableState.Never)] + protected internal static readonly System.Xml.Linq.XName TrimDuplicatesXName = System.Xml.Linq.XName.Get("TrimDuplicates", "urn:Microsoft.Search.Query"); + + /// + /// + /// For FAST Search Server 2010 for SharePoint, this element can also be used to collapse hits in the result set by using a group identifier (ID). + /// + ///The attributes apply only to FAST Search Server 2010 for SharePoint. + /// + /// + /// Occurrence: optional + /// + /// + /// Regular expression: (QueryId?, Context?, Range?, Properties?, SortByProperties?, ImplicitAndBehavior?, RelevanceModel?, EnableStemming?, TrimDuplicates?, IncludeSpecialTermResults?, PreQuerySuggestions?, HighlightQuerySuggestions?, CapitalizeFirstLetters?, ResultProvider?, ResubmitFlags?, EnableSpellcheck?, UserContext?, FindSimilar?, IncludeRefinementResults?, RefinementFilters?, IgnoreAllNoiseQuery?, IncludeRelevantResults?, IncludeHighConfidenceResults?) + /// + /// + public virtual TrimDuplicates TrimDuplicates { + get { + XElement x = this.GetElement(TrimDuplicatesXName); + if ((x == null)) { + return null; + } + return ((TrimDuplicates)(x)); + } + set { + this.SetElement(TrimDuplicatesXName, value); + } + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + [EditorBrowsable(EditorBrowsableState.Never)] + protected internal static readonly System.Xml.Linq.XName IncludeSpecialTermResultsXName = System.Xml.Linq.XName.Get("IncludeSpecialTermResults", "urn:Microsoft.Search.Query"); + + /// + /// + /// For FAST Search Server 2010 for SharePoint, special term results includes best bets and Visual best bets. + /// + /// + /// Occurrence: optional + /// + /// + /// Regular expression: (QueryId?, Context?, Range?, Properties?, SortByProperties?, ImplicitAndBehavior?, RelevanceModel?, EnableStemming?, TrimDuplicates?, IncludeSpecialTermResults?, PreQuerySuggestions?, HighlightQuerySuggestions?, CapitalizeFirstLetters?, ResultProvider?, ResubmitFlags?, EnableSpellcheck?, UserContext?, FindSimilar?, IncludeRefinementResults?, RefinementFilters?, IgnoreAllNoiseQuery?, IncludeRelevantResults?, IncludeHighConfidenceResults?) + /// + /// + public virtual IncludeSpecialTermResults IncludeSpecialTermResults { + get { + XElement x = this.GetElement(IncludeSpecialTermResultsXName); + if ((x == null)) { + return null; + } + return ((IncludeSpecialTermResults)(x)); + } + set { + this.SetElement(IncludeSpecialTermResultsXName, value); + } + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + [EditorBrowsable(EditorBrowsableState.Never)] + protected internal static readonly System.Xml.Linq.XName PreQuerySuggestionsXName = System.Xml.Linq.XName.Get("PreQuerySuggestions", "urn:Microsoft.Search.Query"); + + /// + /// + /// Occurrence: optional + /// + /// + /// Regular expression: (QueryId?, Context?, Range?, Properties?, SortByProperties?, ImplicitAndBehavior?, RelevanceModel?, EnableStemming?, TrimDuplicates?, IncludeSpecialTermResults?, PreQuerySuggestions?, HighlightQuerySuggestions?, CapitalizeFirstLetters?, ResultProvider?, ResubmitFlags?, EnableSpellcheck?, UserContext?, FindSimilar?, IncludeRefinementResults?, RefinementFilters?, IgnoreAllNoiseQuery?, IncludeRelevantResults?, IncludeHighConfidenceResults?) + /// + /// + public virtual PreQuerySuggestions PreQuerySuggestions { + get { + XElement x = this.GetElement(PreQuerySuggestionsXName); + if ((x == null)) { + return null; + } + return ((PreQuerySuggestions)(x)); + } + set { + this.SetElement(PreQuerySuggestionsXName, value); + } + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + [EditorBrowsable(EditorBrowsableState.Never)] + protected internal static readonly System.Xml.Linq.XName HighlightQuerySuggestionsXName = System.Xml.Linq.XName.Get("HighlightQuerySuggestions", "urn:Microsoft.Search.Query"); + + /// + /// + /// Occurrence: optional + /// + /// + /// Regular expression: (QueryId?, Context?, Range?, Properties?, SortByProperties?, ImplicitAndBehavior?, RelevanceModel?, EnableStemming?, TrimDuplicates?, IncludeSpecialTermResults?, PreQuerySuggestions?, HighlightQuerySuggestions?, CapitalizeFirstLetters?, ResultProvider?, ResubmitFlags?, EnableSpellcheck?, UserContext?, FindSimilar?, IncludeRefinementResults?, RefinementFilters?, IgnoreAllNoiseQuery?, IncludeRelevantResults?, IncludeHighConfidenceResults?) + /// + /// + public virtual HighlightQuerySuggestions HighlightQuerySuggestions { + get { + XElement x = this.GetElement(HighlightQuerySuggestionsXName); + if ((x == null)) { + return null; + } + return ((HighlightQuerySuggestions)(x)); + } + set { + this.SetElement(HighlightQuerySuggestionsXName, value); + } + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + [EditorBrowsable(EditorBrowsableState.Never)] + protected internal static readonly System.Xml.Linq.XName CapitalizeFirstLettersXName = System.Xml.Linq.XName.Get("CapitalizeFirstLetters", "urn:Microsoft.Search.Query"); + + /// + /// + /// Occurrence: optional + /// + /// + /// Regular expression: (QueryId?, Context?, Range?, Properties?, SortByProperties?, ImplicitAndBehavior?, RelevanceModel?, EnableStemming?, TrimDuplicates?, IncludeSpecialTermResults?, PreQuerySuggestions?, HighlightQuerySuggestions?, CapitalizeFirstLetters?, ResultProvider?, ResubmitFlags?, EnableSpellcheck?, UserContext?, FindSimilar?, IncludeRefinementResults?, RefinementFilters?, IgnoreAllNoiseQuery?, IncludeRelevantResults?, IncludeHighConfidenceResults?) + /// + /// + public virtual CapitalizeFirstLetters CapitalizeFirstLetters { + get { + XElement x = this.GetElement(CapitalizeFirstLettersXName); + if ((x == null)) { + return null; + } + return ((CapitalizeFirstLetters)(x)); + } + set { + this.SetElement(CapitalizeFirstLettersXName, value); + } + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + [EditorBrowsable(EditorBrowsableState.Never)] + protected internal static readonly System.Xml.Linq.XName ResultProviderXName = System.Xml.Linq.XName.Get("ResultProvider", "urn:Microsoft.Search.Query"); + + /// + /// + /// NOTE: For People Search queries, specify SharePointSearch as the result provider even when FAST Search Server 2010 for SharePoint is the search back-end. + /// + /// + /// Occurrence: optional + /// + /// + /// Regular expression: (QueryId?, Context?, Range?, Properties?, SortByProperties?, ImplicitAndBehavior?, RelevanceModel?, EnableStemming?, TrimDuplicates?, IncludeSpecialTermResults?, PreQuerySuggestions?, HighlightQuerySuggestions?, CapitalizeFirstLetters?, ResultProvider?, ResubmitFlags?, EnableSpellcheck?, UserContext?, FindSimilar?, IncludeRefinementResults?, RefinementFilters?, IgnoreAllNoiseQuery?, IncludeRelevantResults?, IncludeHighConfidenceResults?) + /// + /// + public virtual Microsoft.Search.Query.Schemas.ResultProvider ResultProvider { + get { + XElement x = this.GetElement(ResultProviderXName); + if ((x == null)) { + return null; + } + return ((Microsoft.Search.Query.Schemas.ResultProvider)(x)); + } + set { + this.SetElement(ResultProviderXName, value); + } + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + [EditorBrowsable(EditorBrowsableState.Never)] + protected internal static readonly System.Xml.Linq.XName ResubmitFlagsXName = System.Xml.Linq.XName.Get("ResubmitFlags", "urn:Microsoft.Search.Query"); + + /// + /// + /// Occurrence: optional + /// + /// + /// Regular expression: (QueryId?, Context?, Range?, Properties?, SortByProperties?, ImplicitAndBehavior?, RelevanceModel?, EnableStemming?, TrimDuplicates?, IncludeSpecialTermResults?, PreQuerySuggestions?, HighlightQuerySuggestions?, CapitalizeFirstLetters?, ResultProvider?, ResubmitFlags?, EnableSpellcheck?, UserContext?, FindSimilar?, IncludeRefinementResults?, RefinementFilters?, IgnoreAllNoiseQuery?, IncludeRelevantResults?, IncludeHighConfidenceResults?) + /// + /// + public virtual ResubmitFlags ResubmitFlags { + get { + XElement x = this.GetElement(ResubmitFlagsXName); + if ((x == null)) { + return null; + } + return ((ResubmitFlags)(x)); + } + set { + this.SetElement(ResubmitFlagsXName, value); + } + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + [EditorBrowsable(EditorBrowsableState.Never)] + protected internal static readonly System.Xml.Linq.XName EnableSpellcheckXName = System.Xml.Linq.XName.Get("EnableSpellcheck", "urn:Microsoft.Search.Query"); + + /// + /// + /// The element value specifies the spelling correction mode to apply to the query. + /// + /// + /// Occurrence: optional + /// + /// + /// Regular expression: (QueryId?, Context?, Range?, Properties?, SortByProperties?, ImplicitAndBehavior?, RelevanceModel?, EnableStemming?, TrimDuplicates?, IncludeSpecialTermResults?, PreQuerySuggestions?, HighlightQuerySuggestions?, CapitalizeFirstLetters?, ResultProvider?, ResubmitFlags?, EnableSpellcheck?, UserContext?, FindSimilar?, IncludeRefinementResults?, RefinementFilters?, IgnoreAllNoiseQuery?, IncludeRelevantResults?, IncludeHighConfidenceResults?) + /// + /// + public virtual Microsoft.Search.Query.Schemas.EnableSpellcheck EnableSpellcheck { + get { + XElement x = this.GetElement(EnableSpellcheckXName); + if ((x == null)) { + return null; + } + return ((Microsoft.Search.Query.Schemas.EnableSpellcheck)(x)); + } + set { + this.SetElement(EnableSpellcheckXName, value); + } + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + [EditorBrowsable(EditorBrowsableState.Never)] + protected internal static readonly System.Xml.Linq.XName UserContextXName = System.Xml.Linq.XName.Get("UserContext", "urn:Microsoft.Search.Query"); + + /// + /// + /// The keyword management search settings can be restricted to context. A context defines when a search setting should apply, typically targeting a specific group of users. + /// + /// + /// Occurrence: optional + /// + /// + /// Regular expression: (QueryId?, Context?, Range?, Properties?, SortByProperties?, ImplicitAndBehavior?, RelevanceModel?, EnableStemming?, TrimDuplicates?, IncludeSpecialTermResults?, PreQuerySuggestions?, HighlightQuerySuggestions?, CapitalizeFirstLetters?, ResultProvider?, ResubmitFlags?, EnableSpellcheck?, UserContext?, FindSimilar?, IncludeRefinementResults?, RefinementFilters?, IgnoreAllNoiseQuery?, IncludeRelevantResults?, IncludeHighConfidenceResults?) + /// + /// + public virtual UserContext UserContext { + get { + XElement x = this.GetElement(UserContextXName); + if ((x == null)) { + return null; + } + return ((UserContext)(x)); + } + set { + this.SetElement(UserContextXName, value); + } + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + [EditorBrowsable(EditorBrowsableState.Never)] + protected internal static readonly System.Xml.Linq.XName FindSimilarXName = System.Xml.Linq.XName.Get("FindSimilar", "urn:Microsoft.Search.Query"); + + /// + /// + /// The find similar features enable you to search for documents that are similar to already retrieved query results. The similarity evaluation is based on a statistical measure. + /// + /// + /// Occurrence: optional + /// + /// + /// Regular expression: (QueryId?, Context?, Range?, Properties?, SortByProperties?, ImplicitAndBehavior?, RelevanceModel?, EnableStemming?, TrimDuplicates?, IncludeSpecialTermResults?, PreQuerySuggestions?, HighlightQuerySuggestions?, CapitalizeFirstLetters?, ResultProvider?, ResubmitFlags?, EnableSpellcheck?, UserContext?, FindSimilar?, IncludeRefinementResults?, RefinementFilters?, IgnoreAllNoiseQuery?, IncludeRelevantResults?, IncludeHighConfidenceResults?) + /// + /// + public virtual FindSimilar FindSimilar { + get { + XElement x = this.GetElement(FindSimilarXName); + if ((x == null)) { + return null; + } + return ((FindSimilar)(x)); + } + set { + this.SetElement(FindSimilarXName, value); + } + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + [EditorBrowsable(EditorBrowsableState.Never)] + protected internal static readonly System.Xml.Linq.XName IncludeRefinementResultsXName = System.Xml.Linq.XName.Get("IncludeRefinementResults", "urn:Microsoft.Search.Query"); + + /// + /// + /// Occurrence: optional + /// + /// + /// Regular expression: (QueryId?, Context?, Range?, Properties?, SortByProperties?, ImplicitAndBehavior?, RelevanceModel?, EnableStemming?, TrimDuplicates?, IncludeSpecialTermResults?, PreQuerySuggestions?, HighlightQuerySuggestions?, CapitalizeFirstLetters?, ResultProvider?, ResubmitFlags?, EnableSpellcheck?, UserContext?, FindSimilar?, IncludeRefinementResults?, RefinementFilters?, IgnoreAllNoiseQuery?, IncludeRelevantResults?, IncludeHighConfidenceResults?) + /// + /// + public virtual IncludeRefinementResults IncludeRefinementResults { + get { + XElement x = this.GetElement(IncludeRefinementResultsXName); + if ((x == null)) { + return null; + } + return ((IncludeRefinementResults)(x)); + } + set { + this.SetElement(IncludeRefinementResultsXName, value); + } + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + [EditorBrowsable(EditorBrowsableState.Never)] + protected internal static readonly System.Xml.Linq.XName RefinementFiltersXName = System.Xml.Linq.XName.Get("RefinementFilters", "urn:Microsoft.Search.Query"); + + /// + /// + /// Occurrence: optional + /// + /// + /// Regular expression: (QueryId?, Context?, Range?, Properties?, SortByProperties?, ImplicitAndBehavior?, RelevanceModel?, EnableStemming?, TrimDuplicates?, IncludeSpecialTermResults?, PreQuerySuggestions?, HighlightQuerySuggestions?, CapitalizeFirstLetters?, ResultProvider?, ResubmitFlags?, EnableSpellcheck?, UserContext?, FindSimilar?, IncludeRefinementResults?, RefinementFilters?, IgnoreAllNoiseQuery?, IncludeRelevantResults?, IncludeHighConfidenceResults?) + /// + /// + public virtual RefinementFilters RefinementFilters { + get { + XElement x = this.GetElement(RefinementFiltersXName); + if ((x == null)) { + return null; + } + return ((RefinementFilters)(x)); + } + set { + this.SetElement(RefinementFiltersXName, value); + } + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + [EditorBrowsable(EditorBrowsableState.Never)] + protected internal static readonly System.Xml.Linq.XName IgnoreAllNoiseQueryXName = System.Xml.Linq.XName.Get("IgnoreAllNoiseQuery", "urn:Microsoft.Search.Query"); + + /// + /// + /// Occurrence: optional + /// + /// + /// Regular expression: (QueryId?, Context?, Range?, Properties?, SortByProperties?, ImplicitAndBehavior?, RelevanceModel?, EnableStemming?, TrimDuplicates?, IncludeSpecialTermResults?, PreQuerySuggestions?, HighlightQuerySuggestions?, CapitalizeFirstLetters?, ResultProvider?, ResubmitFlags?, EnableSpellcheck?, UserContext?, FindSimilar?, IncludeRefinementResults?, RefinementFilters?, IgnoreAllNoiseQuery?, IncludeRelevantResults?, IncludeHighConfidenceResults?) + /// + /// + public virtual IgnoreAllNoiseQuery IgnoreAllNoiseQuery { + get { + XElement x = this.GetElement(IgnoreAllNoiseQueryXName); + if ((x == null)) { + return null; + } + return ((IgnoreAllNoiseQuery)(x)); + } + set { + this.SetElement(IgnoreAllNoiseQueryXName, value); + } + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + [EditorBrowsable(EditorBrowsableState.Never)] + protected internal static readonly System.Xml.Linq.XName IncludeRelevantResultsXName = System.Xml.Linq.XName.Get("IncludeRelevantResults", "urn:Microsoft.Search.Query"); + + /// + /// + /// Occurrence: optional + /// + /// + /// Regular expression: (QueryId?, Context?, Range?, Properties?, SortByProperties?, ImplicitAndBehavior?, RelevanceModel?, EnableStemming?, TrimDuplicates?, IncludeSpecialTermResults?, PreQuerySuggestions?, HighlightQuerySuggestions?, CapitalizeFirstLetters?, ResultProvider?, ResubmitFlags?, EnableSpellcheck?, UserContext?, FindSimilar?, IncludeRefinementResults?, RefinementFilters?, IgnoreAllNoiseQuery?, IncludeRelevantResults?, IncludeHighConfidenceResults?) + /// + /// + public virtual IncludeRelevantResults IncludeRelevantResults { + get { + XElement x = this.GetElement(IncludeRelevantResultsXName); + if ((x == null)) { + return null; + } + return ((IncludeRelevantResults)(x)); + } + set { + this.SetElement(IncludeRelevantResultsXName, value); + } + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + [EditorBrowsable(EditorBrowsableState.Never)] + protected internal static readonly System.Xml.Linq.XName IncludeHighConfidenceResultsXName = System.Xml.Linq.XName.Get("IncludeHighConfidenceResults", "urn:Microsoft.Search.Query"); + + /// + /// + /// Occurrence: optional + /// + /// + /// Regular expression: (QueryId?, Context?, Range?, Properties?, SortByProperties?, ImplicitAndBehavior?, RelevanceModel?, EnableStemming?, TrimDuplicates?, IncludeSpecialTermResults?, PreQuerySuggestions?, HighlightQuerySuggestions?, CapitalizeFirstLetters?, ResultProvider?, ResubmitFlags?, EnableSpellcheck?, UserContext?, FindSimilar?, IncludeRefinementResults?, RefinementFilters?, IgnoreAllNoiseQuery?, IncludeRelevantResults?, IncludeHighConfidenceResults?) + /// + /// + public virtual IncludeHighConfidenceResults IncludeHighConfidenceResults { + get { + XElement x = this.GetElement(IncludeHighConfidenceResultsXName); + if ((x == null)) { + return null; + } + return ((IncludeHighConfidenceResults)(x)); + } + set { + this.SetElement(IncludeHighConfidenceResultsXName, value); + } + } + + private static readonly System.Xml.Linq.XName xName = System.Xml.Linq.XName.Get("Query", "urn:Microsoft.Search.Query"); + + static QueryLocalType() { + BuildElementDictionary(); + contentModel = new SequenceContentModelEntity(new NamedContentModelEntity(QueryIdXName), new NamedContentModelEntity(ContextXName), new NamedContentModelEntity(RangeXName), new NamedContentModelEntity(PropertiesXName), new NamedContentModelEntity(SortByPropertiesXName), new NamedContentModelEntity(ImplicitAndBehaviorXName), new NamedContentModelEntity(RelevanceModelXName), new NamedContentModelEntity(EnableStemmingXName), new NamedContentModelEntity(TrimDuplicatesXName), new NamedContentModelEntity(IncludeSpecialTermResultsXName), new NamedContentModelEntity(PreQuerySuggestionsXName), new NamedContentModelEntity(HighlightQuerySuggestionsXName), new NamedContentModelEntity(CapitalizeFirstLettersXName), new NamedContentModelEntity(ResultProviderXName), new NamedContentModelEntity(ResubmitFlagsXName), new NamedContentModelEntity(EnableSpellcheckXName), new NamedContentModelEntity(UserContextXName), new NamedContentModelEntity(FindSimilarXName), new NamedContentModelEntity(IncludeRefinementResultsXName), new NamedContentModelEntity(RefinementFiltersXName), new NamedContentModelEntity(IgnoreAllNoiseQueryXName), new NamedContentModelEntity(IncludeRelevantResultsXName), new NamedContentModelEntity(IncludeHighConfidenceResultsXName)); + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + private static Dictionary localElementDictionary = new Dictionary(); + + private static void BuildElementDictionary() { + localElementDictionary.Add(QueryIdXName, typeof(QueryId)); + localElementDictionary.Add(ContextXName, typeof(Context)); + localElementDictionary.Add(RangeXName, typeof(Range)); + localElementDictionary.Add(PropertiesXName, typeof(Properties)); + localElementDictionary.Add(SortByPropertiesXName, typeof(SortByProperties)); + localElementDictionary.Add(ImplicitAndBehaviorXName, typeof(ImplicitAndBehavior)); + localElementDictionary.Add(RelevanceModelXName, typeof(RelevanceModel)); + localElementDictionary.Add(EnableStemmingXName, typeof(EnableStemming)); + localElementDictionary.Add(TrimDuplicatesXName, typeof(TrimDuplicates)); + localElementDictionary.Add(IncludeSpecialTermResultsXName, typeof(IncludeSpecialTermResults)); + localElementDictionary.Add(PreQuerySuggestionsXName, typeof(PreQuerySuggestions)); + localElementDictionary.Add(HighlightQuerySuggestionsXName, typeof(HighlightQuerySuggestions)); + localElementDictionary.Add(CapitalizeFirstLettersXName, typeof(CapitalizeFirstLetters)); + localElementDictionary.Add(ResultProviderXName, typeof(ResultProvider)); + localElementDictionary.Add(ResubmitFlagsXName, typeof(ResubmitFlags)); + localElementDictionary.Add(EnableSpellcheckXName, typeof(EnableSpellcheck)); + localElementDictionary.Add(UserContextXName, typeof(UserContext)); + localElementDictionary.Add(FindSimilarXName, typeof(FindSimilar)); + localElementDictionary.Add(IncludeRefinementResultsXName, typeof(IncludeRefinementResults)); + localElementDictionary.Add(RefinementFiltersXName, typeof(RefinementFilters)); + localElementDictionary.Add(IgnoreAllNoiseQueryXName, typeof(IgnoreAllNoiseQuery)); + localElementDictionary.Add(IncludeRelevantResultsXName, typeof(IncludeRelevantResults)); + localElementDictionary.Add(IncludeHighConfidenceResultsXName, typeof(IncludeHighConfidenceResults)); + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + Dictionary IXMetaData.LocalElementsDictionary { + get { + return localElementDictionary; + } + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + private static ContentModelEntity contentModel; + + ContentModelEntity IXMetaData.GetContentModel() { + return contentModel; + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + System.Xml.Linq.XName IXMetaData.SchemaName { + get { + return xName; + } + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + SchemaOrigin IXMetaData.TypeOrigin { + get { + return SchemaOrigin.Fragment; + } + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + ILinqToXsdTypeManager IXMetaData.TypeManager { + get { + return LinqToXsdTypeManager.Instance; + } + } + } + } + + public partial class QueryId : XTypedElement, IXMetaData { + + public void Save(string xmlFile) { + XTypedServices.Save(xmlFile, Untyped); + } + + public void Save(System.IO.TextWriter tw) { + XTypedServices.Save(tw, Untyped); + } + + public void Save(System.Xml.XmlWriter xmlWriter) { + XTypedServices.Save(xmlWriter, Untyped); + } + + public static QueryId Load(string xmlFile) { + return XTypedServices.Load(xmlFile); + } + + public static QueryId Load(System.IO.TextReader xmlFile) { + return XTypedServices.Load(xmlFile); + } + + public static QueryId Parse(string xml) { + return XTypedServices.Parse(xml); + } + + public static explicit operator QueryId(XElement xe) { return XTypedServices.ToXTypedElement(xe,LinqToXsdTypeManager.Instance as ILinqToXsdTypeManager); } + + public override XTypedElement Clone() { + return XTypedServices.CloneXTypedElement(this); + } + + public QueryId() { + } + + private static readonly System.Xml.Linq.XName xName = System.Xml.Linq.XName.Get("QueryId", "urn:Microsoft.Search.Query"); + + ContentModelEntity IXMetaData.GetContentModel() { + return ContentModelEntity.Default; + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + System.Xml.Linq.XName IXMetaData.SchemaName { + get { + return xName; + } + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + SchemaOrigin IXMetaData.TypeOrigin { + get { + return SchemaOrigin.Element; + } + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + ILinqToXsdTypeManager IXMetaData.TypeManager { + get { + return LinqToXsdTypeManager.Instance; + } + } + } + + /// + /// + /// Regular expression: (QueryText) + /// + /// + public partial class Context : XTypedElement, IXMetaData { + + public void Save(string xmlFile) { + XTypedServices.Save(xmlFile, Untyped); + } + + public void Save(System.IO.TextWriter tw) { + XTypedServices.Save(tw, Untyped); + } + + public void Save(System.Xml.XmlWriter xmlWriter) { + XTypedServices.Save(xmlWriter, Untyped); + } + + public static Context Load(string xmlFile) { + return XTypedServices.Load(xmlFile); + } + + public static Context Load(System.IO.TextReader xmlFile) { + return XTypedServices.Load(xmlFile); + } + + public static Context Parse(string xml) { + return XTypedServices.Parse(xml); + } + + public static explicit operator Context(XElement xe) { return XTypedServices.ToXTypedElement(xe,LinqToXsdTypeManager.Instance as ILinqToXsdTypeManager); } + + public override XTypedElement Clone() { + return XTypedServices.CloneXTypedElement(this); + } + + /// + /// + /// Regular expression: (QueryText) + /// + /// + public Context() { + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + [EditorBrowsable(EditorBrowsableState.Never)] + protected internal static readonly System.Xml.Linq.XName QueryTextXName = System.Xml.Linq.XName.Get("QueryText", "urn:Microsoft.Search.Query"); + + /// + /// + /// Occurrence: required + /// + /// + /// Regular expression: (QueryText) + /// + /// + public virtual QueryText QueryText { + get { + XElement x = this.GetElement(QueryTextXName); + return ((QueryText)(x)); + } + set { + this.SetElement(QueryTextXName, value); + } + } + + private static readonly System.Xml.Linq.XName xName = System.Xml.Linq.XName.Get("Context", "urn:Microsoft.Search.Query"); + + static Context() { + BuildElementDictionary(); + contentModel = new SequenceContentModelEntity(new NamedContentModelEntity(QueryTextXName)); + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + private static Dictionary localElementDictionary = new Dictionary(); + + private static void BuildElementDictionary() { + localElementDictionary.Add(QueryTextXName, typeof(QueryText)); + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + Dictionary IXMetaData.LocalElementsDictionary { + get { + return localElementDictionary; + } + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + private static ContentModelEntity contentModel; + + ContentModelEntity IXMetaData.GetContentModel() { + return contentModel; + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + System.Xml.Linq.XName IXMetaData.SchemaName { + get { + return xName; + } + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + SchemaOrigin IXMetaData.TypeOrigin { + get { + return SchemaOrigin.Element; + } + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + ILinqToXsdTypeManager IXMetaData.TypeManager { + get { + return LinqToXsdTypeManager.Instance; + } + } + } + + public partial class QueryText : XTypedElement, IXMetaData { + + public void Save(string xmlFile) { + XTypedServices.Save(xmlFile, Untyped); + } + + public void Save(System.IO.TextWriter tw) { + XTypedServices.Save(tw, Untyped); + } + + public void Save(System.Xml.XmlWriter xmlWriter) { + XTypedServices.Save(xmlWriter, Untyped); + } + + public static QueryText Load(string xmlFile) { + return XTypedServices.Load(xmlFile); + } + + public static QueryText Load(System.IO.TextReader xmlFile) { + return XTypedServices.Load(xmlFile); + } + + public static QueryText Parse(string xml) { + return XTypedServices.Parse(xml); + } + + public static explicit operator QueryText(XElement xe) { return XTypedServices.ToXTypedElement(xe,LinqToXsdTypeManager.Instance as ILinqToXsdTypeManager); } + + public override XTypedElement Clone() { + return XTypedServices.CloneXTypedElement(this); + } + + public QueryText() { + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + [EditorBrowsable(EditorBrowsableState.Never)] + protected internal static readonly System.Xml.Linq.XName TypedValueXName = System.Xml.Linq.XName.Get("TypedValue", ""); + + public virtual string TypedValue { + get { + XElement x = this.Untyped; + return XTypedServices.ParseValue(x, XmlSchemaType.GetBuiltInSimpleType(XmlTypeCode.String).Datatype); + } + set { + this.SetValue(value, XmlSchemaType.GetBuiltInSimpleType(XmlTypeCode.String).Datatype); + } + } + + public enum TypeEnum { + + STRING, + + MSSQLFT, + + FQL, + } + + public sealed class TypeEnumValidator { + + private TypeEnumValidator() { + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + public static Xml.Schema.Linq.SimpleTypeValidator TypeDefinition = new Xml.Schema.Linq.AtomicSimpleTypeValidator(XmlSchemaType.GetBuiltInSimpleType(XmlTypeCode.String), new Xml.Schema.Linq.RestrictionFacets(((Xml.Schema.Linq.RestrictionFlags)(16)), new object[] { + "STRING", + "MSSQLFT", + "FQL"}, 0, 0, null, null, 0, null, null, 0, null, 0, XmlSchemaWhiteSpace.Preserve)); + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + [EditorBrowsable(EditorBrowsableState.Never)] + protected internal static readonly System.Xml.Linq.XName typeXName = System.Xml.Linq.XName.Get("type", ""); + + /// + /// + /// Identifies the query type (see the following type Attribute table). + /// + /// + /// Occurrence: optional + /// + /// + public virtual Microsoft.Search.Query.Schemas.QueryText.TypeEnum? type { + get { + XAttribute x = this.Attribute(typeXName); + if ((x == null)) { + return null; + } + return ((Microsoft.Search.Query.Schemas.QueryText.TypeEnum)(Enum.Parse(typeof(Microsoft.Search.Query.Schemas.QueryText.TypeEnum), XTypedServices.ParseValue(x, XmlSchemaType.GetBuiltInSimpleType(XmlTypeCode.String).Datatype, TypeEnumValidator.TypeDefinition)))); + } + set { + if (value == null) { + this.SetAttribute(typeXName, null, XmlSchemaType.GetBuiltInSimpleType(XmlTypeCode.String).Datatype); + } + else { + this.SetAttributeWithValidation(typeXName, value.ToString(), "type", TypeEnumValidator.TypeDefinition); + } + } + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + [EditorBrowsable(EditorBrowsableState.Never)] + protected internal static readonly System.Xml.Linq.XName languageXName = System.Xml.Linq.XName.Get("language", ""); + + /// + /// + /// Identifies the language of the keyword search. The value type is xml:lang. If specified, this is interpreted by SharePoint Enterprise Search as the query locale. If not specified, the default value is the language of the site. + /// + ///For more information about query processing related to the query locale for FAST Search Server 2010 for SharePoint, see Linguistic Query Features (FAST Search Server 2010 for SharePoint). + /// + /// + /// Occurrence: optional + /// + /// + public virtual string language { + get { + XAttribute x = this.Attribute(languageXName); + if ((x == null)) { + return null; + } + return XTypedServices.ParseValue(x, XmlSchemaType.GetBuiltInSimpleType(XmlTypeCode.Language).Datatype); + } + set { + this.SetAttribute(languageXName, value, XmlSchemaType.GetBuiltInSimpleType(XmlTypeCode.Language).Datatype); + } + } + + private static readonly System.Xml.Linq.XName xName = System.Xml.Linq.XName.Get("QueryText", "urn:Microsoft.Search.Query"); + + ContentModelEntity IXMetaData.GetContentModel() { + return ContentModelEntity.Default; + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + System.Xml.Linq.XName IXMetaData.SchemaName { + get { + return xName; + } + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + SchemaOrigin IXMetaData.TypeOrigin { + get { + return SchemaOrigin.Element; + } + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + ILinqToXsdTypeManager IXMetaData.TypeManager { + get { + return LinqToXsdTypeManager.Instance; + } + } + } + + /// + /// + /// Regular expression: (StartAt, Count) + /// + /// + public partial class Range : XTypedElement, IXMetaData { + + public void Save(string xmlFile) { + XTypedServices.Save(xmlFile, Untyped); + } + + public void Save(System.IO.TextWriter tw) { + XTypedServices.Save(tw, Untyped); + } + + public void Save(System.Xml.XmlWriter xmlWriter) { + XTypedServices.Save(xmlWriter, Untyped); + } + + public static Range Load(string xmlFile) { + return XTypedServices.Load(xmlFile); + } + + public static Range Load(System.IO.TextReader xmlFile) { + return XTypedServices.Load(xmlFile); + } + + public static Range Parse(string xml) { + return XTypedServices.Parse(xml); + } + + public static explicit operator Range(XElement xe) { return XTypedServices.ToXTypedElement(xe,LinqToXsdTypeManager.Instance as ILinqToXsdTypeManager); } + + public override XTypedElement Clone() { + return XTypedServices.CloneXTypedElement(this); + } + + /// + /// + /// Regular expression: (StartAt, Count) + /// + /// + public Range() { + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + [EditorBrowsable(EditorBrowsableState.Never)] + protected internal static readonly System.Xml.Linq.XName StartAtXName = System.Xml.Linq.XName.Get("StartAt", "urn:Microsoft.Search.Query"); + + /// + /// + /// Occurrence: required + /// + /// + /// Regular expression: (StartAt, Count) + /// + /// + public virtual StartAt StartAt { + get { + XElement x = this.GetElement(StartAtXName); + return ((StartAt)(x)); + } + set { + this.SetElement(StartAtXName, value); + } + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + [EditorBrowsable(EditorBrowsableState.Never)] + protected internal static readonly System.Xml.Linq.XName CountXName = System.Xml.Linq.XName.Get("Count", "urn:Microsoft.Search.Query"); + + /// + /// + /// Occurrence: required + /// + /// + /// Regular expression: (StartAt, Count) + /// + /// + public virtual Count Count { + get { + XElement x = this.GetElement(CountXName); + return ((Count)(x)); + } + set { + this.SetElement(CountXName, value); + } + } + + private static readonly System.Xml.Linq.XName xName = System.Xml.Linq.XName.Get("Range", "urn:Microsoft.Search.Query"); + + static Range() { + BuildElementDictionary(); + contentModel = new SequenceContentModelEntity(new NamedContentModelEntity(StartAtXName), new NamedContentModelEntity(CountXName)); + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + private static Dictionary localElementDictionary = new Dictionary(); + + private static void BuildElementDictionary() { + localElementDictionary.Add(StartAtXName, typeof(StartAt)); + localElementDictionary.Add(CountXName, typeof(Count)); + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + Dictionary IXMetaData.LocalElementsDictionary { + get { + return localElementDictionary; + } + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + private static ContentModelEntity contentModel; + + ContentModelEntity IXMetaData.GetContentModel() { + return contentModel; + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + System.Xml.Linq.XName IXMetaData.SchemaName { + get { + return xName; + } + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + SchemaOrigin IXMetaData.TypeOrigin { + get { + return SchemaOrigin.Element; + } + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + ILinqToXsdTypeManager IXMetaData.TypeManager { + get { + return LinqToXsdTypeManager.Instance; + } + } + } + + /// + /// + /// Regular expression: (Property+) + /// + /// + public partial class Properties : XTypedElement, IXMetaData { + + public void Save(string xmlFile) { + XTypedServices.Save(xmlFile, Untyped); + } + + public void Save(System.IO.TextWriter tw) { + XTypedServices.Save(tw, Untyped); + } + + public void Save(System.Xml.XmlWriter xmlWriter) { + XTypedServices.Save(xmlWriter, Untyped); + } + + public static Properties Load(string xmlFile) { + return XTypedServices.Load(xmlFile); + } + + public static Properties Load(System.IO.TextReader xmlFile) { + return XTypedServices.Load(xmlFile); + } + + public static Properties Parse(string xml) { + return XTypedServices.Parse(xml); + } + + public static explicit operator Properties(XElement xe) { return XTypedServices.ToXTypedElement(xe,LinqToXsdTypeManager.Instance as ILinqToXsdTypeManager); } + + public override XTypedElement Clone() { + return XTypedServices.CloneXTypedElement(this); + } + + /// + /// + /// Regular expression: (Property+) + /// + /// + public Properties() { + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + [EditorBrowsable(EditorBrowsableState.Never)] + protected internal static readonly System.Xml.Linq.XName PropertyXName = System.Xml.Linq.XName.Get("Property", "urn:Microsoft.Search.Query"); + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + private XTypedList PropertyField; + + /// + /// + /// Occurrence: required, repeating + /// + /// + /// Regular expression: (Property+) + /// + /// + public virtual IList Property { + get { + if ((this.PropertyField == null)) { + this.PropertyField = new XTypedList(this, LinqToXsdTypeManager.Instance, PropertyXName); + } + return this.PropertyField; + } + set { + if ((value == null)) { + this.PropertyField = null; + } + else { + if ((this.PropertyField == null)) { + this.PropertyField = XTypedList.Initialize(this, LinqToXsdTypeManager.Instance, value, PropertyXName); + } + else { + XTypedServices.SetList(this.PropertyField, value); + } + } + } + } + + private static readonly System.Xml.Linq.XName xName = System.Xml.Linq.XName.Get("Properties", "urn:Microsoft.Search.Query"); + + static Properties() { + BuildElementDictionary(); + contentModel = new SequenceContentModelEntity(new NamedContentModelEntity(PropertyXName)); + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + private static Dictionary localElementDictionary = new Dictionary(); + + private static void BuildElementDictionary() { + localElementDictionary.Add(PropertyXName, typeof(Property)); + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + Dictionary IXMetaData.LocalElementsDictionary { + get { + return localElementDictionary; + } + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + private static ContentModelEntity contentModel; + + ContentModelEntity IXMetaData.GetContentModel() { + return contentModel; + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + System.Xml.Linq.XName IXMetaData.SchemaName { + get { + return xName; + } + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + SchemaOrigin IXMetaData.TypeOrigin { + get { + return SchemaOrigin.Element; + } + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + ILinqToXsdTypeManager IXMetaData.TypeManager { + get { + return LinqToXsdTypeManager.Instance; + } + } + } + + public partial class Property : XTypedElement, IXMetaData { + + public void Save(string xmlFile) { + XTypedServices.Save(xmlFile, Untyped); + } + + public void Save(System.IO.TextWriter tw) { + XTypedServices.Save(tw, Untyped); + } + + public void Save(System.Xml.XmlWriter xmlWriter) { + XTypedServices.Save(xmlWriter, Untyped); + } + + public static Property Load(string xmlFile) { + return XTypedServices.Load(xmlFile); + } + + public static Property Load(System.IO.TextReader xmlFile) { + return XTypedServices.Load(xmlFile); + } + + public static Property Parse(string xml) { + return XTypedServices.Parse(xml); + } + + public static explicit operator Property(XElement xe) { return XTypedServices.ToXTypedElement(xe,LinqToXsdTypeManager.Instance as ILinqToXsdTypeManager); } + + public override XTypedElement Clone() { + return XTypedServices.CloneXTypedElement(this); + } + + public Property() { + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + [EditorBrowsable(EditorBrowsableState.Never)] + protected internal static readonly System.Xml.Linq.XName nameXName = System.Xml.Linq.XName.Get("name", ""); + + /// + /// + /// Occurrence: optional + /// + /// + public virtual string name { + get { + XAttribute x = this.Attribute(nameXName); + if ((x == null)) { + return null; + } + return XTypedServices.ParseValue(x, XmlSchemaType.GetBuiltInSimpleType(XmlTypeCode.String).Datatype); + } + set { + this.SetAttribute(nameXName, value, XmlSchemaType.GetBuiltInSimpleType(XmlTypeCode.String).Datatype); + } + } + + private static readonly System.Xml.Linq.XName xName = System.Xml.Linq.XName.Get("Property", "urn:Microsoft.Search.Query"); + + ContentModelEntity IXMetaData.GetContentModel() { + return ContentModelEntity.Default; + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + System.Xml.Linq.XName IXMetaData.SchemaName { + get { + return xName; + } + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + SchemaOrigin IXMetaData.TypeOrigin { + get { + return SchemaOrigin.Element; + } + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + ILinqToXsdTypeManager IXMetaData.TypeManager { + get { + return LinqToXsdTypeManager.Instance; + } + } + } + + /// + /// + /// Regular expression: (SortByProperty+) + /// + /// + public partial class SortByProperties : XTypedElement, IXMetaData { + + public void Save(string xmlFile) { + XTypedServices.Save(xmlFile, Untyped); + } + + public void Save(System.IO.TextWriter tw) { + XTypedServices.Save(tw, Untyped); + } + + public void Save(System.Xml.XmlWriter xmlWriter) { + XTypedServices.Save(xmlWriter, Untyped); + } + + public static SortByProperties Load(string xmlFile) { + return XTypedServices.Load(xmlFile); + } + + public static SortByProperties Load(System.IO.TextReader xmlFile) { + return XTypedServices.Load(xmlFile); + } + + public static SortByProperties Parse(string xml) { + return XTypedServices.Parse(xml); + } + + public static explicit operator SortByProperties(XElement xe) { return XTypedServices.ToXTypedElement(xe,LinqToXsdTypeManager.Instance as ILinqToXsdTypeManager); } + + public override XTypedElement Clone() { + return XTypedServices.CloneXTypedElement(this); + } + + /// + /// + /// Regular expression: (SortByProperty+) + /// + /// + public SortByProperties() { + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + [EditorBrowsable(EditorBrowsableState.Never)] + protected internal static readonly System.Xml.Linq.XName SortByPropertyXName = System.Xml.Linq.XName.Get("SortByProperty", "urn:Microsoft.Search.Query"); + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + private XTypedList SortByPropertyField; + + /// + /// + /// Occurrence: required, repeating + /// + /// + /// Regular expression: (SortByProperty+) + /// + /// + public virtual IList SortByProperty { + get { + if ((this.SortByPropertyField == null)) { + this.SortByPropertyField = new XTypedList(this, LinqToXsdTypeManager.Instance, SortByPropertyXName); + } + return this.SortByPropertyField; + } + set { + if ((value == null)) { + this.SortByPropertyField = null; + } + else { + if ((this.SortByPropertyField == null)) { + this.SortByPropertyField = XTypedList.Initialize(this, LinqToXsdTypeManager.Instance, value, SortByPropertyXName); + } + else { + XTypedServices.SetList(this.SortByPropertyField, value); + } + } + } + } + + private static readonly System.Xml.Linq.XName xName = System.Xml.Linq.XName.Get("SortByProperties", "urn:Microsoft.Search.Query"); + + static SortByProperties() { + BuildElementDictionary(); + contentModel = new SequenceContentModelEntity(new NamedContentModelEntity(SortByPropertyXName)); + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + private static Dictionary localElementDictionary = new Dictionary(); + + private static void BuildElementDictionary() { + localElementDictionary.Add(SortByPropertyXName, typeof(SortByProperty)); + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + Dictionary IXMetaData.LocalElementsDictionary { + get { + return localElementDictionary; + } + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + private static ContentModelEntity contentModel; + + ContentModelEntity IXMetaData.GetContentModel() { + return contentModel; + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + System.Xml.Linq.XName IXMetaData.SchemaName { + get { + return xName; + } + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + SchemaOrigin IXMetaData.TypeOrigin { + get { + return SchemaOrigin.Element; + } + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + ILinqToXsdTypeManager IXMetaData.TypeManager { + get { + return LinqToXsdTypeManager.Instance; + } + } + } + + public partial class SortByProperty : XTypedElement, IXMetaData { + + public void Save(string xmlFile) { + XTypedServices.Save(xmlFile, Untyped); + } + + public void Save(System.IO.TextWriter tw) { + XTypedServices.Save(tw, Untyped); + } + + public void Save(System.Xml.XmlWriter xmlWriter) { + XTypedServices.Save(xmlWriter, Untyped); + } + + public static SortByProperty Load(string xmlFile) { + return XTypedServices.Load(xmlFile); + } + + public static SortByProperty Load(System.IO.TextReader xmlFile) { + return XTypedServices.Load(xmlFile); + } + + public static SortByProperty Parse(string xml) { + return XTypedServices.Parse(xml); + } + + public static explicit operator SortByProperty(XElement xe) { return XTypedServices.ToXTypedElement(xe,LinqToXsdTypeManager.Instance as ILinqToXsdTypeManager); } + + public override XTypedElement Clone() { + return XTypedServices.CloneXTypedElement(this); + } + + public SortByProperty() { + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + [EditorBrowsable(EditorBrowsableState.Never)] + protected internal static readonly System.Xml.Linq.XName nameXName = System.Xml.Linq.XName.Get("name", ""); + + /// + /// + /// The name of the managed property to sort on. + /// + ///The following special conditions apply to FAST Search Server 2010 for SharePoint only: + /// + ///* The name attribute may contain the name of a rank profile instead of a managed property. In this case the result set is sorted by Rank, but using the non-default rank profile specified by name. For more information, see Sort Search Results by Rank. + /// + ///* The name attribute may contain a sort formula specification. In this case the result set is sorted based on the specified formula. For more information about the syntax, see Sort Search Results by a Formula Expression. + /// + /// + /// Occurrence: optional + /// + /// + public virtual string name { + get { + XAttribute x = this.Attribute(nameXName); + if ((x == null)) { + return null; + } + return XTypedServices.ParseValue(x, XmlSchemaType.GetBuiltInSimpleType(XmlTypeCode.String).Datatype); + } + set { + this.SetAttribute(nameXName, value, XmlSchemaType.GetBuiltInSimpleType(XmlTypeCode.String).Datatype); + } + } + + public enum DirectionEnum { + + Ascending, + + Descending, + } + + public sealed class DirectionEnumValidator { + + private DirectionEnumValidator() { + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + public static Xml.Schema.Linq.SimpleTypeValidator TypeDefinition = new Xml.Schema.Linq.AtomicSimpleTypeValidator(XmlSchemaType.GetBuiltInSimpleType(XmlTypeCode.String), new Xml.Schema.Linq.RestrictionFacets(((Xml.Schema.Linq.RestrictionFlags)(16)), new object[] { + "Ascending", + "Descending"}, 0, 0, null, null, 0, null, null, 0, null, 0, XmlSchemaWhiteSpace.Preserve)); + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + [EditorBrowsable(EditorBrowsableState.Never)] + protected internal static readonly System.Xml.Linq.XName directionXName = System.Xml.Linq.XName.Get("direction", ""); + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + private static Microsoft.Search.Query.Schemas.SortByProperty.DirectionEnum directionDefaultValue = Microsoft.Search.Query.Schemas.SortByProperty.DirectionEnum.Descending; + + /// + /// + /// Specifies the direction (ascending or descending) to sort the results. + /// + ///* Ascending Sorting is based on ascending value + ///* Descending Sorting is based on descending value + /// + ///Note: This attribute is not used when specifying a rank profile name in the name attribute (rank sorting is always descending). This applies to FAST Search Server 2010 for SharePoint only. + /// + ///Defaults to Descending. + /// + /// + /// + /// + /// Occurrence: optional + /// + /// + public virtual Microsoft.Search.Query.Schemas.SortByProperty.DirectionEnum direction { + get { + XAttribute x = this.Attribute(directionXName); + if ((x == null)) { + return directionDefaultValue; + } + return ((Microsoft.Search.Query.Schemas.SortByProperty.DirectionEnum)(Enum.Parse(typeof(Microsoft.Search.Query.Schemas.SortByProperty.DirectionEnum), XTypedServices.ParseValue(x, XmlSchemaType.GetBuiltInSimpleType(XmlTypeCode.String).Datatype, DirectionEnumValidator.TypeDefinition)))); + } + set { + this.SetAttributeWithValidation(directionXName, value.ToString(), "direction", DirectionEnumValidator.TypeDefinition); + } + } + + private static readonly System.Xml.Linq.XName xName = System.Xml.Linq.XName.Get("SortByProperty", "urn:Microsoft.Search.Query"); + + ContentModelEntity IXMetaData.GetContentModel() { + return ContentModelEntity.Default; + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + System.Xml.Linq.XName IXMetaData.SchemaName { + get { + return xName; + } + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + SchemaOrigin IXMetaData.TypeOrigin { + get { + return SchemaOrigin.Element; + } + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + ILinqToXsdTypeManager IXMetaData.TypeManager { + get { + return LinqToXsdTypeManager.Instance; + } + } + } + + public partial class RelevanceModel : XTypedElement, IXMetaData { + + public void Save(string xmlFile) { + XTypedServices.Save(xmlFile, Untyped); + } + + public void Save(System.IO.TextWriter tw) { + XTypedServices.Save(tw, Untyped); + } + + public void Save(System.Xml.XmlWriter xmlWriter) { + XTypedServices.Save(xmlWriter, Untyped); + } + + public static RelevanceModel Load(string xmlFile) { + return XTypedServices.Load(xmlFile); + } + + public static RelevanceModel Load(System.IO.TextReader xmlFile) { + return XTypedServices.Load(xmlFile); + } + + public static RelevanceModel Parse(string xml) { + return XTypedServices.Parse(xml); + } + + public static explicit operator RelevanceModel(XElement xe) { return XTypedServices.ToXTypedElement(xe,LinqToXsdTypeManager.Instance as ILinqToXsdTypeManager); } + + public override XTypedElement Clone() { + return XTypedServices.CloneXTypedElement(this); + } + + public RelevanceModel() { + } + + private static readonly System.Xml.Linq.XName xName = System.Xml.Linq.XName.Get("RelevanceModel", "urn:Microsoft.Search.Query"); + + ContentModelEntity IXMetaData.GetContentModel() { + return ContentModelEntity.Default; + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + System.Xml.Linq.XName IXMetaData.SchemaName { + get { + return xName; + } + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + SchemaOrigin IXMetaData.TypeOrigin { + get { + return SchemaOrigin.Element; + } + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + ILinqToXsdTypeManager IXMetaData.TypeManager { + get { + return LinqToXsdTypeManager.Instance; + } + } + } + + public partial class TrimDuplicates : XTypedElement, IXMetaData { + + public void Save(string xmlFile) { + XTypedServices.Save(xmlFile, Untyped); + } + + public void Save(System.IO.TextWriter tw) { + XTypedServices.Save(tw, Untyped); + } + + public void Save(System.Xml.XmlWriter xmlWriter) { + XTypedServices.Save(xmlWriter, Untyped); + } + + public static TrimDuplicates Load(string xmlFile) { + return XTypedServices.Load(xmlFile); + } + + public static TrimDuplicates Load(System.IO.TextReader xmlFile) { + return XTypedServices.Load(xmlFile); + } + + public static TrimDuplicates Parse(string xml) { + return XTypedServices.Parse(xml); + } + + public static explicit operator TrimDuplicates(XElement xe) { return XTypedServices.ToXTypedElement(xe,LinqToXsdTypeManager.Instance as ILinqToXsdTypeManager); } + + public override XTypedElement Clone() { + return XTypedServices.CloneXTypedElement(this); + } + + public TrimDuplicates() { + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + [EditorBrowsable(EditorBrowsableState.Never)] + protected internal static readonly System.Xml.Linq.XName TypedValueXName = System.Xml.Linq.XName.Get("TypedValue", ""); + + public virtual bool TypedValue { + get { + XElement x = this.Untyped; + return XTypedServices.ParseValue(x, XmlSchemaType.GetBuiltInSimpleType(XmlTypeCode.Boolean).Datatype); + } + set { + this.SetValue(value, XmlSchemaType.GetBuiltInSimpleType(XmlTypeCode.Boolean).Datatype); + } + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + [EditorBrowsable(EditorBrowsableState.Never)] + protected internal static readonly System.Xml.Linq.XName onpropertyXName = System.Xml.Linq.XName.Get("onproperty", ""); + + /// + /// + /// Optional attribute indicating the name of a non-default managed property to use as the basis for duplicate removal. + /// + /// + /// Occurrence: optional + /// + /// + public virtual string onproperty { + get { + XAttribute x = this.Attribute(onpropertyXName); + if ((x == null)) { + return null; + } + return XTypedServices.ParseValue(x, XmlSchemaType.GetBuiltInSimpleType(XmlTypeCode.String).Datatype); + } + set { + this.SetAttribute(onpropertyXName, value, XmlSchemaType.GetBuiltInSimpleType(XmlTypeCode.String).Datatype); + } + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + [EditorBrowsable(EditorBrowsableState.Never)] + protected internal static readonly System.Xml.Linq.XName keepcountXName = System.Xml.Linq.XName.Get("keepcount", ""); + + /// + /// + /// Optional attribute specifying how many items to keep for each set of duplicates. + /// + ///The default value is 1. + /// + /// + /// Occurrence: optional + /// + /// + public virtual System.Int32? keepcount { + get { + XAttribute x = this.Attribute(keepcountXName); + if ((x == null)) { + return null; + } + return XTypedServices.ParseValue(x, XmlSchemaType.GetBuiltInSimpleType(XmlTypeCode.Int).Datatype); + } + set { + this.SetAttribute(keepcountXName, value, XmlSchemaType.GetBuiltInSimpleType(XmlTypeCode.Int).Datatype); + } + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + [EditorBrowsable(EditorBrowsableState.Never)] + protected internal static readonly System.Xml.Linq.XName includeidXName = System.Xml.Linq.XName.Get("includeid", ""); + + /// + /// + /// Specifies the value associated with a collapse group, typically used when a user clicks the Duplicates(n) link of an item with duplicates. + /// + /// + /// Occurrence: optional + /// + /// + public virtual System.Boolean? includeid { + get { + XAttribute x = this.Attribute(includeidXName); + if ((x == null)) { + return null; + } + return XTypedServices.ParseValue(x, XmlSchemaType.GetBuiltInSimpleType(XmlTypeCode.Boolean).Datatype); + } + set { + this.SetAttribute(includeidXName, value, XmlSchemaType.GetBuiltInSimpleType(XmlTypeCode.Boolean).Datatype); + } + } + + private static readonly System.Xml.Linq.XName xName = System.Xml.Linq.XName.Get("TrimDuplicates", "urn:Microsoft.Search.Query"); + + ContentModelEntity IXMetaData.GetContentModel() { + return ContentModelEntity.Default; + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + System.Xml.Linq.XName IXMetaData.SchemaName { + get { + return xName; + } + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + SchemaOrigin IXMetaData.TypeOrigin { + get { + return SchemaOrigin.Element; + } + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + ILinqToXsdTypeManager IXMetaData.TypeManager { + get { + return LinqToXsdTypeManager.Instance; + } + } + } + + public partial class ResultProvider : XTypedElement, IXMetaData { + + public void Save(string xmlFile) { + XTypedServices.Save(xmlFile, Untyped); + } + + public void Save(System.IO.TextWriter tw) { + XTypedServices.Save(tw, Untyped); + } + + public void Save(System.Xml.XmlWriter xmlWriter) { + XTypedServices.Save(xmlWriter, Untyped); + } + + public static ResultProvider Load(string xmlFile) { + return XTypedServices.Load(xmlFile); + } + + public static ResultProvider Load(System.IO.TextReader xmlFile) { + return XTypedServices.Load(xmlFile); + } + + public static ResultProvider Parse(string xml) { + return XTypedServices.Parse(xml); + } + + public static explicit operator ResultProvider(XElement xe) { return XTypedServices.ToXTypedElement(xe,LinqToXsdTypeManager.Instance as ILinqToXsdTypeManager); } + + public override XTypedElement Clone() { + return XTypedServices.CloneXTypedElement(this); + } + + public ResultProvider() { + } + + public enum ResultProvider1Enum { + + Default, + + SharePointSearch, + + FASTSearch, + } + + public sealed class ResultProvider1EnumValidator { + + private ResultProvider1EnumValidator() { + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + public static Xml.Schema.Linq.SimpleTypeValidator TypeDefinition = new Xml.Schema.Linq.AtomicSimpleTypeValidator(XmlSchemaType.GetBuiltInSimpleType(XmlTypeCode.String), new Xml.Schema.Linq.RestrictionFacets(((Xml.Schema.Linq.RestrictionFlags)(16)), new object[] { + "Default", + "SharePointSearch", + "FASTSearch"}, 0, 0, null, null, 0, null, null, 0, null, 0, XmlSchemaWhiteSpace.Preserve)); + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + [EditorBrowsable(EditorBrowsableState.Never)] + protected internal static readonly System.Xml.Linq.XName TypedValueXName = System.Xml.Linq.XName.Get("TypedValue", ""); + + public virtual Microsoft.Search.Query.Schemas.ResultProvider.ResultProvider1Enum TypedValue { + get { + XElement x = this.Untyped; + return ((Microsoft.Search.Query.Schemas.ResultProvider.ResultProvider1Enum)(Enum.Parse(typeof(Microsoft.Search.Query.Schemas.ResultProvider.ResultProvider1Enum), XTypedServices.ParseValue(x, XmlSchemaType.GetBuiltInSimpleType(XmlTypeCode.String).Datatype, ResultProvider1EnumValidator.TypeDefinition)))); + } + set { + this.SetValueWithValidation(value.ToString(), "TypedValue", ResultProvider1EnumValidator.TypeDefinition); + } + } + + private static readonly System.Xml.Linq.XName xName = System.Xml.Linq.XName.Get("ResultProvider", "urn:Microsoft.Search.Query"); + + ContentModelEntity IXMetaData.GetContentModel() { + return ContentModelEntity.Default; + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + System.Xml.Linq.XName IXMetaData.SchemaName { + get { + return xName; + } + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + SchemaOrigin IXMetaData.TypeOrigin { + get { + return SchemaOrigin.Element; + } + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + ILinqToXsdTypeManager IXMetaData.TypeManager { + get { + return LinqToXsdTypeManager.Instance; + } + } + } + + /// + /// + /// Regular expression: (ResubmitFlag+) + /// + /// + public partial class ResubmitFlags : XTypedElement, IXMetaData { + + public void Save(string xmlFile) { + XTypedServices.Save(xmlFile, Untyped); + } + + public void Save(System.IO.TextWriter tw) { + XTypedServices.Save(tw, Untyped); + } + + public void Save(System.Xml.XmlWriter xmlWriter) { + XTypedServices.Save(xmlWriter, Untyped); + } + + public static ResubmitFlags Load(string xmlFile) { + return XTypedServices.Load(xmlFile); + } + + public static ResubmitFlags Load(System.IO.TextReader xmlFile) { + return XTypedServices.Load(xmlFile); + } + + public static ResubmitFlags Parse(string xml) { + return XTypedServices.Parse(xml); + } + + public static explicit operator ResubmitFlags(XElement xe) { return XTypedServices.ToXTypedElement(xe,LinqToXsdTypeManager.Instance as ILinqToXsdTypeManager); } + + public override XTypedElement Clone() { + return XTypedServices.CloneXTypedElement(this); + } + + /// + /// + /// Regular expression: (ResubmitFlag+) + /// + /// + public ResubmitFlags() { + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + [EditorBrowsable(EditorBrowsableState.Never)] + protected internal static readonly System.Xml.Linq.XName ResubmitFlagXName = System.Xml.Linq.XName.Get("ResubmitFlag", "urn:Microsoft.Search.Query"); + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + private XTypedList ResubmitFlagField; + + /// + /// + /// The effect of an automatic resubmit is that the query is modified and automatically re-evaluated before results are returned to the client. + /// + /// + /// Occurrence: required, repeating + /// + /// + /// Regular expression: (ResubmitFlag+) + /// + /// + public virtual IList ResubmitFlag { + get { + if ((this.ResubmitFlagField == null)) { + this.ResubmitFlagField = new XTypedList(this, LinqToXsdTypeManager.Instance, ResubmitFlagXName); + } + return this.ResubmitFlagField; + } + set { + if ((value == null)) { + this.ResubmitFlagField = null; + } + else { + if ((this.ResubmitFlagField == null)) { + this.ResubmitFlagField = XTypedList.Initialize(this, LinqToXsdTypeManager.Instance, value, ResubmitFlagXName); + } + else { + XTypedServices.SetList(this.ResubmitFlagField, value); + } + } + } + } + + private static readonly System.Xml.Linq.XName xName = System.Xml.Linq.XName.Get("ResubmitFlags", "urn:Microsoft.Search.Query"); + + static ResubmitFlags() { + BuildElementDictionary(); + contentModel = new SequenceContentModelEntity(new NamedContentModelEntity(ResubmitFlagXName)); + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + private static Dictionary localElementDictionary = new Dictionary(); + + private static void BuildElementDictionary() { + localElementDictionary.Add(ResubmitFlagXName, typeof(ResubmitFlag)); + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + Dictionary IXMetaData.LocalElementsDictionary { + get { + return localElementDictionary; + } + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + private static ContentModelEntity contentModel; + + ContentModelEntity IXMetaData.GetContentModel() { + return contentModel; + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + System.Xml.Linq.XName IXMetaData.SchemaName { + get { + return xName; + } + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + SchemaOrigin IXMetaData.TypeOrigin { + get { + return SchemaOrigin.Element; + } + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + ILinqToXsdTypeManager IXMetaData.TypeManager { + get { + return LinqToXsdTypeManager.Instance; + } + } + } + + public partial class ResubmitFlag : XTypedElement, IXMetaData { + + public void Save(string xmlFile) { + XTypedServices.Save(xmlFile, Untyped); + } + + public void Save(System.IO.TextWriter tw) { + XTypedServices.Save(tw, Untyped); + } + + public void Save(System.Xml.XmlWriter xmlWriter) { + XTypedServices.Save(xmlWriter, Untyped); + } + + public static ResubmitFlag Load(string xmlFile) { + return XTypedServices.Load(xmlFile); + } + + public static ResubmitFlag Load(System.IO.TextReader xmlFile) { + return XTypedServices.Load(xmlFile); + } + + public static ResubmitFlag Parse(string xml) { + return XTypedServices.Parse(xml); + } + + public static explicit operator ResubmitFlag(XElement xe) { return XTypedServices.ToXTypedElement(xe,LinqToXsdTypeManager.Instance as ILinqToXsdTypeManager); } + + public override XTypedElement Clone() { + return XTypedServices.CloneXTypedElement(this); + } + + public ResubmitFlag() { + } + + public enum ValueEnum { + + NoResubmit, + + EnableSpellcheckOnResubmit, + + EnableSpellcheckSuggestOnResubmit, + + EnableStemmingOnResubmit, + + AddSynonymsAutomatically, + } + + public sealed class ValueEnumValidator { + + private ValueEnumValidator() { + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + public static Xml.Schema.Linq.SimpleTypeValidator TypeDefinition = new Xml.Schema.Linq.AtomicSimpleTypeValidator(XmlSchemaType.GetBuiltInSimpleType(XmlTypeCode.String), new Xml.Schema.Linq.RestrictionFacets(((Xml.Schema.Linq.RestrictionFlags)(16)), new object[] { + "NoResubmit", + "EnableSpellcheckOnResubmit", + "EnableSpellcheckSuggestOnResubmit", + "EnableStemmingOnResubmit", + "AddSynonymsAutomatically"}, 0, 0, null, null, 0, null, null, 0, null, 0, XmlSchemaWhiteSpace.Preserve)); + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + [EditorBrowsable(EditorBrowsableState.Never)] + protected internal static readonly System.Xml.Linq.XName valueXName = System.Xml.Linq.XName.Get("value", ""); + + /// + /// + /// Explanation of values follows. + /// + ///NoResubmit: Do not resubmit the query, but return with ZERO results. If this attribute value is set, any other ResubmitFlag elements are ignored. + /// + ///EnableSpellcheckOnResubmit: Resubmit the query with automatic spelling checking enabled. This corresponds to evaluating the query with EnableSpellCheck set to 4 when re-evaluating the query. + /// + ///EnableSpellcheckSuggestOnResubmit: Resubmit the query with spelling checking enabled in suggest mode. This corresponds to evaluating the query with EnableSpellCheck set to 2 when re-evaluating the query. Note - This option will still return a query result with zero hits. + /// + ///EnableStemmingOnResubmit: Resubmit the query with stemming enabled. This corresponds to evaluating the query with EnableStemming set to true when re-evaluating the query. + /// + /// + /// Occurrence: optional + /// + /// + public virtual Microsoft.Search.Query.Schemas.ResubmitFlag.ValueEnum? value { + get { + XAttribute x = this.Attribute(valueXName); + if ((x == null)) { + return null; + } + return ((Microsoft.Search.Query.Schemas.ResubmitFlag.ValueEnum)(Enum.Parse(typeof(Microsoft.Search.Query.Schemas.ResubmitFlag.ValueEnum), XTypedServices.ParseValue(x, XmlSchemaType.GetBuiltInSimpleType(XmlTypeCode.String).Datatype, ValueEnumValidator.TypeDefinition)))); + } + set { + if (value == null) { + this.SetAttribute(valueXName, null, XmlSchemaType.GetBuiltInSimpleType(XmlTypeCode.String).Datatype); + } + else { + this.SetAttributeWithValidation(valueXName, value.ToString(), "value", ValueEnumValidator.TypeDefinition); + } + } + } + + private static readonly System.Xml.Linq.XName xName = System.Xml.Linq.XName.Get("ResubmitFlag", "urn:Microsoft.Search.Query"); + + ContentModelEntity IXMetaData.GetContentModel() { + return ContentModelEntity.Default; + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + System.Xml.Linq.XName IXMetaData.SchemaName { + get { + return xName; + } + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + SchemaOrigin IXMetaData.TypeOrigin { + get { + return SchemaOrigin.Element; + } + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + ILinqToXsdTypeManager IXMetaData.TypeManager { + get { + return LinqToXsdTypeManager.Instance; + } + } + } + + /// + /// + /// Off: Do not apply spelling correction to the query text. + ///Suggest: Suggest transformed (spelled correctly) query in the result, but do not apply spelling checking to the actual query performed. This enables the Did You Mean feature search tip in the result pages. + ///On: Apply spelling corrections to the query text before evaluating the query. + /// + /// + public partial class EnableSpellcheck : XTypedElement, IXMetaData { + + public void Save(string xmlFile) { + XTypedServices.Save(xmlFile, Untyped); + } + + public void Save(System.IO.TextWriter tw) { + XTypedServices.Save(tw, Untyped); + } + + public void Save(System.Xml.XmlWriter xmlWriter) { + XTypedServices.Save(xmlWriter, Untyped); + } + + public static EnableSpellcheck Load(string xmlFile) { + return XTypedServices.Load(xmlFile); + } + + public static EnableSpellcheck Load(System.IO.TextReader xmlFile) { + return XTypedServices.Load(xmlFile); + } + + public static EnableSpellcheck Parse(string xml) { + return XTypedServices.Parse(xml); + } + + public static explicit operator EnableSpellcheck(XElement xe) { return XTypedServices.ToXTypedElement(xe,LinqToXsdTypeManager.Instance as ILinqToXsdTypeManager); } + + public override XTypedElement Clone() { + return XTypedServices.CloneXTypedElement(this); + } + + /// + /// + /// Off: Do not apply spelling correction to the query text. + ///Suggest: Suggest transformed (spelled correctly) query in the result, but do not apply spelling checking to the actual query performed. This enables the Did You Mean feature search tip in the result pages. + ///On: Apply spelling corrections to the query text before evaluating the query. + /// + /// + public EnableSpellcheck() { + } + + public enum EnableSpellcheck1Enum { + + off, + + suggest, + + on, + } + + public sealed class EnableSpellcheck1EnumValidator { + + private EnableSpellcheck1EnumValidator() { + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + public static Xml.Schema.Linq.SimpleTypeValidator TypeDefinition = new Xml.Schema.Linq.AtomicSimpleTypeValidator(XmlSchemaType.GetBuiltInSimpleType(XmlTypeCode.String), new Xml.Schema.Linq.RestrictionFacets(((Xml.Schema.Linq.RestrictionFlags)(16)), new object[] { + "off", + "suggest", + "on"}, 0, 0, null, null, 0, null, null, 0, null, 0, XmlSchemaWhiteSpace.Preserve)); + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + [EditorBrowsable(EditorBrowsableState.Never)] + protected internal static readonly System.Xml.Linq.XName TypedValueXName = System.Xml.Linq.XName.Get("TypedValue", ""); + + public virtual Microsoft.Search.Query.Schemas.EnableSpellcheck.EnableSpellcheck1Enum TypedValue { + get { + XElement x = this.Untyped; + return ((Microsoft.Search.Query.Schemas.EnableSpellcheck.EnableSpellcheck1Enum)(Enum.Parse(typeof(Microsoft.Search.Query.Schemas.EnableSpellcheck.EnableSpellcheck1Enum), XTypedServices.ParseValue(x, XmlSchemaType.GetBuiltInSimpleType(XmlTypeCode.String).Datatype, EnableSpellcheck1EnumValidator.TypeDefinition)))); + } + set { + this.SetValueWithValidation(value.ToString(), "TypedValue", EnableSpellcheck1EnumValidator.TypeDefinition); + } + } + + private static readonly System.Xml.Linq.XName xName = System.Xml.Linq.XName.Get("EnableSpellcheck", "urn:Microsoft.Search.Query"); + + ContentModelEntity IXMetaData.GetContentModel() { + return ContentModelEntity.Default; + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + System.Xml.Linq.XName IXMetaData.SchemaName { + get { + return xName; + } + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + SchemaOrigin IXMetaData.TypeOrigin { + get { + return SchemaOrigin.Element; + } + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + ILinqToXsdTypeManager IXMetaData.TypeManager { + get { + return LinqToXsdTypeManager.Instance; + } + } + } + + /// + /// + /// Regular expression: (UserContextData) + /// + /// + public partial class UserContext : XTypedElement, IXMetaData { + + public void Save(string xmlFile) { + XTypedServices.Save(xmlFile, Untyped); + } + + public void Save(System.IO.TextWriter tw) { + XTypedServices.Save(tw, Untyped); + } + + public void Save(System.Xml.XmlWriter xmlWriter) { + XTypedServices.Save(xmlWriter, Untyped); + } + + public static UserContext Load(string xmlFile) { + return XTypedServices.Load(xmlFile); + } + + public static UserContext Load(System.IO.TextReader xmlFile) { + return XTypedServices.Load(xmlFile); + } + + public static UserContext Parse(string xml) { + return XTypedServices.Parse(xml); + } + + public static explicit operator UserContext(XElement xe) { return XTypedServices.ToXTypedElement(xe,LinqToXsdTypeManager.Instance as ILinqToXsdTypeManager); } + + public override XTypedElement Clone() { + return XTypedServices.CloneXTypedElement(this); + } + + /// + /// + /// Regular expression: (UserContextData) + /// + /// + public UserContext() { + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + [EditorBrowsable(EditorBrowsableState.Never)] + protected internal static readonly System.Xml.Linq.XName UserContextDataXName = System.Xml.Linq.XName.Get("UserContextData", "urn:Microsoft.Search.Query"); + + /// + /// + /// The keyword management search settings can be restricted to context. A context defines when a search setting should apply, typically targeting a specific group of users. + /// + ///If a user with the responsibilities "developer" and "tester" submits a query for "office", the query request should include the following userContextString: "responsibilities:;:developer;tester" + /// + /// + /// + /// Occurrence: required + /// + /// + /// Regular expression: (UserContextData) + /// + /// + public virtual UserContextData UserContextData { + get { + XElement x = this.GetElement(UserContextDataXName); + return ((UserContextData)(x)); + } + set { + this.SetElement(UserContextDataXName, value); + } + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + [EditorBrowsable(EditorBrowsableState.Never)] + protected internal static readonly System.Xml.Linq.XName includeuserprofileXName = System.Xml.Linq.XName.Get("includeuserprofile", ""); + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + private static bool includeuserprofileDefaultValue = System.Xml.XmlConvert.ToBoolean("true"); + + /// + /// + /// Specifies the type of user context data to be applied. + /// + ///true Context values from the SharePoint 2010 user profile service will be included as part of the user context. If UserContextData is also used, the user profile data and the custom context data are both used. + /// + ///false Context values from the SharePoint 2010 user profile are not included as part of the user context. Use UserContextData to submit custom user contexts. + /// + ///Default: true. + /// + /// + /// Occurrence: optional + /// + /// + public virtual bool includeuserprofile { + get { + XAttribute x = this.Attribute(includeuserprofileXName); + if ((x == null)) { + return includeuserprofileDefaultValue; + } + return XTypedServices.ParseValue(x, XmlSchemaType.GetBuiltInSimpleType(XmlTypeCode.Boolean).Datatype); + } + set { + this.SetAttribute(includeuserprofileXName, value, XmlSchemaType.GetBuiltInSimpleType(XmlTypeCode.Boolean).Datatype); + } + } + + private static readonly System.Xml.Linq.XName xName = System.Xml.Linq.XName.Get("UserContext", "urn:Microsoft.Search.Query"); + + static UserContext() { + BuildElementDictionary(); + contentModel = new SequenceContentModelEntity(new NamedContentModelEntity(UserContextDataXName)); + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + private static Dictionary localElementDictionary = new Dictionary(); + + private static void BuildElementDictionary() { + localElementDictionary.Add(UserContextDataXName, typeof(UserContextData)); + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + Dictionary IXMetaData.LocalElementsDictionary { + get { + return localElementDictionary; + } + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + private static ContentModelEntity contentModel; + + ContentModelEntity IXMetaData.GetContentModel() { + return contentModel; + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + System.Xml.Linq.XName IXMetaData.SchemaName { + get { + return xName; + } + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + SchemaOrigin IXMetaData.TypeOrigin { + get { + return SchemaOrigin.Element; + } + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + ILinqToXsdTypeManager IXMetaData.TypeManager { + get { + return LinqToXsdTypeManager.Instance; + } + } + } + + /// + /// + /// Regular expression: (SimilarTo, SimilarType, SortSimilar) + /// + /// + public partial class FindSimilar : XTypedElement, IXMetaData { + + public void Save(string xmlFile) { + XTypedServices.Save(xmlFile, Untyped); + } + + public void Save(System.IO.TextWriter tw) { + XTypedServices.Save(tw, Untyped); + } + + public void Save(System.Xml.XmlWriter xmlWriter) { + XTypedServices.Save(xmlWriter, Untyped); + } + + public static FindSimilar Load(string xmlFile) { + return XTypedServices.Load(xmlFile); + } + + public static FindSimilar Load(System.IO.TextReader xmlFile) { + return XTypedServices.Load(xmlFile); + } + + public static FindSimilar Parse(string xml) { + return XTypedServices.Parse(xml); + } + + public static explicit operator FindSimilar(XElement xe) { return XTypedServices.ToXTypedElement(xe,LinqToXsdTypeManager.Instance as ILinqToXsdTypeManager); } + + public override XTypedElement Clone() { + return XTypedServices.CloneXTypedElement(this); + } + + /// + /// + /// Regular expression: (SimilarTo, SimilarType, SortSimilar) + /// + /// + public FindSimilar() { + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + [EditorBrowsable(EditorBrowsableState.Never)] + protected internal static readonly System.Xml.Linq.XName SimilarToXName = System.Xml.Linq.XName.Get("SimilarTo", "urn:Microsoft.Search.Query"); + + /// + /// + /// Occurrence: required + /// + /// + /// Regular expression: (SimilarTo, SimilarType, SortSimilar) + /// + /// + public virtual SimilarTo SimilarTo { + get { + XElement x = this.GetElement(SimilarToXName); + return ((SimilarTo)(x)); + } + set { + this.SetElement(SimilarToXName, value); + } + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + [EditorBrowsable(EditorBrowsableState.Never)] + protected internal static readonly System.Xml.Linq.XName SimilarTypeXName = System.Xml.Linq.XName.Get("SimilarType", "urn:Microsoft.Search.Query"); + + /// + /// + /// An explanation of possible values follows. + /// + ///FindSimilar: The similarity vectors are added to the query by using an OR operator. + ///RefineSimilar: The query will match if the original query conditions and the similarity vector conditions are met. + ///ExcludeSimilar: The query will match if the original query conditions are met, but not the similarity conditions. + /// + /// + /// Occurrence: required + /// + /// + /// Regular expression: (SimilarTo, SimilarType, SortSimilar) + /// + /// + public virtual Microsoft.Search.Query.Schemas.SimilarType SimilarType { + get { + XElement x = this.GetElement(SimilarTypeXName); + return ((Microsoft.Search.Query.Schemas.SimilarType)(x)); + } + set { + this.SetElement(SimilarTypeXName, value); + } + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + [EditorBrowsable(EditorBrowsableState.Never)] + protected internal static readonly System.Xml.Linq.XName SortSimilarXName = System.Xml.Linq.XName.Get("SortSimilar", "urn:Microsoft.Search.Query"); + + /// + /// + /// If set to False, the result is sorted by relevance score (rank). Default: true. + /// + /// + /// Occurrence: required + /// + /// + /// Regular expression: (SimilarTo, SimilarType, SortSimilar) + /// + /// + public virtual SortSimilar SortSimilar { + get { + XElement x = this.GetElement(SortSimilarXName); + return ((SortSimilar)(x)); + } + set { + this.SetElement(SortSimilarXName, value); + } + } + + private static readonly System.Xml.Linq.XName xName = System.Xml.Linq.XName.Get("FindSimilar", "urn:Microsoft.Search.Query"); + + static FindSimilar() { + BuildElementDictionary(); + contentModel = new SequenceContentModelEntity(new NamedContentModelEntity(SimilarToXName), new NamedContentModelEntity(SimilarTypeXName), new NamedContentModelEntity(SortSimilarXName)); + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + private static Dictionary localElementDictionary = new Dictionary(); + + private static void BuildElementDictionary() { + localElementDictionary.Add(SimilarToXName, typeof(SimilarTo)); + localElementDictionary.Add(SimilarTypeXName, typeof(SimilarType)); + localElementDictionary.Add(SortSimilarXName, typeof(SortSimilar)); + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + Dictionary IXMetaData.LocalElementsDictionary { + get { + return localElementDictionary; + } + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + private static ContentModelEntity contentModel; + + ContentModelEntity IXMetaData.GetContentModel() { + return contentModel; + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + System.Xml.Linq.XName IXMetaData.SchemaName { + get { + return xName; + } + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + SchemaOrigin IXMetaData.TypeOrigin { + get { + return SchemaOrigin.Element; + } + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + ILinqToXsdTypeManager IXMetaData.TypeManager { + get { + return LinqToXsdTypeManager.Instance; + } + } + } + + public partial class SimilarType : XTypedElement, IXMetaData { + + public void Save(string xmlFile) { + XTypedServices.Save(xmlFile, Untyped); + } + + public void Save(System.IO.TextWriter tw) { + XTypedServices.Save(tw, Untyped); + } + + public void Save(System.Xml.XmlWriter xmlWriter) { + XTypedServices.Save(xmlWriter, Untyped); + } + + public static SimilarType Load(string xmlFile) { + return XTypedServices.Load(xmlFile); + } + + public static SimilarType Load(System.IO.TextReader xmlFile) { + return XTypedServices.Load(xmlFile); + } + + public static SimilarType Parse(string xml) { + return XTypedServices.Parse(xml); + } + + public static explicit operator SimilarType(XElement xe) { return XTypedServices.ToXTypedElement(xe,LinqToXsdTypeManager.Instance as ILinqToXsdTypeManager); } + + public override XTypedElement Clone() { + return XTypedServices.CloneXTypedElement(this); + } + + public SimilarType() { + } + + public enum SimilarType1Enum { + + FindSimilar, + + RefineSimilar, + + ExcludeSimilar, + } + + public sealed class SimilarType1EnumValidator { + + private SimilarType1EnumValidator() { + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + public static Xml.Schema.Linq.SimpleTypeValidator TypeDefinition = new Xml.Schema.Linq.AtomicSimpleTypeValidator(XmlSchemaType.GetBuiltInSimpleType(XmlTypeCode.String), new Xml.Schema.Linq.RestrictionFacets(((Xml.Schema.Linq.RestrictionFlags)(16)), new object[] { + "FindSimilar", + "RefineSimilar", + "ExcludeSimilar"}, 0, 0, null, null, 0, null, null, 0, null, 0, XmlSchemaWhiteSpace.Preserve)); + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + [EditorBrowsable(EditorBrowsableState.Never)] + protected internal static readonly System.Xml.Linq.XName TypedValueXName = System.Xml.Linq.XName.Get("TypedValue", ""); + + public virtual Microsoft.Search.Query.Schemas.SimilarType.SimilarType1Enum TypedValue { + get { + XElement x = this.Untyped; + return ((Microsoft.Search.Query.Schemas.SimilarType.SimilarType1Enum)(Enum.Parse(typeof(Microsoft.Search.Query.Schemas.SimilarType.SimilarType1Enum), XTypedServices.ParseValue(x, XmlSchemaType.GetBuiltInSimpleType(XmlTypeCode.String).Datatype, SimilarType1EnumValidator.TypeDefinition)))); + } + set { + this.SetValueWithValidation(value.ToString(), "TypedValue", SimilarType1EnumValidator.TypeDefinition); + } + } + + private static readonly System.Xml.Linq.XName xName = System.Xml.Linq.XName.Get("SimilarType", "urn:Microsoft.Search.Query"); + + ContentModelEntity IXMetaData.GetContentModel() { + return ContentModelEntity.Default; + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + System.Xml.Linq.XName IXMetaData.SchemaName { + get { + return xName; + } + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + SchemaOrigin IXMetaData.TypeOrigin { + get { + return SchemaOrigin.Element; + } + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + ILinqToXsdTypeManager IXMetaData.TypeManager { + get { + return LinqToXsdTypeManager.Instance; + } + } + } + + /// + /// + /// Regular expression: (Refiners, MaxShallowRefinementHits) + /// + /// + public partial class IncludeRefinementResults : XTypedElement, IXMetaData { + + public void Save(string xmlFile) { + XTypedServices.Save(xmlFile, Untyped); + } + + public void Save(System.IO.TextWriter tw) { + XTypedServices.Save(tw, Untyped); + } + + public void Save(System.Xml.XmlWriter xmlWriter) { + XTypedServices.Save(xmlWriter, Untyped); + } + + public static IncludeRefinementResults Load(string xmlFile) { + return XTypedServices.Load(xmlFile); + } + + public static IncludeRefinementResults Load(System.IO.TextReader xmlFile) { + return XTypedServices.Load(xmlFile); + } + + public static IncludeRefinementResults Parse(string xml) { + return XTypedServices.Parse(xml); + } + + public static explicit operator IncludeRefinementResults(XElement xe) { return XTypedServices.ToXTypedElement(xe,LinqToXsdTypeManager.Instance as ILinqToXsdTypeManager); } + + public override XTypedElement Clone() { + return XTypedServices.CloneXTypedElement(this); + } + + /// + /// + /// Regular expression: (Refiners, MaxShallowRefinementHits) + /// + /// + public IncludeRefinementResults() { + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + [EditorBrowsable(EditorBrowsableState.Never)] + protected internal static readonly System.Xml.Linq.XName RefinersXName = System.Xml.Linq.XName.Get("Refiners", "urn:Microsoft.Search.Query"); + + /// + /// + /// Occurrence: required + /// + /// + /// Regular expression: (Refiners, MaxShallowRefinementHits) + /// + /// + public virtual Refiners Refiners { + get { + XElement x = this.GetElement(RefinersXName); + return ((Refiners)(x)); + } + set { + this.SetElement(RefinersXName, value); + } + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + [EditorBrowsable(EditorBrowsableState.Never)] + protected internal static readonly System.Xml.Linq.XName MaxShallowRefinementHitsXName = System.Xml.Linq.XName.Get("MaxShallowRefinementHits", "urn:Microsoft.Search.Query"); + + /// + /// + /// Occurrence: required + /// + /// + /// Regular expression: (Refiners, MaxShallowRefinementHits) + /// + /// + public virtual MaxShallowRefinementHits MaxShallowRefinementHits { + get { + XElement x = this.GetElement(MaxShallowRefinementHitsXName); + return ((MaxShallowRefinementHits)(x)); + } + set { + this.SetElement(MaxShallowRefinementHitsXName, value); + } + } + + private static readonly System.Xml.Linq.XName xName = System.Xml.Linq.XName.Get("IncludeRefinementResults", "urn:Microsoft.Search.Query"); + + static IncludeRefinementResults() { + BuildElementDictionary(); + contentModel = new SequenceContentModelEntity(new NamedContentModelEntity(RefinersXName), new NamedContentModelEntity(MaxShallowRefinementHitsXName)); + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + private static Dictionary localElementDictionary = new Dictionary(); + + private static void BuildElementDictionary() { + localElementDictionary.Add(RefinersXName, typeof(Refiners)); + localElementDictionary.Add(MaxShallowRefinementHitsXName, typeof(MaxShallowRefinementHits)); + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + Dictionary IXMetaData.LocalElementsDictionary { + get { + return localElementDictionary; + } + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + private static ContentModelEntity contentModel; + + ContentModelEntity IXMetaData.GetContentModel() { + return contentModel; + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + System.Xml.Linq.XName IXMetaData.SchemaName { + get { + return xName; + } + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + SchemaOrigin IXMetaData.TypeOrigin { + get { + return SchemaOrigin.Element; + } + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + ILinqToXsdTypeManager IXMetaData.TypeManager { + get { + return LinqToXsdTypeManager.Instance; + } + } + } + + /// + /// + /// Regular expression: (Refiner) + /// + /// + public partial class Refiners : XTypedElement, IXMetaData { + + public void Save(string xmlFile) { + XTypedServices.Save(xmlFile, Untyped); + } + + public void Save(System.IO.TextWriter tw) { + XTypedServices.Save(tw, Untyped); + } + + public void Save(System.Xml.XmlWriter xmlWriter) { + XTypedServices.Save(xmlWriter, Untyped); + } + + public static Refiners Load(string xmlFile) { + return XTypedServices.Load(xmlFile); + } + + public static Refiners Load(System.IO.TextReader xmlFile) { + return XTypedServices.Load(xmlFile); + } + + public static Refiners Parse(string xml) { + return XTypedServices.Parse(xml); + } + + public static explicit operator Refiners(XElement xe) { return XTypedServices.ToXTypedElement(xe,LinqToXsdTypeManager.Instance as ILinqToXsdTypeManager); } + + public override XTypedElement Clone() { + return XTypedServices.CloneXTypedElement(this); + } + + /// + /// + /// Regular expression: (Refiner) + /// + /// + public Refiners() { + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + [EditorBrowsable(EditorBrowsableState.Never)] + protected internal static readonly System.Xml.Linq.XName RefinerXName = System.Xml.Linq.XName.Get("Refiner", "urn:Microsoft.Search.Query"); + + /// + /// + /// Occurrence: required + /// + /// + /// Regular expression: (Refiner) + /// + /// + public virtual Refiner Refiner { + get { + XElement x = this.GetElement(RefinerXName); + return ((Refiner)(x)); + } + set { + this.SetElement(RefinerXName, value); + } + } + + private static readonly System.Xml.Linq.XName xName = System.Xml.Linq.XName.Get("Refiners", "urn:Microsoft.Search.Query"); + + static Refiners() { + BuildElementDictionary(); + contentModel = new SequenceContentModelEntity(new NamedContentModelEntity(RefinerXName)); + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + private static Dictionary localElementDictionary = new Dictionary(); + + private static void BuildElementDictionary() { + localElementDictionary.Add(RefinerXName, typeof(Refiner)); + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + Dictionary IXMetaData.LocalElementsDictionary { + get { + return localElementDictionary; + } + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + private static ContentModelEntity contentModel; + + ContentModelEntity IXMetaData.GetContentModel() { + return contentModel; + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + System.Xml.Linq.XName IXMetaData.SchemaName { + get { + return xName; + } + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + SchemaOrigin IXMetaData.TypeOrigin { + get { + return SchemaOrigin.Element; + } + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + ILinqToXsdTypeManager IXMetaData.TypeManager { + get { + return LinqToXsdTypeManager.Instance; + } + } + } + + /// + /// + /// Regular expression: (RefinementFilter) + /// + /// + public partial class RefinementFilters : XTypedElement, IXMetaData { + + public void Save(string xmlFile) { + XTypedServices.Save(xmlFile, Untyped); + } + + public void Save(System.IO.TextWriter tw) { + XTypedServices.Save(tw, Untyped); + } + + public void Save(System.Xml.XmlWriter xmlWriter) { + XTypedServices.Save(xmlWriter, Untyped); + } + + public static RefinementFilters Load(string xmlFile) { + return XTypedServices.Load(xmlFile); + } + + public static RefinementFilters Load(System.IO.TextReader xmlFile) { + return XTypedServices.Load(xmlFile); + } + + public static RefinementFilters Parse(string xml) { + return XTypedServices.Parse(xml); + } + + public static explicit operator RefinementFilters(XElement xe) { return XTypedServices.ToXTypedElement(xe,LinqToXsdTypeManager.Instance as ILinqToXsdTypeManager); } + + public override XTypedElement Clone() { + return XTypedServices.CloneXTypedElement(this); + } + + /// + /// + /// Regular expression: (RefinementFilter) + /// + /// + public RefinementFilters() { + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + [EditorBrowsable(EditorBrowsableState.Never)] + protected internal static readonly System.Xml.Linq.XName RefinementFilterXName = System.Xml.Linq.XName.Get("RefinementFilter", "urn:Microsoft.Search.Query"); + + /// + /// + /// Occurrence: required + /// + /// + /// Regular expression: (RefinementFilter) + /// + /// + public virtual RefinementFilter RefinementFilter { + get { + XElement x = this.GetElement(RefinementFilterXName); + return ((RefinementFilter)(x)); + } + set { + this.SetElement(RefinementFilterXName, value); + } + } + + private static readonly System.Xml.Linq.XName xName = System.Xml.Linq.XName.Get("RefinementFilters", "urn:Microsoft.Search.Query"); + + static RefinementFilters() { + BuildElementDictionary(); + contentModel = new SequenceContentModelEntity(new NamedContentModelEntity(RefinementFilterXName)); + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + private static Dictionary localElementDictionary = new Dictionary(); + + private static void BuildElementDictionary() { + localElementDictionary.Add(RefinementFilterXName, typeof(RefinementFilter)); + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + Dictionary IXMetaData.LocalElementsDictionary { + get { + return localElementDictionary; + } + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + private static ContentModelEntity contentModel; + + ContentModelEntity IXMetaData.GetContentModel() { + return contentModel; + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + System.Xml.Linq.XName IXMetaData.SchemaName { + get { + return xName; + } + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + SchemaOrigin IXMetaData.TypeOrigin { + get { + return SchemaOrigin.Element; + } + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + ILinqToXsdTypeManager IXMetaData.TypeManager { + get { + return LinqToXsdTypeManager.Instance; + } + } + } + + /// + /// + /// The similarityReference is a string that represents a statistical similarity reference when searching for similar items. + /// + /// + public sealed class similarityReference { + + private similarityReference() { + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + public static Xml.Schema.Linq.SimpleTypeValidator TypeDefinition = new Xml.Schema.Linq.AtomicSimpleTypeValidator(XmlSchemaType.GetBuiltInSimpleType(XmlTypeCode.String), null); + } + + /// + /// + /// This contains the name of the refiner, but you can also use an advanced syntax to apply non-default configuration values for the named refiner. For more information about the advanced syntax for the Refiner element, see Refiner Specification in the Query Web Service and Query Object Model (https://docs.microsoft.com/en-us/previous-versions/office/developer/sharepoint-2010/gg984547%28v%3doffice.14%29). + /// + /// + public sealed class refinerSpecification { + + private refinerSpecification() { + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + public static Xml.Schema.Linq.SimpleTypeValidator TypeDefinition = new Xml.Schema.Linq.AtomicSimpleTypeValidator(XmlSchemaType.GetBuiltInSimpleType(XmlTypeCode.String), null); + } + + public partial class StartAt : XTypedElement, IXMetaData { + + public void Save(string xmlFile) { + XTypedServices.Save(xmlFile, Untyped); + } + + public void Save(System.IO.TextWriter tw) { + XTypedServices.Save(tw, Untyped); + } + + public void Save(System.Xml.XmlWriter xmlWriter) { + XTypedServices.Save(xmlWriter, Untyped); + } + + public static StartAt Load(string xmlFile) { + return XTypedServices.Load(xmlFile); + } + + public static StartAt Load(System.IO.TextReader xmlFile) { + return XTypedServices.Load(xmlFile); + } + + public static StartAt Parse(string xml) { + return XTypedServices.Parse(xml); + } + + public static explicit operator StartAt(XElement xe) { return XTypedServices.ToXTypedElement(xe,LinqToXsdTypeManager.Instance as ILinqToXsdTypeManager); } + + public override XTypedElement Clone() { + return XTypedServices.CloneXTypedElement(this); + } + + public StartAt() { + } + + public StartAt(int content) { + this.TypedValue = content; + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + [EditorBrowsable(EditorBrowsableState.Never)] + protected internal static readonly System.Xml.Linq.XName TypedValueXName = System.Xml.Linq.XName.Get("TypedValue", ""); + + public virtual int TypedValue { + get { + XElement x = this.Untyped; + return XTypedServices.ParseValue(x, XmlSchemaType.GetBuiltInSimpleType(XmlTypeCode.Int).Datatype); + } + set { + this.SetValue(value, XmlSchemaType.GetBuiltInSimpleType(XmlTypeCode.Int).Datatype); + } + } + + private static readonly System.Xml.Linq.XName xName = System.Xml.Linq.XName.Get("StartAt", "urn:Microsoft.Search.Query"); + + ContentModelEntity IXMetaData.GetContentModel() { + return ContentModelEntity.Default; + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + System.Xml.Linq.XName IXMetaData.SchemaName { + get { + return xName; + } + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + SchemaOrigin IXMetaData.TypeOrigin { + get { + return SchemaOrigin.Element; + } + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + ILinqToXsdTypeManager IXMetaData.TypeManager { + get { + return LinqToXsdTypeManager.Instance; + } + } + } + + public partial class Count : XTypedElement, IXMetaData { + + public void Save(string xmlFile) { + XTypedServices.Save(xmlFile, Untyped); + } + + public void Save(System.IO.TextWriter tw) { + XTypedServices.Save(tw, Untyped); + } + + public void Save(System.Xml.XmlWriter xmlWriter) { + XTypedServices.Save(xmlWriter, Untyped); + } + + public static Count Load(string xmlFile) { + return XTypedServices.Load(xmlFile); + } + + public static Count Load(System.IO.TextReader xmlFile) { + return XTypedServices.Load(xmlFile); + } + + public static Count Parse(string xml) { + return XTypedServices.Parse(xml); + } + + public static explicit operator Count(XElement xe) { return XTypedServices.ToXTypedElement(xe,LinqToXsdTypeManager.Instance as ILinqToXsdTypeManager); } + + public override XTypedElement Clone() { + return XTypedServices.CloneXTypedElement(this); + } + + public Count() { + } + + public Count(int content) { + this.TypedValue = content; + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + [EditorBrowsable(EditorBrowsableState.Never)] + protected internal static readonly System.Xml.Linq.XName TypedValueXName = System.Xml.Linq.XName.Get("TypedValue", ""); + + public virtual int TypedValue { + get { + XElement x = this.Untyped; + return XTypedServices.ParseValue(x, XmlSchemaType.GetBuiltInSimpleType(XmlTypeCode.Int).Datatype); + } + set { + this.SetValue(value, XmlSchemaType.GetBuiltInSimpleType(XmlTypeCode.Int).Datatype); + } + } + + private static readonly System.Xml.Linq.XName xName = System.Xml.Linq.XName.Get("Count", "urn:Microsoft.Search.Query"); + + ContentModelEntity IXMetaData.GetContentModel() { + return ContentModelEntity.Default; + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + System.Xml.Linq.XName IXMetaData.SchemaName { + get { + return xName; + } + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + SchemaOrigin IXMetaData.TypeOrigin { + get { + return SchemaOrigin.Element; + } + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + ILinqToXsdTypeManager IXMetaData.TypeManager { + get { + return LinqToXsdTypeManager.Instance; + } + } + } + + public partial class ImplicitAndBehavior : XTypedElement, IXMetaData { + + public void Save(string xmlFile) { + XTypedServices.Save(xmlFile, Untyped); + } + + public void Save(System.IO.TextWriter tw) { + XTypedServices.Save(tw, Untyped); + } + + public void Save(System.Xml.XmlWriter xmlWriter) { + XTypedServices.Save(xmlWriter, Untyped); + } + + public static ImplicitAndBehavior Load(string xmlFile) { + return XTypedServices.Load(xmlFile); + } + + public static ImplicitAndBehavior Load(System.IO.TextReader xmlFile) { + return XTypedServices.Load(xmlFile); + } + + public static ImplicitAndBehavior Parse(string xml) { + return XTypedServices.Parse(xml); + } + + public static explicit operator ImplicitAndBehavior(XElement xe) { return XTypedServices.ToXTypedElement(xe,LinqToXsdTypeManager.Instance as ILinqToXsdTypeManager); } + + public override XTypedElement Clone() { + return XTypedServices.CloneXTypedElement(this); + } + + public ImplicitAndBehavior() { + } + + public ImplicitAndBehavior(bool content) { + this.TypedValue = content; + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + [EditorBrowsable(EditorBrowsableState.Never)] + protected internal static readonly System.Xml.Linq.XName TypedValueXName = System.Xml.Linq.XName.Get("TypedValue", ""); + + public virtual bool TypedValue { + get { + XElement x = this.Untyped; + return XTypedServices.ParseValue(x, XmlSchemaType.GetBuiltInSimpleType(XmlTypeCode.Boolean).Datatype); + } + set { + this.SetValue(value, XmlSchemaType.GetBuiltInSimpleType(XmlTypeCode.Boolean).Datatype); + } + } + + private static readonly System.Xml.Linq.XName xName = System.Xml.Linq.XName.Get("ImplicitAndBehavior", "urn:Microsoft.Search.Query"); + + ContentModelEntity IXMetaData.GetContentModel() { + return ContentModelEntity.Default; + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + System.Xml.Linq.XName IXMetaData.SchemaName { + get { + return xName; + } + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + SchemaOrigin IXMetaData.TypeOrigin { + get { + return SchemaOrigin.Element; + } + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + ILinqToXsdTypeManager IXMetaData.TypeManager { + get { + return LinqToXsdTypeManager.Instance; + } + } + } + + public partial class EnableStemming : XTypedElement, IXMetaData { + + public void Save(string xmlFile) { + XTypedServices.Save(xmlFile, Untyped); + } + + public void Save(System.IO.TextWriter tw) { + XTypedServices.Save(tw, Untyped); + } + + public void Save(System.Xml.XmlWriter xmlWriter) { + XTypedServices.Save(xmlWriter, Untyped); + } + + public static EnableStemming Load(string xmlFile) { + return XTypedServices.Load(xmlFile); + } + + public static EnableStemming Load(System.IO.TextReader xmlFile) { + return XTypedServices.Load(xmlFile); + } + + public static EnableStemming Parse(string xml) { + return XTypedServices.Parse(xml); + } + + public static explicit operator EnableStemming(XElement xe) { return XTypedServices.ToXTypedElement(xe,LinqToXsdTypeManager.Instance as ILinqToXsdTypeManager); } + + public override XTypedElement Clone() { + return XTypedServices.CloneXTypedElement(this); + } + + public EnableStemming() { + } + + public EnableStemming(bool content) { + this.TypedValue = content; + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + [EditorBrowsable(EditorBrowsableState.Never)] + protected internal static readonly System.Xml.Linq.XName TypedValueXName = System.Xml.Linq.XName.Get("TypedValue", ""); + + public virtual bool TypedValue { + get { + XElement x = this.Untyped; + return XTypedServices.ParseValue(x, XmlSchemaType.GetBuiltInSimpleType(XmlTypeCode.Boolean).Datatype); + } + set { + this.SetValue(value, XmlSchemaType.GetBuiltInSimpleType(XmlTypeCode.Boolean).Datatype); + } + } + + private static readonly System.Xml.Linq.XName xName = System.Xml.Linq.XName.Get("EnableStemming", "urn:Microsoft.Search.Query"); + + ContentModelEntity IXMetaData.GetContentModel() { + return ContentModelEntity.Default; + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + System.Xml.Linq.XName IXMetaData.SchemaName { + get { + return xName; + } + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + SchemaOrigin IXMetaData.TypeOrigin { + get { + return SchemaOrigin.Element; + } + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + ILinqToXsdTypeManager IXMetaData.TypeManager { + get { + return LinqToXsdTypeManager.Instance; + } + } + } + + public partial class IncludeSpecialTermResults : XTypedElement, IXMetaData { + + public void Save(string xmlFile) { + XTypedServices.Save(xmlFile, Untyped); + } + + public void Save(System.IO.TextWriter tw) { + XTypedServices.Save(tw, Untyped); + } + + public void Save(System.Xml.XmlWriter xmlWriter) { + XTypedServices.Save(xmlWriter, Untyped); + } + + public static IncludeSpecialTermResults Load(string xmlFile) { + return XTypedServices.Load(xmlFile); + } + + public static IncludeSpecialTermResults Load(System.IO.TextReader xmlFile) { + return XTypedServices.Load(xmlFile); + } + + public static IncludeSpecialTermResults Parse(string xml) { + return XTypedServices.Parse(xml); + } + + public static explicit operator IncludeSpecialTermResults(XElement xe) { return XTypedServices.ToXTypedElement(xe,LinqToXsdTypeManager.Instance as ILinqToXsdTypeManager); } + + public override XTypedElement Clone() { + return XTypedServices.CloneXTypedElement(this); + } + + public IncludeSpecialTermResults() { + } + + public IncludeSpecialTermResults(bool content) { + this.TypedValue = content; + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + [EditorBrowsable(EditorBrowsableState.Never)] + protected internal static readonly System.Xml.Linq.XName TypedValueXName = System.Xml.Linq.XName.Get("TypedValue", ""); + + public virtual bool TypedValue { + get { + XElement x = this.Untyped; + return XTypedServices.ParseValue(x, XmlSchemaType.GetBuiltInSimpleType(XmlTypeCode.Boolean).Datatype); + } + set { + this.SetValue(value, XmlSchemaType.GetBuiltInSimpleType(XmlTypeCode.Boolean).Datatype); + } + } + + private static readonly System.Xml.Linq.XName xName = System.Xml.Linq.XName.Get("IncludeSpecialTermResults", "urn:Microsoft.Search.Query"); + + ContentModelEntity IXMetaData.GetContentModel() { + return ContentModelEntity.Default; + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + System.Xml.Linq.XName IXMetaData.SchemaName { + get { + return xName; + } + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + SchemaOrigin IXMetaData.TypeOrigin { + get { + return SchemaOrigin.Element; + } + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + ILinqToXsdTypeManager IXMetaData.TypeManager { + get { + return LinqToXsdTypeManager.Instance; + } + } + } + + public partial class PreQuerySuggestions : XTypedElement, IXMetaData { + + public void Save(string xmlFile) { + XTypedServices.Save(xmlFile, Untyped); + } + + public void Save(System.IO.TextWriter tw) { + XTypedServices.Save(tw, Untyped); + } + + public void Save(System.Xml.XmlWriter xmlWriter) { + XTypedServices.Save(xmlWriter, Untyped); + } + + public static PreQuerySuggestions Load(string xmlFile) { + return XTypedServices.Load(xmlFile); + } + + public static PreQuerySuggestions Load(System.IO.TextReader xmlFile) { + return XTypedServices.Load(xmlFile); + } + + public static PreQuerySuggestions Parse(string xml) { + return XTypedServices.Parse(xml); + } + + public static explicit operator PreQuerySuggestions(XElement xe) { return XTypedServices.ToXTypedElement(xe,LinqToXsdTypeManager.Instance as ILinqToXsdTypeManager); } + + public override XTypedElement Clone() { + return XTypedServices.CloneXTypedElement(this); + } + + public PreQuerySuggestions() { + } + + public PreQuerySuggestions(bool content) { + this.TypedValue = content; + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + [EditorBrowsable(EditorBrowsableState.Never)] + protected internal static readonly System.Xml.Linq.XName TypedValueXName = System.Xml.Linq.XName.Get("TypedValue", ""); + + public virtual bool TypedValue { + get { + XElement x = this.Untyped; + return XTypedServices.ParseValue(x, XmlSchemaType.GetBuiltInSimpleType(XmlTypeCode.Boolean).Datatype); + } + set { + this.SetValue(value, XmlSchemaType.GetBuiltInSimpleType(XmlTypeCode.Boolean).Datatype); + } + } + + private static readonly System.Xml.Linq.XName xName = System.Xml.Linq.XName.Get("PreQuerySuggestions", "urn:Microsoft.Search.Query"); + + ContentModelEntity IXMetaData.GetContentModel() { + return ContentModelEntity.Default; + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + System.Xml.Linq.XName IXMetaData.SchemaName { + get { + return xName; + } + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + SchemaOrigin IXMetaData.TypeOrigin { + get { + return SchemaOrigin.Element; + } + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + ILinqToXsdTypeManager IXMetaData.TypeManager { + get { + return LinqToXsdTypeManager.Instance; + } + } + } + + public partial class HighlightQuerySuggestions : XTypedElement, IXMetaData { + + public void Save(string xmlFile) { + XTypedServices.Save(xmlFile, Untyped); + } + + public void Save(System.IO.TextWriter tw) { + XTypedServices.Save(tw, Untyped); + } + + public void Save(System.Xml.XmlWriter xmlWriter) { + XTypedServices.Save(xmlWriter, Untyped); + } + + public static HighlightQuerySuggestions Load(string xmlFile) { + return XTypedServices.Load(xmlFile); + } + + public static HighlightQuerySuggestions Load(System.IO.TextReader xmlFile) { + return XTypedServices.Load(xmlFile); + } + + public static HighlightQuerySuggestions Parse(string xml) { + return XTypedServices.Parse(xml); + } + + public static explicit operator HighlightQuerySuggestions(XElement xe) { return XTypedServices.ToXTypedElement(xe,LinqToXsdTypeManager.Instance as ILinqToXsdTypeManager); } + + public override XTypedElement Clone() { + return XTypedServices.CloneXTypedElement(this); + } + + public HighlightQuerySuggestions() { + } + + public HighlightQuerySuggestions(bool content) { + this.TypedValue = content; + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + [EditorBrowsable(EditorBrowsableState.Never)] + protected internal static readonly System.Xml.Linq.XName TypedValueXName = System.Xml.Linq.XName.Get("TypedValue", ""); + + public virtual bool TypedValue { + get { + XElement x = this.Untyped; + return XTypedServices.ParseValue(x, XmlSchemaType.GetBuiltInSimpleType(XmlTypeCode.Boolean).Datatype); + } + set { + this.SetValue(value, XmlSchemaType.GetBuiltInSimpleType(XmlTypeCode.Boolean).Datatype); + } + } + + private static readonly System.Xml.Linq.XName xName = System.Xml.Linq.XName.Get("HighlightQuerySuggestions", "urn:Microsoft.Search.Query"); + + ContentModelEntity IXMetaData.GetContentModel() { + return ContentModelEntity.Default; + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + System.Xml.Linq.XName IXMetaData.SchemaName { + get { + return xName; + } + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + SchemaOrigin IXMetaData.TypeOrigin { + get { + return SchemaOrigin.Element; + } + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + ILinqToXsdTypeManager IXMetaData.TypeManager { + get { + return LinqToXsdTypeManager.Instance; + } + } + } + + public partial class CapitalizeFirstLetters : XTypedElement, IXMetaData { + + public void Save(string xmlFile) { + XTypedServices.Save(xmlFile, Untyped); + } + + public void Save(System.IO.TextWriter tw) { + XTypedServices.Save(tw, Untyped); + } + + public void Save(System.Xml.XmlWriter xmlWriter) { + XTypedServices.Save(xmlWriter, Untyped); + } + + public static CapitalizeFirstLetters Load(string xmlFile) { + return XTypedServices.Load(xmlFile); + } + + public static CapitalizeFirstLetters Load(System.IO.TextReader xmlFile) { + return XTypedServices.Load(xmlFile); + } + + public static CapitalizeFirstLetters Parse(string xml) { + return XTypedServices.Parse(xml); + } + + public static explicit operator CapitalizeFirstLetters(XElement xe) { return XTypedServices.ToXTypedElement(xe,LinqToXsdTypeManager.Instance as ILinqToXsdTypeManager); } + + public override XTypedElement Clone() { + return XTypedServices.CloneXTypedElement(this); + } + + public CapitalizeFirstLetters() { + } + + public CapitalizeFirstLetters(bool content) { + this.TypedValue = content; + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + [EditorBrowsable(EditorBrowsableState.Never)] + protected internal static readonly System.Xml.Linq.XName TypedValueXName = System.Xml.Linq.XName.Get("TypedValue", ""); + + public virtual bool TypedValue { + get { + XElement x = this.Untyped; + return XTypedServices.ParseValue(x, XmlSchemaType.GetBuiltInSimpleType(XmlTypeCode.Boolean).Datatype); + } + set { + this.SetValue(value, XmlSchemaType.GetBuiltInSimpleType(XmlTypeCode.Boolean).Datatype); + } + } + + private static readonly System.Xml.Linq.XName xName = System.Xml.Linq.XName.Get("CapitalizeFirstLetters", "urn:Microsoft.Search.Query"); + + ContentModelEntity IXMetaData.GetContentModel() { + return ContentModelEntity.Default; + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + System.Xml.Linq.XName IXMetaData.SchemaName { + get { + return xName; + } + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + SchemaOrigin IXMetaData.TypeOrigin { + get { + return SchemaOrigin.Element; + } + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + ILinqToXsdTypeManager IXMetaData.TypeManager { + get { + return LinqToXsdTypeManager.Instance; + } + } + } + + public partial class UserContextData : XTypedElement, IXMetaData { + + public void Save(string xmlFile) { + XTypedServices.Save(xmlFile, Untyped); + } + + public void Save(System.IO.TextWriter tw) { + XTypedServices.Save(tw, Untyped); + } + + public void Save(System.Xml.XmlWriter xmlWriter) { + XTypedServices.Save(xmlWriter, Untyped); + } + + public static UserContextData Load(string xmlFile) { + return XTypedServices.Load(xmlFile); + } + + public static UserContextData Load(System.IO.TextReader xmlFile) { + return XTypedServices.Load(xmlFile); + } + + public static UserContextData Parse(string xml) { + return XTypedServices.Parse(xml); + } + + public static explicit operator UserContextData(XElement xe) { return XTypedServices.ToXTypedElement(xe,LinqToXsdTypeManager.Instance as ILinqToXsdTypeManager); } + + public override XTypedElement Clone() { + return XTypedServices.CloneXTypedElement(this); + } + + public UserContextData() { + } + + public UserContextData(string content) { + this.TypedValue = content; + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + [EditorBrowsable(EditorBrowsableState.Never)] + protected internal static readonly System.Xml.Linq.XName TypedValueXName = System.Xml.Linq.XName.Get("TypedValue", ""); + + public virtual string TypedValue { + get { + XElement x = this.Untyped; + return XTypedServices.ParseValue(x, XmlSchemaType.GetBuiltInSimpleType(XmlTypeCode.String).Datatype); + } + set { + this.SetValue(value, XmlSchemaType.GetBuiltInSimpleType(XmlTypeCode.String).Datatype); + } + } + + private static readonly System.Xml.Linq.XName xName = System.Xml.Linq.XName.Get("UserContextData", "urn:Microsoft.Search.Query"); + + ContentModelEntity IXMetaData.GetContentModel() { + return ContentModelEntity.Default; + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + System.Xml.Linq.XName IXMetaData.SchemaName { + get { + return xName; + } + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + SchemaOrigin IXMetaData.TypeOrigin { + get { + return SchemaOrigin.Element; + } + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + ILinqToXsdTypeManager IXMetaData.TypeManager { + get { + return LinqToXsdTypeManager.Instance; + } + } + } + + /// + /// + /// The similarityReference is a string that represents a statistical similarity reference when searching for similar items. + /// + /// + public partial class SimilarTo : XTypedElement, IXMetaData { + + public void Save(string xmlFile) { + XTypedServices.Save(xmlFile, Untyped); + } + + public void Save(System.IO.TextWriter tw) { + XTypedServices.Save(tw, Untyped); + } + + public void Save(System.Xml.XmlWriter xmlWriter) { + XTypedServices.Save(xmlWriter, Untyped); + } + + public static SimilarTo Load(string xmlFile) { + return XTypedServices.Load(xmlFile); + } + + public static SimilarTo Load(System.IO.TextReader xmlFile) { + return XTypedServices.Load(xmlFile); + } + + public static SimilarTo Parse(string xml) { + return XTypedServices.Parse(xml); + } + + public static explicit operator SimilarTo(XElement xe) { return XTypedServices.ToXTypedElement(xe,LinqToXsdTypeManager.Instance as ILinqToXsdTypeManager); } + + public override XTypedElement Clone() { + return XTypedServices.CloneXTypedElement(this); + } + + /// + /// + /// The similarityReference is a string that represents a statistical similarity reference when searching for similar items. + /// + /// + public SimilarTo() { + } + + /// + /// + /// The similarityReference is a string that represents a statistical similarity reference when searching for similar items. + /// + /// + public SimilarTo(string content) { + this.TypedValue = content; + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + [EditorBrowsable(EditorBrowsableState.Never)] + protected internal static readonly System.Xml.Linq.XName TypedValueXName = System.Xml.Linq.XName.Get("TypedValue", ""); + + public virtual string TypedValue { + get { + XElement x = this.Untyped; + return XTypedServices.ParseValue(x, XmlSchemaType.GetBuiltInSimpleType(XmlTypeCode.String).Datatype); + } + set { + this.SetValueWithValidation(value, "TypedValue", global::Microsoft.Search.Query.Schemas.similarityReference.TypeDefinition); + } + } + + private static readonly System.Xml.Linq.XName xName = System.Xml.Linq.XName.Get("SimilarTo", "urn:Microsoft.Search.Query"); + + ContentModelEntity IXMetaData.GetContentModel() { + return ContentModelEntity.Default; + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + System.Xml.Linq.XName IXMetaData.SchemaName { + get { + return xName; + } + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + SchemaOrigin IXMetaData.TypeOrigin { + get { + return SchemaOrigin.Element; + } + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + ILinqToXsdTypeManager IXMetaData.TypeManager { + get { + return LinqToXsdTypeManager.Instance; + } + } + } + + public partial class SortSimilar : XTypedElement, IXMetaData { + + public void Save(string xmlFile) { + XTypedServices.Save(xmlFile, Untyped); + } + + public void Save(System.IO.TextWriter tw) { + XTypedServices.Save(tw, Untyped); + } + + public void Save(System.Xml.XmlWriter xmlWriter) { + XTypedServices.Save(xmlWriter, Untyped); + } + + public static SortSimilar Load(string xmlFile) { + return XTypedServices.Load(xmlFile); + } + + public static SortSimilar Load(System.IO.TextReader xmlFile) { + return XTypedServices.Load(xmlFile); + } + + public static SortSimilar Parse(string xml) { + return XTypedServices.Parse(xml); + } + + public static explicit operator SortSimilar(XElement xe) { return XTypedServices.ToXTypedElement(xe,LinqToXsdTypeManager.Instance as ILinqToXsdTypeManager); } + + public override XTypedElement Clone() { + return XTypedServices.CloneXTypedElement(this); + } + + public SortSimilar() { + } + + public SortSimilar(bool content) { + this.TypedValue = content; + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + [EditorBrowsable(EditorBrowsableState.Never)] + protected internal static readonly System.Xml.Linq.XName TypedValueXName = System.Xml.Linq.XName.Get("TypedValue", ""); + + public virtual bool TypedValue { + get { + XElement x = this.Untyped; + return XTypedServices.ParseValue(x, XmlSchemaType.GetBuiltInSimpleType(XmlTypeCode.Boolean).Datatype); + } + set { + this.SetValue(value, XmlSchemaType.GetBuiltInSimpleType(XmlTypeCode.Boolean).Datatype); + } + } + + private static readonly System.Xml.Linq.XName xName = System.Xml.Linq.XName.Get("SortSimilar", "urn:Microsoft.Search.Query"); + + ContentModelEntity IXMetaData.GetContentModel() { + return ContentModelEntity.Default; + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + System.Xml.Linq.XName IXMetaData.SchemaName { + get { + return xName; + } + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + SchemaOrigin IXMetaData.TypeOrigin { + get { + return SchemaOrigin.Element; + } + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + ILinqToXsdTypeManager IXMetaData.TypeManager { + get { + return LinqToXsdTypeManager.Instance; + } + } + } + + /// + /// + /// This contains the name of the refiner, but you can also use an advanced syntax to apply non-default configuration values for the named refiner. For more information about the advanced syntax for the Refiner element, see Refiner Specification in the Query Web Service and Query Object Model (https://docs.microsoft.com/en-us/previous-versions/office/developer/sharepoint-2010/gg984547%28v%3doffice.14%29). + /// + /// + public partial class Refiner : XTypedElement, IXMetaData { + + public void Save(string xmlFile) { + XTypedServices.Save(xmlFile, Untyped); + } + + public void Save(System.IO.TextWriter tw) { + XTypedServices.Save(tw, Untyped); + } + + public void Save(System.Xml.XmlWriter xmlWriter) { + XTypedServices.Save(xmlWriter, Untyped); + } + + public static Refiner Load(string xmlFile) { + return XTypedServices.Load(xmlFile); + } + + public static Refiner Load(System.IO.TextReader xmlFile) { + return XTypedServices.Load(xmlFile); + } + + public static Refiner Parse(string xml) { + return XTypedServices.Parse(xml); + } + + public static explicit operator Refiner(XElement xe) { return XTypedServices.ToXTypedElement(xe,LinqToXsdTypeManager.Instance as ILinqToXsdTypeManager); } + + public override XTypedElement Clone() { + return XTypedServices.CloneXTypedElement(this); + } + + /// + /// + /// This contains the name of the refiner, but you can also use an advanced syntax to apply non-default configuration values for the named refiner. For more information about the advanced syntax for the Refiner element, see Refiner Specification in the Query Web Service and Query Object Model (https://docs.microsoft.com/en-us/previous-versions/office/developer/sharepoint-2010/gg984547%28v%3doffice.14%29). + /// + /// + public Refiner() { + } + + /// + /// + /// This contains the name of the refiner, but you can also use an advanced syntax to apply non-default configuration values for the named refiner. For more information about the advanced syntax for the Refiner element, see Refiner Specification in the Query Web Service and Query Object Model (https://docs.microsoft.com/en-us/previous-versions/office/developer/sharepoint-2010/gg984547%28v%3doffice.14%29). + /// + /// + public Refiner(string content) { + this.TypedValue = content; + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + [EditorBrowsable(EditorBrowsableState.Never)] + protected internal static readonly System.Xml.Linq.XName TypedValueXName = System.Xml.Linq.XName.Get("TypedValue", ""); + + public virtual string TypedValue { + get { + XElement x = this.Untyped; + return XTypedServices.ParseValue(x, XmlSchemaType.GetBuiltInSimpleType(XmlTypeCode.String).Datatype); + } + set { + this.SetValueWithValidation(value, "TypedValue", global::Microsoft.Search.Query.Schemas.refinerSpecification.TypeDefinition); + } + } + + private static readonly System.Xml.Linq.XName xName = System.Xml.Linq.XName.Get("Refiner", "urn:Microsoft.Search.Query"); + + ContentModelEntity IXMetaData.GetContentModel() { + return ContentModelEntity.Default; + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + System.Xml.Linq.XName IXMetaData.SchemaName { + get { + return xName; + } + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + SchemaOrigin IXMetaData.TypeOrigin { + get { + return SchemaOrigin.Element; + } + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + ILinqToXsdTypeManager IXMetaData.TypeManager { + get { + return LinqToXsdTypeManager.Instance; + } + } + } + + public partial class MaxShallowRefinementHits : XTypedElement, IXMetaData { + + public void Save(string xmlFile) { + XTypedServices.Save(xmlFile, Untyped); + } + + public void Save(System.IO.TextWriter tw) { + XTypedServices.Save(tw, Untyped); + } + + public void Save(System.Xml.XmlWriter xmlWriter) { + XTypedServices.Save(xmlWriter, Untyped); + } + + public static MaxShallowRefinementHits Load(string xmlFile) { + return XTypedServices.Load(xmlFile); + } + + public static MaxShallowRefinementHits Load(System.IO.TextReader xmlFile) { + return XTypedServices.Load(xmlFile); + } + + public static MaxShallowRefinementHits Parse(string xml) { + return XTypedServices.Parse(xml); + } + + public static explicit operator MaxShallowRefinementHits(XElement xe) { return XTypedServices.ToXTypedElement(xe,LinqToXsdTypeManager.Instance as ILinqToXsdTypeManager); } + + public override XTypedElement Clone() { + return XTypedServices.CloneXTypedElement(this); + } + + public MaxShallowRefinementHits() { + } + + public MaxShallowRefinementHits(int content) { + this.TypedValue = content; + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + [EditorBrowsable(EditorBrowsableState.Never)] + protected internal static readonly System.Xml.Linq.XName TypedValueXName = System.Xml.Linq.XName.Get("TypedValue", ""); + + public virtual int TypedValue { + get { + XElement x = this.Untyped; + return XTypedServices.ParseValue(x, XmlSchemaType.GetBuiltInSimpleType(XmlTypeCode.Int).Datatype); + } + set { + this.SetValue(value, XmlSchemaType.GetBuiltInSimpleType(XmlTypeCode.Int).Datatype); + } + } + + private static readonly System.Xml.Linq.XName xName = System.Xml.Linq.XName.Get("MaxShallowRefinementHits", "urn:Microsoft.Search.Query"); + + ContentModelEntity IXMetaData.GetContentModel() { + return ContentModelEntity.Default; + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + System.Xml.Linq.XName IXMetaData.SchemaName { + get { + return xName; + } + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + SchemaOrigin IXMetaData.TypeOrigin { + get { + return SchemaOrigin.Element; + } + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + ILinqToXsdTypeManager IXMetaData.TypeManager { + get { + return LinqToXsdTypeManager.Instance; + } + } + } + + public partial class RefinementFilter : XTypedElement, IXMetaData { + + public void Save(string xmlFile) { + XTypedServices.Save(xmlFile, Untyped); + } + + public void Save(System.IO.TextWriter tw) { + XTypedServices.Save(tw, Untyped); + } + + public void Save(System.Xml.XmlWriter xmlWriter) { + XTypedServices.Save(xmlWriter, Untyped); + } + + public static RefinementFilter Load(string xmlFile) { + return XTypedServices.Load(xmlFile); + } + + public static RefinementFilter Load(System.IO.TextReader xmlFile) { + return XTypedServices.Load(xmlFile); + } + + public static RefinementFilter Parse(string xml) { + return XTypedServices.Parse(xml); + } + + public static explicit operator RefinementFilter(XElement xe) { return XTypedServices.ToXTypedElement(xe,LinqToXsdTypeManager.Instance as ILinqToXsdTypeManager); } + + public override XTypedElement Clone() { + return XTypedServices.CloneXTypedElement(this); + } + + public RefinementFilter() { + } + + public RefinementFilter(byte[] content) { + this.TypedValue = content; + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + [EditorBrowsable(EditorBrowsableState.Never)] + protected internal static readonly System.Xml.Linq.XName TypedValueXName = System.Xml.Linq.XName.Get("TypedValue", ""); + + public virtual byte[] TypedValue { + get { + XElement x = this.Untyped; + return XTypedServices.ParseValue(x, XmlSchemaType.GetBuiltInSimpleType(XmlTypeCode.Base64Binary).Datatype); + } + set { + this.SetValue(value, XmlSchemaType.GetBuiltInSimpleType(XmlTypeCode.Base64Binary).Datatype); + } + } + + private static readonly System.Xml.Linq.XName xName = System.Xml.Linq.XName.Get("RefinementFilter", "urn:Microsoft.Search.Query"); + + ContentModelEntity IXMetaData.GetContentModel() { + return ContentModelEntity.Default; + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + System.Xml.Linq.XName IXMetaData.SchemaName { + get { + return xName; + } + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + SchemaOrigin IXMetaData.TypeOrigin { + get { + return SchemaOrigin.Element; + } + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + ILinqToXsdTypeManager IXMetaData.TypeManager { + get { + return LinqToXsdTypeManager.Instance; + } + } + } + + public partial class IgnoreAllNoiseQuery : XTypedElement, IXMetaData { + + public void Save(string xmlFile) { + XTypedServices.Save(xmlFile, Untyped); + } + + public void Save(System.IO.TextWriter tw) { + XTypedServices.Save(tw, Untyped); + } + + public void Save(System.Xml.XmlWriter xmlWriter) { + XTypedServices.Save(xmlWriter, Untyped); + } + + public static IgnoreAllNoiseQuery Load(string xmlFile) { + return XTypedServices.Load(xmlFile); + } + + public static IgnoreAllNoiseQuery Load(System.IO.TextReader xmlFile) { + return XTypedServices.Load(xmlFile); + } + + public static IgnoreAllNoiseQuery Parse(string xml) { + return XTypedServices.Parse(xml); + } + + public static explicit operator IgnoreAllNoiseQuery(XElement xe) { return XTypedServices.ToXTypedElement(xe,LinqToXsdTypeManager.Instance as ILinqToXsdTypeManager); } + + public override XTypedElement Clone() { + return XTypedServices.CloneXTypedElement(this); + } + + public IgnoreAllNoiseQuery() { + } + + public IgnoreAllNoiseQuery(bool content) { + this.TypedValue = content; + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + [EditorBrowsable(EditorBrowsableState.Never)] + protected internal static readonly System.Xml.Linq.XName TypedValueXName = System.Xml.Linq.XName.Get("TypedValue", ""); + + public virtual bool TypedValue { + get { + XElement x = this.Untyped; + return XTypedServices.ParseValue(x, XmlSchemaType.GetBuiltInSimpleType(XmlTypeCode.Boolean).Datatype); + } + set { + this.SetValue(value, XmlSchemaType.GetBuiltInSimpleType(XmlTypeCode.Boolean).Datatype); + } + } + + private static readonly System.Xml.Linq.XName xName = System.Xml.Linq.XName.Get("IgnoreAllNoiseQuery", "urn:Microsoft.Search.Query"); + + ContentModelEntity IXMetaData.GetContentModel() { + return ContentModelEntity.Default; + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + System.Xml.Linq.XName IXMetaData.SchemaName { + get { + return xName; + } + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + SchemaOrigin IXMetaData.TypeOrigin { + get { + return SchemaOrigin.Element; + } + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + ILinqToXsdTypeManager IXMetaData.TypeManager { + get { + return LinqToXsdTypeManager.Instance; + } + } + } + + public partial class IncludeRelevantResults : XTypedElement, IXMetaData { + + public void Save(string xmlFile) { + XTypedServices.Save(xmlFile, Untyped); + } + + public void Save(System.IO.TextWriter tw) { + XTypedServices.Save(tw, Untyped); + } + + public void Save(System.Xml.XmlWriter xmlWriter) { + XTypedServices.Save(xmlWriter, Untyped); + } + + public static IncludeRelevantResults Load(string xmlFile) { + return XTypedServices.Load(xmlFile); + } + + public static IncludeRelevantResults Load(System.IO.TextReader xmlFile) { + return XTypedServices.Load(xmlFile); + } + + public static IncludeRelevantResults Parse(string xml) { + return XTypedServices.Parse(xml); + } + + public static explicit operator IncludeRelevantResults(XElement xe) { return XTypedServices.ToXTypedElement(xe,LinqToXsdTypeManager.Instance as ILinqToXsdTypeManager); } + + public override XTypedElement Clone() { + return XTypedServices.CloneXTypedElement(this); + } + + public IncludeRelevantResults() { + } + + public IncludeRelevantResults(bool content) { + this.TypedValue = content; + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + [EditorBrowsable(EditorBrowsableState.Never)] + protected internal static readonly System.Xml.Linq.XName TypedValueXName = System.Xml.Linq.XName.Get("TypedValue", ""); + + public virtual bool TypedValue { + get { + XElement x = this.Untyped; + return XTypedServices.ParseValue(x, XmlSchemaType.GetBuiltInSimpleType(XmlTypeCode.Boolean).Datatype); + } + set { + this.SetValue(value, XmlSchemaType.GetBuiltInSimpleType(XmlTypeCode.Boolean).Datatype); + } + } + + private static readonly System.Xml.Linq.XName xName = System.Xml.Linq.XName.Get("IncludeRelevantResults", "urn:Microsoft.Search.Query"); + + ContentModelEntity IXMetaData.GetContentModel() { + return ContentModelEntity.Default; + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + System.Xml.Linq.XName IXMetaData.SchemaName { + get { + return xName; + } + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + SchemaOrigin IXMetaData.TypeOrigin { + get { + return SchemaOrigin.Element; + } + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + ILinqToXsdTypeManager IXMetaData.TypeManager { + get { + return LinqToXsdTypeManager.Instance; + } + } + } + + public partial class IncludeHighConfidenceResults : XTypedElement, IXMetaData { + + public void Save(string xmlFile) { + XTypedServices.Save(xmlFile, Untyped); + } + + public void Save(System.IO.TextWriter tw) { + XTypedServices.Save(tw, Untyped); + } + + public void Save(System.Xml.XmlWriter xmlWriter) { + XTypedServices.Save(xmlWriter, Untyped); + } + + public static IncludeHighConfidenceResults Load(string xmlFile) { + return XTypedServices.Load(xmlFile); + } + + public static IncludeHighConfidenceResults Load(System.IO.TextReader xmlFile) { + return XTypedServices.Load(xmlFile); + } + + public static IncludeHighConfidenceResults Parse(string xml) { + return XTypedServices.Parse(xml); + } + + public static explicit operator IncludeHighConfidenceResults(XElement xe) { return XTypedServices.ToXTypedElement(xe,LinqToXsdTypeManager.Instance as ILinqToXsdTypeManager); } + + public override XTypedElement Clone() { + return XTypedServices.CloneXTypedElement(this); + } + + public IncludeHighConfidenceResults() { + } + + public IncludeHighConfidenceResults(bool content) { + this.TypedValue = content; + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + [EditorBrowsable(EditorBrowsableState.Never)] + protected internal static readonly System.Xml.Linq.XName TypedValueXName = System.Xml.Linq.XName.Get("TypedValue", ""); + + public virtual bool TypedValue { + get { + XElement x = this.Untyped; + return XTypedServices.ParseValue(x, XmlSchemaType.GetBuiltInSimpleType(XmlTypeCode.Boolean).Datatype); + } + set { + this.SetValue(value, XmlSchemaType.GetBuiltInSimpleType(XmlTypeCode.Boolean).Datatype); + } + } + + private static readonly System.Xml.Linq.XName xName = System.Xml.Linq.XName.Get("IncludeHighConfidenceResults", "urn:Microsoft.Search.Query"); + + ContentModelEntity IXMetaData.GetContentModel() { + return ContentModelEntity.Default; + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + System.Xml.Linq.XName IXMetaData.SchemaName { + get { + return xName; + } + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + SchemaOrigin IXMetaData.TypeOrigin { + get { + return SchemaOrigin.Element; + } + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + ILinqToXsdTypeManager IXMetaData.TypeManager { + get { + return LinqToXsdTypeManager.Instance; + } + } + } + + public class LinqToXsdTypeManager : ILinqToXsdTypeManager { + + private LinqToXsdTypeManager() { + } + + private static Dictionary elementDictionary = new Dictionary(); + + private static void BuildElementDictionary() { + elementDictionary.Add(System.Xml.Linq.XName.Get("QueryPacket", "urn:Microsoft.Search.Query"), typeof(global::Microsoft.Search.Query.Schemas.QueryPacket)); + elementDictionary.Add(System.Xml.Linq.XName.Get("QueryId", "urn:Microsoft.Search.Query"), typeof(global::Microsoft.Search.Query.Schemas.QueryId)); + elementDictionary.Add(System.Xml.Linq.XName.Get("Context", "urn:Microsoft.Search.Query"), typeof(global::Microsoft.Search.Query.Schemas.Context)); + elementDictionary.Add(System.Xml.Linq.XName.Get("QueryText", "urn:Microsoft.Search.Query"), typeof(global::Microsoft.Search.Query.Schemas.QueryText)); + elementDictionary.Add(System.Xml.Linq.XName.Get("Range", "urn:Microsoft.Search.Query"), typeof(global::Microsoft.Search.Query.Schemas.Range)); + elementDictionary.Add(System.Xml.Linq.XName.Get("Properties", "urn:Microsoft.Search.Query"), typeof(global::Microsoft.Search.Query.Schemas.Properties)); + elementDictionary.Add(System.Xml.Linq.XName.Get("Property", "urn:Microsoft.Search.Query"), typeof(global::Microsoft.Search.Query.Schemas.Property)); + elementDictionary.Add(System.Xml.Linq.XName.Get("SortByProperties", "urn:Microsoft.Search.Query"), typeof(global::Microsoft.Search.Query.Schemas.SortByProperties)); + elementDictionary.Add(System.Xml.Linq.XName.Get("SortByProperty", "urn:Microsoft.Search.Query"), typeof(global::Microsoft.Search.Query.Schemas.SortByProperty)); + elementDictionary.Add(System.Xml.Linq.XName.Get("RelevanceModel", "urn:Microsoft.Search.Query"), typeof(global::Microsoft.Search.Query.Schemas.RelevanceModel)); + elementDictionary.Add(System.Xml.Linq.XName.Get("TrimDuplicates", "urn:Microsoft.Search.Query"), typeof(global::Microsoft.Search.Query.Schemas.TrimDuplicates)); + elementDictionary.Add(System.Xml.Linq.XName.Get("ResultProvider", "urn:Microsoft.Search.Query"), typeof(global::Microsoft.Search.Query.Schemas.ResultProvider)); + elementDictionary.Add(System.Xml.Linq.XName.Get("ResubmitFlags", "urn:Microsoft.Search.Query"), typeof(global::Microsoft.Search.Query.Schemas.ResubmitFlags)); + elementDictionary.Add(System.Xml.Linq.XName.Get("ResubmitFlag", "urn:Microsoft.Search.Query"), typeof(global::Microsoft.Search.Query.Schemas.ResubmitFlag)); + elementDictionary.Add(System.Xml.Linq.XName.Get("EnableSpellcheck", "urn:Microsoft.Search.Query"), typeof(global::Microsoft.Search.Query.Schemas.EnableSpellcheck)); + elementDictionary.Add(System.Xml.Linq.XName.Get("UserContext", "urn:Microsoft.Search.Query"), typeof(global::Microsoft.Search.Query.Schemas.UserContext)); + elementDictionary.Add(System.Xml.Linq.XName.Get("FindSimilar", "urn:Microsoft.Search.Query"), typeof(global::Microsoft.Search.Query.Schemas.FindSimilar)); + elementDictionary.Add(System.Xml.Linq.XName.Get("SimilarType", "urn:Microsoft.Search.Query"), typeof(global::Microsoft.Search.Query.Schemas.SimilarType)); + elementDictionary.Add(System.Xml.Linq.XName.Get("IncludeRefinementResults", "urn:Microsoft.Search.Query"), typeof(global::Microsoft.Search.Query.Schemas.IncludeRefinementResults)); + elementDictionary.Add(System.Xml.Linq.XName.Get("Refiners", "urn:Microsoft.Search.Query"), typeof(global::Microsoft.Search.Query.Schemas.Refiners)); + elementDictionary.Add(System.Xml.Linq.XName.Get("RefinementFilters", "urn:Microsoft.Search.Query"), typeof(global::Microsoft.Search.Query.Schemas.RefinementFilters)); + elementDictionary.Add(System.Xml.Linq.XName.Get("StartAt", "urn:Microsoft.Search.Query"), typeof(global::Microsoft.Search.Query.Schemas.StartAt)); + elementDictionary.Add(System.Xml.Linq.XName.Get("Count", "urn:Microsoft.Search.Query"), typeof(global::Microsoft.Search.Query.Schemas.Count)); + elementDictionary.Add(System.Xml.Linq.XName.Get("ImplicitAndBehavior", "urn:Microsoft.Search.Query"), typeof(global::Microsoft.Search.Query.Schemas.ImplicitAndBehavior)); + elementDictionary.Add(System.Xml.Linq.XName.Get("EnableStemming", "urn:Microsoft.Search.Query"), typeof(global::Microsoft.Search.Query.Schemas.EnableStemming)); + elementDictionary.Add(System.Xml.Linq.XName.Get("IncludeSpecialTermResults", "urn:Microsoft.Search.Query"), typeof(global::Microsoft.Search.Query.Schemas.IncludeSpecialTermResults)); + elementDictionary.Add(System.Xml.Linq.XName.Get("PreQuerySuggestions", "urn:Microsoft.Search.Query"), typeof(global::Microsoft.Search.Query.Schemas.PreQuerySuggestions)); + elementDictionary.Add(System.Xml.Linq.XName.Get("HighlightQuerySuggestions", "urn:Microsoft.Search.Query"), typeof(global::Microsoft.Search.Query.Schemas.HighlightQuerySuggestions)); + elementDictionary.Add(System.Xml.Linq.XName.Get("CapitalizeFirstLetters", "urn:Microsoft.Search.Query"), typeof(global::Microsoft.Search.Query.Schemas.CapitalizeFirstLetters)); + elementDictionary.Add(System.Xml.Linq.XName.Get("UserContextData", "urn:Microsoft.Search.Query"), typeof(global::Microsoft.Search.Query.Schemas.UserContextData)); + elementDictionary.Add(System.Xml.Linq.XName.Get("SimilarTo", "urn:Microsoft.Search.Query"), typeof(global::Microsoft.Search.Query.Schemas.SimilarTo)); + elementDictionary.Add(System.Xml.Linq.XName.Get("SortSimilar", "urn:Microsoft.Search.Query"), typeof(global::Microsoft.Search.Query.Schemas.SortSimilar)); + elementDictionary.Add(System.Xml.Linq.XName.Get("Refiner", "urn:Microsoft.Search.Query"), typeof(global::Microsoft.Search.Query.Schemas.Refiner)); + elementDictionary.Add(System.Xml.Linq.XName.Get("MaxShallowRefinementHits", "urn:Microsoft.Search.Query"), typeof(global::Microsoft.Search.Query.Schemas.MaxShallowRefinementHits)); + elementDictionary.Add(System.Xml.Linq.XName.Get("RefinementFilter", "urn:Microsoft.Search.Query"), typeof(global::Microsoft.Search.Query.Schemas.RefinementFilter)); + elementDictionary.Add(System.Xml.Linq.XName.Get("IgnoreAllNoiseQuery", "urn:Microsoft.Search.Query"), typeof(global::Microsoft.Search.Query.Schemas.IgnoreAllNoiseQuery)); + elementDictionary.Add(System.Xml.Linq.XName.Get("IncludeRelevantResults", "urn:Microsoft.Search.Query"), typeof(global::Microsoft.Search.Query.Schemas.IncludeRelevantResults)); + elementDictionary.Add(System.Xml.Linq.XName.Get("IncludeHighConfidenceResults", "urn:Microsoft.Search.Query"), typeof(global::Microsoft.Search.Query.Schemas.IncludeHighConfidenceResults)); + } + + private static XmlSchemaSet schemaSet; + + XmlSchemaSet ILinqToXsdTypeManager.Schemas { + get { + if ((schemaSet == null)) { + XmlSchemaSet tempSet = new XmlSchemaSet(); + System.Threading.Interlocked.CompareExchange(ref schemaSet, tempSet, null); + } + return schemaSet; + } + set { + schemaSet = value; + } + } + + protected internal static void AddSchemas(XmlSchemaSet schemas) { + schemas.Add(schemaSet); + } + + Dictionary ILinqToXsdTypeManager.GlobalTypeDictionary { + get { + return XTypedServices.EmptyDictionary; + } + } + + Dictionary ILinqToXsdTypeManager.GlobalElementDictionary { + get { + return elementDictionary; + } + } + + Dictionary ILinqToXsdTypeManager.RootContentTypeMapping { + get { + return XTypedServices.EmptyTypeMappingDictionary; + } + } + + static LinqToXsdTypeManager() { + BuildElementDictionary(); + } + + public static System.Type GetRootType() { + return elementDictionary[System.Xml.Linq.XName.Get("QueryPacket", "urn:Microsoft.Search.Query")]; + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + private static LinqToXsdTypeManager typeManagerSingleton = new LinqToXsdTypeManager(); + + public static LinqToXsdTypeManager Instance { + get { + return typeManagerSingleton; + } + } + } + + public partial class XRootNamespace { + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + private XDocument doc; + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + private XTypedElement rootObject; + + private XRootNamespace() { + } + + public static XRootNamespace Load(string xmlFile) { + XRootNamespace root = new XRootNamespace(); + root.doc = XDocument.Load(xmlFile); + XTypedElement typedRoot = XTypedServices.ToXTypedElement(root.doc.Root, LinqToXsdTypeManager.Instance); + if ((typedRoot == null)) { + throw new LinqToXsdException("Invalid root element in xml document."); + } + root.rootObject = typedRoot; + return root; + } + + public static XRootNamespace Load(string xmlFile, LoadOptions options) { + XRootNamespace root = new XRootNamespace(); + root.doc = XDocument.Load(xmlFile, options); + XTypedElement typedRoot = XTypedServices.ToXTypedElement(root.doc.Root, LinqToXsdTypeManager.Instance); + if ((typedRoot == null)) { + throw new LinqToXsdException("Invalid root element in xml document."); + } + root.rootObject = typedRoot; + return root; + } + + public static XRootNamespace Load(TextReader textReader) { + XRootNamespace root = new XRootNamespace(); + root.doc = XDocument.Load(textReader); + XTypedElement typedRoot = XTypedServices.ToXTypedElement(root.doc.Root, LinqToXsdTypeManager.Instance); + if ((typedRoot == null)) { + throw new LinqToXsdException("Invalid root element in xml document."); + } + root.rootObject = typedRoot; + return root; + } + + public static XRootNamespace Load(TextReader textReader, LoadOptions options) { + XRootNamespace root = new XRootNamespace(); + root.doc = XDocument.Load(textReader, options); + XTypedElement typedRoot = XTypedServices.ToXTypedElement(root.doc.Root, LinqToXsdTypeManager.Instance); + if ((typedRoot == null)) { + throw new LinqToXsdException("Invalid root element in xml document."); + } + root.rootObject = typedRoot; + return root; + } + + public static XRootNamespace Load(XmlReader xmlReader) { + XRootNamespace root = new XRootNamespace(); + root.doc = XDocument.Load(xmlReader); + XTypedElement typedRoot = XTypedServices.ToXTypedElement(root.doc.Root, LinqToXsdTypeManager.Instance); + if ((typedRoot == null)) { + throw new LinqToXsdException("Invalid root element in xml document."); + } + root.rootObject = typedRoot; + return root; + } + + public static XRootNamespace Parse(string text) { + XRootNamespace root = new XRootNamespace(); + root.doc = XDocument.Parse(text); + XTypedElement typedRoot = XTypedServices.ToXTypedElement(root.doc.Root, LinqToXsdTypeManager.Instance); + if ((typedRoot == null)) { + throw new LinqToXsdException("Invalid root element in xml document."); + } + root.rootObject = typedRoot; + return root; + } + + public static XRootNamespace Parse(string text, LoadOptions options) { + XRootNamespace root = new XRootNamespace(); + root.doc = XDocument.Parse(text, options); + XTypedElement typedRoot = XTypedServices.ToXTypedElement(root.doc.Root, LinqToXsdTypeManager.Instance); + if ((typedRoot == null)) { + throw new LinqToXsdException("Invalid root element in xml document."); + } + root.rootObject = typedRoot; + return root; + } + + public virtual void Save(string fileName) { + doc.Save(fileName); + } + + public virtual void Save(TextWriter textWriter) { + doc.Save(textWriter); + } + + public virtual void Save(XmlWriter writer) { + doc.Save(writer); + } + + public virtual void Save(TextWriter textWriter, SaveOptions options) { + doc.Save(textWriter, options); + } + + public virtual void Save(string fileName, SaveOptions options) { + doc.Save(fileName, options); + } + + public virtual XDocument XDocument { + get { + return doc; + } + } + + public virtual XTypedElement Root { + get { + return rootObject; + } + } + + public XRootNamespace(QueryPacket root) { + this.doc = new XDocument(root.Untyped); + this.rootObject = root; + } + + + public QueryPacket QueryPacket { get {return rootObject as QueryPacket; } } + + public XRootNamespace(QueryId root) { + this.doc = new XDocument(root.Untyped); + this.rootObject = root; + } + + + public QueryId QueryId { get {return rootObject as QueryId; } } + + public XRootNamespace(Context root) { + this.doc = new XDocument(root.Untyped); + this.rootObject = root; + } + + + public Context Context { get {return rootObject as Context; } } + + public XRootNamespace(QueryText root) { + this.doc = new XDocument(root.Untyped); + this.rootObject = root; + } + + + public QueryText QueryText { get {return rootObject as QueryText; } } + + public XRootNamespace(Range root) { + this.doc = new XDocument(root.Untyped); + this.rootObject = root; + } + + + public Range Range { get {return rootObject as Range; } } + + public XRootNamespace(Properties root) { + this.doc = new XDocument(root.Untyped); + this.rootObject = root; + } + + + public Properties Properties { get {return rootObject as Properties; } } + + public XRootNamespace(Property root) { + this.doc = new XDocument(root.Untyped); + this.rootObject = root; + } + + + public Property Property { get {return rootObject as Property; } } + + public XRootNamespace(SortByProperties root) { + this.doc = new XDocument(root.Untyped); + this.rootObject = root; + } + + + public SortByProperties SortByProperties { get {return rootObject as SortByProperties; } } + + public XRootNamespace(SortByProperty root) { + this.doc = new XDocument(root.Untyped); + this.rootObject = root; + } + + + public SortByProperty SortByProperty { get {return rootObject as SortByProperty; } } + + public XRootNamespace(RelevanceModel root) { + this.doc = new XDocument(root.Untyped); + this.rootObject = root; + } + + + public RelevanceModel RelevanceModel { get {return rootObject as RelevanceModel; } } + + public XRootNamespace(TrimDuplicates root) { + this.doc = new XDocument(root.Untyped); + this.rootObject = root; + } + + + public TrimDuplicates TrimDuplicates { get {return rootObject as TrimDuplicates; } } + + public XRootNamespace(ResultProvider root) { + this.doc = new XDocument(root.Untyped); + this.rootObject = root; + } + + + public ResultProvider ResultProvider { get {return rootObject as ResultProvider; } } + + public XRootNamespace(ResubmitFlags root) { + this.doc = new XDocument(root.Untyped); + this.rootObject = root; + } + + + public ResubmitFlags ResubmitFlags { get {return rootObject as ResubmitFlags; } } + + public XRootNamespace(ResubmitFlag root) { + this.doc = new XDocument(root.Untyped); + this.rootObject = root; + } + + + public ResubmitFlag ResubmitFlag { get {return rootObject as ResubmitFlag; } } + + public XRootNamespace(EnableSpellcheck root) { + this.doc = new XDocument(root.Untyped); + this.rootObject = root; + } + + + public EnableSpellcheck EnableSpellcheck { get {return rootObject as EnableSpellcheck; } } + + public XRootNamespace(UserContext root) { + this.doc = new XDocument(root.Untyped); + this.rootObject = root; + } + + + public UserContext UserContext { get {return rootObject as UserContext; } } + + public XRootNamespace(FindSimilar root) { + this.doc = new XDocument(root.Untyped); + this.rootObject = root; + } + + + public FindSimilar FindSimilar { get {return rootObject as FindSimilar; } } + + public XRootNamespace(SimilarType root) { + this.doc = new XDocument(root.Untyped); + this.rootObject = root; + } + + + public SimilarType SimilarType { get {return rootObject as SimilarType; } } + + public XRootNamespace(IncludeRefinementResults root) { + this.doc = new XDocument(root.Untyped); + this.rootObject = root; + } + + + public IncludeRefinementResults IncludeRefinementResults { get {return rootObject as IncludeRefinementResults; } } + + public XRootNamespace(Refiners root) { + this.doc = new XDocument(root.Untyped); + this.rootObject = root; + } + + + public Refiners Refiners { get {return rootObject as Refiners; } } + + public XRootNamespace(RefinementFilters root) { + this.doc = new XDocument(root.Untyped); + this.rootObject = root; + } + + + public RefinementFilters RefinementFilters { get {return rootObject as RefinementFilters; } } + + public XRootNamespace(StartAt root) { + this.doc = new XDocument(root.Untyped); + this.rootObject = root; + } + + + public StartAt StartAt { get {return rootObject as StartAt; } } + + public XRootNamespace(Count root) { + this.doc = new XDocument(root.Untyped); + this.rootObject = root; + } + + + public Count Count { get {return rootObject as Count; } } + + public XRootNamespace(ImplicitAndBehavior root) { + this.doc = new XDocument(root.Untyped); + this.rootObject = root; + } + + + public ImplicitAndBehavior ImplicitAndBehavior { get {return rootObject as ImplicitAndBehavior; } } + + public XRootNamespace(EnableStemming root) { + this.doc = new XDocument(root.Untyped); + this.rootObject = root; + } + + + public EnableStemming EnableStemming { get {return rootObject as EnableStemming; } } + + public XRootNamespace(IncludeSpecialTermResults root) { + this.doc = new XDocument(root.Untyped); + this.rootObject = root; + } + + + public IncludeSpecialTermResults IncludeSpecialTermResults { get {return rootObject as IncludeSpecialTermResults; } } + + public XRootNamespace(PreQuerySuggestions root) { + this.doc = new XDocument(root.Untyped); + this.rootObject = root; + } + + + public PreQuerySuggestions PreQuerySuggestions { get {return rootObject as PreQuerySuggestions; } } + + public XRootNamespace(HighlightQuerySuggestions root) { + this.doc = new XDocument(root.Untyped); + this.rootObject = root; + } + + + public HighlightQuerySuggestions HighlightQuerySuggestions { get {return rootObject as HighlightQuerySuggestions; } } + + public XRootNamespace(CapitalizeFirstLetters root) { + this.doc = new XDocument(root.Untyped); + this.rootObject = root; + } + + + public CapitalizeFirstLetters CapitalizeFirstLetters { get {return rootObject as CapitalizeFirstLetters; } } + + public XRootNamespace(UserContextData root) { + this.doc = new XDocument(root.Untyped); + this.rootObject = root; + } + + + public UserContextData UserContextData { get {return rootObject as UserContextData; } } + + public XRootNamespace(SimilarTo root) { + this.doc = new XDocument(root.Untyped); + this.rootObject = root; + } + + + public SimilarTo SimilarTo { get {return rootObject as SimilarTo; } } + + public XRootNamespace(SortSimilar root) { + this.doc = new XDocument(root.Untyped); + this.rootObject = root; + } + + + public SortSimilar SortSimilar { get {return rootObject as SortSimilar; } } + + public XRootNamespace(Refiner root) { + this.doc = new XDocument(root.Untyped); + this.rootObject = root; + } + + + public Refiner Refiner { get {return rootObject as Refiner; } } + + public XRootNamespace(MaxShallowRefinementHits root) { + this.doc = new XDocument(root.Untyped); + this.rootObject = root; + } + + + public MaxShallowRefinementHits MaxShallowRefinementHits { get {return rootObject as MaxShallowRefinementHits; } } + + public XRootNamespace(RefinementFilter root) { + this.doc = new XDocument(root.Untyped); + this.rootObject = root; + } + + + public RefinementFilter RefinementFilter { get {return rootObject as RefinementFilter; } } + + public XRootNamespace(IgnoreAllNoiseQuery root) { + this.doc = new XDocument(root.Untyped); + this.rootObject = root; + } + + + public IgnoreAllNoiseQuery IgnoreAllNoiseQuery { get {return rootObject as IgnoreAllNoiseQuery; } } + + public XRootNamespace(IncludeRelevantResults root) { + this.doc = new XDocument(root.Untyped); + this.rootObject = root; + } + + + public IncludeRelevantResults IncludeRelevantResults { get {return rootObject as IncludeRelevantResults; } } + + public XRootNamespace(IncludeHighConfidenceResults root) { + this.doc = new XDocument(root.Untyped); + this.rootObject = root; + } + + + public IncludeHighConfidenceResults IncludeHighConfidenceResults { get {return rootObject as IncludeHighConfidenceResults; } } + } + + public partial class XRoot { + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + private XDocument doc; + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + private XTypedElement rootObject; + + private XRoot() { + } + + public static XRoot Load(string xmlFile) { + XRoot root = new XRoot(); + root.doc = XDocument.Load(xmlFile); + XTypedElement typedRoot = XTypedServices.ToXTypedElement(root.doc.Root, LinqToXsdTypeManager.Instance); + if ((typedRoot == null)) { + throw new LinqToXsdException("Invalid root element in xml document."); + } + root.rootObject = typedRoot; + return root; + } + + public static XRoot Load(string xmlFile, LoadOptions options) { + XRoot root = new XRoot(); + root.doc = XDocument.Load(xmlFile, options); + XTypedElement typedRoot = XTypedServices.ToXTypedElement(root.doc.Root, LinqToXsdTypeManager.Instance); + if ((typedRoot == null)) { + throw new LinqToXsdException("Invalid root element in xml document."); + } + root.rootObject = typedRoot; + return root; + } + + public static XRoot Load(TextReader textReader) { + XRoot root = new XRoot(); + root.doc = XDocument.Load(textReader); + XTypedElement typedRoot = XTypedServices.ToXTypedElement(root.doc.Root, LinqToXsdTypeManager.Instance); + if ((typedRoot == null)) { + throw new LinqToXsdException("Invalid root element in xml document."); + } + root.rootObject = typedRoot; + return root; + } + + public static XRoot Load(TextReader textReader, LoadOptions options) { + XRoot root = new XRoot(); + root.doc = XDocument.Load(textReader, options); + XTypedElement typedRoot = XTypedServices.ToXTypedElement(root.doc.Root, LinqToXsdTypeManager.Instance); + if ((typedRoot == null)) { + throw new LinqToXsdException("Invalid root element in xml document."); + } + root.rootObject = typedRoot; + return root; + } + + public static XRoot Load(XmlReader xmlReader) { + XRoot root = new XRoot(); + root.doc = XDocument.Load(xmlReader); + XTypedElement typedRoot = XTypedServices.ToXTypedElement(root.doc.Root, LinqToXsdTypeManager.Instance); + if ((typedRoot == null)) { + throw new LinqToXsdException("Invalid root element in xml document."); + } + root.rootObject = typedRoot; + return root; + } + + public static XRoot Parse(string text) { + XRoot root = new XRoot(); + root.doc = XDocument.Parse(text); + XTypedElement typedRoot = XTypedServices.ToXTypedElement(root.doc.Root, LinqToXsdTypeManager.Instance); + if ((typedRoot == null)) { + throw new LinqToXsdException("Invalid root element in xml document."); + } + root.rootObject = typedRoot; + return root; + } + + public static XRoot Parse(string text, LoadOptions options) { + XRoot root = new XRoot(); + root.doc = XDocument.Parse(text, options); + XTypedElement typedRoot = XTypedServices.ToXTypedElement(root.doc.Root, LinqToXsdTypeManager.Instance); + if ((typedRoot == null)) { + throw new LinqToXsdException("Invalid root element in xml document."); + } + root.rootObject = typedRoot; + return root; + } + + public virtual void Save(string fileName) { + doc.Save(fileName); + } + + public virtual void Save(TextWriter textWriter) { + doc.Save(textWriter); + } + + public virtual void Save(XmlWriter writer) { + doc.Save(writer); + } + + public virtual void Save(TextWriter textWriter, SaveOptions options) { + doc.Save(textWriter, options); + } + + public virtual void Save(string fileName, SaveOptions options) { + doc.Save(fileName, options); + } + + public virtual XDocument XDocument { + get { + return doc; + } + } + + public virtual XTypedElement Root { + get { + return rootObject; + } + } + + public XRoot(global::Microsoft.Search.Query.Schemas.QueryPacket root) { + this.doc = new XDocument(root.Untyped); + this.rootObject = root; + } + + + public global::Microsoft.Search.Query.Schemas.QueryPacket QueryPacket { get {return rootObject as global::Microsoft.Search.Query.Schemas.QueryPacket; } } + + public XRoot(global::Microsoft.Search.Query.Schemas.QueryId root) { + this.doc = new XDocument(root.Untyped); + this.rootObject = root; + } + + + public global::Microsoft.Search.Query.Schemas.QueryId QueryId { get {return rootObject as global::Microsoft.Search.Query.Schemas.QueryId; } } + + public XRoot(global::Microsoft.Search.Query.Schemas.Context root) { + this.doc = new XDocument(root.Untyped); + this.rootObject = root; + } + + + public global::Microsoft.Search.Query.Schemas.Context Context { get {return rootObject as global::Microsoft.Search.Query.Schemas.Context; } } + + public XRoot(global::Microsoft.Search.Query.Schemas.QueryText root) { + this.doc = new XDocument(root.Untyped); + this.rootObject = root; + } + + + public global::Microsoft.Search.Query.Schemas.QueryText QueryText { get {return rootObject as global::Microsoft.Search.Query.Schemas.QueryText; } } + + public XRoot(global::Microsoft.Search.Query.Schemas.Range root) { + this.doc = new XDocument(root.Untyped); + this.rootObject = root; + } + + + public global::Microsoft.Search.Query.Schemas.Range Range { get {return rootObject as global::Microsoft.Search.Query.Schemas.Range; } } + + public XRoot(global::Microsoft.Search.Query.Schemas.Properties root) { + this.doc = new XDocument(root.Untyped); + this.rootObject = root; + } + + + public global::Microsoft.Search.Query.Schemas.Properties Properties { get {return rootObject as global::Microsoft.Search.Query.Schemas.Properties; } } + + public XRoot(global::Microsoft.Search.Query.Schemas.Property root) { + this.doc = new XDocument(root.Untyped); + this.rootObject = root; + } + + + public global::Microsoft.Search.Query.Schemas.Property Property { get {return rootObject as global::Microsoft.Search.Query.Schemas.Property; } } + + public XRoot(global::Microsoft.Search.Query.Schemas.SortByProperties root) { + this.doc = new XDocument(root.Untyped); + this.rootObject = root; + } + + + public global::Microsoft.Search.Query.Schemas.SortByProperties SortByProperties { get {return rootObject as global::Microsoft.Search.Query.Schemas.SortByProperties; } } + + public XRoot(global::Microsoft.Search.Query.Schemas.SortByProperty root) { + this.doc = new XDocument(root.Untyped); + this.rootObject = root; + } + + + public global::Microsoft.Search.Query.Schemas.SortByProperty SortByProperty { get {return rootObject as global::Microsoft.Search.Query.Schemas.SortByProperty; } } + + public XRoot(global::Microsoft.Search.Query.Schemas.RelevanceModel root) { + this.doc = new XDocument(root.Untyped); + this.rootObject = root; + } + + + public global::Microsoft.Search.Query.Schemas.RelevanceModel RelevanceModel { get {return rootObject as global::Microsoft.Search.Query.Schemas.RelevanceModel; } } + + public XRoot(global::Microsoft.Search.Query.Schemas.TrimDuplicates root) { + this.doc = new XDocument(root.Untyped); + this.rootObject = root; + } + + + public global::Microsoft.Search.Query.Schemas.TrimDuplicates TrimDuplicates { get {return rootObject as global::Microsoft.Search.Query.Schemas.TrimDuplicates; } } + + public XRoot(global::Microsoft.Search.Query.Schemas.ResultProvider root) { + this.doc = new XDocument(root.Untyped); + this.rootObject = root; + } + + + public global::Microsoft.Search.Query.Schemas.ResultProvider ResultProvider { get {return rootObject as global::Microsoft.Search.Query.Schemas.ResultProvider; } } + + public XRoot(global::Microsoft.Search.Query.Schemas.ResubmitFlags root) { + this.doc = new XDocument(root.Untyped); + this.rootObject = root; + } + + + public global::Microsoft.Search.Query.Schemas.ResubmitFlags ResubmitFlags { get {return rootObject as global::Microsoft.Search.Query.Schemas.ResubmitFlags; } } + + public XRoot(global::Microsoft.Search.Query.Schemas.ResubmitFlag root) { + this.doc = new XDocument(root.Untyped); + this.rootObject = root; + } + + + public global::Microsoft.Search.Query.Schemas.ResubmitFlag ResubmitFlag { get {return rootObject as global::Microsoft.Search.Query.Schemas.ResubmitFlag; } } + + public XRoot(global::Microsoft.Search.Query.Schemas.EnableSpellcheck root) { + this.doc = new XDocument(root.Untyped); + this.rootObject = root; + } + + + public global::Microsoft.Search.Query.Schemas.EnableSpellcheck EnableSpellcheck { get {return rootObject as global::Microsoft.Search.Query.Schemas.EnableSpellcheck; } } + + public XRoot(global::Microsoft.Search.Query.Schemas.UserContext root) { + this.doc = new XDocument(root.Untyped); + this.rootObject = root; + } + + + public global::Microsoft.Search.Query.Schemas.UserContext UserContext { get {return rootObject as global::Microsoft.Search.Query.Schemas.UserContext; } } + + public XRoot(global::Microsoft.Search.Query.Schemas.FindSimilar root) { + this.doc = new XDocument(root.Untyped); + this.rootObject = root; + } + + + public global::Microsoft.Search.Query.Schemas.FindSimilar FindSimilar { get {return rootObject as global::Microsoft.Search.Query.Schemas.FindSimilar; } } + + public XRoot(global::Microsoft.Search.Query.Schemas.SimilarType root) { + this.doc = new XDocument(root.Untyped); + this.rootObject = root; + } + + + public global::Microsoft.Search.Query.Schemas.SimilarType SimilarType { get {return rootObject as global::Microsoft.Search.Query.Schemas.SimilarType; } } + + public XRoot(global::Microsoft.Search.Query.Schemas.IncludeRefinementResults root) { + this.doc = new XDocument(root.Untyped); + this.rootObject = root; + } + + + public global::Microsoft.Search.Query.Schemas.IncludeRefinementResults IncludeRefinementResults { get {return rootObject as global::Microsoft.Search.Query.Schemas.IncludeRefinementResults; } } + + public XRoot(global::Microsoft.Search.Query.Schemas.Refiners root) { + this.doc = new XDocument(root.Untyped); + this.rootObject = root; + } + + + public global::Microsoft.Search.Query.Schemas.Refiners Refiners { get {return rootObject as global::Microsoft.Search.Query.Schemas.Refiners; } } + + public XRoot(global::Microsoft.Search.Query.Schemas.RefinementFilters root) { + this.doc = new XDocument(root.Untyped); + this.rootObject = root; + } + + + public global::Microsoft.Search.Query.Schemas.RefinementFilters RefinementFilters { get {return rootObject as global::Microsoft.Search.Query.Schemas.RefinementFilters; } } + + public XRoot(global::Microsoft.Search.Query.Schemas.StartAt root) { + this.doc = new XDocument(root.Untyped); + this.rootObject = root; + } + + + public global::Microsoft.Search.Query.Schemas.StartAt StartAt { get {return rootObject as global::Microsoft.Search.Query.Schemas.StartAt; } } + + public XRoot(global::Microsoft.Search.Query.Schemas.Count root) { + this.doc = new XDocument(root.Untyped); + this.rootObject = root; + } + + + public global::Microsoft.Search.Query.Schemas.Count Count { get {return rootObject as global::Microsoft.Search.Query.Schemas.Count; } } + + public XRoot(global::Microsoft.Search.Query.Schemas.ImplicitAndBehavior root) { + this.doc = new XDocument(root.Untyped); + this.rootObject = root; + } + + + public global::Microsoft.Search.Query.Schemas.ImplicitAndBehavior ImplicitAndBehavior { get {return rootObject as global::Microsoft.Search.Query.Schemas.ImplicitAndBehavior; } } + + public XRoot(global::Microsoft.Search.Query.Schemas.EnableStemming root) { + this.doc = new XDocument(root.Untyped); + this.rootObject = root; + } + + + public global::Microsoft.Search.Query.Schemas.EnableStemming EnableStemming { get {return rootObject as global::Microsoft.Search.Query.Schemas.EnableStemming; } } + + public XRoot(global::Microsoft.Search.Query.Schemas.IncludeSpecialTermResults root) { + this.doc = new XDocument(root.Untyped); + this.rootObject = root; + } + + + public global::Microsoft.Search.Query.Schemas.IncludeSpecialTermResults IncludeSpecialTermResults { get {return rootObject as global::Microsoft.Search.Query.Schemas.IncludeSpecialTermResults; } } + + public XRoot(global::Microsoft.Search.Query.Schemas.PreQuerySuggestions root) { + this.doc = new XDocument(root.Untyped); + this.rootObject = root; + } + + + public global::Microsoft.Search.Query.Schemas.PreQuerySuggestions PreQuerySuggestions { get {return rootObject as global::Microsoft.Search.Query.Schemas.PreQuerySuggestions; } } + + public XRoot(global::Microsoft.Search.Query.Schemas.HighlightQuerySuggestions root) { + this.doc = new XDocument(root.Untyped); + this.rootObject = root; + } + + + public global::Microsoft.Search.Query.Schemas.HighlightQuerySuggestions HighlightQuerySuggestions { get {return rootObject as global::Microsoft.Search.Query.Schemas.HighlightQuerySuggestions; } } + + public XRoot(global::Microsoft.Search.Query.Schemas.CapitalizeFirstLetters root) { + this.doc = new XDocument(root.Untyped); + this.rootObject = root; + } + + + public global::Microsoft.Search.Query.Schemas.CapitalizeFirstLetters CapitalizeFirstLetters { get {return rootObject as global::Microsoft.Search.Query.Schemas.CapitalizeFirstLetters; } } + + public XRoot(global::Microsoft.Search.Query.Schemas.UserContextData root) { + this.doc = new XDocument(root.Untyped); + this.rootObject = root; + } + + + public global::Microsoft.Search.Query.Schemas.UserContextData UserContextData { get {return rootObject as global::Microsoft.Search.Query.Schemas.UserContextData; } } + + public XRoot(global::Microsoft.Search.Query.Schemas.SimilarTo root) { + this.doc = new XDocument(root.Untyped); + this.rootObject = root; + } + + + public global::Microsoft.Search.Query.Schemas.SimilarTo SimilarTo { get {return rootObject as global::Microsoft.Search.Query.Schemas.SimilarTo; } } + + public XRoot(global::Microsoft.Search.Query.Schemas.SortSimilar root) { + this.doc = new XDocument(root.Untyped); + this.rootObject = root; + } + + + public global::Microsoft.Search.Query.Schemas.SortSimilar SortSimilar { get {return rootObject as global::Microsoft.Search.Query.Schemas.SortSimilar; } } + + public XRoot(global::Microsoft.Search.Query.Schemas.Refiner root) { + this.doc = new XDocument(root.Untyped); + this.rootObject = root; + } + + + public global::Microsoft.Search.Query.Schemas.Refiner Refiner { get {return rootObject as global::Microsoft.Search.Query.Schemas.Refiner; } } + + public XRoot(global::Microsoft.Search.Query.Schemas.MaxShallowRefinementHits root) { + this.doc = new XDocument(root.Untyped); + this.rootObject = root; + } + + + public global::Microsoft.Search.Query.Schemas.MaxShallowRefinementHits MaxShallowRefinementHits { get {return rootObject as global::Microsoft.Search.Query.Schemas.MaxShallowRefinementHits; } } + + public XRoot(global::Microsoft.Search.Query.Schemas.RefinementFilter root) { + this.doc = new XDocument(root.Untyped); + this.rootObject = root; + } + + + public global::Microsoft.Search.Query.Schemas.RefinementFilter RefinementFilter { get {return rootObject as global::Microsoft.Search.Query.Schemas.RefinementFilter; } } + + public XRoot(global::Microsoft.Search.Query.Schemas.IgnoreAllNoiseQuery root) { + this.doc = new XDocument(root.Untyped); + this.rootObject = root; + } + + + public global::Microsoft.Search.Query.Schemas.IgnoreAllNoiseQuery IgnoreAllNoiseQuery { get {return rootObject as global::Microsoft.Search.Query.Schemas.IgnoreAllNoiseQuery; } } + + public XRoot(global::Microsoft.Search.Query.Schemas.IncludeRelevantResults root) { + this.doc = new XDocument(root.Untyped); + this.rootObject = root; + } + + + public global::Microsoft.Search.Query.Schemas.IncludeRelevantResults IncludeRelevantResults { get {return rootObject as global::Microsoft.Search.Query.Schemas.IncludeRelevantResults; } } + + public XRoot(global::Microsoft.Search.Query.Schemas.IncludeHighConfidenceResults root) { + this.doc = new XDocument(root.Untyped); + this.rootObject = root; + } + + + public global::Microsoft.Search.Query.Schemas.IncludeHighConfidenceResults IncludeHighConfidenceResults { get {return rootObject as global::Microsoft.Search.Query.Schemas.IncludeHighConfidenceResults; } } + } +} diff --git a/XObjectsCode/Src/Scriban/ScribanGlobals.cs b/XObjectsCode/Src/Scriban/ScribanGlobals.cs new file mode 100644 index 0000000..aaa3193 --- /dev/null +++ b/XObjectsCode/Src/Scriban/ScribanGlobals.cs @@ -0,0 +1,246 @@ +#nullable enable +using System.CodeDom; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using System.Text.RegularExpressions; +using Scriban; + +namespace Xml.Schema.Linq.CodeGen.Scriban; + +static class ScribanGlobals +{ + public static void Comments(TemplateContext ctx, object target) + { + var comments = target switch + { + CodeTypeDeclaration decl => decl.Comments, + CodeTypeMember m => m.Comments, + _ => null, + }; + + if (comments == null || comments.Count == 0) + return; + + foreach (CodeCommentStatement c in comments) + ctx.Write($"/// {c.Comment.Text.Replace("\n", "\n///")}\n"); + ctx.ResetPreviousNewLine(); + ctx.Write(ctx.CurrentIndent); + } + + public static IEnumerable Classes(CodeTypeDeclaration type) + { + return type.Members + .OfType() + .Where(x => !x.IsEnum && !x.Name.EndsWith("EnumValidator")); + } + + public static CodeTypeDeclaration EnumDecl(string enumName, CodeTypeDeclaration type) + { + enumName = enumName.TrimEnd('?'); + return type.Members + .OfType() + .First(x => x.IsEnum && x.Name == enumName); + } + + public static CodeConstructor? Ctor(CodeTypeDeclaration type, int args = 0) + { + return type.Members + .OfType() + .FirstOrDefault(x => x.Parameters.Count == args); + } + + public static IEnumerable Properties(CodeTypeDeclaration type) + { + return type.Members + .OfType() + .Where(x => + // Exclude properties like SchemaName, TypeOrigin or TypeManager + !x.CustomAttributes.Cast().Any(a => a.Name == "DebuggerBrowsable") && + x.Name != "TypedValue"); + } + + public static bool IsList(CodeMemberProperty prop) + { + return prop.Type.BaseType == "IList`1"; + } + + public static bool IsElement(CodeMemberProperty prop) + { + return IsList(prop) || + prop.GetStatements[0] is CodeVariableDeclarationStatement { Type.BaseType: "XElement" }; + } + + public static IEnumerable Elements(CodeTypeDeclaration type) + { + return Properties(type).Where(IsElement); + } + + public static bool HasElements(CodeTypeDeclaration type) + { + return Elements(type).Any(); + } + + public static bool IsOptional(CodeMemberProperty prop) + { + return prop.Comments + .Cast() + .Any(x => x.Comment.Text.Contains("Occurrence: optional")); + } + + public static bool IsTypeDefinition(CodeTypeDeclaration type) + { + return type.TypeAttributes.HasFlag(TypeAttributes.Sealed); + } + + public static string? Validator(CodeTypeDeclaration type) + { + var statement = type.Members + .OfType() + .First(x => x.Name == "TypedValue") + .SetStatements[0]; + + if (statement is not CodeExpressionStatement + { + Expression: CodeMethodInvokeExpression + { + Method.MethodName: "SetValueWithValidation", + Parameters: [_, _, CodeFieldReferenceExpression + { + TargetObject: CodeTypeReferenceExpression + { + Type: var typeRef + } + }] + } + }) + return null; + + return typeRef.BaseType; + } + + public static string? SimpleType(CodeTypeDeclaration type) + { + var typeDecl = type.Members + .OfType() + .FirstOrDefault(x => x.Name == "TypedValue") + ?.Type; + return typeDecl != null ? TypeName(typeDecl, nullable: false) : null; + } + + public static IEnumerable EnumValues(CodeTypeDeclaration enumType) + { + return enumType.Members + .OfType() + .Select(x => x.Name); + } + + public static string? DefaultValue(CodeMemberProperty prop, CodeTypeDeclaration type) + { + var name = prop.Name + "DefaultValue"; + var init = type.Members + .OfType() + .FirstOrDefault(x => x.Name == name) + ?.InitExpression; + + return init switch + { + CodeMethodInvokeExpression i => $"{i.Method.MethodName}(\"{ ((CodePrimitiveExpression)i.Parameters[0]).Value }\")", + CodePrimitiveExpression p => (string)p.Value, + CodeFieldReferenceExpression f => f.FieldName, + _ => null, + }; + } + + public static string LocalName(CodeTypeDeclaration type, string name) + { + var init = type.Members + .OfType() + .FirstOrDefault(x => x.Name == name) + ?.InitExpression as CodeMethodInvokeExpression; + if (init is null) return "TODO: review null"; + return (string)(init.Parameters[0] as CodePrimitiveExpression)!.Value; + } + + public static string Namespace(CodeTypeDeclaration type, string name) + { + var init = type.Members + .OfType() + .FirstOrDefault(x => x.Name == name) + ?.InitExpression as CodeMethodInvokeExpression; + if (init is null) return "TODO: review null"; + return (string)(init.Parameters[1] as CodePrimitiveExpression)!.Value; + } + + public static bool HasContentModel(CodeTypeDeclaration type) + { + return type.Members + .OfType() + .Any(x => x.Name == "contentModel"); + } + + public static string TypeName(CodeTypeReference type, bool nullable = true) + { + if (type.ArrayElementType != null) + return TypeName(type.ArrayElementType) + "[]"; + + var name = type.BaseType; + + if (type.TypeArguments.Count > 0) + { + return Regex.Replace(name, @"`\d+$", "") + + "<" + + string.Join(", ", type.TypeArguments.Cast().Select(x => TypeName(x))) + + ">"; + } + + if (!nullable) + name = name.TrimEnd('?'); + + return name switch + { + "System.Boolean" => "bool", + "System.Byte" => "byte", + "System.Int32" => "int", + "System.String" => "string", + _ => name, + }; + } + + public static string ListElement(string typeName) + { + return Regex.Match(typeName, "^IList<([^>]+)>$") is { Success: true, Groups: var g } + ? g[1].Value + : typeName; + } + + public static string XmlTypeCode(object type, string? name = null) + { + // HACK: this is plain wrong but a shortcut to make the proof of concept match 100% without going to deep in CodeDom analysis + if (name == "language") return "XmlTypeCode.Language"; + + if (type is CodeTypeReference typeRef) + type = TypeName(typeRef, nullable: false); + + return type switch + { + "bool" => "XmlTypeCode.Boolean", + "byte[]" => "XmlTypeCode.Base64Binary", + "int" => "XmlTypeCode.Int", + "string" => "XmlTypeCode.String", + _ => "TODO", + }; + } + + public static IEnumerable AllTypes(CodeNamespace ns) + { + return ns.Types + .Cast() + .Where(x => x.Name is not ("XRootNamespace" or "XRoot" or "LinqToXsdTypeManager")); + } + + public static IEnumerable ElementTypes(CodeNamespace ns) + { + return AllTypes(ns).Where(x => !IsTypeDefinition(x)); + } +} \ No newline at end of file diff --git a/XObjectsCode/Src/Scriban/TemplateLoader.cs b/XObjectsCode/Src/Scriban/TemplateLoader.cs new file mode 100644 index 0000000..906c59b --- /dev/null +++ b/XObjectsCode/Src/Scriban/TemplateLoader.cs @@ -0,0 +1,33 @@ +using Scriban; +using Scriban.Parsing; +using Scriban.Runtime; +using System.IO; +using System.Threading.Tasks; + +namespace Xml.Schema.Linq.CodeGen.Scriban; + +class TemplateLoader : ITemplateLoader +{ + static string FullPath(string name) + { + return Path.Combine( + Path.GetDirectoryName(typeof(TemplateLoader).Assembly.Location), + "Templates", + name); + } + + public static Template Load(string name) + { + var file = FullPath(name); + return Template.Parse(File.ReadAllText(file), file); + } + + public string GetPath(TemplateContext context, SourceSpan callerSpan, string templateName) + => FullPath(templateName); + + public string Load(TemplateContext context, SourceSpan callerSpan, string templatePath) + => File.ReadAllText(templatePath); + + public ValueTask LoadAsync(TemplateContext context, SourceSpan callerSpan, string templatePath) + => new ValueTask(File.ReadAllText(templatePath)); +} diff --git a/XObjectsCode/Src/XObjectsCoreGenerator.cs b/XObjectsCode/Src/XObjectsCoreGenerator.cs index 0070f4b..e5dc0f7 100644 --- a/XObjectsCode/Src/XObjectsCoreGenerator.cs +++ b/XObjectsCode/Src/XObjectsCoreGenerator.cs @@ -3,10 +3,14 @@ using System.Collections.Generic; using System.IO; using System.Linq; +using System.Text; using System.Xml; using System.Xml.Linq; using System.Xml.Schema; +using Scriban; +using Scriban.Runtime; using Xml.Schema.Linq.CodeGen; +using Xml.Schema.Linq.CodeGen.Scriban; using Xml.Schema.Linq.Extensions; using XObjects; @@ -143,8 +147,9 @@ public static Dictionary Generate(IEnumerable xsdFil return GenerateCodeCompileUnits(schemaSet, settings) .Select(x => { - var writer = x.unit.ToStringWriter(); + var writer = new StringWriter(new StringBuilder(x.code)); + // TODO: put directly in template if (settings.NullableReferences) { // HACK: CodeDom doesn't allow us to add #pragmas. @@ -168,7 +173,7 @@ public static Dictionary Generate(IEnumerable xsdFil /// /// is /// is - public static IEnumerable<(string clrNamespace, CodeCompileUnit unit)> GenerateCodeCompileUnits(XmlSchemaSet schemaSet, LinqToXsdSettings settings) + public static IEnumerable<(string clrNamespace, string code)> GenerateCodeCompileUnits(XmlSchemaSet schemaSet, LinqToXsdSettings settings) { if (schemaSet == null) throw new ArgumentNullException(nameof(schemaSet)); if (settings == null) throw new ArgumentNullException(nameof(settings)); @@ -178,16 +183,29 @@ public static Dictionary Generate(IEnumerable xsdFil var codeGenerator = new CodeDomTypesGenerator(settings); var namespaces = codeGenerator.GenerateTypes(mapping); + var template = TemplateLoader.Load("file.scriban-cs"); + return settings.SplitFilesByNamespace ? namespaces.GroupBy(ns => ns.Name).Select(g => (g.Key, BuildUnit(g))) : new[] { ((string)null, BuildUnit(namespaces)) }; - static CodeCompileUnit BuildUnit(IEnumerable namespaces) + // TODO: rename + string BuildUnit(IEnumerable namespaces) { - var ccu = new CodeCompileUnit(); - foreach (var ns in namespaces) - ccu.Namespaces.Add(ns); - return ccu; + var globals = new ScriptObject(); + globals.Import(typeof(ScribanGlobals)); + globals.Import( + new { Settings = settings, Namespaces = namespaces.ToArray() }, + renamer: m => m.Name); + + var context = new TemplateContext() + { + MemberRenamer = m => m.Name, + TemplateLoader = new TemplateLoader(), + }; + context.PushGlobal(globals); + + return template.Render(context); } } diff --git a/XObjectsCode/Templates/class.scriban-cs b/XObjectsCode/Templates/class.scriban-cs new file mode 100644 index 0000000..b12aebf --- /dev/null +++ b/XObjectsCode/Templates/class.scriban-cs @@ -0,0 +1,248 @@ +{{ $1 | comments -}} +public partial class {{ $1.Name }} : XTypedElement, IXMetaData { + {{~ if !$.isNested ~}} + + public void Save(string xmlFile) { + XTypedServices.Save(xmlFile, Untyped); + } + + public void Save(System.IO.TextWriter tw) { + XTypedServices.Save(tw, Untyped); + } + + public void Save(System.Xml.XmlWriter xmlWriter) { + XTypedServices.Save(xmlWriter, Untyped); + } + + public static {{ $1.Name }} Load(string xmlFile) { + return XTypedServices.Load<{{ $1.Name }}>(xmlFile); + } + + public static {{ $1.Name }} Load(System.IO.TextReader xmlFile) { + return XTypedServices.Load<{{ $1.Name }}>(xmlFile); + } + + public static {{ $1.Name }} Parse(string xml) { + return XTypedServices.Parse<{{ $1.Name }}>(xml); + } + {{~ end ~}} + + public static explicit operator {{ $1.Name }}(XElement xe) { return XTypedServices.ToXTypedElement<{{ $1.Name }}>(xe,LinqToXsdTypeManager.Instance as ILinqToXsdTypeManager); } + + public override XTypedElement Clone() { + return XTypedServices.CloneXTypedElement<{{ $1.Name }}>(this); + } + + {{ $1 | ctor | comments -}} + public {{ $1.Name }}() { + } + + {{- + $simple = $1 | simple_type + if $simple != null + $validatorType = $1 | validator + $enumType = $simple | (regex.matches "Enum\\??$").empty? ? null : $simple | string.split "." | array.last + if $enumType + }} + + {{ include 'enum.scriban-cs' 'TypedValue' ($enumType | enum_decl $1) $simple }} + + {{- else # simple type but not an enum }} + + {{- if ($1 | properties).empty? }} + + {{ $1 | ctor 1 | comments -}} + public {{ $1.Name }}({{ $simple }} content) { + this.TypedValue = content; + } + {{- end }} + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + [EditorBrowsable(EditorBrowsableState.Never)] + protected internal static readonly System.Xml.Linq.XName TypedValueXName = System.Xml.Linq.XName.Get("TypedValue", ""); + + public virtual {{ $simple }} TypedValue { + get { + XElement x = this.Untyped; + return XTypedServices.ParseValue<{{ $simple }}>(x, XmlSchemaType.GetBuiltInSimpleType({{ $simple | xml_type_code }}).Datatype); + } + set { + {{~ if $validatorType == null ~}} + this.SetValue(value, XmlSchemaType.GetBuiltInSimpleType({{ $simple | xml_type_code }}).Datatype); + {{~ else ~}} + this.SetValueWithValidation(value, "TypedValue", {{ $validatorType }}.TypeDefinition); + {{~ end ~}} + } + } + + {{- end # if $enumType }} + + {{- end # if $simple }} + + {{- for $prop in $1 | properties }} + + {{- + $propType = $prop.Type | type_name + $enumType = $propType | (regex.matches "Enum\\??$").empty? ? null : $propType | string.split "." | array.last + if $enumType + }} + + {{ + include 'enum.scriban-cs' $prop.Name ($enumType | enum_decl $1) $propType $prop ($prop | default_value $1) + continue + end + }} + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + [EditorBrowsable(EditorBrowsableState.Never)] + protected internal static readonly System.Xml.Linq.XName {{ $prop.Name }}XName = System.Xml.Linq.XName.Get("{{ $1 | local_name $prop.Name + 'XName' }}", "{{ $1 | namespace $prop.Name + 'XName' }}"); + + {{- + $default = $prop | default_value $1 + if $default + }} + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + private static {{ $prop.Type | type_name }} {{ $prop.Name }}DefaultValue = System.Xml.XmlConvert.{{ $default }}; + {{- end }} + + {{- if $prop | is_list }} + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + private XTypedList<{{ $prop.Name }}> {{ $prop.Name }}Field; + + {{- end }} + + {{ $prop | comments -}} + public virtual {{ $prop.Type | type_name}} {{ $prop.Name }} { + {{- if $prop | is_list }} + get { + if ((this.{{ $prop.Name }}Field == null)) { + this.{{ $prop.Name }}Field = new XTypedList<{{ $prop.Name }}>(this, LinqToXsdTypeManager.Instance, {{ $prop.Name }}XName); + } + return this.{{ $prop.Name }}Field; + } + set { + if ((value == null)) { + this.{{ $prop.Name }}Field = null; + } + else { + if ((this.{{ $prop.Name }}Field == null)) { + this.{{ $prop.Name }}Field = XTypedList<{{ $prop.Name }}>.Initialize(this, LinqToXsdTypeManager.Instance, value, {{ $prop.Name }}XName); + } + else { + XTypedServices.SetList<{{ $prop.Name }}>(this.{{ $prop.Name }}Field, value); + } + } + } + + {{- else if $prop | is_element }} + get { + XElement x = this.GetElement({{ $prop.Name }}XName); + {{- if $prop | is_optional }} + if ((x == null)) { + return null; + } + {{- end }} + return (({{ $prop.Type | type_name }})(x)); + } + set { + this.SetElement({{ $prop.Name }}XName, value); + } + + {{- else }} + get { + XAttribute x = this.Attribute({{ $prop.Name }}XName); + {{- if $prop | is_optional }} + if ((x == null)) { + return {{ $default ? $prop.Name + "DefaultValue" : "null" }}; + } + {{- end }} + return XTypedServices.ParseValue<{{ $prop.Type | type_name nullable: false }}>(x, XmlSchemaType.GetBuiltInSimpleType({{ $prop.Type | xml_type_code $prop.Name }}).Datatype); + } + set { + this.SetAttribute({{ $prop.Name }}XName, value, XmlSchemaType.GetBuiltInSimpleType({{ $prop.Type | xml_type_code $prop.Name }}).Datatype); + } + + {{- end }} + } + {{- end }} + + private static readonly System.Xml.Linq.XName xName = System.Xml.Linq.XName.Get("{{ $1 | local_name 'xName' }}", "{{ $1 | namespace 'xName' }}"); + + {{- if $1 | has_elements }} + + static {{ $1.Name }}() { + BuildElementDictionary(); + {{- if $1 | has_content_model }} + contentModel = new SequenceContentModelEntity( + {{- for $el in $1 | elements -}} + new NamedContentModelEntity({{ $el.Name }}XName) + {{- if !for.last; ', '; end -}} + {{- end -}} + ); + {{- end }} + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + private static Dictionary localElementDictionary = new Dictionary(); + + private static void BuildElementDictionary() { + {{- for $prop in $1 | elements }} + localElementDictionary.Add({{ $prop.Name }}XName, typeof({{ $prop.Type | type_name | list_element | string.split "." | array.last }})); + {{- end }} + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + Dictionary IXMetaData.LocalElementsDictionary { + get { + return localElementDictionary; + } + } + + {{- end }} + + {{- if $1 | has_content_model }} + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + private static ContentModelEntity contentModel; + + ContentModelEntity IXMetaData.GetContentModel() { + return contentModel; + } + + {{- else }} + + ContentModelEntity IXMetaData.GetContentModel() { + return ContentModelEntity.Default; + } + + {{- end }} + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + System.Xml.Linq.XName IXMetaData.SchemaName { + get { + return xName; + } + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + SchemaOrigin IXMetaData.TypeOrigin { + get { + return {{ if $.isNested -}} SchemaOrigin.Fragment {{- else -}} SchemaOrigin.Element {{- end }}; + } + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + ILinqToXsdTypeManager IXMetaData.TypeManager { + get { + return LinqToXsdTypeManager.Instance; + } + } + + {{- for $type in $1 | classes }} + + {{ include 'class.scriban-cs' $type isNested: true }} + + {{- end }} +} \ No newline at end of file diff --git a/XObjectsCode/Templates/enum.scriban-cs b/XObjectsCode/Templates/enum.scriban-cs new file mode 100644 index 0000000..dd87bc2 --- /dev/null +++ b/XObjectsCode/Templates/enum.scriban-cs @@ -0,0 +1,60 @@ +public enum {{ $2.Name }} { + {{~ for $value in $2 | enum_values ~}} + + {{ $value }}, + {{~ end ~}} +} + +public sealed class {{ $2.Name }}Validator { + + private {{ $2.Name }}Validator() { + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + public static Xml.Schema.Linq.SimpleTypeValidator TypeDefinition = new Xml.Schema.Linq.AtomicSimpleTypeValidator(XmlSchemaType.GetBuiltInSimpleType(XmlTypeCode.String), new Xml.Schema.Linq.RestrictionFacets(((Xml.Schema.Linq.RestrictionFlags)(16)), new object[] { + {{ $2 | enum_values | array.join ",\n" do; ret '"' + $0 + '"'; end -}} + }, 0, 0, null, null, 0, null, null, 0, null, 0, XmlSchemaWhiteSpace.Preserve)); +} + +[DebuggerBrowsable(DebuggerBrowsableState.Never)] +[EditorBrowsable(EditorBrowsableState.Never)] +protected internal static readonly System.Xml.Linq.XName {{ $1 }}XName = System.Xml.Linq.XName.Get("{{ $1 }}", ""); + +{{- if $5 }} + +[DebuggerBrowsable(DebuggerBrowsableState.Never)] +private static {{ $3 }} {{ $1 }}DefaultValue = {{ $3 }}.{{ $5 }}; +{{- end }} + +{{ $4 | comments ~}} +public virtual {{ $3 }} {{ $1 }} { + {{~ if $1 == "TypedValue" ~}} + get { + XElement x = this.Untyped; + return (({{ $3 }})(Enum.Parse(typeof({{ $3 }}), XTypedServices.ParseValue(x, XmlSchemaType.GetBuiltInSimpleType(XmlTypeCode.String).Datatype, {{ $2.Name }}Validator.TypeDefinition)))); + } + set { + this.SetValueWithValidation(value.ToString(), "{{ $1 }}", {{ $2.Name }}Validator.TypeDefinition); + } + {{~ else ~}} + get { + XAttribute x = this.Attribute({{ $1 }}XName); + if ((x == null)) { + return {{ $5 ? $1 + "DefaultValue" : "null" }}; + } + return (({{ $3 | string.remove_last "?" }})(Enum.Parse(typeof({{ $3 | string.remove_last "?" }}), XTypedServices.ParseValue(x, XmlSchemaType.GetBuiltInSimpleType(XmlTypeCode.String).Datatype, {{ $2.Name }}Validator.TypeDefinition)))); + } + set { + {{~ if $3 | string.ends_with "?" ~}} + if (value == null) { + this.SetAttribute({{ $1 }}XName, null, XmlSchemaType.GetBuiltInSimpleType(XmlTypeCode.String).Datatype); + } + else { + this.SetAttributeWithValidation({{ $1 }}XName, value.ToString(), "{{ $1 }}", {{ $2.Name }}Validator.TypeDefinition); + } + {{~ else ~}} + this.SetAttributeWithValidation({{ $1 }}XName, value.ToString(), "{{ $1 }}", {{ $2.Name }}Validator.TypeDefinition); + {{~ end ~}} + } + {{~ end ~}} +} \ No newline at end of file diff --git a/XObjectsCode/Templates/file.scriban-cs b/XObjectsCode/Templates/file.scriban-cs new file mode 100644 index 0000000..840b015 --- /dev/null +++ b/XObjectsCode/Templates/file.scriban-cs @@ -0,0 +1,43 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +{{- for $ns in Namespaces }} + +namespace {{ $ns.Name }} { + using System; + using System.Collections; + using System.Collections.Generic; + using System.ComponentModel; + using System.IO; + using System.Linq; + using System.Diagnostics; + using System.Xml; + using System.Xml.Schema; + {{~ if Settings.EnableServiceReference ~}} + using System.Xml.Serialization; + {{~ end ~}} + using System.Xml.Linq; + using Xml.Schema.Linq; + + {{~ for $type in $ns | all_types ~}} + + {{ + if $type | is_type_definition + include 'type.scriban-cs' $type + else + include 'class.scriban-cs' $type + end + }} + {{~ end ~}} + + {{ include 'manager.scriban-cs' $ns }} + + {{ include 'root.scriban-cs' $ns }} +} +{{ end }} \ No newline at end of file diff --git a/XObjectsCode/Templates/manager.scriban-cs b/XObjectsCode/Templates/manager.scriban-cs new file mode 100644 index 0000000..bb8a08d --- /dev/null +++ b/XObjectsCode/Templates/manager.scriban-cs @@ -0,0 +1,67 @@ +public class LinqToXsdTypeManager : ILinqToXsdTypeManager { + + private LinqToXsdTypeManager() { + } + + private static Dictionary elementDictionary = new Dictionary(); + + private static void BuildElementDictionary() { + {{- for $el in $1 | element_types }} + elementDictionary.Add(System.Xml.Linq.XName.Get("{{ $el | local_name 'xName' }}", "{{ $el | namespace 'xName' }}"), typeof(global::{{ $1.Name }}.{{ $el.Name }})); + {{- end }} + } + + private static XmlSchemaSet schemaSet; + + XmlSchemaSet ILinqToXsdTypeManager.Schemas { + get { + if ((schemaSet == null)) { + XmlSchemaSet tempSet = new XmlSchemaSet(); + System.Threading.Interlocked.CompareExchange(ref schemaSet, tempSet, null); + } + return schemaSet; + } + set { + schemaSet = value; + } + } + + protected internal static void AddSchemas(XmlSchemaSet schemas) { + schemas.Add(schemaSet); + } + + Dictionary ILinqToXsdTypeManager.GlobalTypeDictionary { + get { + return XTypedServices.EmptyDictionary; + } + } + + Dictionary ILinqToXsdTypeManager.GlobalElementDictionary { + get { + return elementDictionary; + } + } + + Dictionary ILinqToXsdTypeManager.RootContentTypeMapping { + get { + return XTypedServices.EmptyTypeMappingDictionary; + } + } + + static LinqToXsdTypeManager() { + BuildElementDictionary(); + } + + public static System.Type GetRootType() { + return elementDictionary[System.Xml.Linq.XName.Get("{{ $1.Types[0] | local_name 'xName' }}", "{{ $1.Types[0] | namespace 'xName' }}")]; + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + private static LinqToXsdTypeManager typeManagerSingleton = new LinqToXsdTypeManager(); + + public static LinqToXsdTypeManager Instance { + get { + return typeManagerSingleton; + } + } +} \ No newline at end of file diff --git a/XObjectsCode/Templates/root.scriban-cs b/XObjectsCode/Templates/root.scriban-cs new file mode 100644 index 0000000..db27a62 --- /dev/null +++ b/XObjectsCode/Templates/root.scriban-cs @@ -0,0 +1,265 @@ +public partial class XRootNamespace { + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + private XDocument doc; + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + private XTypedElement rootObject; + + private XRootNamespace() { + } + + public static XRootNamespace Load(string xmlFile) { + XRootNamespace root = new XRootNamespace(); + root.doc = XDocument.Load(xmlFile); + XTypedElement typedRoot = XTypedServices.ToXTypedElement(root.doc.Root, LinqToXsdTypeManager.Instance); + if ((typedRoot == null)) { + throw new LinqToXsdException("Invalid root element in xml document."); + } + root.rootObject = typedRoot; + return root; + } + + public static XRootNamespace Load(string xmlFile, LoadOptions options) { + XRootNamespace root = new XRootNamespace(); + root.doc = XDocument.Load(xmlFile, options); + XTypedElement typedRoot = XTypedServices.ToXTypedElement(root.doc.Root, LinqToXsdTypeManager.Instance); + if ((typedRoot == null)) { + throw new LinqToXsdException("Invalid root element in xml document."); + } + root.rootObject = typedRoot; + return root; + } + + public static XRootNamespace Load(TextReader textReader) { + XRootNamespace root = new XRootNamespace(); + root.doc = XDocument.Load(textReader); + XTypedElement typedRoot = XTypedServices.ToXTypedElement(root.doc.Root, LinqToXsdTypeManager.Instance); + if ((typedRoot == null)) { + throw new LinqToXsdException("Invalid root element in xml document."); + } + root.rootObject = typedRoot; + return root; + } + + public static XRootNamespace Load(TextReader textReader, LoadOptions options) { + XRootNamespace root = new XRootNamespace(); + root.doc = XDocument.Load(textReader, options); + XTypedElement typedRoot = XTypedServices.ToXTypedElement(root.doc.Root, LinqToXsdTypeManager.Instance); + if ((typedRoot == null)) { + throw new LinqToXsdException("Invalid root element in xml document."); + } + root.rootObject = typedRoot; + return root; + } + + public static XRootNamespace Load(XmlReader xmlReader) { + XRootNamespace root = new XRootNamespace(); + root.doc = XDocument.Load(xmlReader); + XTypedElement typedRoot = XTypedServices.ToXTypedElement(root.doc.Root, LinqToXsdTypeManager.Instance); + if ((typedRoot == null)) { + throw new LinqToXsdException("Invalid root element in xml document."); + } + root.rootObject = typedRoot; + return root; + } + + public static XRootNamespace Parse(string text) { + XRootNamespace root = new XRootNamespace(); + root.doc = XDocument.Parse(text); + XTypedElement typedRoot = XTypedServices.ToXTypedElement(root.doc.Root, LinqToXsdTypeManager.Instance); + if ((typedRoot == null)) { + throw new LinqToXsdException("Invalid root element in xml document."); + } + root.rootObject = typedRoot; + return root; + } + + public static XRootNamespace Parse(string text, LoadOptions options) { + XRootNamespace root = new XRootNamespace(); + root.doc = XDocument.Parse(text, options); + XTypedElement typedRoot = XTypedServices.ToXTypedElement(root.doc.Root, LinqToXsdTypeManager.Instance); + if ((typedRoot == null)) { + throw new LinqToXsdException("Invalid root element in xml document."); + } + root.rootObject = typedRoot; + return root; + } + + public virtual void Save(string fileName) { + doc.Save(fileName); + } + + public virtual void Save(TextWriter textWriter) { + doc.Save(textWriter); + } + + public virtual void Save(XmlWriter writer) { + doc.Save(writer); + } + + public virtual void Save(TextWriter textWriter, SaveOptions options) { + doc.Save(textWriter, options); + } + + public virtual void Save(string fileName, SaveOptions options) { + doc.Save(fileName, options); + } + + public virtual XDocument XDocument { + get { + return doc; + } + } + + public virtual XTypedElement Root { + get { + return rootObject; + } + } + + {{- for $el in $1 | element_types }} + + public XRootNamespace({{ $el.Name }} root) { + this.doc = new XDocument(root.Untyped); + this.rootObject = root; + } + + + public {{ $el.Name }} {{ $el.Name }} { get {return rootObject as {{ $el.Name }}; } } + + {{- end }} +} + +public partial class XRoot { + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + private XDocument doc; + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + private XTypedElement rootObject; + + private XRoot() { + } + + public static XRoot Load(string xmlFile) { + XRoot root = new XRoot(); + root.doc = XDocument.Load(xmlFile); + XTypedElement typedRoot = XTypedServices.ToXTypedElement(root.doc.Root, LinqToXsdTypeManager.Instance); + if ((typedRoot == null)) { + throw new LinqToXsdException("Invalid root element in xml document."); + } + root.rootObject = typedRoot; + return root; + } + + public static XRoot Load(string xmlFile, LoadOptions options) { + XRoot root = new XRoot(); + root.doc = XDocument.Load(xmlFile, options); + XTypedElement typedRoot = XTypedServices.ToXTypedElement(root.doc.Root, LinqToXsdTypeManager.Instance); + if ((typedRoot == null)) { + throw new LinqToXsdException("Invalid root element in xml document."); + } + root.rootObject = typedRoot; + return root; + } + + public static XRoot Load(TextReader textReader) { + XRoot root = new XRoot(); + root.doc = XDocument.Load(textReader); + XTypedElement typedRoot = XTypedServices.ToXTypedElement(root.doc.Root, LinqToXsdTypeManager.Instance); + if ((typedRoot == null)) { + throw new LinqToXsdException("Invalid root element in xml document."); + } + root.rootObject = typedRoot; + return root; + } + + public static XRoot Load(TextReader textReader, LoadOptions options) { + XRoot root = new XRoot(); + root.doc = XDocument.Load(textReader, options); + XTypedElement typedRoot = XTypedServices.ToXTypedElement(root.doc.Root, LinqToXsdTypeManager.Instance); + if ((typedRoot == null)) { + throw new LinqToXsdException("Invalid root element in xml document."); + } + root.rootObject = typedRoot; + return root; + } + + public static XRoot Load(XmlReader xmlReader) { + XRoot root = new XRoot(); + root.doc = XDocument.Load(xmlReader); + XTypedElement typedRoot = XTypedServices.ToXTypedElement(root.doc.Root, LinqToXsdTypeManager.Instance); + if ((typedRoot == null)) { + throw new LinqToXsdException("Invalid root element in xml document."); + } + root.rootObject = typedRoot; + return root; + } + + public static XRoot Parse(string text) { + XRoot root = new XRoot(); + root.doc = XDocument.Parse(text); + XTypedElement typedRoot = XTypedServices.ToXTypedElement(root.doc.Root, LinqToXsdTypeManager.Instance); + if ((typedRoot == null)) { + throw new LinqToXsdException("Invalid root element in xml document."); + } + root.rootObject = typedRoot; + return root; + } + + public static XRoot Parse(string text, LoadOptions options) { + XRoot root = new XRoot(); + root.doc = XDocument.Parse(text, options); + XTypedElement typedRoot = XTypedServices.ToXTypedElement(root.doc.Root, LinqToXsdTypeManager.Instance); + if ((typedRoot == null)) { + throw new LinqToXsdException("Invalid root element in xml document."); + } + root.rootObject = typedRoot; + return root; + } + + public virtual void Save(string fileName) { + doc.Save(fileName); + } + + public virtual void Save(TextWriter textWriter) { + doc.Save(textWriter); + } + + public virtual void Save(XmlWriter writer) { + doc.Save(writer); + } + + public virtual void Save(TextWriter textWriter, SaveOptions options) { + doc.Save(textWriter, options); + } + + public virtual void Save(string fileName, SaveOptions options) { + doc.Save(fileName, options); + } + + public virtual XDocument XDocument { + get { + return doc; + } + } + + public virtual XTypedElement Root { + get { + return rootObject; + } + } + + {{- for $el in $1 | element_types }} + + public XRoot(global::{{ $1.Name }}.{{ $el.Name }} root) { + this.doc = new XDocument(root.Untyped); + this.rootObject = root; + } + + + public global::{{ $1.Name }}.{{ $el.Name }} {{ $el.Name }} { get {return rootObject as global::{{ $1.Name }}.{{ $el.Name }}; } } + + {{- end }} +} \ No newline at end of file diff --git a/XObjectsCode/Templates/type.scriban-cs b/XObjectsCode/Templates/type.scriban-cs new file mode 100644 index 0000000..5fd2299 --- /dev/null +++ b/XObjectsCode/Templates/type.scriban-cs @@ -0,0 +1,9 @@ +{{ $1 | comments -}} +public sealed class {{ $1.Name }} { + + private {{ $1.Name }}() { + } + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + public static Xml.Schema.Linq.SimpleTypeValidator TypeDefinition = new Xml.Schema.Linq.AtomicSimpleTypeValidator(XmlSchemaType.GetBuiltInSimpleType(XmlTypeCode.String), null); +} \ No newline at end of file diff --git a/XObjectsCode/XObjectsCodeGen.csproj b/XObjectsCode/XObjectsCodeGen.csproj index 0936503..9958c3c 100644 --- a/XObjectsCode/XObjectsCodeGen.csproj +++ b/XObjectsCode/XObjectsCodeGen.csproj @@ -16,6 +16,7 @@ + all runtime; build; native; contentfiles; analyzers; buildtransitive @@ -23,6 +24,10 @@ + + + + TargetFramework=net6.0