private void cmdPrint_Click(object sender, RoutedEventArgs e)
        {
            Button button = (sender as Button);
            var    trans  = (null != button) ? button.DataContext as TSBCouponSummary : null;

            if (null == trans)
            {
                return;
            }

            var search = Search.Users.ById.Create(trans.UserId,
                                                  "ADMINS",
                                                  "ACCOUNT",
                                                  "CTC_MGR", "CTC", "TC",
                                                  "MT_ADMIN", "MT_TECH",
                                                  "FINANCE", "SV",
                                                  "RAD_MGR", "RAD_SUP");
            var user = ops.Users.GetById(search).Value();

            if (null == user)
            {
                return;
            }

            // Raise Event.
            OnPrint.Invoke(this, new PrintCouponReceivedReportEventArgs()
            {
                Transaction = trans,
                User        = user
            });
        }
Example #2
0
    /// <summary>
    /// Submit generic text to the console.
    /// </summary>
    public static void WriteLine(object text, LogType type = LogType.Log)
    {
        string stringText = GetStringFromObject(text);

        if (stringText == null)
        {
            return;
        }

        if (type == LogType.Log)
        {
            Print(stringText);
        }
        else if (type == LogType.Error || type == LogType.Assert || type == LogType.Exception)
        {
            Error(stringText);
        }
        else if (type == LogType.Warning)
        {
            Warn(stringText);
        }

        //invoke the event
        onPrint?.Invoke(stringText, type);
    }
Example #3
0
        // TODO: IsOn(TraceIndex)

        public static void Print(string text)
        {
            var data = Encoding.GetEncoding(1252).GetBytes(text + '\0');

            Send(TronCommand.Print, data);

            OnPrint?.Invoke(text);
        }
 public void Print(string[] text)
 {
     Thread.Sleep(1500);
     if (OnPrint != null)
     {
         OnPrint.Invoke(this, text.Length);
     }
 }
 private void Update()
 {
     if (Input.GetMouseButtonDown(0))
     {
         onLeftClicked.Invoke();
     }
     else if (Input.GetMouseButtonDown(1))
     {
         onRightClicked.Invoke();
         onPrint.Invoke(13);
     }
 }
Example #6
0
        private void Combine(int position, int combinationCount)
        {
            if (_tempStack.Count == combinationCount)
            {
                OnPrint?.Invoke(_tempStack);
                return;
            }

            for (int i = position; i < _taskList.Count; i++)
            {
                _tempStack.Push(_taskList[i]);
                Combine(i + 1, combinationCount);
                _tempStack.Pop();
            }
        }
Example #7
0
        private void Combine(int combinationCount)
        {
            if (_tempStack.Count == combinationCount)
            {
                OnPrint?.Invoke(_tempStack);
                return;
            }

            foreach (var item in _taskList)
            {
                _tempStack.Push(item);
                Combine(combinationCount);
                _tempStack.Pop();
            }
        }
        /// <summary>
        /// Prints message to all outputs.
        /// </summary>
        public void Print()
        {
            if (!_configurations.Any())
            {
                throw new ApplicationException("No printing outputs configured");
            }
            OnPrint?.Invoke(this, new HelloWorldEventArgs(Message));
            foreach (var configuration in _configurations)
            {
                switch (configuration.OutputType)
                {
                case OutputType.Console:
                    configuration.Printer.Print(Message);
                    break;

                default:
                    throw new ArgumentOutOfRangeException();
                }
            }
        }
Example #9
0
 void Print(string PrintValue)
 {
     OnPrint?.Invoke(this, new PrintEventArgs {
         Message = PrintValue
     });
 }
Example #10
0
 public void Print(string s)
 {
     Console.WriteLine(s);
     OnPrint?.Invoke(this, EventArgs.Empty);
 }
Example #11
0
 public static void PrintErr(string text)
 {
     OnPrint?.Invoke(DateTime.Now, DbgPrintType.Err, text);
 }
Example #12
0
 public static void PrintWarn(string text)
 {
     OnPrint?.Invoke(DateTime.Now, DbgPrintType.Warn, text);
 }
Example #13
0
 public static void PrintInfo(string text)
 {
     OnPrint?.Invoke(DateTime.Now, DbgPrintType.Info, text);
 }
Example #14
0
 public static void PrintClearAll()
 {
     OnPrint?.Invoke(DateTime.Now, DbgPrintType.ClearAll, "");
 }