Esempio n. 1
0
 private void maze_OnChange(object sender) {
     if (this.InvokeRequired) {
         RefreshCallback c = new RefreshCallback(this.Refresh);
         this.Invoke(c, new object[] { });
     } else
         this.Refresh();
 }
Esempio n. 2
0
        public ConfirmDialogueViewModels(List <SingleGridMapItemViewModels> SelectedMapItemsss,
                                         Models.Entity.Map map,
                                         Window selfWindow, RefreshCallback callback, MainStatusCallBack mainStatusCallBack
                                         )
        {
            this.SelectedMapItems = SelectedMapItemsss;
            this.self             = selfWindow;
            this._map             = map;

            this.refreshCallback    = callback;
            this.mainStatusCallBack = mainStatusCallBack;
            ExecuteSaveCommand      = new DelegateCommand(ExecuteSaveCommandDo, CanExecuteSaveCommandDo);
        }
Esempio n. 3
0
 private void OnRefresh(object source, ElapsedEventArgs e)
 {
     if (this.propertyGrid.InvokeRequired)
     {
         RefreshCallback d = new RefreshCallback(propertyGrid.Refresh);
         if (this.IsHandleCreated)
         {
             this.Invoke(d, new object[] { });
         }
     }
     else
     {
         propertyGrid.Refresh();
     }
 }
Esempio n. 4
0
        public YahooWeatherControl(YahooWeatherCondition initialCondition, int X, int Y)
            : base(X, Y, 400, 136)
        {
            _buffer       = new Bitmap(Width, Height);
            _remakeBuffer = true;
            _weather      = initialCondition;

            _refreshTimer = new Timer((o) =>
            {
                _remakeBuffer = true;
                RefreshParent();
            }, null, Timeout.Infinite, Timeout.Infinite);

            RefreshMethod = new RefreshCallback(Refresh);
        }
Esempio n. 5
0
 public void UpdateStackDisplay()
 {
     if (iPrevSP != Regs[14].ReadLong())
     {
         CreateStackBag((uint)(iPrevSP = Regs[14].ReadLong()));
     }
     if (gridStack.InvokeRequired)
     {
         RefreshCallback cb = new RefreshCallback(gridStack.Refresh);
         this.Invoke(cb, new object[] { });
     }
     else
     {
         gridStack.Refresh();
     }
 }
Esempio n. 6
0
 private void Refresh(PictureBox target)
 {
     if (target.InvokeRequired)
     {
         RefreshCallback d = new RefreshCallback(Refresh);
         try
         {
             this.Invoke(d, new object[] { target });
         }
         catch
         {
         }
     }
     else
     {
         target.Refresh();
     }
 }
Esempio n. 7
0
 internal void RefreshLog(string newLine)
 {
     if (InvokeRequired)
     {
         RefreshCallback callback = new RefreshCallback(RefreshLog);
         try
         {
             Invoke(callback, new object[] { newLine });
         }
         catch (Exception)
         {
         }
     }
     else
     {
         RefreshLogLines(newLine);
     }
 }
Esempio n. 8
0
        private DialogResult OpenModalForm(Form screen, TacticalEnvironment environment)
        {
            Form mainForm = null;

            if (Application.OpenForms.Count > 0)
            {
                mainForm = Application.OpenForms[0];
            }

            if (mainForm != null && mainForm.InvokeRequired)
            {
                RefreshCallback d = OpenModalForm;
                return((DialogResult)mainForm.Invoke(d, screen, environment));
            }

            screen.Tag = environment;

            return(screen.ShowDialog());
        }
Esempio n. 9
0
        private DialogResult OpenModalForm(Form screen, GameEvent gameEvent, GameSession gameSession)
        {
            Form mainForm = null;

            if (Application.OpenForms.Count > 0)
            {
                mainForm = Application.OpenForms[0];
            }

            if (mainForm != null && mainForm.InvokeRequired)
            {
                RefreshCallback d = OpenModalForm;
                return((DialogResult)mainForm.Invoke(d, screen, gameEvent, gameSession));
            }

            Logger.Info($"Received game event ({gameEvent.Id}). Open dialog.");

            return(screen.ShowDialog());
        }
