コード例 #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();
 }
コード例 #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);
        }
コード例 #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();
     }
 }
コード例 #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);
        }
コード例 #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();
     }
 }
コード例 #6
0
ファイル: MainForm.cs プロジェクト: akiken/TetrisV0
 private void Refresh(PictureBox target)
 {
     if (target.InvokeRequired)
     {
         RefreshCallback d = new RefreshCallback(Refresh);
         try
         {
             this.Invoke(d, new object[] { target });
         }
         catch
         {
         }
     }
     else
     {
         target.Refresh();
     }
 }
コード例 #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);
     }
 }
コード例 #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());
        }
コード例 #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());
        }
コード例 #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;
 }
コード例 #11
0
ファイル: MainForm.cs プロジェクト: benbu/remotocon
        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);
                }
            }
        }
コード例 #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;
 }
コード例 #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();
     }
 }
コード例 #14
0
        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());
        }
コード例 #15
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);
        }
コード例 #16
0
 public void RefreshMap()
 {
     if (this.InvokeRequired)
     {
         RefreshCallback d = new RefreshCallback(RefreshMap);
         this.Invoke(d, new object[] { });
     }
     else
     {
         this.Refresh();
     }
 }
コード例 #17
0
 public override void Dispose()
 {
     _refreshMethod = null;
     base.Dispose();
 }
コード例 #18
0
ファイル: FrmChat.cs プロジェクト: jahan33/realjabber
 /// <summary>Constructor</summary>
 public FrmChat()
 {
     InitializeComponent();
     timerRTTsend.Tick += new EventHandler(timerRTTsend_Tick);
     delegateRefresh = new RefreshCallback(UpdateConversationWindow);
     convoUpdateTimer.Tick += new EventHandler(convoUpdateTimer_Tick);
     lastSendBox = textboxSendMsg1;
 }
コード例 #19
0
ファイル: MapEditor.cs プロジェクト: blastboy/PMD-Toolkit
        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);
            }
        }
コード例 #20
0
 public void Close()
 {
     gameObject.SetActive(false);
     m_RefreshCallback = null;
 }
コード例 #21
0
ファイル: MainForm.cs プロジェクト: akiken/TetrisV0
 private void Refresh(PictureBox target)
 {
     if (target.InvokeRequired)
     {
         RefreshCallback d = new RefreshCallback(Refresh);
         try
         {
             this.Invoke(d, new object[] { target });
         }
         catch
         {
         }
     }
     else
     {
         target.Refresh();
     }
 }
コード例 #22
0
        public async Task DeletePefLogDialog_OnDialogClose()
        {
            await PerfLogDisplayService.DeleteById(_itemToBeDeleted);

            await RefreshCallback.InvokeAsync(true);
        }
コード例 #23
0
 public override void Dispose()
 {
     _refreshMethod = null;
     base.Dispose();
 }
コード例 #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();
 }
コード例 #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;
        }