Inheritance: IDisposable
Exemple #1
0
		internal TaskTrayBaloon(TaskTrayIcon icon)
		{
			this._icon = icon;
		}
        public void ShowTaskTrayIcon()
        {
            const string iconUri = "pack://application:,,,/SylphyHorn;Component/Assets/tasktray.ico";

            Uri uri;
            if (!Uri.TryCreate(iconUri, UriKind.Absolute, out uri)) return;

            var icon = IconHelper.GetIconFromResource(uri);
            var menus = new[]
            {
                new TaskTrayIconItem(Resources.TaskTray_Menu_Settings, () => this.ShowSettings(), () => Application.Args.CanSettings),
                new TaskTrayIconItem(Resources.TaskTray_Menu_Exit, () => this._application.Shutdown()),
            };

            var taskTrayIcon = new TaskTrayIcon(icon, menus);
            taskTrayIcon.Show();
            taskTrayIcon.AddTo(this._application);

            if (Settings.General.FirstTime)
            {
                var baloon = taskTrayIcon.CreateBaloon();
                baloon.Title = ProductInfo.Title;
                baloon.Text = Resources.TaskTray_FirstTimeMessage;
                baloon.Timespan = TimeSpan.FromMilliseconds(5000);
                baloon.Show();

                Settings.General.FirstTime.Value = false;
                LocalSettingsProvider.Instance.SaveAsync().Forget();
            }
        }
 internal TaskTrayBaloon(TaskTrayIcon icon)
 {
     this._icon = icon;
 }