public override void ClientSide(FormCollection OpenWindows, CreateClientWindow CreateWindow, Connection ThisConnection) { //CLOSE THE STATUS WINDOW ONCE THE FILE GET IS COMPLETE foreach (Form OpenWindow in OpenWindows) { if (OpenWindow.Text == "Get Status") { OpenWindow.Invoke((MethodInvoker) delegate { OpenWindow.Close(); }); break; } } //IF THE USER SELECTED A DOWNLOAD LOCATION THEN SAVE THE FILE, OTHERWISE OPEN WITH INTERNET EXPLORER if (string.IsNullOrEmpty(this.SaveLocation)) { string tmpFileName = Path.Combine(Path.GetTempPath(), this.FileName); File.WriteAllBytes(tmpFileName, this.FileBytes); //CREATE AN IE PROCESS AND LAUNCH IT WITH THE FILE AS THE PARAMETER Process tmpProc = new Process(); tmpProc.StartInfo = new ProcessStartInfo("IExplore.exe", tmpFileName); tmpProc.Start(); } else { //SAVE THE FILE TO THE SAVE LOCATION AND LET THE USER KNOW IT IS DONE File.WriteAllBytes(this.SaveLocation, this.FileBytes); MessageBox.Show("File Download Complete"); } }
public override void ClientSide(FormCollection OpenWindows, CreateClientWindow CreateWindow, Connection ThisConnection) { //FIND THE WINDOW WHICH HAS THE CORRECT TAG AND UPDATE THE STATUS SO THE USER KNOWS THEY HAVE ENTERED IN TEXT foreach (Form OpenWindow in OpenWindows) { if ((string)OpenWindow.Tag == this.ConversationID) { OpenWindow.Invoke((MethodInvoker) delegate { ((IConversationWindow)OpenWindow).EnteredText(this.Sender); }); } } }
public override void ClientSide(FormCollection OpenWindows, CreateClientWindow CreateWindow, Connection ThisConnection) { //FIND THE WINDOW ASSOCIATED TO THIS CONVERSATION ID AND UPDATES ITS TITLE foreach (Form OpenWindow in OpenWindows) { if ((string)OpenWindow.Tag == this.ConversationID) { OpenWindow.Invoke((MethodInvoker) delegate { OpenWindow.Text = string.Format("{0} - Conversation", string.Join("; ", this.Recipients)); }); } } }
private static void _notifyIcon_BalloonTipClicked(object sender, EventArgs e) { // Если это системное сообщение if (_notifyIcon.BalloonTipTitle == Settings.TitleUpdate) { CheckUpdates?.Invoke(null, EventArgs.Empty); } string windowTitle = _notifyIcon.Tag as string; if (windowTitle != null && windowTitle.Length > 0) { OpenWindow?.Invoke(null, new WindowEventArgs(windowTitle)); } }
public override void ClientSide(FormCollection OpenWindows, CreateClientWindow CreateWindow, Connection ThisConnection) { new Message_Private() { ConversationID = this.ConversationID, Sender = this.Sender, SenderID = this.SenderID, Message = string.Format(@"Has sent you a file: <a href=""getfile://{0}"">{1}</a>", this.FileID, this.FileName) }.Send(ThisConnection); foreach (Form OpenWindow in OpenWindows) { if (OpenWindow.Text == "Send Status") { OpenWindow.Invoke((MethodInvoker) delegate { OpenWindow.Close(); }); break; } } }
public static void Notify(object sender, GameEventArgs e) { switch (e.type) { case OPEN_WINDOW: OpenWindow?.Invoke(sender, e); break; case CLOSE_WINDOW: CloseWindow?.Invoke(sender, e); break; case HOLD_WINDOW: HoldWindow?.Invoke(sender, e); break; case RESUME_WINDOW: ResumeWindow?.Invoke(sender, e); break; case WINDOW_OPENED: OnWindowOpened?.Invoke(sender, e); break; case WINDOW_CLOSED: OnWindowClosed?.Invoke(sender, e); break; case WINDOW_HOLDED: OnWindowHolded?.Invoke(sender, e); break; case WINDOW_RESUMED: OnWindowResumed?.Invoke(sender, e); break; } }
protected void OpenOtherWindow(AbstractShellWindow otherWindow) { OpenWindow?.Invoke(otherWindow); }
async Task Initialize() { notification = new NotificationManager(); favoriteList = new FavoriteList(false); watchdog = new Watchdog(); Debug.OnCatchLog += (l) => { Logs = l; }; await favoriteList.InitializeFavoriteList().ConfigureAwait(false); watchdog.OnAddUser += (l, u) => { try { OnAddUser(l, u); } catch (Exception e) { Debug.Log(e.ToString()); Debug.Log("Listing Error... Please Relogin"); throw; } }; watchdog.OnUpdateLocation += OnUpdateLocation; watchdog.OnLostUser += OnLostUser; watchdog.OnUpdateUser += OnUpdateUser; watchdog.OnLogout += OpenLoginDialog; isReloading = true; watchdog.OnUpdateFinish += ListFilterUpdate; await watchdog.InitializeUserList(() => { isReloading = false; watchdog.StartWatchdog(); }).ConfigureAwait(false); OnReloadClick = new DelegateCommand(() => { if (isReloading == false) { isReloading = true; watchdog.StopWatchdog(); watchdog.ReloadInstance(() => { Locations = new List <LocationList>(); FilterdLocationList = new ObservableCollection <LocationList>(); watchdog.InitializeUserList(() => { isReloading = false; watchdog.StartWatchdog(); }); }); } }); OnLogoutClick = new DelegateCommand(() => { ConfigData.UserName = ""; ConfigData.Password = ""; OpenLoginDialog?.Invoke(); }); OnTaskIconClick = new DelegateCommand(() => { OpenWindow?.Invoke(); }); }