コード例 #1
0
 public FancyBalloon(string title, string message)
 {
     InitializeComponent();
     txtBalloonTitle.Text   = title;
     txtBalloonMessage.Text = message;
     TaskbarIcon.AddBalloonClosingHandler(this, OnBalloonClosing);
 }
コード例 #2
0
        void ToastUi_Loaded(object sender, RoutedEventArgs e)
        {
            var dc = DataContext;

            TaskbarIcon = TaskbarIcon.GetParentTaskbarIcon(this);
            TaskbarIcon.AddBalloonClosingHandler(this, OnBaloonClosing);
            MouseLeave += ToastUi_MouseLeave;
        }
コード例 #3
0
 public MyBalloonTip()
 {
     InitializeComponent();
     grid.MouseEnter += grid_MouseEnter;
     grid.MouseLeave += grid_MouseLeave;
     grid.MouseMove  += OnGridMouseMove;
     TaskbarIcon.AddBalloonClosingHandler(this, OnBalloonClosing);
 }
コード例 #4
0
        public PoeBalloon()
        {
            InitializeComponent();
            TaskbarIcon.AddBalloonClosingHandler(this, OnBalloonClosing);

            sBG.Top    = ((Bitmap)Properties.Resources.ResourceManager.GetObject("ToastBGTop")).ToBitmapSource();
            sBG.Center = ((Bitmap)Properties.Resources.ResourceManager.GetObject("ToastBGCenter")).ToBitmapSource();
        }
コード例 #5
0
        public NotificationToast()
        {
            InitializeComponent();

            // Initialize icon
            var icon = Taction.Properties.Resources.Icon;
            var src  = Imaging.CreateBitmapSourceFromHIcon(icon.Handle, Int32Rect.Empty, BitmapSizeOptions.FromEmptyOptions());

            IconImage.Source = src;

            TaskbarIcon.AddBalloonClosingHandler(this, OnBalloonClosing);
        }
コード例 #6
0
        public TrayNotification()
        {
            InitializeComponent();
            TaskbarIcon.AddBalloonClosingHandler(this, OnBalloonClosing);

            this.WhenActivated(d => {
                d(this.WhenAnyValue(x => x.ViewModel).BindTo(this, v => v.DataContext));
                d(this.OneWayBind(ViewModel, vm => vm.Actions, v => v.Actions.ItemsSource));
                d(this.OneWayBind(ViewModel, vm => vm.Title, v => v.Title.Text));
                d(this.OneWayBind(ViewModel, vm => vm.Text, v => v.Text.Text));
                d(ViewModel.WhenAnyObservable(x => x.Close)
                  .Subscribe(x => Close()));
            });
        }
コード例 #7
0
ファイル: TongZhi.xaml.cs プロジェクト: Jackjet/MhczTBG
 /// <summary>
 ///  初始化生成
 /// </summary>
 /// <param name="popupAnimation">动画</param>
 /// <param name="tittle">标题</param>
 private void ParamesInit(PopupAnimation popupAnimation, string tittle)
 {
     try
     {
         //生成标题
         this.txtTittle.Text = tittle;
         TaskbarIcon.AddBalloonClosingHandler(this, OnBalloonClosing);
         TaskbarIcon MyNotifyIcon = new TaskbarIcon();
         MyNotifyIcon.ShowCustomBalloon(this, popupAnimation, 60000);
     }
     catch (Exception ex)
     {
         MethodLb.CreateLog(this.GetType().FullName, "ParamesInit", ex.ToString(), popupAnimation, tittle);
     }
     finally
     {
     }
 }
コード例 #8
0
        public FancyBalloon(int count, params DAL.Model.Track[] musicItems)
        {
            InitializeComponent();
            TaskbarIcon.AddBalloonClosingHandler(this, OnBalloonClosing);

            Count = " (" + count + ")";

            if (musicItems.Length > 2 || musicItems.Length < 1)
            {
                throw new Exception("Something went wrong");
            }

            if (musicItems.Length == 1)
            {
                musicItem2.Visibility = System.Windows.Visibility.Hidden;
            }

            if (musicItems.Length >= 1)
            {
                musicItem1.Text       = musicItems[0].TrackTitle;
                musicItem1.MouseDown += (s, e) =>
                {
                    if (PlayClicked != null)
                    {
                        PlayClicked(musicItems[0]);
                    }
                    ForceClose();
                };
            }

            if (musicItems.Length >= 2)
            {
                musicItem2.Text       = musicItems[1].TrackTitle;
                musicItem2.MouseDown += (s, e) =>
                {
                    if (PlayClicked != null)
                    {
                        PlayClicked(musicItems[1]);
                    }
                    ForceClose();
                };
            }
        }
コード例 #9
0
        public SelectableMessage()
        {
            InitializeComponent();
            TaskbarIcon.AddBalloonClosingHandler(this, OnBalloonClosing);
            listView.SelectedIndex = 0;
            this.KeyDown          += (o, e) =>
            {
                var index = e.Key - Key.D0;
                if (index >= 0 && DataContext is ObservableCollection <TipItem> col && index < col.Count)
                {
                    listView.SelectedIndex = index;

                    Confirm(null, null);
                }
                else
                {
                    Close();
                }
            };
        }
