public void Add(MaskDescriptorTemplate mdt) { if (mdt.Mask != null) { this.dx.Add(mdt); } }
/// <summary> /// Adds the specified MaskDescriptorTemplate object provided it is a valid one. /// </summary> public void Add(MaskDescriptorTemplate maskDescriptorTemplate) { if (maskDescriptorTemplate.Mask != null) { List.Add(maskDescriptorTemplate); } }
private void AddDefaultMaskDescriptors(CultureInfo culture) { this.customMaskDescriptor = new MaskDescriptorTemplate(null, System.Design.SR.GetString("MaskDesignerDialogCustomEntry"), null, null, null, true); List <MaskDescriptor> localizedMaskDescriptors = MaskDescriptorTemplate.GetLocalizedMaskDescriptors(culture); this.InsertMaskDescriptor(0, this.customMaskDescriptor, false); foreach (MaskDescriptor descriptor in localizedMaskDescriptors) { this.InsertMaskDescriptor(0, descriptor); } }
/// <summary> /// Adds the default mask descriptors to the mask description list. /// We need to add the default descriptors explicitly because the DiscoverMaskDescriptors method only adds /// public descriptors and these are internal. /// </summary> private void AddDefaultMaskDescriptors(CultureInfo culture) { _customMaskDescriptor = new MaskDescriptorTemplate(null, SR.MaskDesignerDialogCustomEntry, null, null, null, true); List <MaskDescriptor> maskDescriptors = MaskDescriptorTemplate.GetLocalizedMaskDescriptors(culture); // Need to pass false for validateDescriptor param since the custom mask will fail validation // because the mask is empty. InsertMaskDescriptor(0, _customMaskDescriptor, /*validate*/ false); foreach (MaskDescriptor maskDescriptor in maskDescriptors) { InsertMaskDescriptor(0, maskDescriptor); } }