Beispiel #1
0
        /// <summary>
        /// Clears a specific amount of lines
        /// </summary>
        /// <param name="lineCount">Lines to clear</param>
        /// <param name="order">The order in which the lines will be cleared</param>
        public void Clear(int lineCount = 1, ClearOrder order = ClearOrder.OldestToNewest)
        {
            if (_lines.Count == 0)
            {
                return;
            }

            lineCount = Math.Min(lineCount, _lines.Count);

            switch (order)
            {
            default:
            case ClearOrder.OldestToNewest:
                for (int i = 0; i < lineCount; i++)
                {
                    ClearLine(0);
                }
                break;

            case ClearOrder.NewestToOldest:
                for (int i = 0; i < lineCount; i++)
                {
                    ClearLine(_lines.Count - 1);
                }
                break;
            }
        }
Beispiel #2
0
 public PosViewModel(string appInfo, string windowIcon, OperatingStatus status)
 {
     MachineSn    = Global.MachineSettings.MachineInformations.MachineSn;
     StoreName    = Global.MachineSettings.MachineInformations.StoreName;
     WinTitle     = string.Format("{0}{1}", Global.MachineSettings.MachineInformations.Company, string.IsNullOrEmpty(Global.MachineSettings.MachineInformations.StoreName) ? "" : " | " + Global.MachineSettings.MachineInformations.StoreName);
     Current      = this;
     AppName      = appInfo;
     WinIcon      = windowIcon;
     UserCode     = Global.CurrentSaleMen.UserCode;
     OperatorName = Global.CurrentSaleMen.FullName;
     OrderList    = new ObservableCollection <Product>();
     Task.Factory.StartNew(() =>
     {
         while (isRuning)
         {
             Date = DateTime.Now;
             Thread.Sleep(1000);
         }
     });
     OperatingStatus = status;
     // ConnectStatus = PosModels.ConnectStatus.Server;
     ClearOrder.Execute(null);
     //绑定快捷键对应文本
     BindHotKeys();
 }