Beispiel #1
0
 private void Redo_Clicked(object sender, MouseButtonEventArgs e)
 {
     if (Redo != null)
     {
         Redo.Execute(null);
     }
 }
Beispiel #2
0
 private void Form1_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.R)
     {
         c = Color.Red;
     }
     if (e.KeyCode == Keys.B)
     {
         c = Color.Black;
     }
     if (e.KeyCode == Keys.Z && e.Control && Stroke.Count > 0)
     {
         //undo
         Redo.Add(Stroke[Stroke.Count - 1]); // need to define Redo as list<pointwithattributes> see where Class is defined!
         Stroke.RemoveAt(Stroke.Count - 1);
         Invalidate();                       //repaint
     }
     if (e.KeyCode == Keys.Y && e.Control && Redo.Count > 0)
     {
         //redo
         Stroke.Add(Redo[Redo.Count - 1]);
         Redo.RemoveAt(Redo.Count - 1);
         Invalidate();
     }
 }
Beispiel #3
0
        //
        // Process reset
        //
        private void OnReset()
        {
            for (uint i = 0; i < puzzle.Guesses.Length; i++)
            {
                puzzle.Guesses[i] = 0;
            }
            userTable = creator.Evaluate(puzzle);

            for (uint i = 0; i < puzzle.Givens.Length; i++)
            {
                uint val = puzzle.Givens[i];
                UICells[i].SetNumber(val);
                UICells[i].SetNumberStatus(false);
                UICells[i].SetGiven(val != 0);
                UICells[i].SetSelected(false);
                UICells[i].ResetPossibles();
            }

            selectedCell     = uint.MaxValue;
            lastSelectedCell = uint.MaxValue;
            logEntries.Clear();
            Undo.SetCanExecute(false);
            Redo.SetCanExecute(false);
            Reset.SetCanExecute(false);
            logIndex = 0;
        }
Beispiel #4
0
 public void MakeHistory(string id = "")
 {
     if (!TrackChanges)
     {
         return;
     }
     if (id == null)
     {
         id = "";
     }
     if (id == "" || id != lastid)
     {
         UndoBuffer.AddLast(Model.Clone());
         RedoBuffer.Clear();
         if (UndoBuffer.Count > 100)
         {
             UndoBuffer.RemoveFirst();
         }
         UnsavedChanges++;
         Device.BeginInvokeOnMainThread(() =>
         {
             Save.ChangeCanExecute();
             Undo.ChangeCanExecute();
             Redo.ChangeCanExecute();
         });
     }
     lastid = id;
 }
 private void Redo_Clicked(object sender, PointerRoutedEventArgs e)
 {
     if (Redo != null)
     {
         Redo.Execute(null);
     }
 }
Beispiel #6
0
 private void Player_HistoryButtonChange(object sender, bool CanUndo, bool CanRedo)
 {
     Device.BeginInvokeOnMainThread(() =>
     {
         Undo.ChangeCanExecute();
         Redo.ChangeCanExecute();
     });
 }
 public LevelEditModel(OGLContext context)
 {
     context.Levels.ToAP(0);
     Context = context;
     Undo    = new Command(() =>
     {
         if (UndoBuffer.Count > 0)
         {
             lastid = "";
             RedoBuffer.AddLast(Model);
             Model = UndoBuffer.Last.Value;
             UndoBuffer.RemoveLast();
             if (UnsavedChanges > 0)
             {
                 UnsavedChanges--;
             }
             Undo.ChangeCanExecute();
             Redo.ChangeCanExecute();
             Save.ChangeCanExecute();
             bool old     = TrackChanges;
             TrackChanges = false;
             FireModelChanged();
             OnPropertyChanged("");
             TrackChanges = old;
         }
     },
                           () => UndoBuffer.Count > 0);
     Redo = new Command(() =>
     {
         if (RedoBuffer.Count > 0)
         {
             lastid = "";
             UndoBuffer.AddLast(Model);
             Model = RedoBuffer.Last.Value;
             RedoBuffer.RemoveLast();
             UnsavedChanges++;
             Undo.ChangeCanExecute();
             Redo.ChangeCanExecute();
             Save.ChangeCanExecute();
             bool old = TrackChanges;
             FireModelChanged();
             TrackChanges = false;
             OnPropertyChanged("");
             TrackChanges = old;
         }
     },
                        () => RedoBuffer.Count > 0);
     Save = new Command(async() =>
     {
         if (IsBusy)
         {
             return;
         }
         IsBusy = true;
         await SaveAsync();
         IsBusy = false;
     }, () => UnsavedChanges > 0);
 }
