private void OnPrinting(int current)
        {
            var args = new PrintingEventArgs {
                CurrentPage = current
            };

            Printing?.Invoke(this, args);
            Thread.Sleep(1500);
        }
Beispiel #2
0
        private void Permutate(int position)
        {
            if (position == _arrayLength)
            {
                Printing?.Invoke(_array);
                return;
            }

            for (int i = position; i < _arrayLength; i++)
            {
                Swap(i, position);
                Permutate(position + 1);
                Swap(i, position);
            }
        }
        public void Print <TEntity>(TEntity entity)
        {
            Printing?.Invoke(this, new EventArgs());

            Console.WriteLine(entity);

            // TODO zapisz do logu

            //if (log != null)
            //{
            //    log.Invoke($"LOG: {entity}");
            //}

            // C# 6.0
            log?.Invoke($"LOG: {entity}");

            Finished?.Invoke("koniec wydruku");
        }
Beispiel #4
0
        private void Permutate(Stack <string> tempStack)
        {
            if (tempStack.Count == _arrayLength)
            {
                // call print event.
                Printing?.Invoke(tempStack);
                return;
            }

            foreach (var item in _array)
            {
                if (tempStack.Contains(item))
                {
                    continue;
                }
                tempStack.Push(item);
                Permutate(tempStack);
                tempStack.Pop();
            }
        }
Beispiel #5
0
        protected virtual void OnPrinted(PrintEventArgs e)
        {
            EventHandler <PrintEventArgs> temp = Printing;

            Printing?.Invoke(this, e);
        }
Beispiel #6
0
 protected virtual void OnPrinting(PrintingEventArgs e)
 {
     Printing?.Invoke(new object(), e);
 }
Beispiel #7
0
        private void PrintCupom_PrintPage(object sender, PrintPageEventArgs e)
        {
            var tools = new PrinterTools(e);

            Printing.Invoke(this, tools);
        }