public DialogLatLong(IRenderer Renderer, CloseCallback CloseCallback, LatLongChange ChangeCallback, double Latitude, double Longitude, QSize ScreenSize, QPen ForePen, QPen BorderPen, QPen BackPen) : base(Renderer, ScreenSize, CloseCallback, ForePen, BorderPen, BackPen) { this.changeCallback = ChangeCallback; Latitude.ToComponents(out latDeg, out latMin, out latSec, out north); Longitude.ToComponents(out lngDeg, out lngMin, out lngSec, out east); }
protected virtual void CloseFile() { //Prepare bool remove = true; //Check if (IsDirty) { //Get result MessageBoxResult result = MessageBox.Show($"Save changes to {DisplayName}?", "Unsaved Changes", MessageBoxButton.YesNoCancel, MessageBoxImage.Information); //Handle switch (result) { case MessageBoxResult.Cancel: remove = false; break; case MessageBoxResult.Yes: SaveToFile(); break; } } //Check and remove if (remove) { CloseCallback?.Invoke(this); } }
internal WebSocketListener(ClientWebSocket wsConn, MessageCallback msgCallback, CloseCallback closeCallback) { this._ws = wsConn; this._msgCb = msgCallback; this._closeCb = closeCallback; this.listenThread = new Thread(new ThreadStart(this.StartListeningForMessages)); this.listenThread.Start(); }
// // Close the connection associated with the proxy and wait until the close completes. // private static void closeConnection(Ice.ObjectPrx prx) { CloseCallback cb = new CloseCallback(); prx.ice_getConnection().setCloseCallback(cb.closed); prx.ice_getConnection().close(Ice.ConnectionClose.GracefullyWithWait); cb.check(); }
public void ShowWindow(int diam, int rep, CloseCallback callBack = null) { this.diam = diam; this.rep = rep; this.closedCallback = callBack; OpenView(); }
// // Close the connection associated with the proxy and wait until the close completes. // private static void closeConnection(Ice.ObjectPrx prx) { CloseCallback cb = new CloseCallback(); prx.ice_getConnection().setCloseCallback(cb.closed); prx.ice_getConnection().close(false); cb.check(); }
// // Close the connection associated with the proxy and wait until the close completes. // private static void closeConnection(IObjectPrx prx) { CloseCallback cb = new CloseCallback(); prx.GetConnection().SetCloseCallback(cb.closed); prx.GetConnection().Close(ConnectionClose.GracefullyWithWait); cb.check(); }
public async void PatientSelect(PatientUI patient) { await SelectCallback.InvokeAsync(patient); await CloseCallback.InvokeAsync(true); ShowDialog = false; StateHasChanged(); }
protected async Task HandleValidSubmit() { await PatientService.AddPatient(Patient); ShowDialog = false; await CloseCallback.InvokeAsync(true); StateHasChanged(); }
protected Dialog(IRenderer Renderer, QSize ScreenSize, CloseCallback CloseCallback, QPen ForePen, QPen BorderPen, QPen BackPen) { this.renderer = Renderer; this.screenSize = ScreenSize; this.closeCallback = CloseCallback; this.forePen = ForePen; this.borderPen = BorderPen; this.backPen = BackPen; SetupLayout(); }
/// <summary> /// /// </summary> public void CloseSafe() { if (this.InvokeRequired) { CloseCallback d = new CloseCallback(CloseSafe); Invoke(d); } else { Close(); } }
private void FormClose() { if (this.InvokeRequired) { CloseCallback d = new CloseCallback(FormClose); this.Invoke(d); } else { this.Close(); } }
private void CloseC() { if (this.InvokeRequired) { CloseCallback d = new CloseCallback(CloseC); this.Invoke(d, new object[] { }); } else { this.Close(); } }
private void SafeClose() { if (this.statusLabel.InvokeRequired) { CloseCallback d = new CloseCallback(SafeClose); this.Invoke(d, new object[] {}); } else { this.timer1.Enabled = false; this.Close(); } }
private void SafeClose() { if (this.statusLabel.InvokeRequired) { CloseCallback d = new CloseCallback(SafeClose); this.Invoke(d, new object[] {}); } else { this.timer1.Enabled = false; this.Close(); } }
public void Close(CloseCallback callback) { if(IsOpen) { fTwain.Close(); fWia.Close(); fDataSources = null; } if(callback != null) { callback(); } }
public DialogDateTime(IRenderer Renderer, CloseCallback CloseCallback, DateTimeChange ChangeCallback, DateTime DateTime, bool UTC, QSize ScreenSize, QPen ForePen, QPen BorderPen, QPen BackPen) : base(Renderer, ScreenSize, CloseCallback, ForePen, BorderPen, BackPen) { this.changeCallback = ChangeCallback; date = DateTime; minDate = MathEx.Min(minDate, date.AddYears(-10)); maxDate = MathEx.Max(maxDate, date.AddYears(10)); this.utc = UTC; changeCallback(date); }
/// <summary> /// Handles input signal (or error) from the RedRat3. /// </summary> public void SignalDataIn(object sender, EventArgs e) { if (e is SignalEventArgs) { sigInEvent = (SignalEventArgs)e; if (this.InvokeRequired) { CloseCallback cb = new CloseCallback(this.Close); this.Invoke(cb, null); } else { this.Close(); } } }
public void CloseThread(ThreadData td) { if (InvokeRequired)//调用和创建该控件的线程是不同的线程,必须调用Invoke方法 { if (closing) { return; } //创建该方法的委托实例 CloseCallback d = new CloseCallback(CloseThread); //调用该委托实例,并传递参数,参数为object类型,使用this调用Invoke(this为当前窗体,是创建该窗体控件的线程) Invoke(d, new object[] { td });//this指定创建该控件的线程来Invoke(调用) } else//调用与创建该控件的线程是同一个线程 { td.callBack(td); } }
private void CloseForm() { if (pictureBox1.InvokeRequired)//调用和创建该控件的线程是不同的线程,必须调用Invoke方法 { //创建该方法的委托实例 CloseCallback d = new CloseCallback(CloseForm); //调用该委托实例,并传递参数,参数为object类型,使用this调用Invoke(this为当前窗体,是创建该窗体控件的线程) Invoke(d, new object[] { });//this指定创建该控件的线程来Invoke(调用) } else//调用与创建该控件的线程是同一个线程 { if (pictureBox1.BackgroundImage != null) { pictureBox1.BackgroundImage.Dispose(); pictureBox1.BackgroundImage = null; } Close(); } }
public static void Close(CloseCallback callback) { try { foreach (ILogger logger in Loggers) { logger.Dispose(); } Loggers.Clear(); callback(true, null); } catch (Exception e) { if (callback != null) { callback(false, e.Message); } } }
/// <summary> /// Begins the close. /// </summary> /// <param name="callback">The callback.</param> /// <returns></returns> public IAsyncResult BeginClose(AsyncCallback callback) { CloseCallback ftpCallback = Close; return(ftpCallback.BeginInvoke(callback, null)); }
public void close() { CloseCallback d = new CloseCallback(this.Close); this.Invoke(d); }
public override void OnPointerClick(PointerEventData eventData) { CloseCallback.SafeInvoke(); }
public override void Close(bool shouldCloseImmediately = false) { _shouldCloseImmediately = shouldCloseImmediately; CloseCallback.SafeInvoke(); }
public System.IAsyncResult BeginClose( System.AsyncCallback callback ) { CloseCallback ftpCallback = new CloseCallback( this.Close); return ftpCallback.BeginInvoke(callback, null); }
/// <summary> /// Updates the UI every second. /// </summary> private void KeepUpdated() { while (waiting) { Program.CurrentPlayer = Program.CurrentGame.LocalPlayers[0]; Program.CurrentPlayer.NextCommand = "GAMEUPDATE"; Program.CurrentPlayer.NewCommand = true; while (!Program.CurrentPlayer.NewResponse) { Application.DoEvents(); } string[] response = Program.CurrentPlayer.LastResponse.Split(' '); Program.CurrentPlayer.NewResponse = false; switch (response[0]) { case "WAITING": Program.CurrentGame.Stage = 'W'; break; case "PLAYING": Program.CurrentGame.Stage = 'P'; break; case "VOTING": Program.CurrentGame.Stage = 'V'; break; case "END": Program.CurrentGame.Stage = 'E'; break; default: MessageBox.Show("Unexpected Error! Unknown Game State, Application will exit!", "Fatal Error", MessageBoxButtons.OK, MessageBoxIcon.Stop); Program.Exit(); break; } switch (Program.CurrentGame.Stage) { case 'W': Update("Waiting for other players to join the game..."); break; case 'P': foreach (ClientNetworking player in Program.CurrentGame.LocalPlayers) { Program.CurrentPlayer = player; Program.CurrentPlayer.NextCommand = "NEED ANSWER"; Program.CurrentPlayer.NewCommand = true; while (!Program.CurrentPlayer.NewResponse) { Application.DoEvents(); } string[] responseP = Program.CurrentPlayer.LastResponse.Split(' '); Program.CurrentPlayer.NewResponse = false; switch (responseP[0]) { case "YES": waiting = false; break; case "NO": break; default: MessageBox.Show("Unexpected Error! Unknown NEED ANSWER Response, Application will exit!", "Fatal Error", MessageBoxButtons.OK, MessageBoxIcon.Stop); Program.Exit(); break; } } Update("Waiting for other players to submit their answers..."); break; case 'V': foreach (ClientNetworking player in Program.CurrentGame.LocalPlayers) { Program.CurrentPlayer = player; Program.CurrentPlayer.NextCommand = "NEED VOTE"; Program.CurrentPlayer.NewCommand = true; while (!Program.CurrentPlayer.NewResponse) { Application.DoEvents(); } string[] responseP = Program.CurrentPlayer.LastResponse.Split(' '); Program.CurrentPlayer.NewResponse = false; switch (responseP[0]) { case "YES": waiting = false; break; case "NO": break; default: MessageBox.Show("Unexpected Error! Unknown NEED VOTE Response, Application will exit!", "Fatal Error", MessageBoxButtons.OK, MessageBoxIcon.Stop); Program.Exit(); break; } } Update("Waiting for other players to submit their votes..."); break; default: waiting = false; return; } Thread.Sleep(1000); } CloseCallback d = new CloseCallback(Close); this.Invoke(d, new object[] { }); return; }
public virtual void Close() { CloseCallback?.Invoke(); }
static extern void GLUT_RegisterClose(CloseCallback tickCallback);
public CloseState(CloseCallback callback, object state){ this.callback = callback; this.state = state; }
public ThreadQueue.TaskControl Close(CloseCallback callback, object state) { return ThreadQueue.QueueUserWorkItem(new ThreadQueue.WorkCallback(CloseDatabase), new WaitCallback(CloseDatabaseComplete), new CloseState(callback,state)); }
public ThreadQueue.TaskControl Close(CloseCallback callback, object state) { return(ThreadQueue.QueueUserWorkItem(new ThreadQueue.WorkCallback(CloseDatabase), new WaitCallback(CloseDatabaseComplete), new CloseState(callback, state))); }
/// <summary> /// Sets the close callback. /// </summary> /// <param name="func"> /// The new close callback function. See <see cref="CloseCallback" />. /// </param> public static void glutCloseFunc([In] CloseCallback func) { closeCallback = func; __glutCloseFunc(closeCallback); }
private static extern void __glutCloseFunc(CloseCallback func);
public System.IAsyncResult BeginClose(System.AsyncCallback callback) { CloseCallback ftpCallback = new CloseCallback(this.Close); return(ftpCallback.BeginInvoke(callback, null)); }
public void setCloseCallback(CloseCallback callback) { lock(this) { if(_state >= StateClosed) { if(callback != null) { _threadPool.dispatch(() => { try { callback(this); } catch(System.Exception ex) { _logger.error("connection callback exception:\n" + ex + '\n' + _desc); } } , this); } } else { _closeCallback = callback; } } }
public void OnClose(CloseCallback callback) { this.close_callback = callback; }
public void Stop() { CloseCallback c = new CloseCallback(InternalClose); this.Invoke(c); }
// // Close the connection associated with the proxy and wait until the close completes. // private static void closeConnection(Ice.ObjectPrx prx) { CloseCallback cb = new CloseCallback(); prx.ice_getConnection().setCloseCallback(cb.closed); prx.ice_getConnection().close(false); cb.check(); }
public CloseState(CloseCallback callback, object state) { this.callback = callback; this.state = state; }
public void close() { CloseCallback d = new CloseCallback(this.Close); this.Invoke(d); }