Beispiel #8
0
 public Print(Document document)
 {
     Execute = delegate { Redo.Log(); document.Print(); };
     Redo    = delegate { Redo.Log(); document.Print(); };
     Undo    = delegate {
         Redo.Log(); Console.WriteLine(
             "Cannot undo a Print ");
     };
 }
Beispiel #9
0
 protected override void OnKeyUp(KeyEventArgs e)
 {
     engine?.inputManager.keyboard.KeyUp(e.Key);
     if (!Undo.Matches(e) && !Redo.Matches(e) && !IsModifierKey(e.Key))
     {
         e.Handled = true;
     }
     base.OnKeyUp(e);
 }
Beispiel #10
0
 private void toolStripButton2_Click(object sender, EventArgs e)//forward
 {
     IsButtonPressed = false;
     Redo?.Invoke(this, EventArgs.Empty);
     textBox1.SelectionStart  = textBox1.Text.Length;
     toolStripButton1.Enabled = true;
     if (RedoesQuantity == 0)
     {
         toolStripButton2.Enabled = false;
     }
 }
Beispiel #11
0
 private void redoRToolStripMenuItem_Click(object sender, EventArgs e)
 {
     try
     {
         Bitmap Information = new Bitmap(image);
         Undo.Push(Information);
         image             = Redo.Pop();
         picDrawArea.Image = image;
         g = Graphics.FromImage(image);
         picDrawArea.Refresh();
     }
     catch
     {
     }
 }
Beispiel #12
0
 public Paste(Document document)
 {
     Execute = delegate
     {
         Execute.Log();
         document.Paste();
     };
     Redo = delegate
     {
         Redo.Log();
         document.Paste();
     };
     Undo = delegate
     {
         Undo.Log();
         document.Restore();
     };
 }
Beispiel #13
0
        private void LogAction(uint position, uint oldNumber, uint newNumber, uint oldPossibles, uint newPossibles)
        {
            var entry = new LogEntry(position, oldNumber, newNumber, oldPossibles, newPossibles, selectedCell);

            if (logIndex < logEntries.Count)
            {
                logEntries[logIndex] = entry;
            }
            else
            {
                logEntries.Add(entry);
            }

            logIndex++;
            Redo.SetCanExecute(false);
            Undo.SetCanExecute(true);
            Reset.SetCanExecute(true);
        }
Beispiel #14
0
        //
        // Process Redo
        //
        private void OnRedo()
        {
            if (logIndex < logEntries.Count)
            {
                var entryToRedo = logEntries[logIndex++];
                if (logIndex == logEntries.Count)
                {
                    Redo.SetCanExecute(false);
                }

                SetNumber(entryToRedo.Position, entryToRedo.NewNumber);
                UICells[entryToRedo.Position].SetPossiblesAsBitList(entryToRedo.NewPossibles);
                UpdateAllNumberAndPossibleStatus();
                UpdateSelection(entryToRedo.SelectedCell);

                Undo.SetCanExecute(true);
                Reset.SetCanExecute(true);
            }
        }
Beispiel #15
0
        //
        // Process Undo
        //
        private void OnUndo()
        {
            if (logIndex > 0)
            {
                var entryToUndo = logEntries[--logIndex];
                if (logIndex == 0)
                {
                    Undo.SetCanExecute(false);
                    Reset.SetCanExecute(false);
                }

                SetNumber(entryToUndo.Position, entryToUndo.OldNumber);
                UICells[entryToUndo.Position].SetPossiblesAsBitList(entryToUndo.OldPossibles);
                UpdateAllNumberAndPossibleStatus();
                UpdateSelection(entryToUndo.SelectedCell);

                Redo.SetCanExecute(true);
            }
        }