Esempio n. 10
0
 public RefreshIndicator(
     Key key                   = null,
     Widget child              = null,
     float displacement        = 40.0f,
     RefreshCallback onRefresh = null,
     Color color               = null,
     Color backgroundColor     = null,
     ScrollNotificationPredicate notificationPredicate = null
     ) : base(key: key)
 {
     D.assert(child != null);
     D.assert(onRefresh != null);
     this.child                 = child;
     this.displacement          = displacement;
     this.onRefresh             = onRefresh;
     this.color                 = color;
     this.backgroundColor       = backgroundColor;
     this.notificationPredicate = notificationPredicate ?? ScrollNotification.defaultScrollNotificationPredicate;
 }
Esempio n. 11
0
        public void RefreshPluginListSafely()
        {
            if (lvPlugins.InvokeRequired)
            {
                RefreshCallback d = new RefreshCallback(RefreshPluginListSafely);
                this.Invoke(d);
            }
            else
            {
                lvPlugins.Items.Clear();

                foreach (ActivePlugin ap in pluginServices.ActivePlugins)
                {
                    ListViewItem lvi = new ListViewItem(ap.Instance.Name);
                    lvi.SubItems.Add(new ListViewItem.ListViewSubItem(lvi, ap.Instance.Version));
                    lvPlugins.Items.Add(lvi);
                }
            }
        }
Esempio n. 12
0
 public CupertinoSliverRefreshControl(
     Key key = null,
     float refreshTriggerPullDistance       = _defaultRefreshTriggerPullDistance,
     float refreshIndicatorExtent           = _defaultRefreshIndicatorExtent,
     RefreshControlIndicatorBuilder builder = null,
     RefreshCallback onRefresh = null
     ) : base(key: key)
 {
     D.assert(refreshTriggerPullDistance != null);
     D.assert(refreshTriggerPullDistance > 0.0);
     D.assert(refreshIndicatorExtent != null);
     D.assert(refreshIndicatorExtent >= 0.0);
     D.assert(
         refreshTriggerPullDistance >= refreshIndicatorExtent, () =>
         "The refresh indicator cannot take more space in its final state " +
         "than the amount initially created by overscrolling."
         );
     this.refreshIndicatorExtent     = refreshIndicatorExtent;
     this.refreshTriggerPullDistance = refreshTriggerPullDistance;
     this.builder   = builder ?? buildSimpleRefreshIndicator;
     this.onRefresh = onRefresh;
 }
Esempio n. 13
0
 public void properRefresh()
 {
     if (!simPanel.continueSimulation)
     {
         return;
     }
     if (this.viewPanel.InvokeRequired)
     {
         RefreshCallback rC = new RefreshCallback(properRefresh);
         try {
             this.Invoke(rC, null);
         }
         catch (System.ObjectDisposedException e) {
             Console.WriteLine(e.Message);
             return;
         }
     }
     else
     {
         viewPanel.Refresh();
     }
 }
        private static DialogResult CallModalForm(GameEvent gameEvent, GameSession gameSession)
        {
            Form mainForm = null;

            if (Application.OpenForms.Count > 0)
            {
                mainForm = Application.OpenForms[0];
            }

            if (mainForm != null && mainForm.InvokeRequired)
            {
                RefreshCallback d = CallModalForm;
                return((DialogResult)mainForm.Invoke(d, gameEvent, gameSession));
            }

            var windowAnomalyFound = new WindowAnomalyFound
            {
                ShowInTaskbar = false,
                ShowIcon      = false,
                GameEvent     = gameEvent
            };

            return(windowAnomalyFound.ShowDialog());
        }
        public YahooWeatherControl(YahooWeatherCondition initialCondition, int X, int Y)
            : base(X, Y, 400, 136)
        {
            _buffer = new Bitmap(Width, Height);
            _remakeBuffer = true;
            _weather = initialCondition;

            _refreshTimer = new Timer((o) =>
                {
                    _remakeBuffer = true;
                    RefreshParent();
                }, null, Timeout.Infinite, Timeout.Infinite);

            RefreshMethod = new RefreshCallback(Refresh);
        }
