コード例 #1
0
        public OrderedPropertyItem(ReceiptItemProperty property, IList <ReceiptItemProperty> destination, IList siblings)
        {
            this.destination = destination;
            this.siblings    = siblings;
            this.property    = property;

            Name     = property.GetDisplay();
            Selected = false;
        }
コード例 #2
0
        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!");
        }
コード例 #3
0
 private OrderedPropertyItem GetOrderedProperty(ReceiptItemProperty property)
 {
     return(Items.Single(o => o.Property == property));
 }
コード例 #4
0
 public static string GetDisplay(this ReceiptItemProperty property)
 {
     return(propertyDisplayText[property]);
 }