/// <summary> /// Inserts a ISqlFilterMangler instance into the collection. /// </summary> /// <param name="item">The item to add.</param> public void Insert(int index, ISqlFilterMangler item) { if (item == null) { throw new ArgumentNullException("item"); } List.Insert(index, item); }
/// <summary> /// Removes a ISqlFilterMangler item to the collection. /// </summary> /// <param name="item">The item to remove.</param> public void Remove(ISqlFilterMangler item) { if (item == null) { throw new ArgumentNullException("item"); } List.Remove(item); }
/// <summary> /// Adds a ISqlFilterMangler instance to the collection. /// </summary> /// <param name="item">The item to add.</param> public int Add(ISqlFilterMangler item) { if (item == null) { throw new ArgumentNullException("item"); } return(List.Add(item)); }
/// <summary> /// Discovers if the given item is in the collection. /// </summary> /// <param name="item">The item to find.</param> /// <returns>Returns true if the given item is in the collection.</returns> public bool Contains(ISqlFilterMangler item) { if (IndexOf(item) == -1) { return(false); } else { return(true); } }
public FilterMangler(string manglerId, SimpleXmlPropertyBag settings, ISqlFilterMangler filter) { if (manglerId == null) { throw new ArgumentNullException("manglerId"); } if (manglerId.Length == 0) { throw new ArgumentOutOfRangeException("'manglerId' is zero-length."); } if (settings == null) { throw new ArgumentNullException("settings"); } if (filter == null) { throw new ArgumentNullException("filter"); } // set... _manglerId = manglerId; _settings = settings; _filterMangler = filter; }
private static FilterMangler LoadMangler(SqlSearchSettings settings, XmlElement element) { if (settings == null) { throw new ArgumentNullException("settings"); } if (element == null) { throw new ArgumentNullException("element"); } // get the type... string manglerId = XmlHelper.GetAttributeString(element, "manglerId", OnNotFound.ThrowException); if (manglerId == null) { throw new InvalidOperationException("'manglerId' is null."); } if (manglerId.Length == 0) { throw new InvalidOperationException("'manglerId' is zero-length."); } // get the type... Type type = XmlHelper.GetAttributeType(element, "type", OnNotFound.ThrowException); if (type == null) { throw new InvalidOperationException("type is null."); } // create... ISqlFilterMangler filter = (ISqlFilterMangler)CreateInstance(type); if (filter == null) { throw new InvalidOperationException("filter is null."); } // get the settings element... XmlElement settingsElement = (XmlElement)element.SelectSingleNode("Settings"); if (settingsElement == null) { throw new InvalidOperationException("settingsElement is null."); } // load... SimpleXmlPropertyBag bag = SimpleXmlPropertyBag.Load(settingsElement, typeof(SimpleXmlPropertyBag)); if (bag == null) { throw new InvalidOperationException("bag is null."); } // Lets deserialize the bag into the control filter.DeserializeSqlSearchSettings(bag); FilterMangler mangler = new FilterMangler(manglerId, bag, filter); // patch... //mangler.DeserializeSqlSearchSettings(bag); // return... return(mangler); }
/// <summary> /// Returns the index of the item in the collection. /// </summary> /// <param name="item">The item to find.</param> /// <returns>The index of the item, or -1 if it is not found.</returns> public int IndexOf(ISqlFilterMangler item) { return(List.IndexOf(item)); }
public FilterMangler(string manglerId, ISqlFilterMangler filter) : this(manglerId, new SimpleXmlPropertyBag(), filter) { }