/// <summary> /// Initializes a new instance of the <see cref="FormMappingDataRelationList"/> class /// that contains elements copied from the specified collection and /// that has the same initial capacity as the number of elements copied. /// </summary> /// <param name="collection">The <see cref="FormMappingDataRelationList"/> /// whose elements are copied to the new collection.</param> /// <exception cref="ArgumentNullException"> /// <paramref name="collection"/> is a null reference.</exception> /// <remarks>Please refer to <see cref="ArrayList(ICollection)"/> for details.</remarks> public FormMappingDataRelationList(FormMappingDataRelationList collection) { if (collection == null) throw new ArgumentNullException("collection"); this._array = new FormMappingDataRelation[collection.Count]; AddRange(collection); }
public void SaveFormMapping(Uri uri, FormMappingDataRelationList relations, Hashtable postDataValues, HtmlFormTag form) { // create new formMapData FormMapData formMapData = new FormMapData(); formMapData.FormTag = form; formMapData.PostData = postDataValues; formMapData.FormMappingRelations = relations; // Save .gbmap file. this.AddFormMapping(uri, formMapData); }
private FormMappingDataRelationList CreateFormMappingRelations(Hashtable postData, HtmlFormTag formTag) { FormMappingDataRelationList relationList = new FormMappingDataRelationList(); foreach ( DictionaryEntry de in formTag ) { HtmlTagBaseList controlArray = (HtmlTagBaseList)de.Value; #region Tag Collection foreach ( HtmlTagBase tag in controlArray ) { string name = string.Empty; if (tag is HtmlInputTag) { HtmlInputTag input=(HtmlInputTag)tag; name = input.Name; } if (tag is HtmlButtonTag) { HtmlButtonTag button = (HtmlButtonTag)tag; name = button.Name; } if (tag is HtmlSelectTag) { HtmlSelectTag select = (HtmlSelectTag)tag; name = select.Name; } if (tag is HtmlTextAreaTag) { HtmlTextAreaTag textarea=(HtmlTextAreaTag)tag; name = textarea.Name; } FormMappingDataRelation relation = new FormMappingDataRelation(); relation.CurrentValue = (string)postData[name]; relation.FieldName = name; relationList.Add(relation); //relation.FormMappingCopyType = FormMappingDataTransformation. } #endregion } return relationList; }
internal ReadOnlyList(FormMappingDataRelationList collection) : base(Tag.Default) { this._collection = collection; }
internal Enumerator(FormMappingDataRelationList collection) { this._collection = collection; this._version = collection._version; this._index = -1; }
/// <overloads> /// Adds a range of elements to the end of the <see cref="FormMappingDataRelationList"/>. /// </overloads> /// <summary> /// Adds the elements of another collection to the end of the <see cref="FormMappingDataRelationList"/>. /// </summary> /// <param name="collection">The <see cref="FormMappingDataRelationList"/> whose elements /// should be added to the end of the current collection.</param> /// <exception cref="ArgumentNullException"> /// <paramref name="collection"/> is a null reference.</exception> /// <exception cref="NotSupportedException"> /// <para>The <see cref="FormMappingDataRelationList"/> is read-only.</para> /// <para>-or-</para> /// <para>The <b>FormMappingDataRelationList</b> has a fixed size.</para></exception> /// <remarks>Please refer to <see cref="ArrayList.AddRange"/> for details.</remarks> public virtual void AddRange(FormMappingDataRelationList collection) { if (collection == null) throw new ArgumentNullException("collection"); if (collection.Count == 0) return; if (this._count + collection.Count > this._array.Length) EnsureCapacity(this._count + collection.Count); ++this._version; Array.Copy(collection._array, 0, this._array, this._count, collection.Count); this._count += collection.Count; }
/// <summary> /// Creates a shallow copy of the <see cref="FormMappingDataRelationList"/>. /// </summary> /// <returns>A shallow copy of the <see cref="FormMappingDataRelationList"/>.</returns> /// <remarks>Please refer to <see cref="ArrayList.Clone"/> for details.</remarks> public virtual object Clone() { FormMappingDataRelationList collection = new FormMappingDataRelationList(this._count); Array.Copy(this._array, 0, collection._array, 0, this._count); collection._count = this._count; collection._version = this._version; return collection; }
/// <summary> /// Returns a synchronized (thread-safe) wrapper /// for the specified <see cref="FormMappingDataRelationList"/>. /// </summary> /// <param name="collection">The <see cref="FormMappingDataRelationList"/> to synchronize.</param> /// <returns> /// A synchronized (thread-safe) wrapper around <paramref name="collection"/>. /// </returns> /// <exception cref="ArgumentNullException"> /// <paramref name="collection"/> is a null reference.</exception> /// <remarks>Please refer to <see cref="ArrayList.Synchronized"/> for details.</remarks> public static FormMappingDataRelationList Synchronized(FormMappingDataRelationList collection) { if (collection == null) throw new ArgumentNullException("collection"); return new SyncList(collection); }
/// <summary> /// Returns a read-only wrapper for the specified <see cref="FormMappingDataRelationList"/>. /// </summary> /// <param name="collection">The <see cref="FormMappingDataRelationList"/> to wrap.</param> /// <returns>A read-only wrapper around <paramref name="collection"/>.</returns> /// <exception cref="ArgumentNullException"> /// <paramref name="collection"/> is a null reference.</exception> /// <remarks>Please refer to <see cref="ArrayList.ReadOnly"/> for details.</remarks> public static FormMappingDataRelationList ReadOnly(FormMappingDataRelationList collection) { if (collection == null) throw new ArgumentNullException("collection"); return new ReadOnlyList(collection); }
public override void AddRange(FormMappingDataRelationList collection) { lock (this._root) this._collection.AddRange(collection); }
internal SyncList(FormMappingDataRelationList collection) : base(Tag.Default) { this._root = collection.SyncRoot; this._collection = collection; }
public override void AddRange(FormMappingDataRelationList collection) { throw new NotSupportedException("Read-only collections cannot be modified."); }