public virtual int Add(MaskElement element) { int res = IndexOf(element); if (res == -1) { res = List.Add(element); } return(res); }
public override DateTime ApplyElement(int result, DateTime editedDateTime) { MaskElement aElement = aEdit.Properties.MaskElements[aIndex]; EditElement editElement = aElement.EditCollection.Find(aEdit); if (editElement != null) { editElement.EditValue = result; } return(new DateTime(editedDateTime.Ticks + 1)); }
public override string Format(DateTime formattedDateTime) { MaskElement aElement = aEdit.Properties.MaskElements[aIndex]; EditElement editElement = aElement.EditCollection.Find(aEdit); if (editElement != null) { return(editElement.EditValue.ToString()); } initvalue = 0; return(initvalue.ToString()); }
public override DateTimeElementEditor CreateElementEditor(DateTime editedDateTime) { MaskElement aElement = aEdit.Properties.MaskElements[aIndex]; EditElement editElement = aElement.EditCollection.Find(aEdit); if (editElement != null) { initvalue = editElement.EditValue; } else { initvalue = 0; } return(new DateTimeNumericRangeElementEditor(initvalue, aElement.MinValue, aElement.MaxValue, 1, Math.Max(aElement.MinValue.ToString().Length, aElement.MaxValue.ToString().Length))); }
public MaskButtonEditMaskFormatInfo(string mask, DateTimeFormatInfo dateTimeFormatInfo, MaskButtonEdit aedit) : base(mask, dateTimeFormatInfo) { for (int i = 0; i < Count; i++) { if ((innerList[i] is DateTimeMaskFormatElementLiteral) && (i < Count - 1) && (innerList[i + 1] is DateTimeMaskFormatElementLiteral)) { string aMaskSymbol = ((DateTimeMaskFormatElementLiteral)innerList[i]).Literal + ((DateTimeMaskFormatElementLiteral)innerList[i + 1]).Literal; MaskElement aElement = MaskElementsRepository.MaskCollection.Find(aMaskSymbol); if (aElement != null) { innerList[i] = new MaskButtonEditMaskFormatElement(aMaskSymbol, dateTimeFormatInfo, aedit.Properties.MaskElements.IndexOf(aElement), aedit); innerList.RemoveAt(i + 1); } } } }
public static int Add(MaskElement aElement) { return(aCollection.Add(aElement)); }
public bool Contains(MaskElement value) { return(List.Contains(value)); }
public void Remove(MaskElement value) { List.Remove(value); }
public void Insert(int index, MaskElement value) { List.Insert(index, value); }
public int IndexOf(MaskElement element) { return(List.IndexOf(element)); }