Пример #1
0
 /// <summary>
 ///   Adds the contents of another <see cref='XmlSchemaCompletionDataCollection'/> to the end of the collection.
 /// </summary>
 /// <param name='val'>
 ///    A <see cref='XmlSchemaCompletionDataCollection'/> containing the objects to add to the collection.
 /// </param>
 /// <seealso cref='XmlSchemaCompletionDataCollection.Add'/>
 public void AddRange(XmlSchemaCompletionDataCollection val)
 {
     for (int i = 0; i < val.Count; i++)
     {
         this.Add(val[i]);
     }
 }
Пример #2
0
 /// <summary>
 /// Gets the schema completion data with the same filename.
 /// </summary>
 /// <returns><see langword="null"/> if no matching schema found.</returns>
 public XmlSchemaCompletionData GetSchemaFromFileName(string fileName)
 {
     foreach (XmlSchemaCompletionData schema in this)
     {
         if (XmlSchemaCompletionDataCollection.IsEqualFileName(schema.FileName, fileName))
         {
             return(schema);
         }
     }
     return(null);
 }
    public XmlCompletionDataProvider(XmlSchemaSet schemaSet, string defaultNamespace
      , string prefix = null
      , Func<string> namespaceWriter = null
      , Func<XmlSchemaElement, bool> filter = null)
    {
      var def = schemaSet.Schemas(defaultNamespace).OfType<XmlSchema>().First();

      this.schemaCompletionDataItems = new XmlSchemaCompletionDataCollection();
      foreach (var schema in schemaSet.Schemas().OfType<XmlSchema>().Where(s => s != def))
      {
        this.schemaCompletionDataItems.Add(new XmlSchemaCompletionData(schema)
        {
          ElementFilter = filter
        });
      }
      this.defaultSchemaCompletionData = new XmlSchemaCompletionData(def)
      {
        RelatedSchemas = this.schemaCompletionDataItems,
        NamespaceWriter = namespaceWriter,
        ElementFilter = filter
      };
      this.defaultNamespacePrefix = prefix ?? string.Empty;
    }
        public XmlCompletionDataProvider(XmlSchemaSet schemaSet, string defaultNamespace
                                         , string prefix = null
                                         , Func <string> namespaceWriter        = null
                                         , Func <XmlSchemaElement, bool> filter = null)
        {
            var def = schemaSet.Schemas(defaultNamespace).OfType <XmlSchema>().First();

            this.schemaCompletionDataItems = new XmlSchemaCompletionDataCollection();
            foreach (var schema in schemaSet.Schemas().OfType <XmlSchema>().Where(s => s != def))
            {
                this.schemaCompletionDataItems.Add(new XmlSchemaCompletionData(schema)
                {
                    ElementFilter = filter
                });
            }
            this.defaultSchemaCompletionData = new XmlSchemaCompletionData(def)
            {
                RelatedSchemas  = this.schemaCompletionDataItems,
                NamespaceWriter = namespaceWriter,
                ElementFilter   = filter
            };
            this.defaultNamespacePrefix = prefix ?? string.Empty;
        }
 public XmlCompletionDataProvider(XmlSchema schema)
 {
   this.schemaCompletionDataItems = new XmlSchemaCompletionDataCollection();
   this.defaultSchemaCompletionData = new XmlSchemaCompletionData(schema);
   this.defaultNamespacePrefix = string.Empty;
 }
		/// <summary>
		///   Initializes a new instance of <see cref='XmlSchemaCompletionDataCollection'/> based on another <see cref='XmlSchemaCompletionDataCollection'/>.
		/// </summary>
		/// <param name='val'>
		///   A <see cref='XmlSchemaCompletionDataCollection'/> from which the contents are copied
		/// </param>
		public XmlSchemaCompletionDataCollection(XmlSchemaCompletionDataCollection val)
		{
			this.AddRange(val);
		}
			/// <summary>
			///   Initializes a new instance of <see cref='XmlSchemaCompletionDataEnumerator'/>.
			/// </summary>
			public XmlSchemaCompletionDataEnumerator(XmlSchemaCompletionDataCollection mappings)
			{
				this.temp = ((System.Collections.IEnumerable)(mappings));
				this.baseEnumerator = temp.GetEnumerator();
			}
		/// <summary>
		///   Adds the contents of another <see cref='XmlSchemaCompletionDataCollection'/> to the end of the collection.
		/// </summary>
		/// <param name='val'>
		///    A <see cref='XmlSchemaCompletionDataCollection'/> containing the objects to add to the collection.
		/// </param>
		/// <seealso cref='XmlSchemaCompletionDataCollection.Add'/>
		public void AddRange(XmlSchemaCompletionDataCollection val)
		{
			for (int i = 0; i < val.Count; i++)
			{
				this.Add(val[i]);
			}
		}
 public XmlCompletionDataProvider(XmlSchema schema)
 {
     this.schemaCompletionDataItems   = new XmlSchemaCompletionDataCollection();
     this.defaultSchemaCompletionData = new XmlSchemaCompletionData(schema);
     this.defaultNamespacePrefix      = string.Empty;
 }
Пример #10
0
 /// <summary>
 ///   Initializes a new instance of <see cref='XmlSchemaCompletionDataCollection'/> based on another <see cref='XmlSchemaCompletionDataCollection'/>.
 /// </summary>
 /// <param name='val'>
 ///   A <see cref='XmlSchemaCompletionDataCollection'/> from which the contents are copied
 /// </param>
 public XmlSchemaCompletionDataCollection(XmlSchemaCompletionDataCollection val)
 {
     this.AddRange(val);
 }
Пример #11
0
 /// <summary>
 ///   Initializes a new instance of <see cref='XmlSchemaCompletionDataEnumerator'/>.
 /// </summary>
 public XmlSchemaCompletionDataEnumerator(XmlSchemaCompletionDataCollection mappings)
 {
     this.temp           = ((System.Collections.IEnumerable)(mappings));
     this.baseEnumerator = temp.GetEnumerator();
 }