Beispiel #16
0
        public void CreateMainMenu(Gtk.Menu menu)
        {
            menu.Append(Undo.CreateAcceleratedMenuItem(Gdk.Key.Z, Gdk.ModifierType.ControlMask));

            ImageMenuItem redo = Redo.CreateAcceleratedMenuItem(Gdk.Key.Z, Gdk.ModifierType.ControlMask | Gdk.ModifierType.ShiftMask);

            redo.AddAccelerator("activate", PintaCore.Actions.AccelGroup, new AccelKey(Gdk.Key.Y, Gdk.ModifierType.ControlMask, AccelFlags.Visible));
            menu.Append(redo);

            menu.AppendSeparator();
            menu.Append(Cut.CreateAcceleratedMenuItem(Gdk.Key.X, Gdk.ModifierType.ControlMask));
            menu.Append(Copy.CreateAcceleratedMenuItem(Gdk.Key.C, Gdk.ModifierType.ControlMask));
            menu.Append(CopyMerged.CreateAcceleratedMenuItem(Gdk.Key.C, Gdk.ModifierType.ControlMask | Gdk.ModifierType.ShiftMask));
            menu.Append(Paste.CreateAcceleratedMenuItem(Gdk.Key.V, Gdk.ModifierType.ControlMask));
            menu.Append(PasteIntoNewLayer.CreateAcceleratedMenuItem(Gdk.Key.V, Gdk.ModifierType.ShiftMask | Gdk.ModifierType.ControlMask));
            menu.Append(PasteIntoNewImage.CreateAcceleratedMenuItem(Gdk.Key.V, Gdk.ModifierType.Mod1Mask | Gdk.ModifierType.ControlMask));

            menu.AppendSeparator();
            menu.Append(SelectAll.CreateAcceleratedMenuItem(Gdk.Key.A, Gdk.ModifierType.ControlMask));

            ImageMenuItem deslect = Deselect.CreateAcceleratedMenuItem(Gdk.Key.A, Gdk.ModifierType.ControlMask | Gdk.ModifierType.ShiftMask);

            deslect.AddAccelerator("activate", PintaCore.Actions.AccelGroup, new AccelKey(Gdk.Key.D, Gdk.ModifierType.ControlMask, AccelFlags.Visible));
            menu.Append(deslect);

            menu.AppendSeparator();
            menu.Append(EraseSelection.CreateAcceleratedMenuItem(Gdk.Key.Delete, Gdk.ModifierType.None));
            menu.Append(FillSelection.CreateAcceleratedMenuItem(Gdk.Key.BackSpace, Gdk.ModifierType.None));
            menu.Append(InvertSelection.CreateAcceleratedMenuItem(Gdk.Key.I, Gdk.ModifierType.ControlMask));

            menu.AppendSeparator();
            Gtk.Action menu_action  = new Gtk.Action("Palette", Mono.Unix.Catalog.GetString("Palette"), null, null);
            Menu       palette_menu = (Menu)menu.AppendItem(menu_action.CreateSubMenuItem()).Submenu;

            palette_menu.Append(LoadPalette.CreateMenuItem());
            palette_menu.Append(SavePalette.CreateMenuItem());
            palette_menu.Append(ResetPalette.CreateMenuItem());
            palette_menu.Append(ResizePalette.CreateMenuItem());

            menu.AppendSeparator();
            menu.Append(AddinManager.CreateMenuItem());
        }
Beispiel #17
0
        private void document_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
        {
            if (string.IsNullOrEmpty(e.PropertyName))
            {
                Redo.RaiseCanExecuteChanged();
                Undo.RaiseCanExecuteChanged();
                return;
            }
            switch (e.PropertyName)
            {
            case nameof(Document.UndoAction):
                RaisePropertyChanged(nameof(UndoHint));
                Undo.RaiseCanExecuteChanged();
                break;

            case nameof(Document.RedoAction):
                Redo.RaiseCanExecuteChanged();
                RaisePropertyChanged(nameof(RedoHint));
                break;

            default:
                break;
            }
        }
Beispiel #18
0
 private void Form1_KeyUp(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Escape)
     {
         if ((pointsTemp.Count() > 1))
         {
             Graphics gTemp = Graphics.FromImage(frameMain);
             prevShape.Points(points.ToArray());
             gTemp = prevShape.DrawS(gTemp);
             g.DrawImage(frameMain, 0, 0);
             if (record)
             {
                 RecordDrawMain.Add((Shape)Activator.CreateInstance(prevShape.GetType(), prevShape));
             }
             else
             {
                 ShapesUndo.Add((Shape)Activator.CreateInstance(prevShape.GetType(), prevShape));
             }
             points     = new List <Point>();
             pointsTemp = new List <Point>();
             gTemp.Dispose();
         }
     }
     if (e.Control && e.KeyCode == Keys.S)
     {
         ToFile.PerformClick();
     }
     if (e.Control && e.KeyCode == Keys.Z)
     {
         Undo.PerformClick();
     }
     if (e.Control && e.KeyCode == Keys.Y)
     {
         Redo.PerformClick();
     }
 }
 public void RedoSound()
 {
     Redo.Play();
 }
        private void Redo(object sender, EventArgs e)
        {
            Redo redo = new Redo();

            redo.Execute(textEditorControl);
        }
 public void Dispose()
 {
     Undo.Dispose();
     Redo.Dispose();
     Clear.Dispose();
 }
