예제 #1
0
 public Workflow()
 {
     invalidOrder = new OrderError();
     invalidZipCodeErrorCollection = new OrderErrorCollection();
     invalidItemNumErrorCollection = new OrderErrorCollection();
     invalidOrdersCollection       = new OrderErrorCollection();
     InitializeComponent();
 }
예제 #2
0
        // The definition of the extension method for the class OrderErrorCollection.
        public static void PrintOrderErrors(this OrderErrorCollection orderErrorCollection)
        {
            Console.WriteLine();

            foreach (OrderError orderError in orderErrorCollection)
            {
                Console.WriteLine(orderError.ErrorText);
            }
        }
예제 #3
0
        // Overload the operator + for two OrderErrorCollection objects.
        public static OrderErrorCollection operator +(OrderErrorCollection orderErrorCollection1, OrderErrorCollection orderErrorCollection2)
        {
            OrderErrorCollection orderErrorCollection = new OrderErrorCollection();

            if (null != orderErrorCollection1)
            {
                foreach (OrderError orderError in orderErrorCollection1)
                {
                    orderErrorCollection.Add(orderError);
                }
            }

            if (null != orderErrorCollection2)
            {
                foreach (OrderError orderError in orderErrorCollection2)
                {
                    orderErrorCollection.Add(orderError);
                }
            }

            return(orderErrorCollection);
        }