コード例 #10
0
        private void SetDefaultValues()
        {
            // Get single settings instance and subscribe to it's event
            settings = UserSettings.Instance;
            settings.PropertyChanged += UserSettings_PropertyChanged;

            // Initialize short, long, pause and minute timers
            shortIntervalTimer           = new Timer();
            shortIntervalTimer.AutoReset = false;
            shortIntervalTimer.Elapsed  += ShortCycleTimer_Elapsed;

            longIntervalTimer           = new Timer();
            longIntervalTimer.AutoReset = false;
            longIntervalTimer.Elapsed  += LongCycleTimer_Elapsed;

            pauseTimer           = new Timer();
            pauseTimer.AutoReset = false;
            pauseTimer.Elapsed  += PauseTimer_Elapsed;

            minuteTimer           = new Timer();
            minuteTimer.AutoReset = true;
            minuteTimer.Elapsed  += MinuteTimer_Elasped;

            // Set up update checker
            updater = new UpdateCheck(new int[] { MAJVERSION, MINVERSION, REVVERSION });

            // Subscribe to workstation lock event
            Microsoft.Win32.SystemEvents.SessionSwitch += new Microsoft.Win32.SessionSwitchEventHandler(SystemEvents_SessionSwitch);

            // Subscribe to sleep event - Unsubscribe in Dispose!
            // Microsoft.Win32.SystemEvents.PowerModeChanged += OnPowerChange;

            // Create stopwatch
            lockWatch = new Stopwatch();

            // Set up the pre-break popup
            breakPopup = new BreakNotificationPopup();
            TaskbarIcon.AddBalloonClosingHandler(breakPopup, OnBalloonClosing);
        }
コード例 #11
0
        public SelectableMessage()
        {
            InitializeComponent();
            TaskbarIcon.AddBalloonClosingHandler(this, OnBalloonClosing);
            listView.SelectedIndex = 0;
            KeyDown += (o, e) =>
            {
                var index = e.Key - Key.D0;
                if (index >= 0 && DataContext is ObservableCollection <TipItem> col && index < col.Count)
                {
                    listView.SelectedIndex = index;

                    Confirm(null, null);
                }
                else
                {
                    Close();
                    var virtualkeyCode = KeyInterop.VirtualKeyFromKey(e.Key);
                    CloseViaKey?.Invoke(virtualkeyCode);
                }
            };
        }
コード例 #12
0
        /// <summary>
        ///     Initializes a new instance of the <see cref="PerfGraphPopup" /> class.
        /// </summary>
        public PerfGraphPopup( )
        {
            InitializeComponent( );

            TaskbarIcon.AddBalloonClosingHandler(this, OnBalloonClosing);
        }
コード例 #13
0
 public Balloon()
 {
     InitializeComponent();
     text.Text = getRandomLine();
     TaskbarIcon.AddBalloonClosingHandler(this, OnBalloonClosing);
 }
コード例 #14
0
ファイル: Baloon.xaml.cs プロジェクト: qwandery/PNotes.NET
 internal Baloon(BaloonMode mode)
 {
     Mode = mode;
     InitializeComponent();
     TaskbarIcon.AddBalloonClosingHandler(this, OnBalloonClosing);
 }
コード例 #15
0
 public NotifyWindow()
 {
     this.InitializeComponent();
     TaskbarIcon.AddBalloonClosingHandler(this, OnBallonClosing);
 }
コード例 #16
0
 public UpdateApplicationNotify()
 {
     InitializeComponent();
     TaskbarIcon.AddBalloonClosingHandler(this, OnBalloonClosing);
 }
コード例 #17
0
 public NotifyBalloonView()
 {
     InitializeComponent();
     TaskbarIcon.AddBalloonClosingHandler(this, OnBalloonClosing);
     this.DataContext = ViewModelLocator.GetSharedViewModel <INotifyBalloonViewModel>();
 }
コード例 #18
0
 public PopupNotificationCtrl()
 {
     InitializeComponent();
     TaskbarIcon.AddBalloonClosingHandler(this, OnBalloonClosing);
 }
コード例 #19
0
 public NotificationControl()
 {
     InitializeComponent();
     TaskbarIcon.AddBalloonClosingHandler(this, OnNotificationClosing);
 }
コード例 #20
0
 public PopupNotificationUC(PopupNotificationModel model)
 {
     Model = model;
     InitializeComponent();
     TaskbarIcon.AddBalloonClosingHandler(this, OnBalloonClosing);
 }
コード例 #21
0
 public Notificacao()
 {
     InitializeComponent();
     TaskbarIcon.AddBalloonClosingHandler(this, OnBalloonClosing);
 }
コード例 #22
0
 public NotifyBalloon()
 {
     InitializeComponent();
     this.DataContext = this;
     TaskbarIcon.AddBalloonClosingHandler(this, OnBalloonClosing);
 }
コード例 #23
0
 public MarketIndexesUserControl()
 {
     InitializeComponent();
     TaskbarIcon.AddBalloonClosingHandler(this, OnBalloonClosing);
     //DataContext = new MarketIndexesViewModel();
 }
コード例 #24
0
 public FancyBalloon()
 {
     InitializeComponent();
     TaskbarIcon.AddBalloonClosingHandler(this, OnBalloonClosing);
 }
コード例 #25
0
ファイル: FlitzBalloon.xaml.cs プロジェクト: martwaters/FBMon
 public FlitzBalloon()
 {
     InitializeComponent();
     DataContext = viewModel;
     TaskbarIcon.AddBalloonClosingHandler(this, OnBalloonClosing);
 }