Beispiel #22
0
        private void InitUI()
        {
            Debug.WriteLine("Initializing UI objects.");

            #region Editor and Canvas

            Debug.WriteLine("Loading canvas...");
            this.editor = new DefaultEditor();
            this.toolStripContainer1.ContentPanel.Controls.Add((Control)this.editor);

            ICanvas canvas = new DefaultCanvas();
            canvas.Name = "Pattern Design";
            this.editor.AddCanvas(canvas);

            #endregion

            #region Commands

            //command di menubar file
            GenerateFile addGenerateFile = new GenerateFile(canvas);
            Save         save            = new Save(canvas);
            OpenFile     open            = new OpenFile(canvas);
            Exit         exit            = new Exit();

            //command di menubar edit
            undo  = new Undo(canvas);
            redo  = new Redo(canvas);
            copy  = new Copy(canvas);
            paste = new Paste(canvas);

            //command di menubar generate
            AddPattern1         addPattern1         = new AddPattern1(canvas);
            AddFactoryPattern   addFactoryPattern   = new AddFactoryPattern(canvas);
            AddCommandPattern   addCommandPattern   = new AddCommandPattern(canvas);
            AddCompositePattern addCompositePattern = new AddCompositePattern(canvas);
            AddFacadePattern    addFacadePattern    = new AddFacadePattern(canvas);
            AddMementoPattern   addMementroPattern  = new AddMementoPattern(canvas);
            AddSingletonPattern addSingletonPattern = new AddSingletonPattern(canvas);

            #endregion

            #region Menubar

            Debug.WriteLine("Loading menubar...");
            this.menubar = new DefaultMenubar();
            this.Controls.Add((Control)this.menubar);

            //menubar file
            DefaultMenuItem fileMenuItem = new DefaultMenuItem("File");
            this.menubar.AddMenuItem(fileMenuItem);

            DefaultMenuItem generateFile = new DefaultMenuItem("Generate Class File");
            generateFile.SetCommand(addGenerateFile);
            fileMenuItem.AddMenuItem(generateFile);

            DefaultMenuItem openItem = new DefaultMenuItem("Open");
            openItem.SetCommand(open);
            fileMenuItem.AddMenuItem(openItem);

            DefaultMenuItem saveItem = new DefaultMenuItem("Save");
            saveItem.SetCommand(save);
            fileMenuItem.AddMenuItem(saveItem);

            fileMenuItem.AddSeparator();

            DefaultMenuItem exitMenuItem = new DefaultMenuItem("Exit");
            exitMenuItem.SetCommand(exit);
            fileMenuItem.AddMenuItem(exitMenuItem);

            //menubar edit
            DefaultMenuItem editMenuItem = new DefaultMenuItem("Edit");
            this.menubar.AddMenuItem(editMenuItem);

            DefaultMenuItem undoItem = new DefaultMenuItem("Undo");
            undoItem.SetCommand(undo);
            editMenuItem.AddMenuItem(undoItem);

            DefaultMenuItem redoItem = new DefaultMenuItem("Redo");
            redoItem.SetCommand(redo);
            editMenuItem.AddMenuItem(redoItem);

            DefaultMenuItem copyItem = new DefaultMenuItem("Copy");
            copyItem.SetCommand(copy);
            editMenuItem.AddMenuItem(copyItem);

            DefaultMenuItem pasteItem = new DefaultMenuItem("Paste");
            pasteItem.SetCommand(paste);
            editMenuItem.AddMenuItem(pasteItem);

            //menubar generate
            DefaultMenuItem generateMenuItem = new DefaultMenuItem("Generate");
            this.menubar.AddMenuItem(generateMenuItem);

            DefaultMenuItem creationalSubMenu = new DefaultMenuItem("Creational Pattern");
            generateMenuItem.AddMenuItem(creationalSubMenu);

            DefaultMenuItem structuralSubMenu = new DefaultMenuItem("Structural Pattern");
            generateMenuItem.AddMenuItem(structuralSubMenu);

            DefaultMenuItem behavioralSubMenu = new DefaultMenuItem("Behavioral Pattern");
            generateMenuItem.AddMenuItem(behavioralSubMenu);

            DefaultMenuItem factoryMenuItem = new DefaultMenuItem("Factory Pattern");
            factoryMenuItem.SetCommand(addFactoryPattern);
            creationalSubMenu.AddMenuItem(factoryMenuItem);

            DefaultMenuItem singletonMenuItem = new DefaultMenuItem("Singleton Pattern");
            singletonMenuItem.SetCommand(addSingletonPattern);
            creationalSubMenu.AddMenuItem(singletonMenuItem);

            DefaultMenuItem compositeMenuItem = new DefaultMenuItem("Composite Pattern");
            compositeMenuItem.SetCommand(addCompositePattern);
            structuralSubMenu.AddMenuItem(compositeMenuItem);

            DefaultMenuItem facadeMenuItem = new DefaultMenuItem("Facade Pattern");
            facadeMenuItem.SetCommand(addFacadePattern);
            structuralSubMenu.AddMenuItem(facadeMenuItem);

            DefaultMenuItem commandMenuItem = new DefaultMenuItem("Command Pattern");
            commandMenuItem.SetCommand(addCommandPattern);
            behavioralSubMenu.AddMenuItem(commandMenuItem);

            DefaultMenuItem mementoMenuItem = new DefaultMenuItem("Memento Pattern");
            mementoMenuItem.SetCommand(addMementroPattern);
            behavioralSubMenu.AddMenuItem(mementoMenuItem);

            #endregion

            #region Toolbox

            // Initializing toolbox
            Debug.WriteLine("Loading toolbox...");
            this.toolbox = new DefaultToolbox();
            this.toolStripContainer1.LeftToolStripPanel.Controls.Add((Control)this.toolbox);
            this.editor.Toolbox = toolbox;

            #endregion

            #region Tools


            // Initializing tools
            Debug.WriteLine("Loading tools...");
            this.toolbox.AddTool(new SelectionTool());
            this.toolbox.AddSeparator();
            //this.toolbox.AddTool(new LineTool());
            this.toolbox.AddTool(new ClassTool());
            this.toolbox.AddSeparator();
            this.toolbox.AddTool(new AssociationTool());
            this.toolbox.AddTool(new DirectedTool());
            this.toolbox.AddTool(new GeneralizationTool());
            this.toolbox.AddTool(new DependencyTool());
            this.toolbox.AddTool(new RealizationTool());
            this.toolbox.AddSeparator();
            //this.toolbox.AddTool(new DeleteTool());
            this.toolbox.ToolSelected += Toolbox_ToolSelected;

            #endregion

            #region Toolbar

            // Initializing toolbar
            Debug.WriteLine("Loading toolbar...");
            this.toolbar = new DefaultToolbar();
            this.toolStripContainer1.TopToolStripPanel.Controls.Add((Control)this.toolbar);

            UndoToolItem undoToolItem = new UndoToolItem(canvas);
            undoToolItem.SetCommand(undo);
            RedoToolItem redoToolItem = new RedoToolItem(canvas);
            redoToolItem.SetCommand(redo);
            SaveToolbarItem saveToolItem = new SaveToolbarItem(canvas);
            saveToolItem.SetCommand(save);

            OpenToolbarItem openToolItem = new OpenToolbarItem(canvas);
            openToolItem.SetCommand(open);

            CopyToolbarItem copyToolItem = new CopyToolbarItem(canvas);
            copyToolItem.SetCommand(copy);
            PasteToolbarItem pasteToolItem = new PasteToolbarItem(canvas);
            pasteToolItem.SetCommand(paste);


            this.toolbar.AddToolbarItem(openToolItem);
            this.toolbar.AddToolbarItem(saveToolItem);
            this.toolbar.AddSeparator();
            this.toolbar.AddToolbarItem(undoToolItem);
            this.toolbar.AddToolbarItem(redoToolItem);
            this.toolbar.AddSeparator();
            this.toolbar.AddToolbarItem(copyToolItem);
            this.toolbar.AddToolbarItem(pasteToolItem);


            #endregion
        }