Esempio n. 16
0
 public void RefreshMap()
 {
     if (this.InvokeRequired)
     {
         RefreshCallback d = new RefreshCallback(RefreshMap);
         this.Invoke(d, new object[] { });
     }
     else
     {
         this.Refresh();
     }
 }
 public override void Dispose()
 {
     _refreshMethod = null;
     base.Dispose();
 }
Esempio n. 18
0
 /// <summary>Constructor</summary>
 public FrmChat()
 {
     InitializeComponent();
     timerRTTsend.Tick += new EventHandler(timerRTTsend_Tick);
     delegateRefresh = new RefreshCallback(UpdateConversationWindow);
     convoUpdateTimer.Tick += new EventHandler(convoUpdateTimer_Tick);
     lastSendBox = textboxSendMsg1;
 }
Esempio n. 19
0
        static void GetTileTexFromTileAnim(TileAnim anim)
        {
            if (anim.Frames.Count == 1)
            {
                inAnimMode = false;
                chosenTileset = anim.Frames[0].Sheet;
                chosenTile = anim.Frames[0].Texture;

                currentTileset = chosenTileset;

                //refresh
                RefreshCallback refresh = new RefreshCallback(MainPanel.CurrentMapEditor.RefreshTileSelect);
                MainPanel.CurrentMapEditor.Invoke(refresh);
            }
            else if (anim.Frames.Count > 1)
            {
                inAnimMode = true;

                chosenAnim = new TileAnim(anim);

                //refresh
                RefreshCallback refresh = new RefreshCallback(MainPanel.CurrentMapEditor.RefreshTileSelect);
                MainPanel.CurrentMapEditor.Invoke(refresh);
            }
        }
Esempio n. 20
0
 public void Close()
 {
     gameObject.SetActive(false);
     m_RefreshCallback = null;
 }
Esempio n. 21
0
 private void Refresh(PictureBox target)
 {
     if (target.InvokeRequired)
     {
         RefreshCallback d = new RefreshCallback(Refresh);
         try
         {
             this.Invoke(d, new object[] { target });
         }
         catch
         {
         }
     }
     else
     {
         target.Refresh();
     }
 }
Esempio n. 22
0
        public async Task DeletePefLogDialog_OnDialogClose()
        {
            await PerfLogDisplayService.DeleteById(_itemToBeDeleted);

            await RefreshCallback.InvokeAsync(true);
        }
 public override void Dispose()
 {
     _refreshMethod = null;
     base.Dispose();
 }
Esempio n. 24
0
 private void OnRefresh(object source, ElapsedEventArgs e)
 {
     if (this.propertyGrid.InvokeRequired)
       {
     RefreshCallback d = new RefreshCallback(propertyGrid.Refresh);
     if (this.IsHandleCreated)
     {
       this.Invoke(d, new object[] { });
     }
       }
       else
     propertyGrid.Refresh();
 }
Esempio n. 25
0
        /// <summary>
        /// Starts the given task!
        /// </summary>
        /// <param name="task">The task to start</param>
        /// <param name="control">The control object, which will be synced with the timer</param>
        /// <param name="callback">A callback function which will be called wheneber the given task have been modified</param>
        /// <returns>Return TRUE if the task has started</returns>
        public Boolean StartTask(Model.Task task, Control control, RefreshCallback callback)
        {
            if (runningTask != null) return false;

            this.callback = callback;

            runningTask = taskList.Where(t => t.ID == task.ID).First();
            taskTimer = new System.Timers.Timer();
            taskTimer.Interval = 1000;
            taskTimer.Elapsed += TaskTimer_Elapsed;
            taskTimer.SynchronizingObject = control;
            taskTimer.Start();

            runningTaskTime = new TaskTime();
            runningTaskTime.TaskID = runningTask.ID;
            runningTaskTime.StartTime = DateTime.Now;
            return true;
        }