Ejemplo n.º 1
0
 /// <summary>
 /// Add Order
 /// </summary>
 /// <param name="order"></param>
 /// <param name="index">Optional, insert index</param>
 public static void AddOrder(Order order, int index = -1)
 {
     if (index < 0)
     {
         if (OrderList.Count == 0)
         {
             OrderList.Add(order);
             return;
         }
         // Add in appropriate date slot
         for (int i = 0; i < OrderList.Count; i++)
         {
             OrderList.Insert(i, order);
             return;
         }
     }
     else
     {
         OrderList.Insert(index, order);
     }
     // Sort by date
 }