コード例 #1
0
ファイル: TaskTrayPopupDialog.cs プロジェクト: GNUtn/wimaxcu
 public void ShowPopup(string message, TaskTrayPopupClickOptions clickOption, bool allowPopupToBeSuperceded, bool popupShouldBeVisibleForExtraLongTime)
 {
     if (this.InvokeRequired || this.IsDisposed || !this.IsHandleCreated)
     return;
       if (this.Visible)
       {
     if (!this._allowPopupToBeSuperceded)
       return;
     this.HidePopup();
       }
       this._clickOption = clickOption;
       this._allowPopupToBeSuperceded = allowPopupToBeSuperceded;
       if (this.ClosePopupTimer != null)
     this.ClosePopupTimer.Interval = !popupShouldBeVisibleForExtraLongTime ? TimerSettings.TaskTrayPopupDialog_ClosePopupTimer_NormalInterval : TimerSettings.TaskTrayPopupDialog_ClosePopupTimer_LongInterval;
       this.Controls.Clear();
       TaskTrayBalloonPanel trayBalloonPanel = new TaskTrayBalloonPanel(message);
       trayBalloonPanel.Location = new Point(ImageHelper.Unscaled.FrameLeftPixel.Width, ImageHelper.Unscaled.FrameTopPixel.Height);
       this.Controls.Add((Control) trayBalloonPanel);
       this.Size = new Size(trayBalloonPanel.Width + ImageHelper.Unscaled.FrameLeftPixel.Width + ImageHelper.Unscaled.FrameRightPixel.Width, trayBalloonPanel.Height + ImageHelper.Unscaled.FrameTopPixel.Height + ImageHelper.Unscaled.FrameBottomPixel.Height);
       this.Location = AppFramework.TaskTray.GetTaskTrayPopupLocation(DPIUtils.ScaleSize(this.Size));
       this.ScaleMe();
       try
       {
     this.Opacity = 0.0;
       }
       catch (Exception ex)
       {
     Logging.LogEvent(TraceModule.SDK, TraceLevel.Warning, (object) this, Logging.GetMessageForException(ex));
     this.HidePopup();
     return;
       }
       UIHelper.ShowAsTopMostForm((Form) this);
       try
       {
     if (File.Exists("C:\\Windows\\Media\\Windows XP Balloon.wav"))
       new SoundPlayer("C:\\Windows\\Media\\Windows XP Balloon.wav").Play();
     else if (File.Exists("C:\\Windows\\Media\\Windows Balloon.wav"))
       new SoundPlayer("C:\\Windows\\Media\\Windows Balloon.wav").Play();
       }
       catch (Exception ex)
       {
     Logging.LogEvent(TraceModule.SDK, TraceLevel.Warning, (object) this, Logging.GetMessageForException(ex));
       }
       this.FadePopupInTimer.Start();
 }
コード例 #2
0
ファイル: TaskTray.cs プロジェクト: GNUtn/wimaxcu
 public void ShowTaskTrayNotification(string message, TaskTrayPopupClickOptions clickOption, bool allowPopupToBeSuperceded, bool popupShouldBeVisibleForExtraLongTime, bool showPopupEvenIfDashboardIsVisible)
 {
     if (this._systemSuspended || !MediaHandler.IntelCUIsInControl || (!MediaHandler.TheMedia.WiMAXIsReady || !CurrentUserSettings.GetShowTaskTrayNotifications()) || !showPopupEvenIfDashboardIsVisible && !this.ShowPopupInTaskTray() && AppFramework.Dashboard.WindowState != FormWindowState.Minimized)
     return;
       TaskTrayPopupDialog.Singleton.ShowPopup(message, clickOption, allowPopupToBeSuperceded, popupShouldBeVisibleForExtraLongTime);
 }