Beispiel #23
0
        public void RegisterActions(Gtk.Application app, GLib.Menu menu)
        {
            app.AddAccelAction(Undo, "<Primary>Z");
            menu.AppendItem(Undo.CreateMenuItem());

            app.AddAccelAction(Redo, new[] { "<Primary><Shift>Z", "<Ctrl>Y" });
            menu.AppendItem(Redo.CreateMenuItem());

            var paste_section = new GLib.Menu();

            menu.AppendSection(null, paste_section);

            app.AddAccelAction(Cut, "<Primary>X");
            paste_section.AppendItem(Cut.CreateMenuItem());

            app.AddAccelAction(Copy, "<Primary>C");
            paste_section.AppendItem(Copy.CreateMenuItem());

            app.AddAccelAction(CopyMerged, "<Primary><Shift>C");
            paste_section.AppendItem(CopyMerged.CreateMenuItem());

            app.AddAccelAction(Paste, "<Primary>V");
            paste_section.AppendItem(Paste.CreateMenuItem());

            app.AddAccelAction(PasteIntoNewLayer, "<Primary><Shift>V");
            paste_section.AppendItem(PasteIntoNewLayer.CreateMenuItem());

            app.AddAccelAction(PasteIntoNewImage, "<Primary><Alt>V");
            paste_section.AppendItem(PasteIntoNewImage.CreateMenuItem());

            var sel_section = new GLib.Menu();

            menu.AppendSection(null, sel_section);

            app.AddAccelAction(SelectAll, "<Primary>A");
            sel_section.AppendItem(SelectAll.CreateMenuItem());

            app.AddAccelAction(Deselect, new[] { "<Primary><Shift>A", "<Ctrl>D" });
            sel_section.AppendItem(Deselect.CreateMenuItem());

            var edit_sel_section = new GLib.Menu();

            menu.AppendSection(null, edit_sel_section);

            app.AddAccelAction(EraseSelection, "Delete");
            edit_sel_section.AppendItem(EraseSelection.CreateMenuItem());

            app.AddAccelAction(FillSelection, "BackSpace");
            edit_sel_section.AppendItem(FillSelection.CreateMenuItem());

            app.AddAccelAction(InvertSelection, "<Primary>I");
            edit_sel_section.AppendItem(InvertSelection.CreateMenuItem());

            var palette_section = new GLib.Menu();

            menu.AppendSection(null, palette_section);

            var palette_menu = new GLib.Menu();

            menu.AppendSubmenu(Translations.GetString("Palette"), palette_menu);

            app.AddAction(LoadPalette);
            palette_menu.AppendItem(LoadPalette.CreateMenuItem());

            app.AddAction(SavePalette);
            palette_menu.AppendItem(SavePalette.CreateMenuItem());

            app.AddAction(ResetPalette);
            palette_menu.AppendItem(ResetPalette.CreateMenuItem());

            app.AddAction(ResizePalette);
            palette_menu.AppendItem(ResizePalette.CreateMenuItem());
        }
