public OrderedPropertyItem(ReceiptItemProperty property, IList <ReceiptItemProperty> destination, IList siblings) { this.destination = destination; this.siblings = siblings; this.property = property; Name = property.GetDisplay(); Selected = false; }
private Control CreateControl(ReceiptItemProperty prop) { switch (prop) { case ReceiptItemProperty.Name: { txtName = new TextEdit(); txtName.Name = "txtName"; return(txtName); } case ReceiptItemProperty.Price: { numPrice = new SpinEdit(); numPrice.Name = "numPrice"; numPrice.SetMinMax(); return(numPrice); } case ReceiptItemProperty.ShoppingListItemID: { aliasEditor = new ShoppingListItemEditor(); aliasEditor.Name = "aliasEditor"; return(aliasEditor); } case ReceiptItemProperty.Code: { codeEditor = new CodeEditor(); codeEditor.Name = "codeEditor"; return(codeEditor); } case ReceiptItemProperty.Quantity: { quantityEditor = new QuantityEditor(); quantityEditor.Name = "quantityEditor"; return(quantityEditor); } } throw new InvalidOperationException("Unknown property!"); }
private OrderedPropertyItem GetOrderedProperty(ReceiptItemProperty property) { return(Items.Single(o => o.Property == property)); }
public static string GetDisplay(this ReceiptItemProperty property) { return(propertyDisplayText[property]); }