本文整理汇总了C#中Hardcodet.Wpf.TaskbarNotification.TaskbarIcon类的典型用法代码示例。如果您正苦于以下问题:C# TaskbarIcon类的具体用法?C# TaskbarIcon怎么用?C# TaskbarIcon使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TaskbarIcon类属于Hardcodet.Wpf.TaskbarNotification命名空间,在下文中一共展示了TaskbarIcon类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: OnStartup
protected override void OnStartup(StartupEventArgs e)
{
base.OnStartup(e);
// Create a new instance of the main window.
var mainWindow = new MainWindow();
Application.Current.MainWindow = mainWindow;
if (e.Args.Any(arg => arg.ToUpper().Equals("/refresh")))
{
mainWindow.Refresh();
}
//create the notifyicon (it's a resource declared in SystemTray/SystemTrayResources.xaml).
_taskBarIcon = (TaskbarIcon)FindResource("SystemTrayIcon");
// Register the hot-key that will show the application
HotKeyManager.Register(
Key.Space,
OperatingSystem.KeyModifier.Alt,
() =>
{
var command = GlobalCommands.ShowWindowCommand();
if (command.CanExecute(null))
{
command.Execute(null);
}
});
}
开发者ID:hrudham,项目名称:Quicken,代码行数:30,代码来源:App.xaml.cs
示例2: CustomBalloon
public CustomBalloon([NotNull] TaskbarIcon taskbarIcon)
{
if (taskbarIcon == null) throw new ArgumentNullException(nameof(taskbarIcon));
InitializeComponent();
_taskbarIcon = taskbarIcon;
}
开发者ID:Iyemon-018,项目名称:Dev,代码行数:7,代码来源:CustomBalloon.xaml.cs
示例3: OnStartup
protected override void OnStartup(StartupEventArgs e)
{
base.OnStartup(e);
//create the notifyicon (it's a resource declared in NotifyIconResources.xaml
notifyIcon = (TaskbarIcon) FindResource("NotifyIcon");
}
开发者ID:gitter-badger,项目名称:Infoscreen,代码行数:7,代码来源:App.xaml.cs
示例4: OnStartup
protected override void OnStartup(StartupEventArgs e)
{
bool mutexIsAvailable = false;
try
{
_lock = new Mutex(true, "Smaller.Singleton");
mutexIsAvailable = _lock.WaitOne(1, false); // wait only 1 ms
}
catch (AbandonedMutexException)
{
//In case the previous instance did not correctly release the mutex, ignore the error.
mutexIsAvailable = true;
}
if (!mutexIsAvailable)
{
RunJobController.Instance.TriggerRunJobs();
Current.Shutdown();
return;
}
else
{
base.OnStartup(e);
//create the notifyicon (it's a resource declared in NotifyIconResources.xaml
notifyIcon = (TaskbarIcon)FindResource("NotifyIcon");
RunJobController.Instance.TriggerRunJobs();
}
}
开发者ID:geoffles,项目名称:Smaller,代码行数:31,代码来源:App.xaml.cs
示例5: OnStartup
protected override void OnStartup(StartupEventArgs e)
{
base.OnStartup(e);
ShutdownMode = ShutdownMode.OnExplicitShutdown;
_notificationIcon = (TaskbarIcon)FindResource("NotificationWebViewIcon");
}
开发者ID:xcjs,项目名称:NotificationWebView,代码行数:7,代码来源:App.xaml.cs
示例6: AddTaskbarIcon
// Adds the notification icon
public void AddTaskbarIcon()
{
// The display text of the icon
string DisplayText = "MouseControl running at " + WebServer.runningIp;
systemIcon = new TaskbarIcon();
systemIcon.Icon = new System.Drawing.Icon(typeof(App), "MouseControlIcon.ico");
systemIcon.ToolTipText = DisplayText;
systemIcon.ShowBalloonTip("MouseControl", DisplayText, BalloonIcon.Info);
// Remove the text after a certain amount of time
Thread.Sleep(6000);
systemIcon.HideBalloonTip();
// Add context menu
ContextMenu cMenu = new ContextMenu();
MenuItem about = new MenuItem();
about.Header = "About";
about.Click += aboutClick;
MenuItem exit = new MenuItem();
exit.Header = "Exit";
exit.Click += exitClick;
cMenu.Items.Add(about);
cMenu.Items.Add(exit);
// Add System tray icon click handler
systemIcon.TrayMouseDoubleClick += SystemTrayIconClick;
systemIcon.ContextMenu = cMenu;
}
开发者ID:jamest222,项目名称:MouseControl,代码行数:33,代码来源:MainWindow.xaml.cs
示例7: AddTrayIconWpf
private void AddTrayIconWpf() {
Application.Current.Dispatcher.Invoke(() => {
var rhm = new MenuItem { Header = "RHM Settings", Command = RhmService.Instance.ShowSettingsCommand };
rhm.SetBinding(UIElement.VisibilityProperty, new Binding {
Source = RhmService.Instance,
Path = new PropertyPath(nameof(RhmService.Active))
});
var restore = new MenuItem { Header = UiStrings.Restore };
var close = new MenuItem { Header = UiStrings.Close };
restore.Click += RestoreMenuItem_Click;
close.Click += CloseMenuItem_Click;
_icon = new TaskbarIcon {
Icon = AppIconService.GetTrayIcon(),
ToolTipText = AppStrings.Hibernate_TrayText,
ContextMenu = new ContextMenu {
Items = {
rhm,
restore,
new Separator(),
close
}
},
DoubleClickCommand = new DelegateCommand(WakeUp)
};
});
}
开发者ID:gro-ove,项目名称:actools,代码行数:30,代码来源:AppHibernator.TaskbarIcon.cs
示例8: TrayWindowViewModel
public TrayWindowViewModel(TaskbarIcon taskbarIcon)
{
_taskbarIcon = taskbarIcon;
ExitCommand = new ExitCommand();
ShowCommand = new ShowAllCommand();
HideCommand = new HideAllCommand();
AddRepoCommand = new AddRepositoryCommand();
ShowAboutCommand = new ShowSingleViewCommand(typeof(AboutView));
LeftClickCommand = new ToggleShowHideCommand();
DoubleClickCommand = LeftClickCommand;
ShowSettingsCommand = new ShowSingleViewCommand(typeof(SettingsView));
#if DEBUG
ShowSettingsVisiblilty = "Visible";
#else
ShowSettingsVisiblilty = "Collapsed";
#endif
ShowUpdateCommand = new ShowSingleViewCommand(typeof(UpdateView));
CheckUpdateCommand = ShowUpdateCommand;
HotkeyHelper.OnHotkeyChanged += (sender, args) => OnPropertyChanged("ShowHideHeader");
// todo: currently the only balloon is for update, so no distinction about what to do.
_taskbarIcon.TrayBalloonTipClicked += (sender, args) => ShowUpdateCommand.Execute(null);
UpdateManager.OnUpdateRequired += UpdateManager_OnUpdateRequired;
UpdateManager.OnUpdateInfoChanged += delegate(object sender, EventArgs args)
{
OnPropertyChanged("CheckUpdateHeader");
OnPropertyChanged("ToolTipText");
};
}
开发者ID:tbener,项目名称:DiGit,代码行数:35,代码来源:TrayWindowViewModel.cs
示例9: OnStartup
protected override void OnStartup(StartupEventArgs e)
{
base.OnStartup(e);
try
{
_settings = SerializationHelper.LoadObjectFromFile<AmbilightSettings>(PATH_SETTINGS) ??
new AmbilightSettings();
IScreenCapture screenCapture = new DX9ScreenCapture();
// DarthAffe 05.11.2016: This could be done way cleaner ...
_taskBar = FindResource("Taskbar") as TaskbarIcon;
FrameworkElement configView = _taskBar?.TrayPopup as ConfigView;
if (configView == null)
Shutdown();
else
configView.DataContext = new ConfigViewModel(_settings);
_ambilight = new Ambilight(screenCapture, _settings);
if (!_ambilight.Initialize())
throw new ApplicationException();
}
catch
{
MessageBox.Show("An error occured while starting the Keyboard-Ambilight.\r\nPlease double check if CUE is running and 'Enable SDK' is checked.", "Can't start Keyboard-Ambilight");
Shutdown();
}
}
开发者ID:DarthAffe,项目名称:CUE.NET,代码行数:28,代码来源:App.xaml.cs
示例10: App
public App()
{
InitializeComponent();
tb = (TaskbarIcon)FindResource("iNGenTaskbarIcon");
tb.TrayMouseDoubleClick += tb_TrayMouseDoubleClick;
Locator = new ViewModels.ViewModelLocator();
}
开发者ID:Cronos79,项目名称:iNGEN-Ark-RCON-Desktop,代码行数:7,代码来源:App.xaml.cs
示例11: OnStartup
protected override void OnStartup(StartupEventArgs e)
{
base.OnStartup(e);
notifyIcon = (TaskbarIcon)FindResource("NotifyIcon");
notifyIcon.ShowBalloonTip("Beba Água", "Beba água iniciado!", BalloonIcon.Info);
}
开发者ID:joaopgrassi,项目名称:Desktop-Water-Reminder,代码行数:8,代码来源:App.xaml.cs
示例12: InitializeIcon
private void InitializeIcon()
{
_taskbarIcon = (TaskbarIcon) Application.Current.FindResource("NetWatcherNotify");
if (_taskbarIcon != null)
{
_taskbarIcon.DataContext = this;
}
}
开发者ID:PhilipRieck,项目名称:RdpIpUpd,代码行数:8,代码来源:NotifyViewModel.cs
示例13: AutotrackerNotification
public AutotrackerNotification(TaskbarIcon icon, MainWindow mainWindow)
{
this.icon = icon;
this.mainWindow = mainWindow;
this.InitializeComponent();
Toggl.OnAutotrackerNotification += this.onAutotrackerNotification;
}
开发者ID:Nukil,项目名称:toggldesktop,代码行数:8,代码来源:AutotrackerNotification.xaml.cs
示例14: InitializeViewLayer
private void InitializeViewLayer()
{
trayIconViewModel = new TrayIconViewModel();
iconView = (TaskbarIcon)FindResource("NotifyIcon");
trayIconViewModel.icon = iconView;
iconView.DataContext = trayIconViewModel;
mainWindowViewModel = new MainWindowViewModel();
}
开发者ID:hschroedl,项目名称:clean-folders,代码行数:8,代码来源:App.xaml.cs
示例15: PomodoroNotification
public PomodoroNotification(TaskbarIcon icon, MainWindow mainWindow)
{
this.icon = icon;
this.mainWindow = mainWindow;
this.InitializeComponent();
Toggl.OnDisplayPomodoro += this.onDisplayPomodoro;
}
开发者ID:DanielJomphe,项目名称:toggldesktop,代码行数:8,代码来源:PomodoroNotification.xaml.cs
示例16: OnStartup
protected override void OnStartup(StartupEventArgs e)
{
_tbi = (TaskbarIcon)FindResource("TrayIcon");
_windowPlacement = WindowPlacement.Instance;
_windowPlacement.RegisterHotkeys();
base.OnStartup(e);
}
开发者ID:mewdriller,项目名称:ventanas,代码行数:9,代码来源:App.xaml.cs
示例17: App
public App()
{
InitializeComponent();
Debug.WriteLine(GetErrorFile());
AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
Tb = (TaskbarIcon)FindResource("iNGenTaskbarIcon");
if (Tb != null) Tb.TrayMouseDoubleClick += tb_TrayMouseDoubleClick;
Locator = new ViewModels.ViewModelLocator();
}
开发者ID:prom3theu5,项目名称:iNGEN-Ark-RCON-Desktop,代码行数:9,代码来源:App.xaml.cs
示例18: OnStartup
/// <summary>
/// Create our hotkey on startup, initialize notifyicon
/// TBI -- Customize hotkey combination via options right click
/// </summary>
protected override void OnStartup(StartupEventArgs e)
{
base.OnStartup(e);
notifyIcon = (TaskbarIcon)FindResource("NotifyIcon");
var _hotKey = new KeyboardHook(Key.Space,KeyModifier.Ctrl, OnHotKeyHandler);
notifyIcon.ShowBalloonTip("Window Butler Started", "Press [CTRL] + [SPACE]", BalloonIcon.Info);
}
开发者ID:SamTwining,项目名称:WindowButler,代码行数:13,代码来源:App.xaml.cs
示例19: OnStartup
protected override void OnStartup(System.Windows.StartupEventArgs e)
{
tb = (TaskbarIcon)FindResource("MyNotifyIcon");
var viewModel = new StahpViewModel();
viewModel.Notify += (s, evt) => tb.ShowBalloonTip("Stahp!!!", "Time's up.", BalloonIcon.Error);
tb.DataContext = viewModel;
}
开发者ID:PapaMufflon,项目名称:Stahp,代码行数:9,代码来源:App.xaml.cs
示例20: switch
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
switch (connectionId)
{
case 1:
this.MyNotifyIcon = ((Hardcodet.Wpf.TaskbarNotification.TaskbarIcon)(target));
return;
}
this._contentLoaded = true;
}
开发者ID:juank334,项目名称:TimeToBreak,代码行数:9,代码来源:InlinePopupWindow.g.cs
注:本文中的Hardcodet.Wpf.TaskbarNotification.TaskbarIcon类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论