Beispiel #24
0
        static void Run(bool noredo)
        {
            // CancellationTokenSource cts = new CancellationTokenSource();

            // ThreadPool.SetMinThreads(3, 3);

            // Максимальное количество соединений с конечной точкой
            ServicePointManager.DefaultConnectionLimit = Settings.ConnectionLimit;

            ManualResetEvent[] CancelTaskEvents = new ManualResetEvent[2];

            Task task;
            Redo redo = new Redo("Redo");
            // Не отправляем реестры в МТС
            // GWMtsRegister regs = new GWMtsRegister();
            TaskState stateInfo;

            if (!noredo)
            {
                // Запустить процесс допроведения платежей
                CancelTaskEvents[0] = new ManualResetEvent(false);
                stateInfo           = new TaskState(CancelTaskEvents[0]);
                task = new System.Threading.Tasks.Task(redo.Run, stateInfo, TaskCreationOptions.LongRunning);
                task.Start();
                Oldi.Net.Utility.Log(Settings.OldiGW.LogFile, "Запущен процесс допроведения платежей");

                /* Реестры МТС
                 * CancelTaskEvents[1] = new ManualResetEvent(false);
                 *              stateInfo = new TaskState(CancelTaskEvents[1]);
                 *              task = new System.Threading.Tasks.Task(regs.ProcessingRegisters, stateInfo, TaskCreationOptions.LongRunning);
                 *              task.Start();
                 *              Oldi.Net.Utility.Log(Settings.OldiGW.LogFile, "Запущен процесс отправки реестров МТС");
                 */

                // Запуск процесса отправки СМС
                // task = new Task(GWRequest.SendSmsProcess, TaskCreationOptions.LongRunning | TaskCreationOptions.AttachedToParent);
                // task.Start();
                // Oldi.Net.Utility.Log(Settings.OldiGW.LogFile, "Запущен процесс отправки СМС");
            }

            // Запуск слушателя
            try
            {
                Log($"Регистрация сертифика службы SMPP: {SubjectName}");

                GWListener listener = new GWListener(Settings.OldiGW.LogFile, Settings.Port, Settings.SslPort);
                listener.Run();
                stop = true;
                // Остановить слушатель
                listener.Dispose();
            }
            catch (Exception ex)
            {
                Log(ex.ToString());
            }

            Console.WriteLine("{0} останавливается...", Settings.Title);
            Log("{0} останавливается...", Settings.Title);

            // Остановка процессов допроведения

            /* Пока отложим надо разбираться
             * if (!noredo)
             *                  WaitHandle.WaitAll(CancelTaskEvents, new TimeSpan(0, 0, 5), false);
             */

            // Остановка службы
            // Console.WriteLine("Служба {0} остановлена", Settings.Title);
            Log($"Служба {Settings.Title} остановлена");

            // Перезагрузка службы
            if (Reload)
            {
                Log("Перезагрузка....");
                stop                 = false;
                Reload               = false;
                Redo.Canceling       = false;
                GWListener.Canceling = false;
            }
        }
