public void Add(WinRangeValidator value) { if(!list.ContainsKey( value.Id)) { value.Parent = this.parent; list.Add(value.Id,value); } else { throw new Exception("Item already exists in the collection."); } }
public void Add(string id, Control controlToValidate) { if(!list.ContainsKey(id)) { WinRangeValidator validator = new WinRangeValidator(id,controlToValidate,this.parent); list.Add(id,validator); } else { throw new Exception("Item already exists in the collection."); } }
public void Add(string id, Control controlToValidate,string errorMessage,object minValue,object maxValue,DataType dataType) { if(!list.ContainsKey(id)) { WinRangeValidator validator = new WinRangeValidator(id,controlToValidate,errorMessage,minValue,maxValue,dataType,this.parent); list.Add(id,validator); } else { throw new Exception("Item already exists in the collection."); } }