Beispiel #25
0
 public void ExecuteRedo()
 {
     Redo?.Invoke();
 }
Beispiel #26
0
 private void RedoInvoke() => Redo.InvokeAsync();
Beispiel #27
0
 private void Player_HistoryButtonChange(object sender, bool CanUndo, bool CanRedo)
 {
     Undo.ChangeCanExecute();
     Redo.ChangeCanExecute();
 }
Beispiel #28
0
        void RedoToolStripMenuItemClick(object sender, EventArgs e)
        {
            Redo redo = new Redo();

            redo.Run();
        }
Beispiel #29
0
 public void CreateHistoryWindowToolBar(Gtk.Toolbar toolbar)
 {
     toolbar.AppendItem(Undo.CreateToolBarItem());
     toolbar.AppendItem(Redo.CreateToolBarItem());
 }
        /// <summary>
        /// defines all of the actions
        /// </summary>
        public void DefineActions()
        {
            Click              click             = new Click();
            Clear              clear             = new Clear();
            Close              close             = new Close();
            Exit               exit              = new Exit();
            Next_Tab           next_tab          = new Next_Tab();
            Previous_Tab       previous_tab      = new Previous_Tab();
            WindowsCtrlTab     wtab              = new WindowsCtrlTab();
            Idle               idle              = new Idle();
            Next_Selection     nextSelection     = new Next_Selection();
            Previous_Selection previousSelection = new Previous_Selection();
            Scroll_Down        scrollDown        = new Scroll_Down();
            Scroll_Up          scrollUp          = new Scroll_Up();
            MousePress         mousePress        = new MousePress();
            MouseRelease       mouseRelease      = new MouseRelease();
            MultipleSelection  multipleSelection = new MultipleSelection();
            Maximize           maximize          = new Maximize();
            Minimize           minimize          = new Minimize();
            Lock               locking           = new Lock();
            Unlock             unlocking         = new Unlock();
            Undo               undo              = new Undo();
            Redo               redo              = new Redo();
            Open               open              = new Open();


            //defining the click actions
            QlikMove.StandardHelper.ActionCore.Action clickAction = new QlikMove.StandardHelper.ActionCore.Action(ActionName.SIMPLE_SELECTION, new ActionPart[1] {
                click
            });
            this.AddAction(clickAction);

            //defining the mouse press actions
            QlikMove.StandardHelper.ActionCore.Action mousePressedAction = new QlikMove.StandardHelper.ActionCore.Action(ActionName.MOUSE_PRESS, new ActionPart[1] {
                mousePress
            });
            this.AddAction(mousePressedAction);

            //defining the mouse release actions
            QlikMove.StandardHelper.ActionCore.Action mouseReleasedAction = new QlikMove.StandardHelper.ActionCore.Action(ActionName.MOUSE_RELEASE, new ActionPart[1] {
                mouseRelease
            });
            this.AddAction(mouseReleasedAction);


            //defining the exit action
            QlikMove.StandardHelper.ActionCore.Action exitAction = new StandardHelper.ActionCore.Action(ActionName.EXIT, new ActionPart[1] {
                exit
            });
            this.AddAction(exitAction);

            //defining the next action
            QlikMove.StandardHelper.ActionCore.Action nextAction = new StandardHelper.ActionCore.Action(ActionName.NEXT_TAB, new ActionPart[1] {
                next_tab
            });
            this.AddAction(nextAction);

            //defining the previous action
            QlikMove.StandardHelper.ActionCore.Action previousAction = new StandardHelper.ActionCore.Action(ActionName.PREVIOUS_TAB, new ActionPart[1] {
                previous_tab
            });
            this.AddAction(previousAction);

            //defining the menu action
            QlikMove.StandardHelper.ActionCore.Action tabsAction = new QlikMove.StandardHelper.ActionCore.Action(ActionName.MENU, new ActionPart[1] {
                wtab
            });
            this.AddAction(tabsAction);

            //defining the idle action
            QlikMove.StandardHelper.ActionCore.Action idleAction = new QlikMove.StandardHelper.ActionCore.Action(ActionName.IDLE, new ActionPart[1] {
                idle
            });
            this.AddAction(idleAction);

            //defining the next selection action
            QlikMove.StandardHelper.ActionCore.Action nextSelectionAction = new QlikMove.StandardHelper.ActionCore.Action(ActionName.NEXT_SELECTION, new ActionPart[1] {
                nextSelection
            });
            this.AddAction(nextSelectionAction);

            //defining the previous selection action
            QlikMove.StandardHelper.ActionCore.Action previousSelectionAction = new QlikMove.StandardHelper.ActionCore.Action(ActionName.PREVIOUS_SELECTION, new ActionPart[1] {
                previousSelection
            });
            this.AddAction(previousSelectionAction);

            //defining the scrolling down action
            QlikMove.StandardHelper.ActionCore.Action scrollDownAction = new StandardHelper.ActionCore.Action(ActionName.SCROLL_DOWN, new ActionPart[1] {
                scrollDown
            });
            this.AddAction(scrollDownAction);

            //defining the scrolling up action
            QlikMove.StandardHelper.ActionCore.Action scrollUpAction = new StandardHelper.ActionCore.Action(ActionName.SCROLL_UP, new ActionPart[1] {
                scrollUp
            });
            this.AddAction(scrollUpAction);

            //defining the multiple selection action
            QlikMove.StandardHelper.ActionCore.Action multipleSelectionAction = new StandardHelper.ActionCore.Action(ActionName.MULTIPLE_SELECTION, new ActionPart[1] {
                multipleSelection
            });
            this.AddAction(multipleSelectionAction);

            //defining the maximize action
            QlikMove.StandardHelper.ActionCore.Action maximizeAction = new StandardHelper.ActionCore.Action(ActionName.MAX, new ActionPart[1] {
                maximize
            });
            this.AddAction(maximizeAction);

            //defining the minimize action
            QlikMove.StandardHelper.ActionCore.Action minimizeAction = new StandardHelper.ActionCore.Action(ActionName.MIN, new ActionPart[1] {
                minimize
            });
            this.AddAction(minimizeAction);

            //defining the clear action
            QlikMove.StandardHelper.ActionCore.Action clearAction = new StandardHelper.ActionCore.Action(ActionName.CLEAR, new ActionPart[1] {
                clear
            });
            this.AddAction(clearAction);

            //defining the undo action
            QlikMove.StandardHelper.ActionCore.Action undoAction = new StandardHelper.ActionCore.Action(ActionName.UNDO, new ActionPart[1] {
                undo
            });
            this.AddAction(undoAction);

            //defining the redo action
            QlikMove.StandardHelper.ActionCore.Action redoAction = new StandardHelper.ActionCore.Action(ActionName.REDO, new ActionPart[1] {
                redo
            });
            this.AddAction(redoAction);

            //defining the locking action
            QlikMove.StandardHelper.ActionCore.Action lockingAction = new StandardHelper.ActionCore.Action(ActionName.LOCK, new ActionPart[1] {
                locking
            });
            this.AddAction(lockingAction);

            //defining the unlocking action
            QlikMove.StandardHelper.ActionCore.Action unlockingAction = new StandardHelper.ActionCore.Action(ActionName.UNLOCK, new ActionPart[1] {
                unlocking
            });
            this.AddAction(unlockingAction);

            //defining the close action
            QlikMove.StandardHelper.ActionCore.Action closeAction = new StandardHelper.ActionCore.Action(ActionName.CLOSE, new ActionPart[1] {
                close
            });
            this.AddAction(closeAction);

            //defining the open action
            QlikMove.StandardHelper.ActionCore.Action openAction = new StandardHelper.ActionCore.Action(ActionName.OPEN, new ActionPart[1] {
                open
            });
            this.AddAction(openAction);

            LogHelper.logInput("Actions defined", LogHelper.logType.INFO, this);
        }