private void init() { Icon appIcon = Icon.ExtractAssociatedIcon(Assembly.GetExecutingAssembly().Location); notifyIcon.Text = "FolderWatcher"; notifyIcon.Icon = appIcon; notifyIcon.Visible = false; var menu = new System.Windows.Forms.ContextMenu(); var RunItem = new System.Windows.Forms.MenuItem() { Text = "Run Once" }; var ExitItem = new System.Windows.Forms.MenuItem() { Text = "Exit" }; ExitItem.Click += ExitItem_Click; RunItem.Click += RunItem_Click; menu.MenuItems.Add(RunItem); menu.MenuItems.Add(ExitItem); notifyIcon.ContextMenu = menu; }
public NotifyIconForm() { this.components = new System.ComponentModel.Container(); this.contextMenu = new System.Windows.Forms.ContextMenu(); this.closeMenuItem = new System.Windows.Forms.MenuItem(); this.openMenuItem = new System.Windows.Forms.MenuItem(); // Initialize contextMenu this.contextMenu.MenuItems.AddRange( new System.Windows.Forms.MenuItem[] { this.openMenuItem, this.closeMenuItem }); // Initialize menuItems this.openMenuItem.Index = 0; this.openMenuItem.Text = "&Show"; this.openMenuItem.Click += new EventHandler(this.openMenuItem_Click); this.closeMenuItem.Index = 1; this.closeMenuItem.Text = "E&xit"; this.closeMenuItem.Click += new EventHandler(this.closeMenuItem_Click); this.notifyIcon = new System.Windows.Forms.NotifyIcon(this.components); notifyIcon.Icon = Properties.Resources.Icon1; notifyIcon.Text = "EasyCrawling"; notifyIcon.ContextMenu = this.contextMenu; notifyIcon.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(notifyIcon_DoubleClick); }
public ConsoleWindow() { InitializeComponent(); LogsTab.DataContext = ConsoleViewModel.Instance; SettingsTab.DataContext = SettingsViewModel.Instance; TrayIcon = new System.Windows.Forms.NotifyIcon { Icon = System.Drawing.Icon.ExtractAssociatedIcon(System.Windows.Forms.Application.ExecutablePath), Visible = true }; Closed += (s, e) => TrayIcon.Dispose(); var contextMenu = new System.Windows.Forms.ContextMenu(); contextMenu.MenuItems.Add("E&xit", (s, e) => Close()); TrayIcon.ContextMenu = contextMenu; TrayIcon.DoubleClick += (s, e) => { if (IsEnabled) { MinimizeToTray(); } else { Restore(); } }; }
public MainWindow() { InitializeComponent(); //Save the current dispatcher to use it for changes in the user interface. dispatcher = Dispatcher.CurrentDispatcher; // Create a timer, but do not start it yet clock.Interval = 1000; // Milliseconds clock.Tick += OnTick; // We want to use a notify icon in the system tray, but WPF doesn't have one so we will use the one from Windows Forms instead var systrayContextMenu = new System.Windows.Forms.ContextMenu(); systrayContextMenu.MenuItems.Add("E&xit", (s, o) => { this.Close(); }); systrayContextMenu.MenuItems.Add("&Open", ActivateForm); // Create the systray icon var notifyIcon = new System.Windows.Forms.NotifyIcon(); // The Icon property sets the icon that will appear in the systray for this application. using (Stream stream = Application.GetResourceStream(new Uri("LyncUtility.ico", UriKind.Relative)).Stream) { notifyIcon.Icon = new Icon(stream); } // The ContextMenu property sets the menu that will appear when the systray icon is right clicked. notifyIcon.ContextMenu = systrayContextMenu; // Set the text that will be displayed when the mouse hovers over the systray icon. notifyIcon.Text = "LyncUtility"; notifyIcon.Visible = true; // Allow the double click on the systray icon to activate the form. notifyIcon.DoubleClick += ActivateForm; }
protected override void OnSourceInitialized(EventArgs e) { base.OnSourceInitialized(e); // Clipboard manager _clipboardMonitor = new ClipboardMonitor(); _clipboardMonitor.ClipboardContentChanged += OnClipboardContentChanged; _hWnd = new WindowInteropHelper(this).Handle; // Notification menu items (when minimized) _exitMenuItem = new System.Windows.Forms.MenuItem(LocalizationProvider.GetLocalizedValue <string>(nameof(Properties.Resources.Trayicon_ExitLabel))); _settingsMenuItem = new System.Windows.Forms.MenuItem(LocalizationProvider.GetLocalizedValue <string>(nameof(Properties.Resources.Trayicon_SettingsLabel))); _compactDbMenuItem = new System.Windows.Forms.MenuItem(LocalizationProvider.GetLocalizedValue <string>(nameof(Properties.Resources.Trayicon_CompactDbLabel))); _toggleClipboardMonitorMenuItem = new System.Windows.Forms.MenuItem(LocalizationProvider.GetLocalizedValue <string>(nameof(Properties.Resources.Trayicon_DisconnectFromClipboardLabel))); _exitMenuItem.Click += OnExitMenuItemClick; _settingsMenuItem.Click += OnSettingsMenuItemClick; _compactDbMenuItem.Click += OnCompactDbMenuItemClick; _toggleClipboardMonitorMenuItem.Click += OnToggleClipboardMonitorMenuItemClick; _notifyIconContextMenu = new System.Windows.Forms.ContextMenu(); _notifyIconContextMenu.MenuItems.Add(_settingsMenuItem); _notifyIconContextMenu.MenuItems.Add(_compactDbMenuItem); _notifyIconContextMenu.MenuItems.Add(_toggleClipboardMonitorMenuItem); _notifyIconContextMenu.MenuItems.Add("-"); _notifyIconContextMenu.MenuItems.Add(_exitMenuItem); _notifyIcon = new System.Windows.Forms.NotifyIcon(); _notifyIcon.Icon = new System.Drawing.Icon(@"../../Resources/Clipboard.ico"); _notifyIcon.MouseClick += OnNotifyIconClick; _notifyIcon.ContextMenu = _notifyIconContextMenu; _notifyIcon.Visible = true; }
private System.Windows.Forms.ContextMenu GetContextMenu() { if (contextMenu == null) { contextMenu = new System.Windows.Forms.ContextMenu(); System.Windows.Forms.MenuItem item = null; item = new System.Windows.Forms.MenuItem(); item.Text = Globals.SRestore; item.DefaultItem = true; item.Click += delegate(object sender, EventArgs args) { RestoreWindow(); }; contextMenu.MenuItems.Add(item); item = new System.Windows.Forms.MenuItem(); item.Text = "-"; contextMenu.MenuItems.Add(item); item = new System.Windows.Forms.MenuItem(); item.Text = Globals.SExit; item.Click += delegate(object sender, EventArgs args) { Exit(); }; contextMenu.MenuItems.Add(item); } return(contextMenu); }
/// <summary> /// https://msdn.microsoft.com/en-us/library/system.windows.forms.notifyicon.contextmenu(v=vs.110).aspx /// </summary> private void _SetupNotifyIcon() { var contextMenu = new System.Windows.Forms.ContextMenu(); var menuItem = new System.Windows.Forms.MenuItem(); // Initialize contextMenu1 contextMenu.MenuItems.AddRange(new[] { menuItem }); // Initialize menuItem1 menuItem.Index = 0; menuItem.Text = "O&pen"; menuItem.Click += delegate { Show(); WindowState = WindowState.Normal; }; var notificationIcon = new System.Windows.Forms.NotifyIcon { Icon = new Icon("img/Window.ico"), Visible = true, ContextMenu = contextMenu }; notificationIcon.DoubleClick += delegate { Show(); WindowState = WindowState.Normal; }; }
public Main() { InitializeComponent(); System.Windows.Forms.ContextMenu systemTrayContextMenu = new System.Windows.Forms.ContextMenu(); systemTrayContextMenu.MenuItems.Add(new System.Windows.Forms.MenuItem("Reports", new EventHandler(Reports_Click))); systemTrayContextMenu.MenuItems.Add(new System.Windows.Forms.MenuItem("Settings", new EventHandler(Settings_Click))); systemTrayContextMenu.MenuItems.Add(new System.Windows.Forms.MenuItem("Exit", new EventHandler(Exit_Click))); SystemTrayIcon = new System.Windows.Forms.NotifyIcon(); SystemTrayIcon.ContextMenu = systemTrayContextMenu; SystemTrayIcon.Visible = true; SystemTrayIcon.Icon = new Icon(SystemIcons.Application, 40, 40); SystemTrayIcon.Text = "Slacking off"; SystemTrayIcon.BalloonTipTitle = "Get Back To Work"; SystemTrayIcon.BalloonTipIcon = System.Windows.Forms.ToolTipIcon.Info; SystemTrayIcon.Click += new EventHandler(SystemTrayIcon_Click); Hide(); Left = System.Windows.SystemParameters.PrimaryScreenWidth - Width - 5; Top = 5; DateStarted = null; LoadSettings(); }
private void InitNotificationIcon() { System.Windows.Forms.MenuItem notifyIconContextMenuShow = new System.Windows.Forms.MenuItem { Index = 0, Text = "Show" }; notifyIconContextMenuShow.Click += new EventHandler(NotifyIcon_Show); System.Windows.Forms.MenuItem notifyIconContextMenuQuit = new System.Windows.Forms.MenuItem { Index = 1, Text = "Quit" }; notifyIconContextMenuQuit.Click += new EventHandler(NotifyIcon_Quit); System.Windows.Forms.ContextMenu notifyIconContextMenu = new System.Windows.Forms.ContextMenu(); notifyIconContextMenu.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { notifyIconContextMenuShow, notifyIconContextMenuQuit }); _notifyIcon = new System.Windows.Forms.NotifyIcon { Visible = true }; _notifyIcon.ContextMenu = notifyIconContextMenu; _notifyIcon.DoubleClick += new EventHandler(NotifyIcon_Show); }
// private bool firstShowTip = true; private void InitNotifyIcon() { trayContextMenu = new System.Windows.Forms.ContextMenu(); trayExitMenuItem = new System.Windows.Forms.MenuItem(); trayMiniMenuItem = new System.Windows.Forms.MenuItem(); trayViewHistorymenuItem = new System.Windows.Forms.MenuItem(); trayContextMenu.MenuItems.AddRange( new System.Windows.Forms.MenuItem[] { trayViewHistorymenuItem, trayMiniMenuItem, trayExitMenuItem }); trayViewHistorymenuItem.Index = 0; trayViewHistorymenuItem.Text = "查看历史记录(&H)"; trayViewHistorymenuItem.Click += new EventHandler(TrayViewHistoryMenuItem_Click); trayMiniMenuItem.Index = 1; trayMiniMenuItem.Text = "隐藏悬浮窗(&M)"; trayMiniMenuItem.Click += new EventHandler(TrayMiniMenuItem_Click); trayExitMenuItem.Index = 2; trayExitMenuItem.Text = "退出(&E)"; trayExitMenuItem.Click += new EventHandler(TrayExitMenuItem_Click); notifyIcon = new System.Windows.Forms.NotifyIcon(); notifyIcon.BalloonTipText = "SmartMe已最小化到托盘,双击此处恢复窗口"; notifyIcon.BalloonTipTitle = "SmartMe"; notifyIcon.Text = "SmartMe"; notifyIcon.Icon = new System.Drawing.Icon("icon.ico"); notifyIcon.MouseClick += new System.Windows.Forms.MouseEventHandler(notifyIcon_Click); notifyIcon.ContextMenu = this.trayContextMenu; ShowTrayIcon(true); // Always show the icon }
private void InitNotificationIcon() { if (_notifyIcon != null) { return; } System.Windows.Forms.MenuItem notifyIconContextMenuShow = new System.Windows.Forms.MenuItem { Index = 0, Text = "Show" }; notifyIconContextMenuShow.Click += new EventHandler(NotifyIcon_Show); System.Windows.Forms.MenuItem notifyIconContextMenuQuit = new System.Windows.Forms.MenuItem { Index = 1, Text = "Quit" }; notifyIconContextMenuQuit.Click += new EventHandler(NotifyIcon_Quit); System.Windows.Forms.ContextMenu notifyIconContextMenu = new System.Windows.Forms.ContextMenu(); notifyIconContextMenu.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { notifyIconContextMenuShow, notifyIconContextMenuQuit }); _notifyIcon = new System.Windows.Forms.NotifyIcon { Icon = Ciribob.DCS.SimpleRadio.Standalone.Client.Properties.Resources.audio_headset, Visible = true }; _notifyIcon.ContextMenu = notifyIconContextMenu; _notifyIcon.DoubleClick += new EventHandler(NotifyIcon_Show); }
/// <summary> /// 初始化 /// </summary> private void Init() { this.ImageList = this.imageList1; this.HideSelection = false; try { if (this.IsShowContextMenu == true)//显示属性 { // 加入右键菜单 by zlw 2006-5-1 System.Windows.Forms.ContextMenu cmPatientPro = new System.Windows.Forms.ContextMenu(); System.Windows.Forms.MenuItem miPatientPro = new System.Windows.Forms.MenuItem(); #region addby xuewj 2010-9-28 查询患者费用明细 {98057398-9233-4aec-8FAF-662A8E82BF74} System.Windows.Forms.MenuItem miPatientFeeQuery = new System.Windows.Forms.MenuItem(); cmPatientPro.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { miPatientPro, miPatientFeeQuery }); #endregion miPatientPro.Text = "查看患者信息"; miPatientFeeQuery.Text = "查看患者费用明细";//addby xuewj 2010-9-28 查询患者费用明细 {98057398-9233-4aec-8FAF-662A8E82BF74} this.ContextMenu = cmPatientPro; miPatientPro.Click += new System.EventHandler(this.miPatientPro_Click); miPatientFeeQuery.Click += new EventHandler(miPatientFeeQuery_Click); } Neusoft.HISFC.BizLogic.Manager.Spell dataBase = new Neusoft.HISFC.BizLogic.Manager.Spell(); this.dtToday = dataBase.GetDateTimeFromSysDateTime(); this.InitInterface(); } catch { this.dtToday = DateTime.Today; } }
/// <summary> /// Initializes the trayicon and the contextmenu /// </summary> public static void InitializeTrayIcon() { // Initialize objects and tray icon NotifyIcon = new System.Windows.Forms.NotifyIcon(); NotifyIcon.Text = "Sun Plasma"; NotifyIcon.Icon = Icon.ExtractAssociatedIcon(Assembly.GetExecutingAssembly().Location); NotifyIcon.DoubleClick += new EventHandler(NotifyIcon_Click); NotifyIcon.Visible = true; // Set up the context menu for the notify icon NotifyContextMenu = new System.Windows.Forms.ContextMenu(); // Launch Star Citizen var launchStarCitizenItem = NotifyContextMenu.MenuItems.Add("Launch Star Citizen"); var command = new ViewModel.Commands.LaunchStarCitizenCommand(); launchStarCitizenItem.Enabled = command.CanExecute(null); launchStarCitizenItem.Click += (sender, args) => command.Execute(null); // Launch Mumble var launchMumble = NotifyContextMenu.MenuItems.Add("Launch Mumble"); var commandMumble = new ViewModel.Commands.LaunchMumbleCommand(); launchMumble.Enabled = commandMumble.CanExecute(null); launchMumble.Click += (sender, args) => commandMumble.Execute(null); // Exit NotifyContextMenu.MenuItems.Add("-"); NotifyContextMenu.MenuItems.Add("Exit", NotifyContextMenuExit_Click); NotifyIcon.ContextMenu = NotifyContextMenu; }
public MainWindow() { InitializeComponent(); Stream iconStream = Application.GetResourceStream(new Uri("pack://application:,,,/KeyBoardHelper;component/Icons/monitor.ico")).Stream; nIcon.Icon = new System.Drawing.Icon(iconStream); nIcon.Visible = true; //nIcon.ShowBalloonTip(5000, "Title", "Text", System.Windows.Forms.ToolTipIcon.Info); nIcon.MouseClick += nIcon_MouseClick; this.components = new System.ComponentModel.Container(); this.contextMenu1 = new System.Windows.Forms.ContextMenu(); this.menuItem1 = new System.Windows.Forms.MenuItem(); this.contextMenu1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { this.menuItem1 }); this.menuItem1.Index = 0; this.menuItem1.Text = "Выход"; this.menuItem1.Click += new System.EventHandler(this.menuItem1_Click); nIcon.ContextMenu = this.contextMenu1; nIcon.Text = "KeyBoardHelper"; nIcon.Visible = true; }
public MainWindow() { PathWorker.WallpaperPathWorker(); InitializeComponent(); DateTime localDate1 = DateTime.Now; String minute = localDate1.ToString("mm", new CultureInfo("en-US")); String second = localDate1.ToString("ss", new CultureInfo("en-US")); int trueMinute = 0; int trueSeconds = 60 - Convert.ToInt16(second); DayChangeLogic.timer.Tick += new EventHandler(DayChangeLogic.timerTick); DayChangeLogic.timer.Interval = new TimeSpan(0, trueMinute, trueSeconds); DayChangeLogic.timer.Start(); System.Windows.Forms.NotifyIcon ni = new System.Windows.Forms.NotifyIcon(); ni.Icon = new System.Drawing.Icon("fire-2-24.ico"); ni.Visible = true; System.Windows.Forms.ContextMenu myMenu1 = new System.Windows.Forms.ContextMenu(); myMenu1.MenuItems.Add("Настройки", new EventHandler(FormShow)); myMenu1.MenuItems.Add("About", new EventHandler(OpenGithub)); myMenu1.MenuItems.Add("Выход", new EventHandler(FormExit)); ni.ContextMenu = myMenu1; ni.DoubleClick += new EventHandler(FormShow); }
/// <summary> /// 初始化托盘图标 /// </summary> /// <param name="visible">托盘图标是否隐藏</param> public void InitTrayIcon(bool visible = true) { notifyIcon = new System.Windows.Forms.NotifyIcon(); notifyIcon.Text = "团长助理"; notifyIcon.Icon = System.Drawing.Icon.ExtractAssociatedIcon(System.Windows.Forms.Application.ExecutablePath); notifyIcon.Visible = visible; notifyIcon.DoubleClick += new EventHandler(notifyIcon_DoubleClick); notifyIcon.BalloonTipClicked += new EventHandler(notifyIcon_DoubleClick); System.Windows.Forms.ContextMenu menu = new System.Windows.Forms.ContextMenu(); System.Windows.Forms.MenuItem showItem = new System.Windows.Forms.MenuItem(); showItem.DefaultItem = true; showItem.Text = "显示窗口(&O)"; showItem.Click += new EventHandler(notifyIcon_DoubleClick); System.Windows.Forms.MenuItem closeItem = new System.Windows.Forms.MenuItem(); closeItem.Text = "退出程序(&X)"; closeItem.Click += new EventHandler(delegate { this.Close(); }); menu.MenuItems.Add(showItem); menu.MenuItems.Add(closeItem); notifyIcon.ContextMenu = menu; }
private void _CreateTrayIcon() { //create new NotifyIcon that will function as the tray icon m_trayIcon = new System.Windows.Forms.NotifyIcon { Icon = Properties.Resources.UnblindTrayIcon, Visible = true, Text = "Unblind is running" }; m_trayIcon.DoubleClick += (object sender, EventArgs args) => { this.Show(); this.WindowState = WindowState.Normal; this.ShowInTaskbar = true; this.Activate(); }; //create context menu for the tray icon System.Windows.Forms.ContextMenu cMenu = new System.Windows.Forms.ContextMenu(); System.Windows.Forms.MenuItem cMenuItem = new System.Windows.Forms.MenuItem(); //create menu item to exit the application cMenuItem.Index = 0; cMenuItem.Text = "E&xit"; cMenuItem.Click += new EventHandler((object Sender, EventArgs e) => { m_close = true; this.Close(); }); cMenu.MenuItems.Add(cMenuItem); m_trayIcon.ContextMenu = cMenu; }
public SystemTray() { menuitemEnableTransmit = new System.Windows.Forms.MenuItem(sr_tray_enable_transmit, MenuItem_EnableTransmit) { Checked = App.GlobalConfig.IsTransmitEnabled }; // init notify icon notifyIcon = new System.Windows.Forms.NotifyIcon { Icon = Properties.Resources.XTransmit, Visible = true, }; notifyIcon.Click += NotifyIcon_Click; System.Windows.Forms.ContextMenu contextMenu = new System.Windows.Forms.ContextMenu(); contextMenu.Popup += ContextMenu_Popup; contextMenu.MenuItems.Add(menuitemEnableTransmit); contextMenu.MenuItems.Add(new System.Windows.Forms.MenuItem( sr_tray_add_server_scan, MenuItem_AddServer_ScanQRCode)); contextMenu.MenuItems.Add("-"); contextMenu.MenuItems.Add(new System.Windows.Forms.MenuItem( sr_tray_exit, MenuItem_Exit)); notifyIcon.ContextMenu = contextMenu; }
private void InitializeNotifyIcon() { // Create tray icon notifyIcon = new System.Windows.Forms.NotifyIcon(); notifyIcon.Icon = Properties.Resources.main; notifyIcon.Visible = true; notifyIcon.Text = "Unicodex"; notifyIcon.DoubleClick += delegate(object sender, EventArgs args) { Show(); WindowState = WindowState.Normal; }; // Create right-click context menu for tray icon System.Windows.Forms.MenuItem menuItemShow = new System.Windows.Forms.MenuItem(); menuItemShow.Index = 0; menuItemShow.Text = "&Show"; menuItemShow.Click += new System.EventHandler(NotifyIcon_MenuItem_Show_Click); System.Windows.Forms.MenuItem menuItemExit = new System.Windows.Forms.MenuItem(); menuItemExit.Index = 1; menuItemExit.Text = "E&xit"; menuItemExit.Click += new System.EventHandler(NotifyIcon_MenuItem_Exit_Click); System.Windows.Forms.ContextMenu contextMenu = new System.Windows.Forms.ContextMenu(); contextMenu.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { menuItemShow, menuItemExit }); notifyIcon.ContextMenu = contextMenu; }
private void InitializeContextMenu() { contextMenu = new System.Windows.Forms.ContextMenu(); signInMenuItem = new System.Windows.Forms.MenuItem(); signInMenuItem.Index = 0; signInMenuItem.Text = "Sign &In"; signInMenuItem.Click += Menu_SignIn; signInMenuItem.Visible = !IsAuthenticated(); contextMenu.MenuItems.Add(signInMenuItem); signOutMenuItem = new System.Windows.Forms.MenuItem(); signOutMenuItem.Index = 1; signOutMenuItem.Text = "Sign &Out"; signOutMenuItem.Click += Menu_SignOut; signOutMenuItem.Visible = IsAuthenticated(); contextMenu.MenuItems.Add(signOutMenuItem); var exitMenuItem = new System.Windows.Forms.MenuItem(); exitMenuItem.Index = 2; exitMenuItem.Text = "E&xit"; exitMenuItem.Click += Menu_Exit; contextMenu.MenuItems.Add(exitMenuItem); }
public TrayNotify() { string enable_transmit = (string)Application.Current.FindResource("tray_enable_transmit"); string scan_qrcode = (string)Application.Current.FindResource("add_server_qrcode"); string import_clipboard = (string)Application.Current.FindResource("add_server_clipboard"); string setting = (string)Application.Current.FindResource("_settings"); string exit = (string)Application.Current.FindResource("_exit"); menuitemEnableTransmit = new System.Windows.Forms.MenuItem(enable_transmit, MenuItem_EnableTransmit) { Checked = SettingManager.Configuration.IsTransmitEnabled }; // init notify icon notifyIcon = new System.Windows.Forms.NotifyIcon { Icon = SettingManager.Configuration.IsTransmitEnabled ? Properties.Resources.xtransmit_on : Properties.Resources.xtransmit_off, Visible = true, }; notifyIcon.Click += NotifyIcon_Click; notifyIcon.MouseMove += NotifyIcon_MouseMove; System.Windows.Forms.ContextMenu contextMenu = new System.Windows.Forms.ContextMenu(); contextMenu.Popup += ContextMenu_Popup; contextMenu.MenuItems.Add(menuitemEnableTransmit); contextMenu.MenuItems.Add("-"); contextMenu.MenuItems.Add(new System.Windows.Forms.MenuItem(scan_qrcode, MenuItem_AddServer_ScanQRCode)); //contextMenu.MenuItems.Add(new System.Windows.Forms.MenuItem(import_clipboard, MenuItem_AddServer_Clipboard)); contextMenu.MenuItems.Add("-"); contextMenu.MenuItems.Add(new System.Windows.Forms.MenuItem(setting, MenuItem_Setting)); contextMenu.MenuItems.Add(new System.Windows.Forms.MenuItem(exit, MenuItem_Exit)); notifyIcon.ContextMenu = contextMenu; }
public NotificationMenu() { notifyIcon = new System.Windows.Forms.NotifyIcon(); contextMenu = new System.Windows.Forms.ContextMenu(); notifyIcon.Visible = true; notifyIcon.ContextMenu = contextMenu; }
} // 창 드래그 함수. private void MinimizeTray(object sender, MouseButtonEventArgs e) // 종료시 프로그램이 꺼지지 않고 최소화되게함. { this.Hide(); this.ShowInTaskbar = false; // 우클릭시 나오는 선택창 선언. System.Windows.Forms.ContextMenu menu = new System.Windows.Forms.ContextMenu(); ni.Icon = Properties.Resources.icon; ni.Visible = true; ni.ContextMenu = menu; ni.Text = "헬-테이커"; // 선택창 0번줄 System.Windows.Forms.MenuItem i0 = new System.Windows.Forms.MenuItem(); menu.MenuItems.Add(i0); i0.Index = 0; i0.Text = "만든사람 / 사용법"; i0.Click += delegate(object s, EventArgs e1) { System.Diagnostics.Process.Start("https://github.com/Koder0205/Helltaker-Widjet"); }; // 선택창 1번줄 System.Windows.Forms.MenuItem i1 = new System.Windows.Forms.MenuItem(); menu.MenuItems.Add(i1); i1.Index = 1; i1.Text = "캐릭터생성창 열기"; i1.Click += delegate(object s, EventArgs e1) { this.Show(); this.WindowState = WindowState.Normal; ni.Visible = false; this.ShowInTaskbar = true; }; // 선택창 2번줄 System.Windows.Forms.MenuItem i2 = new System.Windows.Forms.MenuItem(); menu.MenuItems.Add(i2); i2.Index = 2; i2.Text = "프로그램 종료하기"; i2.Click += delegate(object s, EventArgs e1) { System.Windows.Application.Current.Shutdown(); ni.Dispose(); }; }
private void InitializeNotificationArea() { notifyIcon = new System.Windows.Forms.NotifyIcon(); notifyIcon.BalloonTipText = "The app is running. Double-click to show window."; notifyIcon.BalloonTipTitle = "Restart LCore"; notifyIcon.Text = "Restart LCore"; // Get the icon from resources using (System.IO.Stream iconStream = Application.GetResourceStream(new Uri("pack://application:,,,/icon.ico")).Stream) { notifyIcon.Icon = new System.Drawing.Icon(iconStream); } notifyIcon.DoubleClick += new EventHandler(notifyIcon_DoubleClick); // Context menu for notification icon var contextMenuNotifyIcon = new System.Windows.Forms.ContextMenu(); var menuItemRestore = new System.Windows.Forms.MenuItem(); var menuItemExit = new System.Windows.Forms.MenuItem(); contextMenuNotifyIcon.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { menuItemRestore, menuItemExit }); menuItemRestore.Index = 0; menuItemRestore.Text = "Restore"; menuItemRestore.Click += new System.EventHandler(menuItemRestore_Click); menuItemExit.Index = 1; menuItemExit.Text = "Exit"; menuItemExit.Click += new System.EventHandler(menuItemExit_Click); notifyIcon.ContextMenu = contextMenuNotifyIcon; }
public MainWindow() { InitializeComponent(); ErrorStatus = new StatusClass(); this.StatusLabel.DataContext = ErrorStatus; //Initialize List for the ListView OrderList = new System.Collections.ObjectModel.ObservableCollection <Order>(); this.OrdersView.ItemsSource = OrderList; //Creation of context menu of NotifyIcon NotifyMenu = new System.Windows.Forms.ContextMenu(); NotifyMenu.MenuItems.Add("Restore", MenuItem_Restore); NotifyMenu.MenuItems.Add("Exit", MenuItem_Exit); //Initializing for the NotifyIcon AppNotifyIcon = new System.Windows.Forms.NotifyIcon(); AppNotifyIcon.Icon = System.Drawing.Icon.FromHandle(Properties.Resources.logo.GetHicon()); AppNotifyIcon.Visible = true; AppNotifyIcon.DoubleClick += OnDoubleClickNotify; AppNotifyIcon.ContextMenu = NotifyMenu; AppNotifyIcon.BalloonTipText = "Bitfresh is minimized to system tray"; AppNotifyIcon.Text = "Bitfresh"; //Create configuration object confWindow = new Configure(ConnectButton, confBtn); }
private void _CreateTrayIcon() { if (m_trayIcon != null) { return; } //create new NotifyIcon that will function as the tray icon m_trayIcon = new System.Windows.Forms.NotifyIcon { Icon = Properties.Resources.filer_logo, Visible = true, Text = "Filer" }; m_trayIcon.Click += (object sender, EventArgs args) => { _ShowSelf(); }; //create context menu for the tray icon System.Windows.Forms.ContextMenu cMenu = new System.Windows.Forms.ContextMenu(); System.Windows.Forms.MenuItem cMenuItem = new System.Windows.Forms.MenuItem(); //create menu item to exit the application cMenuItem.Index = 0; cMenuItem.Text = "E&xit"; cMenuItem.Click += new EventHandler((object Sender, EventArgs e) => { m_close = true; this.Close(); }); cMenu.MenuItems.Add(cMenuItem); m_trayIcon.ContextMenu = cMenu; }
private void RefreshMenu() { var contextMenu = new ContextMenu(); if (accounts.Length == 0) { contextMenu.MenuItems.Add(new System.Windows.Forms.MenuItem { Enabled = false, Text = "- No available accounts -" }); } else { foreach (var account in accounts) { contextMenu.MenuItems.Add(account, (s, e) => RestartSteamAsGivenAccount(account)); } } contextMenu.MenuItems.Add("-"); contextMenu.MenuItems.Add("Reload", (s, e) => ButtonReload_Click(s, null)); contextMenu.MenuItems.Add("Setting", (s, e) => ButtonSetting_Click(s, null)); contextMenu.MenuItems.Add("Exit", (s, e) => BeforeExit()); this.nIcon.ContextMenu = contextMenu; }
private void LoadNotification() { System.Windows.Forms.ContextMenu menu = new System.Windows.Forms.ContextMenu(); System.Windows.Forms.MenuItem itemConfig = new System.Windows.Forms.MenuItem(); itemConfig.Index = 0; itemConfig.Text = "Configure"; itemConfig.Click += ItemConfig_Click; menu.MenuItems.Add(itemConfig); System.Windows.Forms.MenuItem itemExit = new System.Windows.Forms.MenuItem(); itemExit.Index = 1; itemExit.Text = "Exit"; itemExit.Click += ItemExit_Click; menu.MenuItems.Add(itemExit); m_notify = new System.Windows.Forms.NotifyIcon(); m_notify.Icon = Properties.Resources.Artua_Wall_E_Eve; m_notify.Visible = true; m_notify.DoubleClick += (object send, EventArgs args) => { this.Show(); this.WindowState = WindowState.Normal; this.ShowInTaskbar = true; }; m_notify.ContextMenu = menu; m_notify.Text = "MES TO ERP"; Version ver = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version; string str = string.Format("MES TO ERP: v{0}.{1}.{2}", ver.Major, ver.Minor, ver.Build); notiftyBalloonTip(str, 1000); }
private void CreateNotifyIcon() { notifyIcon = new System.Windows.Forms.NotifyIcon(); notifyIcon.DoubleClick += NotifyIcon_DoubleClick; components = new System.ComponentModel.Container(); contextMenu = new System.Windows.Forms.ContextMenu(); menuItemClose = new System.Windows.Forms.MenuItem(); menuItemOpen = new System.Windows.Forms.MenuItem(); menuItemSettings = new System.Windows.Forms.MenuItem(); contextMenu.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { menuItemClose, menuItemOpen, menuItemSettings }); menuItemSettings.Index = 0; menuItemSettings.Text = "Settings"; menuItemSettings.Click += MenuItemSettings_Click; menuItemOpen.Index = 1; menuItemOpen.Text = "Open"; menuItemOpen.Click += MenuItemOpen_Click; menuItemClose.Index = 2; menuItemClose.Text = "Exit"; menuItemClose.Click += MenuItemClose_Click; notifyIcon.ContextMenu = contextMenu; notifyIcon.Text = "Clipboard manager"; notifyIcon.MouseDown += NotifyIcon_MouseDown; notifyIcon.Icon = Properties.Resources.app_icon; notifyIcon.Visible = true; }
private System.Windows.Forms.MenuItem createMenuByType(XtraContextMenuType menuType) { Type enumType = typeof(XtraContextMenuType); string str = MB.Util.MyCustomAttributeLib.Instance.GetFieldDesc(enumType, menuType.ToString(), false); str = CLL.Convert(str); XtraMenu menu = new XtraMenu(str, new System.EventHandler(menuItemClick), menuType); _GridMenu.MenuItems.Add(menu); if (menuType == XtraContextMenuType.ColumnsAllowSort) { menu.Checked = true; } if (menuType == XtraContextMenuType.Chart) { var templateMenu = new WinDxChart.Chart.ChartTemplateMenu(_XtraGrid); System.Windows.Forms.ContextMenu contextMenu = templateMenu.ChartContextMenu; int count = contextMenu.MenuItems.Count; for (int i = 0; i < count; i++) { menu.MenuItems.Add(contextMenu.MenuItems[0]); } } return(menu); }
public static System.Windows.Forms.ContextMenu GetTrayContextMenu(params System.Windows.Forms.MenuItem[] items) { System.Windows.Forms.ContextMenu balloonContextMenu = new System.Windows.Forms.ContextMenu(); balloonContextMenu.MenuItems.AddRange(items); return(balloonContextMenu); }
private void InitializeContextMenu() { var components = new System.ComponentModel.Container(); var contextMenu = new System.Windows.Forms.ContextMenu(); var menuItemSettings = new System.Windows.Forms.MenuItem(); var menuItemAbout = new System.Windows.Forms.MenuItem(); var menuItemExit = new System.Windows.Forms.MenuItem(); // Initialize contextMenu contextMenu.MenuItems.AddRange( new System.Windows.Forms.MenuItem[] { menuItemSettings, menuItemAbout, menuItemExit }); int menuItemIndex = -1; // Initialize menuItemSettings menuItemSettings.Index = ++menuItemIndex; menuItemSettings.Text = "Settings"; menuItemSettings.Click += new System.EventHandler(this.SettingsClick); // Initialize menuItemAbout menuItemAbout.Index = ++menuItemIndex; menuItemAbout.Text = "About"; menuItemAbout.Click += new System.EventHandler(this.AboutClick); // Initialize menuItemExit menuItemExit.Index = ++menuItemIndex; menuItemExit.Text = "Exit"; menuItemExit.Click += new System.EventHandler(this.ExitClick); this.notifyIcon.Icon = this.GetIconFromFile(Constants.AppPaths.iconIcoPath); this.notifyIcon.Visible = false; this.notifyIcon.Text = Constants.APP_ID; this.notifyIcon.DoubleClick += this.NotifyIconDoubleClicked; this.notifyIcon.ContextMenu = contextMenu; }
public MainWindow() { _icon = new System.Windows.Forms.NotifyIcon(); _menu = new System.Windows.Forms.ContextMenu(); _menu.Popup += _menu_Popup; // Versioni precedenti _prevoiusVersions = new System.Windows.Forms.MenuItem(); _prevoiusVersions.Text = "Versioni precedenti..."; _prevoiusVersions.Click += (object sender, EventArgs args) => { ApplicationController.Instance.ShowPreviousVers(); }; _menu.MenuItems.Add(0,_prevoiusVersions); // Logout _logout = new System.Windows.Forms.MenuItem(); _logout.Text = "Logout"; _logout.Click += (object sender, EventArgs args) => { ApplicationController.Instance.Logout(); }; _menu.MenuItems.Add(1, _logout); // Login _login = new System.Windows.Forms.MenuItem(); _login.Text = "Login"; _login.Click += (object sender, EventArgs args) => { ApplicationController.Instance.RequireLogin(); }; _menu.MenuItems.Add(2, _login); // Exit _exit = new System.Windows.Forms.MenuItem(); _exit.Text = "Esci"; _exit.Click += (object sender, EventArgs args) => { ApplicationController.Instance.Shutdown(RETURN_VALUES.OK); }; _menu.MenuItems.Add(3, _exit); _icon.ContextMenu = _menu; //this.WindowState = System.Windows.WindowState.Maximized; _icon.Icon = new System.Drawing.Icon(@"rockbox_small.ico"); this._icon.Visible = true; InitializeComponent(); this.Left = (System.Windows.SystemParameters.WorkArea.Width - this.Width) + System.Windows.SystemParameters.WorkArea.Left; this.Top = (System.Windows.SystemParameters.WorkArea.Height - this.Height) + System.Windows.SystemParameters.WorkArea.Top; }
private System.Windows.Forms.ContextMenu GetContextMenu() { System.Windows.Forms.ContextMenu menu = new System.Windows.Forms.ContextMenu(); var exitItem = new System.Windows.Forms.MenuItem() { Text = "Exit" }; exitItem.Click += exitItem_Click; var settingsItem = new System.Windows.Forms.MenuItem() { Text = "Settings" }; settingsItem.Click += settingsItem_Click; menu.MenuItems.Add(settingsItem); menu.MenuItems.Add(exitItem); return menu; }
public MainWindow() { InitializeComponent(); System.Windows.Forms.NotifyIcon ni = new System.Windows.Forms.NotifyIcon(); ni.Icon = System.Drawing.SystemIcons.Application; ni.Text = "Программа перезапуска КММ с пульта"; ni.Visible = true; ni.DoubleClick += delegate(object sender, EventArgs args) { this.Show(); this.WindowState = WindowState.Normal; }; System.Windows.Forms.ContextMenu contextMenu1 = new System.Windows.Forms.ContextMenu(); System.Windows.Forms.MenuItem menuItem1 = new System.Windows.Forms.MenuItem(); System.Windows.Forms.MenuItem menuItem2 = new System.Windows.Forms.MenuItem(); // Initialize contextMenu1 contextMenu1.MenuItems.AddRange( new System.Windows.Forms.MenuItem[] { menuItem1, menuItem2 }); // Initialize menuItem1 menuItem1.Index = 1; menuItem1.Text = "Выход"; menuItem1.Click += new System.EventHandler(menuItem1_Click); menuItem2.Index = 0; menuItem2.Text = "Открыть"; menuItem2.Click += new System.EventHandler(menuItem2_Click); ni.ContextMenu = contextMenu1; this.Hide(); serialPort = new SerialPort(); serialPort.DataReceived += serialPort_DataReceived; serialPort.PortName = Settings.Default.ComPortNameSetting; path1 = Settings.Default.Path1; nameexe1 = Settings.Default.NameExe1; try { serialPort.Open(); } catch (Exception) { MessageBox.Show("Не открывается порт " + Settings.Default.ComPortNameSetting + ".\nВыберите COM порт."); } }
private void MakeIcon() { this.notifyIcon = new System.Windows.Forms.NotifyIcon(); this.notifyIcon.Icon = new System.Drawing.Icon("flowmonitor.ico"); this.notifyIcon.Text = "流量监控 - CA"; this.notifyIcon.Visible = true; this.notifyIcon.DoubleClick += new System.EventHandler(notifyIcon_DoubleClick); System.Windows.Forms.ContextMenu menu = new System.Windows.Forms.ContextMenu(); System.Windows.Forms.MenuItem close = new System.Windows.Forms.MenuItem(); close.Text = "退出"; close.Click += new EventHandler(delegate { this.Close(); }); menu.MenuItems.Add(close); this.notifyIcon.ContextMenu = menu; }
private System.Windows.Forms.ContextMenu GetSystrayContextMenu() { var menu = new System.Windows.Forms.ContextMenu(); var exit = new System.Windows.Forms.MenuItem("Exit", (sender, args) => { m_ExtendedNotifyIcon.Dispose(); // So that the icon disappears and it looks like the app closed quickly. Close(); // Takes about two seconds to close. }); var settings = new System.Windows.Forms.MenuItem("Settings", (sender, args) => { var vm = (DataContext as NotifyWindowViewModel); if (vm != null) vm.IsShowSettings = true; extendedNotifyIcon_OnShowWindow(); }); menu.MenuItems.Add(settings); menu.MenuItems.Add(exit); return menu; }
public Main() { this.Initialized += Main_Initialized; InitializeComponent(); //Set title with version info. Version version = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version; this.Title = "OCTGN verson " + version.ToString(); frame1.Navigate(new ContactList()); DebugWindowCommand.InputGestures.Add(new KeyGesture(Key.D, ModifierKeys.Control)); CommandBinding cb = new CommandBinding(DebugWindowCommand, MyCommandExecute, MyCommandCanExecute); this.CommandBindings.Add(cb); KeyGesture kg = new KeyGesture(Key.M, ModifierKeys.Control); InputBinding ib = new InputBinding(DebugWindowCommand, kg); this.InputBindings.Add(ib); Program.lobbyClient.OnFriendRequest += new LobbyClient.FriendRequest(lobbyClient_OnFriendRequest); Program.lobbyClient.OnDisconnect += new EventHandler(lobbyClient_OnDisconnectEvent); Program.lobbyClient.OnUserStatusChanged += new LobbyClient.UserStatusChanged(lobbyClient_OnUserStatusChanged); Program.lobbyClient.Chatting.eChatEvent += new Chatting.ChatEventDelegate(Chatting_eChatEvent); Program.lobbyClient.OnDataRecieved += new LobbyClient.DataRecieved(lobbyClient_OnDataRecieved); tbUsername.Text = Program.lobbyClient.Me.DisplayName; tbStatus.Text = Program.lobbyClient.Me.CustomStatus; _originalBorderBrush = NotificationTab.Background; System.Windows.Forms.ContextMenu cm = new System.Windows.Forms.ContextMenu(); cm.MenuItems.Add("Show", cmShow_Click).DefaultItem = true; cm.MenuItems.Add("Log Off", cmLogOff_Click); cm.MenuItems.Add("-"); cm.MenuItems.Add("Quit", cmQuit_Click); SystemTrayIcon = new System.Windows.Forms.NotifyIcon(); SystemTrayIcon.Icon = new System.Drawing.Icon("Resources/Icon.ico"); SystemTrayIcon.Visible = false; SystemTrayIcon.ContextMenu = cm; SystemTrayIcon.Text = "Octgn"; SystemTrayIcon.DoubleClick += new System.EventHandler(this.SystemTrayIcon_DoubleClick); // Insert code required on object creation below this point. }
public MainWindow() { TabaltHooks.AltTabHook(); TabaltHooks.AltTabPressed += this.OnAltTabPressed; TabaltHooks.ActivationRequested += this.OnActivationRequested; InitializeComponent(); this._notificationMenu = new System.Windows.Forms.ContextMenu(); var exitMenuItem = new System.Windows.Forms.MenuItem("&Quit", (s, e)=> Application.Current.Shutdown()); this._notificationMenu.MenuItems.Add(exitMenuItem); this._notificationIcon = new System.Windows.Forms.NotifyIcon(); this._notificationIcon.Text = "tabalt - An alternative ALT TAB implementation"; var x = Assembly.GetExecutingAssembly().Location; var dir = System.IO.Path.GetDirectoryName(x); var ico = System.IO.Path.Combine(dir, "logo.ico"); this._notificationIcon.Icon = new System.Drawing.Icon(ico); this._notificationIcon.Click += new EventHandler(_notificationIcon_Click); this._notificationIcon.ContextMenu = this._notificationMenu; this._notificationIcon.Visible = true; }
public TrayIcon(Connection Connection, User CurrentUser, Room CurrentRoom) { InitializeComponent(); this.Connection = Connection; this.CurrentUser = CurrentUser; this.CurrentRoom = CurrentRoom; Connection.Disconnect += Connection_Disconnect; MainWindowShown = false; AdminWindowShown = false; ToolbarIcon = new System.Windows.Forms.NotifyIcon(); ToolbarIcon.MouseClick += ToolbarIcon_Click; ToolbarIcon.Icon = Properties.Resources.ToolbarIcon; ToolbarIcon.Visible = true; // Construct the context menu so that it contains relevant options for the user Menu = new System.Windows.Forms.ContextMenu(); Menu.MenuItems.Add(new System.Windows.Forms.MenuItem("View Bookings", (s, e) => ToolbarIcon_Click(s, null))); // Admins can customise if (CurrentUser.Access == AccessMode.Admin) Menu.MenuItems.Add(new System.Windows.Forms.MenuItem("Customise system", (s, e) => ShowAdminWindow())); // Admins and teachers can exit if (CurrentUser.Access == AccessMode.Admin || CurrentUser.Access == AccessMode.Teacher) Menu.MenuItems.Add(new System.Windows.Forms.MenuItem("Exit", ExitClick)); ToolbarIcon.ContextMenu = Menu; // Every 30 seconds, fire an event Timer = new Timer(TimeSpan.FromSeconds(30).TotalMilliseconds); Timer.Elapsed += Timer_Elapsed; Timer.Start(); Timer_Elapsed(null, null); // Fire the timer event immediately }
/// <summary> /// Loads the notify icon. /// </summary> private void LoadNotifyIcon() { var menu = new ContextMenu(); NotifyIcon = new NotifyIcon { Text = "RS TV Show Tracker", Icon = new Drawing.Icon(Application.GetResourceStream(new Uri("pack://application:,,,/RSTVShowTracker;component/tv.ico")).Stream), Visible = true, ContextMenu = menu }; var showMenu = new WinMenuItem { Text = "Hide" }; showMenu.Click += ShowMenuClick; var exitMenu = new WinMenuItem { Text = "Exit" }; exitMenu.Click += (s, r) => { NotifyIcon.Visible = false; //Application.Current.Shutdown(); Process.GetCurrentProcess().Kill(); // this would be more *aggressive* I guess }; menu.MenuItems.Add(showMenu); menu.MenuItems.Add(exitMenu); NotifyIcon.DoubleClick += (s, e) => showMenu.PerformClick(); }
/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.panelStatus = new System.Windows.Forms.Panel(); this.panelState = new System.Windows.Forms.Panel(); this.listState = new System.Windows.Forms.ListBox(); this.splitter3 = new System.Windows.Forms.Splitter(); this.panelRegs = new System.Windows.Forms.Panel(); this.listF = new System.Windows.Forms.ListBox(); this.splitter4 = new System.Windows.Forms.Splitter(); this.listREGS = new System.Windows.Forms.ListBox(); this.splitter1 = new System.Windows.Forms.Splitter(); this.panelMem = new System.Windows.Forms.Panel(); this.dataPanel = new ZXMAK2.Hardware.Adlers.UI.DataPanel(); this.splitter2 = new System.Windows.Forms.Splitter(); this.panelDasm = new System.Windows.Forms.Panel(); this.dasmPanel = new ZXMAK2.Hardware.Adlers.UI.DasmPanel(); this.contextMenuDasm = new System.Windows.Forms.ContextMenu(); this.menuItemDasmGotoADDR = new System.Windows.Forms.MenuItem(); this.menuItemDasmGotoPC = new System.Windows.Forms.MenuItem(); this.menuItem2 = new System.Windows.Forms.MenuItem(); this.menuItemDasmClearBreakpoints = new System.Windows.Forms.MenuItem(); this.menuItem4 = new System.Windows.Forms.MenuItem(); this.menuDasmLoadBlock = new System.Windows.Forms.MenuItem(); this.menuDasmSaveBlock = new System.Windows.Forms.MenuItem(); this.menuItem1 = new System.Windows.Forms.MenuItem(); this.menuItemDasmRefresh = new System.Windows.Forms.MenuItem(); this.contextMenuData = new System.Windows.Forms.ContextMenu(); this.menuItemDataGotoADDR = new System.Windows.Forms.MenuItem(); this.menuItemDataSetColumnCount = new System.Windows.Forms.MenuItem(); this.menuItem5 = new System.Windows.Forms.MenuItem(); this.menuDataLoadBlock = new System.Windows.Forms.MenuItem(); this.menuDataSaveBlock = new System.Windows.Forms.MenuItem(); this.menuItem3 = new System.Windows.Forms.MenuItem(); this.menuItemDataRefresh = new System.Windows.Forms.MenuItem(); this.panel1 = new System.Windows.Forms.Panel(); this.dbgCmdLine = new System.Windows.Forms.TextBox(); this.panelStatus.SuspendLayout(); this.panelState.SuspendLayout(); this.panelRegs.SuspendLayout(); this.panelMem.SuspendLayout(); this.panelDasm.SuspendLayout(); this.panel1.SuspendLayout(); this.SuspendLayout(); // // panelStatus // this.panelStatus.Controls.Add(this.panelState); this.panelStatus.Controls.Add(this.splitter3); this.panelStatus.Controls.Add(this.panelRegs); this.panelStatus.Dock = System.Windows.Forms.DockStyle.Right; this.panelStatus.Location = new System.Drawing.Point(451, 0); this.panelStatus.Name = "panelStatus"; this.panelStatus.Size = new System.Drawing.Size(168, 404); this.panelStatus.TabIndex = 0; // // panelState // this.panelState.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; this.panelState.Controls.Add(this.listState); this.panelState.Dock = System.Windows.Forms.DockStyle.Fill; this.panelState.Location = new System.Drawing.Point(0, 252); this.panelState.Name = "panelState"; this.panelState.Size = new System.Drawing.Size(168, 152); this.panelState.TabIndex = 2; // // listState // this.listState.Dock = System.Windows.Forms.DockStyle.Fill; this.listState.Font = new System.Drawing.Font("Courier New", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204))); this.listState.FormattingEnabled = true; this.listState.IntegralHeight = false; this.listState.ItemHeight = 14; this.listState.Location = new System.Drawing.Point(0, 0); this.listState.Name = "listState"; this.listState.Size = new System.Drawing.Size(164, 148); this.listState.TabIndex = 3; this.listState.DoubleClick += new System.EventHandler(this.listState_DoubleClick); // // splitter3 // this.splitter3.Dock = System.Windows.Forms.DockStyle.Top; this.splitter3.Location = new System.Drawing.Point(0, 249); this.splitter3.Name = "splitter3"; this.splitter3.Size = new System.Drawing.Size(168, 3); this.splitter3.TabIndex = 1; this.splitter3.TabStop = false; // // panelRegs // this.panelRegs.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; this.panelRegs.Controls.Add(this.listF); this.panelRegs.Controls.Add(this.splitter4); this.panelRegs.Controls.Add(this.listREGS); this.panelRegs.Dock = System.Windows.Forms.DockStyle.Top; this.panelRegs.Location = new System.Drawing.Point(0, 0); this.panelRegs.Name = "panelRegs"; this.panelRegs.Size = new System.Drawing.Size(168, 249); this.panelRegs.TabIndex = 0; // // listF // this.listF.BackColor = System.Drawing.SystemColors.ButtonFace; this.listF.Dock = System.Windows.Forms.DockStyle.Fill; this.listF.Font = new System.Drawing.Font("Courier New", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204))); this.listF.FormattingEnabled = true; this.listF.IntegralHeight = false; this.listF.ItemHeight = 15; this.listF.Items.AddRange(new object[] { " S = 0", " Z = 0", " F5 = 0", " H = 1", " F3 = 0", "P/V = 0", " N = 0", " C = 0"}); this.listF.Location = new System.Drawing.Point(88, 0); this.listF.Name = "listF"; this.listF.Size = new System.Drawing.Size(76, 245); this.listF.TabIndex = 2; this.listF.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.listF_MouseDoubleClick); // // splitter4 // this.splitter4.Location = new System.Drawing.Point(85, 0); this.splitter4.Name = "splitter4"; this.splitter4.Size = new System.Drawing.Size(3, 245); this.splitter4.TabIndex = 1; this.splitter4.TabStop = false; // // listREGS // this.listREGS.BackColor = System.Drawing.SystemColors.ButtonFace; this.listREGS.Dock = System.Windows.Forms.DockStyle.Left; this.listREGS.Font = new System.Drawing.Font("Courier New", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204))); this.listREGS.FormattingEnabled = true; this.listREGS.IntegralHeight = false; this.listREGS.ItemHeight = 15; this.listREGS.Items.AddRange(new object[] { " PC = 0000", " IR = 0000", " SP = 0000", " AF = 0000", " HL = 0000", " DE = 0000", " BC = 0000", " IX = 0000", " IY = 0000", "AF\' = 0000", "HL\' = 0000", "DE\' = 0000", "BC\' = 0000", " MW = 0000"}); this.listREGS.Location = new System.Drawing.Point(0, 0); this.listREGS.Name = "listREGS"; this.listREGS.Size = new System.Drawing.Size(85, 245); this.listREGS.TabIndex = 1; this.listREGS.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.listREGS_MouseDoubleClick); // // splitter1 // this.splitter1.Dock = System.Windows.Forms.DockStyle.Right; this.splitter1.Location = new System.Drawing.Point(448, 0); this.splitter1.Name = "splitter1"; this.splitter1.Size = new System.Drawing.Size(3, 404); this.splitter1.TabIndex = 1; this.splitter1.TabStop = false; // // panelMem // this.panelMem.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.panelMem.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; this.panelMem.Controls.Add(this.dataPanel); this.panelMem.Location = new System.Drawing.Point(0, 251); this.panelMem.Name = "panelMem"; this.panelMem.Size = new System.Drawing.Size(448, 125); this.panelMem.TabIndex = 2; // // dataPanel // this.dataPanel.BackColor = System.Drawing.SystemColors.ButtonFace; this.dataPanel.ColCount = 8; this.dataPanel.Dock = System.Windows.Forms.DockStyle.Fill; this.dataPanel.Font = new System.Drawing.Font("Courier New", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204))); this.dataPanel.Location = new System.Drawing.Point(0, 0); this.dataPanel.Name = "dataPanel"; this.dataPanel.Size = new System.Drawing.Size(444, 121); this.dataPanel.TabIndex = 0; this.dataPanel.Text = "dataPanel1"; this.dataPanel.TopAddress = ((ushort)(0)); this.dataPanel.GetData += new ZXMAK2.Hardware.Adlers.UI.DataPanel.ONGETDATACPU(this.dasmPanel_GetData); this.dataPanel.DataClick += new ZXMAK2.Hardware.Adlers.UI.DataPanel.ONCLICKCPU(this.dataPanel_DataClick); this.dataPanel.MouseClick += new System.Windows.Forms.MouseEventHandler(this.dataPanel_MouseClick); // // splitter2 // this.splitter2.Dock = System.Windows.Forms.DockStyle.Bottom; this.splitter2.Location = new System.Drawing.Point(0, 401); this.splitter2.Name = "splitter2"; this.splitter2.Size = new System.Drawing.Size(448, 3); this.splitter2.TabIndex = 3; this.splitter2.TabStop = false; // // panelDasm // this.panelDasm.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.panelDasm.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; this.panelDasm.Controls.Add(this.dasmPanel); this.panelDasm.Location = new System.Drawing.Point(0, 0); this.panelDasm.Name = "panelDasm"; this.panelDasm.Size = new System.Drawing.Size(448, 249); this.panelDasm.TabIndex = 4; // // dasmPanel // this.dasmPanel.ActiveAddress = ((ushort)(0)); this.dasmPanel.BackColor = System.Drawing.SystemColors.ControlText; this.dasmPanel.BreakpointColor = System.Drawing.Color.Red; this.dasmPanel.BreakpointForeColor = System.Drawing.Color.Black; this.dasmPanel.Dock = System.Windows.Forms.DockStyle.Fill; this.dasmPanel.Font = new System.Drawing.Font("Courier New", 9F); this.dasmPanel.ForeColor = System.Drawing.SystemColors.ActiveCaptionText; this.dasmPanel.Location = new System.Drawing.Point(0, 0); this.dasmPanel.Name = "dasmPanel"; this.dasmPanel.Size = new System.Drawing.Size(444, 245); this.dasmPanel.TabIndex = 0; this.dasmPanel.Text = "dasmPanel1"; this.dasmPanel.TopAddress = ((ushort)(0)); this.dasmPanel.CheckBreakpoint += new ZXMAK2.Hardware.Adlers.UI.DasmPanel.ONCHECKCPU(this.dasmPanel_CheckBreakpoint); this.dasmPanel.CheckExecuting += new ZXMAK2.Hardware.Adlers.UI.DasmPanel.ONCHECKCPU(this.dasmPanel_CheckExecuting); this.dasmPanel.GetData += new ZXMAK2.Hardware.Adlers.UI.DasmPanel.ONGETDATACPU(this.dasmPanel_GetData); this.dasmPanel.GetDasm += new ZXMAK2.Hardware.Adlers.UI.DasmPanel.ONGETDASMCPU(this.dasmPanel_GetDasm); this.dasmPanel.BreakpointClick += new ZXMAK2.Hardware.Adlers.UI.DasmPanel.ONCLICKCPU(this.dasmPanel_SetBreakpoint); this.dasmPanel.MouseClick += new System.Windows.Forms.MouseEventHandler(this.dasmPanel_MouseClick); // // contextMenuDasm // this.contextMenuDasm.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { this.menuItemDasmGotoADDR, this.menuItemDasmGotoPC, this.menuItem2, this.menuItemDasmClearBreakpoints, this.menuItem4, this.menuDasmLoadBlock, this.menuDasmSaveBlock, this.menuItem1, this.menuItemDasmRefresh}); this.contextMenuDasm.Popup += new System.EventHandler(this.contextMenuDasm_Popup); // // menuItemDasmGotoADDR // this.menuItemDasmGotoADDR.Index = 0; this.menuItemDasmGotoADDR.Text = "Goto address..."; this.menuItemDasmGotoADDR.Click += new System.EventHandler(this.menuItemDasmGotoADDR_Click); // // menuItemDasmGotoPC // this.menuItemDasmGotoPC.Index = 1; this.menuItemDasmGotoPC.Text = "Goto PC"; this.menuItemDasmGotoPC.Click += new System.EventHandler(this.menuItemDasmGotoPC_Click); // // menuItem2 // this.menuItem2.Index = 2; this.menuItem2.Text = "-"; // // menuItemDasmClearBreakpoints // this.menuItemDasmClearBreakpoints.Index = 3; this.menuItemDasmClearBreakpoints.Text = "Reset breakpoints"; this.menuItemDasmClearBreakpoints.Click += new System.EventHandler(this.menuItemDasmClearBP_Click); // // menuItem4 // this.menuItem4.Index = 4; this.menuItem4.Text = "-"; // // menuDasmLoadBlock // this.menuDasmLoadBlock.Index = 5; this.menuDasmLoadBlock.Text = "Load Block..."; this.menuDasmLoadBlock.Click += new System.EventHandler(this.menuLoadBlock_Click); // // menuDasmSaveBlock // this.menuDasmSaveBlock.Index = 6; this.menuDasmSaveBlock.Text = "Save Block..."; this.menuDasmSaveBlock.Click += new System.EventHandler(this.menuSaveBlock_Click); // // menuItem1 // this.menuItem1.Index = 7; this.menuItem1.Text = "-"; // // menuItemDasmRefresh // this.menuItemDasmRefresh.Index = 8; this.menuItemDasmRefresh.Text = "Refresh"; this.menuItemDasmRefresh.Click += new System.EventHandler(this.menuItemDasmRefresh_Click); // // contextMenuData // this.contextMenuData.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { this.menuItemDataGotoADDR, this.menuItemDataSetColumnCount, this.menuItem5, this.menuDataLoadBlock, this.menuDataSaveBlock, this.menuItem3, this.menuItemDataRefresh}); // // menuItemDataGotoADDR // this.menuItemDataGotoADDR.Index = 0; this.menuItemDataGotoADDR.Text = "Goto Address..."; this.menuItemDataGotoADDR.Click += new System.EventHandler(this.menuItemDataGotoADDR_Click); // // menuItemDataSetColumnCount // this.menuItemDataSetColumnCount.Index = 1; this.menuItemDataSetColumnCount.Text = "Set column count..."; this.menuItemDataSetColumnCount.Click += new System.EventHandler(this.menuItemDataSetColumnCount_Click); // // menuItem5 // this.menuItem5.Index = 2; this.menuItem5.Text = "-"; // // menuDataLoadBlock // this.menuDataLoadBlock.Index = 3; this.menuDataLoadBlock.Text = "Load Block..."; this.menuDataLoadBlock.Click += new System.EventHandler(this.menuLoadBlock_Click); // // menuDataSaveBlock // this.menuDataSaveBlock.Index = 4; this.menuDataSaveBlock.Text = "Save Block..."; this.menuDataSaveBlock.Click += new System.EventHandler(this.menuSaveBlock_Click); // // menuItem3 // this.menuItem3.Index = 5; this.menuItem3.Text = "-"; // // menuItemDataRefresh // this.menuItemDataRefresh.Index = 6; this.menuItemDataRefresh.Text = "Refresh"; this.menuItemDataRefresh.Click += new System.EventHandler(this.menuItemDataRefresh_Click); // // panel1 // this.panel1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; this.panel1.Controls.Add(this.dbgCmdLine); this.panel1.Dock = System.Windows.Forms.DockStyle.Bottom; this.panel1.Location = new System.Drawing.Point(0, 378); this.panel1.Name = "panel1"; this.panel1.Size = new System.Drawing.Size(448, 23); this.panel1.TabIndex = 5; // // dbgCmdLine // this.dbgCmdLine.AutoCompleteCustomSource.AddRange(new string[] { "ds", "ld", "br"}); this.dbgCmdLine.BorderStyle = System.Windows.Forms.BorderStyle.None; this.dbgCmdLine.Dock = System.Windows.Forms.DockStyle.Fill; this.dbgCmdLine.Font = new System.Drawing.Font("Courier New", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); this.dbgCmdLine.Location = new System.Drawing.Point(0, 0); this.dbgCmdLine.Name = "dbgCmdLine"; this.dbgCmdLine.Size = new System.Drawing.Size(444, 17); this.dbgCmdLine.TabIndex = 0; this.dbgCmdLine.KeyUp += new System.Windows.Forms.KeyEventHandler(this.dbgCmdLine_KeyUp); // // FormCpu // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.BackColor = System.Drawing.Color.Yellow; this.ClientSize = new System.Drawing.Size(619, 404); this.Controls.Add(this.panel1); this.Controls.Add(this.panelDasm); this.Controls.Add(this.splitter2); this.Controls.Add(this.panelMem); this.Controls.Add(this.splitter1); this.Controls.Add(this.panelStatus); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.SizableToolWindow; this.KeyPreview = true; this.Name = "FormCpu"; this.ShowInTaskbar = false; this.Text = "Z80 CPU"; this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.FormCPU_FormClosing); this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.FormCPU_FormClosed); this.Load += new System.EventHandler(this.FormCPU_Load); this.Shown += new System.EventHandler(this.FormCPU_Shown); this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.FormCPU_KeyDown); this.panelStatus.ResumeLayout(false); this.panelState.ResumeLayout(false); this.panelRegs.ResumeLayout(false); this.panelMem.ResumeLayout(false); this.panelDasm.ResumeLayout(false); this.panel1.ResumeLayout(false); this.panel1.PerformLayout(); this.ResumeLayout(false); }
private void InitializeContextMenu() { m_menu = new System.Windows.Forms.ContextMenu(); System.Windows.Forms.MenuItem menuFlash = new System.Windows.Forms.MenuItem("Flash", new System.EventHandler(menuFlash_Click)); m_menu.MenuItems.Add(menuFlash); System.Windows.Forms.MenuItem menuSeparator = new System.Windows.Forms.MenuItem("-"); m_menu.MenuItems.Add(menuSeparator); System.Windows.Forms.MenuItem menuZoomTo = new System.Windows.Forms.MenuItem("ZoomTo", new System.EventHandler(menuZoomTo_Click)); m_menu.MenuItems.Add(menuZoomTo); System.Windows.Forms.MenuItem menuSelect = new System.Windows.Forms.MenuItem("Select", new System.EventHandler(menuSelect_Click)); m_menu.MenuItems.Add(menuSelect); }
public MainWindow() { InitializeComponent(); AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(EventCurrentDomainUnhandledException); this.DataContext = this; iExtendedNotifyIcon = new ExtendedNotifyIcon(Properties.Resources.Icon); iExtendedNotifyIcon.Click += EventNotifyIconClick; iExtendedNotifyIcon.RightClick += EventNotifyIconRightClick; System.Windows.Forms.ContextMenu menu = new System.Windows.Forms.ContextMenu(); System.Windows.Forms.MenuItem open = new System.Windows.Forms.MenuItem("Open", new EventHandler(EventContextMenuOpen)); System.Windows.Forms.MenuItem exit = new System.Windows.Forms.MenuItem("Exit", new EventHandler(EventContextMenuExit)); menu.MenuItems.Add(open); menu.MenuItems.Add(exit); iExtendedNotifyIcon.ContextMenu = menu; Left = SystemParameters.WorkArea.Width - LayoutRoot.Width - 10; Top = SystemParameters.WorkArea.Height - LayoutRoot.Height - 2; iConfigurationWindow = new ConfigurationWindow(); iMediaPlayerWindow = new MediaPlayerWindow(iConfigurationWindow.Enabled, this); iConfigurationWindow.Left = Left; iConfigurationWindow.Top = Top - iConfigurationWindow.LayoutRoot.Height + 1; iMediaPlayerWindow.Left = Left; iMediaPlayerWindow.Top = Top - iMediaPlayerWindow.LayoutRoot.Height + 1; // Locate these storyboards and "cache" them - we only ever want to find these once for performance reasons iStoryBoardFadeIn = (Storyboard)this.TryFindResource("storyBoardFadeIn"); iStoryBoardFadeIn.Completed += new EventHandler(EventStoryBoardFadeInCompleted); iStoryBoardFadeOut = (Storyboard)TryFindResource("storyBoardFadeOut"); iStoryBoardFadeOut.Completed += new EventHandler(EventStoryBoardFadeOutCompleted); this.Closing += EventWindowClosing; System.Drawing.Image image = OpenHome.Songcast.Properties.Resources.Icon.ToBitmap(); MemoryStream stream = new MemoryStream(); image.Save(stream, System.Drawing.Imaging.ImageFormat.Bmp); byte[] bytes = stream.ToArray(); try { iSongcast = new Songcast("av.openhome.org", iConfigurationWindow.Subnet, iConfigurationWindow.Channel, iConfigurationWindow.Ttl, iConfigurationWindow.Latency, iConfigurationWindow.Multicast, iConfigurationWindow.Enabled, iConfigurationWindow.Preset, iMediaPlayerWindow.ReceiverList, iConfigurationWindow.SubnetList, this, "OpenHome", "http://www.openhome.org", "http://www.openhome.org", bytes, "image/bmp"); } catch (SongcastError e) { MessageBox.Show(e.Message, "Error", MessageBoxButton.OK, MessageBoxImage.Error); App.Current.Shutdown(1); } iConfigurationWindow.SubnetChanged += EventSubnetChanged; iConfigurationWindow.MulticastChanged += EventMulticastChanged; iConfigurationWindow.ChannelChanged += EventMulticastChannelChanged; iConfigurationWindow.TtlChanged += EventTtlChanged; iConfigurationWindow.LatencyChanged += EventLatencyChanged; iConfigurationWindow.PresetChanged += EventPresetChanged; bool value = iConfigurationWindow.Enabled; iMediaPlayerWindow.SetEnabled(value); Settings.Click += new RoutedEventHandler(EventSettingsClick); Receivers.Click += new RoutedEventHandler(EventReceiversClick); this.Topmost = true; iConfigurationWindow.Topmost = true; iMediaPlayerWindow.Topmost = true; }
private void CreateNotifyIcon() { //create menu var main = new System.Windows.Forms.ContextMenu(); var restore = new System.Windows.Forms.MenuItem { Text = "Show Interface..." }; restore.Click += new EventHandler(restore_Click); main.MenuItems.Add(restore); var refresh = new System.Windows.Forms.MenuItem { Name = "refresh", Text = "Refresh Now" }; refresh.Click += new EventHandler(refresh_Click); main.MenuItems.Add(refresh); var tipOption = new System.Windows.Forms.MenuItem { Text = _config.ShowBalloonTip ? "Disable Balloon" : "Enable Balloon" }; tipOption.Click += new EventHandler(notifyIcon_BalloonTipClicked); main.MenuItems.Add(tipOption); var configureOption = new System.Windows.Forms.MenuItem { Name = "configure", Text = "Configure Media Browser..." }; configureOption.Click += new EventHandler(configure_Click); main.MenuItems.Add(configureOption); var sep = new System.Windows.Forms.MenuItem { Text = "-" }; main.MenuItems.Add(sep); var exit = new System.Windows.Forms.MenuItem { Name = "exit", Text = "Exit" }; exit.Click += new EventHandler(exit_Click); main.MenuItems.Add(exit); //set up our systray icon Stream iconStream = Application.GetResourceStream(new Uri("pack://application:,,,/MediaBrowserService;component/MBService.ico")).Stream; notifyIcon = new System.Windows.Forms.NotifyIcon { BalloonTipTitle = "Media Browser Service", BalloonTipText = "Running in background. Use tray icon to configure...", Text = "Media Browser Service", Icon = new System.Drawing.Icon(iconStream), ContextMenu = main, Visible = true }; notifyIcon.DoubleClick += notifyIcon_Click; notifyIcon.BalloonTipClicked += new EventHandler(notifyIcon_BalloonTipClicked); if (_config.ShowBalloonTip) notifyIcon.ShowBalloonTip(2000); //create our refresh icons iconStream = Application.GetResourceStream(new Uri("pack://application:,,,/MediaBrowserService;component/MBServiceRefresh.ico")).Stream; RefreshIcons[0] = new System.Drawing.Icon(iconStream); iconStream = Application.GetResourceStream(new Uri("pack://application:,,,/MediaBrowserService;component/MBServiceRefresh2.ico")).Stream; RefreshIcons[1] = new System.Drawing.Icon(iconStream); }
private void InitializeComponent() { this.components = new System.ComponentModel.Container(); this.tvMacroTree = new System.Windows.Forms.TreeView(); this.mnuTreeContext = new System.Windows.Forms.ContextMenu(); this.mnuTreeClear = new System.Windows.Forms.MenuItem(); this.mnuTreeDelete = new System.Windows.Forms.MenuItem(); this.mnuTreeRename = new System.Windows.Forms.MenuItem(); this.mnuTreeSave = new System.Windows.Forms.MenuItem(); this.mnuTreeSep = new System.Windows.Forms.MenuItem(); this.mnuTreeCollapse = new System.Windows.Forms.MenuItem(); this.mnuTreeExpand = new System.Windows.Forms.MenuItem(); this.mnuTreeExpandAll = new System.Windows.Forms.MenuItem(); this.mnuTreeSep2 = new System.Windows.Forms.MenuItem(); this.mnuTreeNew = new System.Windows.Forms.MenuItem(); this.mnuTreeNewFolder = new System.Windows.Forms.MenuItem(); this.mnuTreeNewMacro = new System.Windows.Forms.MenuItem(); this.ilBrowserIcons = new System.Windows.Forms.ImageList(this.components); this.pnlProperties = new System.Windows.Forms.Panel(); this.grpMacroCommands = new System.Windows.Forms.GroupBox(); this.txtCommand6 = new System.Windows.Forms.TextBox(); this.mnuTextContext = new System.Windows.Forms.ContextMenu(); this.mnuTextClear = new System.Windows.Forms.MenuItem(); this.mnuTextCopy = new System.Windows.Forms.MenuItem(); this.mnuTextCut = new System.Windows.Forms.MenuItem(); this.mnuTextPaste = new System.Windows.Forms.MenuItem(); this.txtCommand5 = new System.Windows.Forms.TextBox(); this.txtCommand4 = new System.Windows.Forms.TextBox(); this.txtCommand3 = new System.Windows.Forms.TextBox(); this.txtCommand2 = new System.Windows.Forms.TextBox(); this.txtCommand1 = new System.Windows.Forms.TextBox(); this.pnlProperties.SuspendLayout(); this.grpMacroCommands.SuspendLayout(); this.SuspendLayout(); // // tvMacroTree // this.tvMacroTree.AllowDrop = true; this.tvMacroTree.ContextMenu = this.mnuTreeContext; this.tvMacroTree.Dock = System.Windows.Forms.DockStyle.Fill; this.tvMacroTree.HideSelection = false; this.tvMacroTree.HotTracking = true; this.tvMacroTree.ImageIndex = 0; this.tvMacroTree.ImageList = this.ilBrowserIcons; this.tvMacroTree.LabelEdit = true; this.tvMacroTree.Location = new System.Drawing.Point(0, 0); this.tvMacroTree.Name = "tvMacroTree"; this.tvMacroTree.PathSeparator = "::"; this.tvMacroTree.SelectedImageIndex = 0; this.tvMacroTree.Size = new System.Drawing.Size(394, 412); this.tvMacroTree.TabIndex = 0; this.tvMacroTree.BeforeLabelEdit += new System.Windows.Forms.NodeLabelEditEventHandler(this.tvMacroTree_BeforeLabelEdit); this.tvMacroTree.AfterLabelEdit += new System.Windows.Forms.NodeLabelEditEventHandler(this.tvMacroTree_AfterLabelEdit); this.tvMacroTree.ItemDrag += new System.Windows.Forms.ItemDragEventHandler(this.tvMacroTree_ItemDrag); this.tvMacroTree.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.tvMacroTree_AfterSelect); this.tvMacroTree.DragDrop += new System.Windows.Forms.DragEventHandler(this.tvMacroTree_DragDrop); this.tvMacroTree.DragOver += new System.Windows.Forms.DragEventHandler(this.tvMacroTree_DragOver); this.tvMacroTree.KeyUp += new System.Windows.Forms.KeyEventHandler(this.tvMacroTree_KeyUp); // // mnuTreeContext // this.mnuTreeContext.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { this.mnuTreeClear, this.mnuTreeDelete, this.mnuTreeRename, this.mnuTreeSave, this.mnuTreeSep, this.mnuTreeCollapse, this.mnuTreeExpand, this.mnuTreeExpandAll, this.mnuTreeSep2, this.mnuTreeNew}); this.mnuTreeContext.Popup += new System.EventHandler(this.mnuTreeContext_Popup); // // mnuTreeClear // this.mnuTreeClear.Index = 0; this.mnuTreeClear.Text = "&Clear"; this.mnuTreeClear.Click += new System.EventHandler(this.mnuTreeClear_Click); // // mnuTreeDelete // this.mnuTreeDelete.Index = 1; this.mnuTreeDelete.Text = "&Delete"; this.mnuTreeDelete.Click += new System.EventHandler(this.mnuTreeDelete_Click); // // mnuTreeRename // this.mnuTreeRename.Index = 2; this.mnuTreeRename.Text = "&Rename"; this.mnuTreeRename.Click += new System.EventHandler(this.mnuTreeRename_Click); // // mnuTreeSave // this.mnuTreeSave.Index = 3; this.mnuTreeSave.Text = "&Save Changes"; this.mnuTreeSave.Click += new System.EventHandler(this.mnuTreeSave_Click); // // mnuTreeSep // this.mnuTreeSep.Index = 4; this.mnuTreeSep.Text = "-"; // // mnuTreeCollapse // this.mnuTreeCollapse.Index = 5; this.mnuTreeCollapse.Text = "Co&llapse"; this.mnuTreeCollapse.Click += new System.EventHandler(this.mnuTreeCollapse_Click); // // mnuTreeExpand // this.mnuTreeExpand.Index = 6; this.mnuTreeExpand.Text = "&Expand"; this.mnuTreeExpand.Click += new System.EventHandler(this.mnuTreeExpand_Click); // // mnuTreeExpandAll // this.mnuTreeExpandAll.Index = 7; this.mnuTreeExpandAll.Text = "E&xpand All"; this.mnuTreeExpandAll.Click += new System.EventHandler(this.mnuTreeExpandAll_Click); // // mnuTreeSep2 // this.mnuTreeSep2.Index = 8; this.mnuTreeSep2.Text = "-"; this.mnuTreeSep2.Visible = false; // // mnuTreeNew // this.mnuTreeNew.Index = 9; this.mnuTreeNew.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { this.mnuTreeNewFolder, this.mnuTreeNewMacro}); this.mnuTreeNew.Text = "&New"; this.mnuTreeNew.Visible = false; // // mnuTreeNewFolder // this.mnuTreeNewFolder.Index = 0; this.mnuTreeNewFolder.Text = "&Folder"; this.mnuTreeNewFolder.Click += new System.EventHandler(this.mnuTreeNewFolder_Click); // // mnuTreeNewMacro // this.mnuTreeNewMacro.Index = 1; this.mnuTreeNewMacro.Text = "&Macro"; this.mnuTreeNewMacro.Click += new System.EventHandler(this.mnuTreeNewMacro_Click); // // ilBrowserIcons // this.ilBrowserIcons.ColorDepth = System.Windows.Forms.ColorDepth.Depth32Bit; this.ilBrowserIcons.ImageSize = new System.Drawing.Size(16, 16); this.ilBrowserIcons.TransparentColor = System.Drawing.Color.Transparent; // // pnlProperties // this.pnlProperties.Controls.Add(this.grpMacroCommands); this.pnlProperties.Dock = System.Windows.Forms.DockStyle.Right; this.pnlProperties.Location = new System.Drawing.Point(394, 0); this.pnlProperties.Name = "pnlProperties"; this.pnlProperties.Size = new System.Drawing.Size(396, 412); this.pnlProperties.TabIndex = 1; // // grpMacroCommands // this.grpMacroCommands.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.grpMacroCommands.Controls.Add(this.txtCommand6); this.grpMacroCommands.Controls.Add(this.txtCommand5); this.grpMacroCommands.Controls.Add(this.txtCommand4); this.grpMacroCommands.Controls.Add(this.txtCommand3); this.grpMacroCommands.Controls.Add(this.txtCommand2); this.grpMacroCommands.Controls.Add(this.txtCommand1); this.grpMacroCommands.FlatStyle = System.Windows.Forms.FlatStyle.System; this.grpMacroCommands.Location = new System.Drawing.Point(8, 4); this.grpMacroCommands.Name = "grpMacroCommands"; this.grpMacroCommands.Size = new System.Drawing.Size(380, 216); this.grpMacroCommands.TabIndex = 0; this.grpMacroCommands.TabStop = false; this.grpMacroCommands.Text = "Macro Commands"; // // txtCommand6 // this.txtCommand6.AcceptsTab = true; this.txtCommand6.ContextMenu = this.mnuTextContext; this.txtCommand6.Font = new System.Drawing.Font("Lucida Sans Unicode", 9F); this.txtCommand6.Location = new System.Drawing.Point(8, 180); this.txtCommand6.Name = "txtCommand6"; this.txtCommand6.Size = new System.Drawing.Size(364, 26); this.txtCommand6.TabIndex = 5; this.txtCommand6.TextChanged += new System.EventHandler(this.txtCommand_TextChanged); // // mnuTextContext // this.mnuTextContext.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { this.mnuTextClear, this.mnuTextCopy, this.mnuTextCut, this.mnuTextPaste}); this.mnuTextContext.Popup += new System.EventHandler(this.mnuTextContext_Popup); // // mnuTextClear // this.mnuTextClear.Index = 0; this.mnuTextClear.Text = "C&lear"; this.mnuTextClear.Click += new System.EventHandler(this.mnuTextClear_Click); // // mnuTextCopy // this.mnuTextCopy.Index = 1; this.mnuTextCopy.Text = "&Copy"; this.mnuTextCopy.Click += new System.EventHandler(this.mnuTextCopy_Click); // // mnuTextCut // this.mnuTextCut.Index = 2; this.mnuTextCut.Text = "Cu&t"; this.mnuTextCut.Click += new System.EventHandler(this.mnuTextCut_Click); // // mnuTextPaste // this.mnuTextPaste.Index = 3; this.mnuTextPaste.Text = "&Paste"; this.mnuTextPaste.Click += new System.EventHandler(this.mnuTextPaste_Click); // // txtCommand5 // this.txtCommand5.AcceptsTab = true; this.txtCommand5.ContextMenu = this.mnuTextContext; this.txtCommand5.Font = new System.Drawing.Font("Lucida Sans Unicode", 9F); this.txtCommand5.Location = new System.Drawing.Point(8, 148); this.txtCommand5.Name = "txtCommand5"; this.txtCommand5.Size = new System.Drawing.Size(364, 26); this.txtCommand5.TabIndex = 4; this.txtCommand5.TextChanged += new System.EventHandler(this.txtCommand_TextChanged); // // txtCommand4 // this.txtCommand4.AcceptsTab = true; this.txtCommand4.ContextMenu = this.mnuTextContext; this.txtCommand4.Font = new System.Drawing.Font("Lucida Sans Unicode", 9F); this.txtCommand4.Location = new System.Drawing.Point(8, 116); this.txtCommand4.Name = "txtCommand4"; this.txtCommand4.Size = new System.Drawing.Size(364, 26); this.txtCommand4.TabIndex = 3; this.txtCommand4.TextChanged += new System.EventHandler(this.txtCommand_TextChanged); // // txtCommand3 // this.txtCommand3.AcceptsTab = true; this.txtCommand3.ContextMenu = this.mnuTextContext; this.txtCommand3.Font = new System.Drawing.Font("Lucida Sans Unicode", 9F); this.txtCommand3.Location = new System.Drawing.Point(8, 84); this.txtCommand3.Name = "txtCommand3"; this.txtCommand3.Size = new System.Drawing.Size(364, 26); this.txtCommand3.TabIndex = 2; this.txtCommand3.TextChanged += new System.EventHandler(this.txtCommand_TextChanged); // // txtCommand2 // this.txtCommand2.AcceptsTab = true; this.txtCommand2.ContextMenu = this.mnuTextContext; this.txtCommand2.Font = new System.Drawing.Font("Lucida Sans Unicode", 9F); this.txtCommand2.Location = new System.Drawing.Point(8, 52); this.txtCommand2.Name = "txtCommand2"; this.txtCommand2.Size = new System.Drawing.Size(364, 26); this.txtCommand2.TabIndex = 1; this.txtCommand2.Tag = ""; this.txtCommand2.TextChanged += new System.EventHandler(this.txtCommand_TextChanged); // // txtCommand1 // this.txtCommand1.AcceptsTab = true; this.txtCommand1.ContextMenu = this.mnuTextContext; this.txtCommand1.Font = new System.Drawing.Font("Lucida Sans Unicode", 9F); this.txtCommand1.Location = new System.Drawing.Point(8, 20); this.txtCommand1.Name = "txtCommand1"; this.txtCommand1.Size = new System.Drawing.Size(364, 26); this.txtCommand1.TabIndex = 0; this.txtCommand1.Tag = ""; this.txtCommand1.TextChanged += new System.EventHandler(this.txtCommand_TextChanged); // // MainWindow // this.ClientSize = new System.Drawing.Size(790, 412); this.Controls.Add(this.tvMacroTree); this.Controls.Add(this.pnlProperties); this.MaximizeBox = false; this.Name = "MainWindow"; this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.Text = "FFXI Macro Manager"; this.pnlProperties.ResumeLayout(false); this.grpMacroCommands.ResumeLayout(false); this.grpMacroCommands.PerformLayout(); this.ResumeLayout(false); }
private void TrayIconInitialize() { _servicecontroller = new ServiceController("Huen CDR Service"); ni = new System.Windows.Forms.NotifyIcon(); ni.Icon = (System.Drawing.Icon)util.LoadProjectResource("icon", "COMMONRES", ""); ni.Text = string.Format("{0} ({1})", "Huen CDR Agent", util.LoadProjectResource("HOTEL_CODE", "COMMONRES", "").ToString()); System.Windows.Forms.ContextMenu contextmenu = new System.Windows.Forms.ContextMenu(); System.Windows.Forms.MenuItem miTitle = new System.Windows.Forms.MenuItem(); miTitle.Index = 0; miTitle.Enabled = false; miTitle.Text = "Huen CDR Agent"; System.Windows.Forms.MenuItem miSeperator0 = new System.Windows.Forms.MenuItem(); miSeperator0.Index = 1; miSeperator0.Text = "-"; System.Windows.Forms.MenuItem mi0 = new System.Windows.Forms.MenuItem(); mi0.Index = 2; mi0.Text = "환경설정(&P)"; mi0.Click += delegate(object sender, EventArgs args) { this.Show(); this.WindowState = WindowState.Normal; }; System.Windows.Forms.MenuItem mi1 = new System.Windows.Forms.MenuItem(); mi1.Index = 3; mi1.Text = "서비스 시작(&S)"; mi1.Click += delegate(object sender, EventArgs args) { if (_servicecontroller.Status == ServiceControllerStatus.Stopped) { _servicecontroller.Start(); } }; System.Windows.Forms.MenuItem mi2 = new System.Windows.Forms.MenuItem(); mi2.Index = 4; mi2.Text = "서비스 멈춤(&S)"; mi2.Enabled = false; mi2.Click += delegate(object sender, EventArgs args) { if (_servicecontroller.Status == ServiceControllerStatus.Running) { _servicecontroller.Stop(); } }; System.Windows.Forms.MenuItem miSeperator1 = new System.Windows.Forms.MenuItem(); miSeperator1.Index = 5; miSeperator1.Text = "-"; System.Windows.Forms.MenuItem mi3 = new System.Windows.Forms.MenuItem(); mi3.Index = 6; mi3.Text = "종료(&X)"; mi3.Click += delegate(object sender, EventArgs args) { this._trueExit = true; this.Close(); }; contextmenu.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { miTitle, miSeperator0, mi0, mi1, mi2, miSeperator1, mi3 }); this.ni.ContextMenu = contextmenu; this.ni.Visible = true; this.ni.DoubleClick += delegate(object sender, EventArgs args) { this.Show(); this.WindowState = WindowState.Normal; }; this.ni.ContextMenu.Popup += ContextMenu_Popup; }
public MainWindow() { InitializeComponent(); Closing += CloseToNi; SettingsWND = new Settings(); SettingsWND.OnSave += delegate { Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Background, new PrimeDelegate(delegate { System.Collections.IEnumerator e = AlertStack.Children.GetEnumerator(); while (e.MoveNext()) { AlertBox b = (AlertBox)e.Current; b.Invalidate(); } CheckIfEmpty(); })); }; bw = new BackgroundWorker(); bw.WorkerReportsProgress = true; bw.WorkerSupportsCancellation = false; bw.DoWork += AlertWorker; ni = new System.Windows.Forms.NotifyIcon(); ni.Icon = System.Drawing.Icon.ExtractAssociatedIcon(App.ResourceAssembly.Location); //i f*****g hate IO issues ni.Visible = Properties.Settings.Default.notify; PREVIOUS_WND = this.WindowState; using (MemoryStream memory = new MemoryStream()) { global::Warmon.Properties.Resources.ic_launcher.Save(memory, ImageFormat.Png); memory.Position = 0; BitmapImage i = new BitmapImage(); i.BeginInit(); i.StreamSource = memory; i.CacheOption = BitmapCacheOption.OnLoad; i.EndInit(); Icon = i; } System.Windows.Forms.ContextMenu cm = new System.Windows.Forms.ContextMenu(); cm.MenuItems.Add("&Settings", delegate(object s, EventArgs e) { SettingsWND.Show(); }); cm.MenuItems.Add("&Exit", delegate(object s, EventArgs e) { Environment.Exit(0); }); ni.ContextMenu = cm; ni.MouseClick += delegate(object s, System.Windows.Forms.MouseEventArgs e) { if(e.Button == System.Windows.Forms.MouseButtons.Left) { this.Show(); this.Focus(); this.WindowState = PREVIOUS_WND; } }; CheckIfEmpty("Loading Events..."); SettingsBtn.Click += delegate(object s, RoutedEventArgs e) { SettingsWND.Show(); }; PostInit(); }
/// ------------------------------------------------------------------------------------ /// <summary> /// Executes in two distinct scenarios. /// 1. If disposing is true, the method has been called directly /// or indirectly by a user's code via the Dispose method. /// Both managed and unmanaged resources can be disposed. /// 2. If disposing is false, the method has been called by the /// runtime from inside the finalizer and you should not reference (access) /// other managed objects, as they already have been garbage collected. /// Only unmanaged resources can be disposed. /// </summary> /// <param name="disposing"></param> /// <remarks> /// If any exceptions are thrown, that is fine. /// If the method is being done in a finalizer, it will be ignored. /// If it is thrown by client code calling Dispose, /// it needs to be handled by fixing the bug. /// If subclasses override this method, they should call the base implementation. /// </remarks> /// ------------------------------------------------------------------------------------ protected override void Dispose(bool disposing) { //Debug.WriteLineIf(!disposing, "****************** " + GetType().Name + " 'disposing' is false. ******************"); // Must not be run more than once. if (IsDisposed) return; base.Dispose(disposing); if (disposing) { // Dispose managed resources here. if (m_diffViewVc != null) m_diffViewVc.Dispose(); if (m_contextMenu != null) m_contextMenu.Dispose(); } // Dispose unmanaged resources here, whether disposing is true or false. m_diffViewVc = null; m_scrBook = null; m_SelectionHelper = null; m_contextMenu = null; m_mnuCopy = null; m_mnuPaste = null; m_mnuCut = null; m_Differences = null; }
private void InitializeNotifyIcon() { NotifyIcon = new System.Windows.Forms.NotifyIcon { Text = "Patchy", Icon = new System.Drawing.Icon(Application.GetResourceStream( new Uri("pack://application:,,,/Patchy;component/Images/patchy.ico" )).Stream), Visible = true }; NotifyIcon.DoubleClick += NotifyIconClick; NotifyIcon.BalloonTipClicked += NotifyIconBalloonTipClicked; var menu = new System.Windows.Forms.ContextMenu(); menu.MenuItems.Add("Add Torrent", (s, e) => ExecuteOpen(null, null)); menu.MenuItems.Add("Create Torrent", (s, e) => {}); // TODO menu.MenuItems.Add("-"); pauseResumeAllTorrentsMenuItem = new System.Windows.Forms.MenuItem("Pause all torrents"); menu.MenuItems.Add(pauseResumeAllTorrentsMenuItem); pauseResumeAllTorrentsMenuItem.Click += (s, e) => { if (Client.Torrents.Any(t => t.State != TorrentState.Paused)) { foreach (var torrent in Client.Torrents) torrent.Torrent.Pause(); } else { foreach (var torrent in Client.Torrents) torrent.Torrent.Start(); } }; menu.MenuItems.Add("-"); menu.MenuItems.Add("Exit", (s, e) => { AllowClose = true; Close(); }); NotifyIcon.ContextMenu = menu; }
/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(DiffView)); this.m_contextMenu = new System.Windows.Forms.ContextMenu(); this.m_mnuCopy = new System.Windows.Forms.MenuItem(); this.m_mnuPaste = new System.Windows.Forms.MenuItem(); this.m_mnuCut = new System.Windows.Forms.MenuItem(); // // m_contextMenu // this.m_contextMenu.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { this.m_mnuCut, this.m_mnuCopy, this.m_mnuPaste}); this.m_contextMenu.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("m_contextMenu.RightToLeft"))); // // m_mnuCopy // this.m_mnuCopy.Enabled = ((bool)(resources.GetObject("m_mnuCopy.Enabled"))); this.m_mnuCopy.Index = 1; this.m_mnuCopy.Shortcut = ((System.Windows.Forms.Shortcut)(resources.GetObject("m_mnuCopy.Shortcut"))); this.m_mnuCopy.ShowShortcut = ((bool)(resources.GetObject("m_mnuCopy.ShowShortcut"))); this.m_mnuCopy.Text = resources.GetString("m_mnuCopy.Text"); this.m_mnuCopy.Visible = ((bool)(resources.GetObject("m_mnuCopy.Visible"))); // // m_mnuPaste // this.m_mnuPaste.Enabled = ((bool)(resources.GetObject("m_mnuPaste.Enabled"))); this.m_mnuPaste.Index = 2; this.m_mnuPaste.Shortcut = ((System.Windows.Forms.Shortcut)(resources.GetObject("m_mnuPaste.Shortcut"))); this.m_mnuPaste.ShowShortcut = ((bool)(resources.GetObject("m_mnuPaste.ShowShortcut"))); this.m_mnuPaste.Text = resources.GetString("m_mnuPaste.Text"); this.m_mnuPaste.Visible = ((bool)(resources.GetObject("m_mnuPaste.Visible"))); // // m_mnuCut // this.m_mnuCut.Enabled = ((bool)(resources.GetObject("m_mnuCut.Enabled"))); this.m_mnuCut.Index = 0; this.m_mnuCut.Shortcut = ((System.Windows.Forms.Shortcut)(resources.GetObject("m_mnuCut.Shortcut"))); this.m_mnuCut.ShowShortcut = ((bool)(resources.GetObject("m_mnuCut.ShowShortcut"))); this.m_mnuCut.Text = resources.GetString("m_mnuCut.Text"); this.m_mnuCut.Visible = ((bool)(resources.GetObject("m_mnuCut.Visible"))); // // DiffView // this.AccessibleDescription = resources.GetString("$this.AccessibleDescription"); this.AccessibleName = resources.GetString("$this.AccessibleName"); this.AutoScroll = ((bool)(resources.GetObject("$this.AutoScroll"))); this.AutoScrollMargin = ((System.Drawing.Size)(resources.GetObject("$this.AutoScrollMargin"))); this.AutoScrollMinSize = ((System.Drawing.Size)(resources.GetObject("$this.AutoScrollMinSize"))); this.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("$this.BackgroundImage"))); this.Enabled = ((bool)(resources.GetObject("$this.Enabled"))); this.Font = ((System.Drawing.Font)(resources.GetObject("$this.Font"))); this.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("$this.ImeMode"))); this.Location = ((System.Drawing.Point)(resources.GetObject("$this.Location"))); this.Name = "DiffView"; this.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("$this.RightToLeft"))); this.Size = ((System.Drawing.Size)(resources.GetObject("$this.Size"))); }
/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.mainMenu1 = new System.Windows.Forms.MainMenu(); this.menuItemFile = new System.Windows.Forms.MenuItem(); this.menuItemNew = new System.Windows.Forms.MenuItem(); this.menuItemOpen = new System.Windows.Forms.MenuItem(); this.menuItemSave = new System.Windows.Forms.MenuItem(); this.menuItemSaveAs = new System.Windows.Forms.MenuItem(); this.menuItemExit = new System.Windows.Forms.MenuItem(); this.menuItemMenu = new System.Windows.Forms.MenuItem(); this.menuItemUndo = new System.Windows.Forms.MenuItem(); this.menuItemCut = new System.Windows.Forms.MenuItem(); this.menuItemCopy = new System.Windows.Forms.MenuItem(); this.menuItemPaste = new System.Windows.Forms.MenuItem(); this.menuItemSelectAll = new System.Windows.Forms.MenuItem(); this.menuItemSeparator1 = new System.Windows.Forms.MenuItem(); this.menuItemFind = new System.Windows.Forms.MenuItem(); this.menuItemReplace = new System.Windows.Forms.MenuItem(); this.menuItem3 = new System.Windows.Forms.MenuItem(); this.menuItemWordWrap = new System.Windows.Forms.MenuItem(); this.menuItemTextSize = new System.Windows.Forms.MenuItem(); this.menuItemTextSizeLarger = new System.Windows.Forms.MenuItem(); this.menuItemTextSizeNormal = new System.Windows.Forms.MenuItem(); this.menuItemTextSizeSmaller = new System.Windows.Forms.MenuItem(); this.menuItemInsert = new System.Windows.Forms.MenuItem(); this.menuItemInsertTime = new System.Windows.Forms.MenuItem(); this.menuItemInsertDate = new System.Windows.Forms.MenuItem(); this.menuItemInsertDateTime = new System.Windows.Forms.MenuItem(); this.menuItemSeparator2 = new System.Windows.Forms.MenuItem(); this.menuItemOptions = new System.Windows.Forms.MenuItem(); this.menuItemAbout = new System.Windows.Forms.MenuItem(); this.menuItemFindNext = new System.Windows.Forms.MenuItem(); this.menuItemCancel = new System.Windows.Forms.MenuItem(); this.contextMenu1 = new System.Windows.Forms.ContextMenu(); this.menuItemContextCut = new System.Windows.Forms.MenuItem(); this.menuItemContextCopy = new System.Windows.Forms.MenuItem(); this.menuItemContextPaste = new System.Windows.Forms.MenuItem(); this.menuItemContextSelectAll = new System.Windows.Forms.MenuItem(); this.menuItemContextSeparator = new System.Windows.Forms.MenuItem(); this.menuItemContextWordWrap = new System.Windows.Forms.MenuItem(); this.menuItemContextTextSize = new System.Windows.Forms.MenuItem(); this.menuItemContextTextSizeLarger = new System.Windows.Forms.MenuItem(); this.menuItemContextTextSizeNormal = new System.Windows.Forms.MenuItem(); this.menuItemContextTextSizeSmaller = new System.Windows.Forms.MenuItem(); this.menuItemContextInsert = new System.Windows.Forms.MenuItem(); this.menuItemContextInsertTime = new System.Windows.Forms.MenuItem(); this.menuItemContextInsertDate = new System.Windows.Forms.MenuItem(); this.menuItemContextInsertDateTime = new System.Windows.Forms.MenuItem(); this.textBoxDoc = new System.Windows.Forms.TextBox(); this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog(); this.saveFileDialog1 = new System.Windows.Forms.SaveFileDialog(); this.menuItemEdit = new System.Windows.Forms.MenuItem(); this.SuspendLayout(); // // mainMenu1 // this.mainMenu1.MenuItems.Add(this.menuItemFile); this.mainMenu1.MenuItems.Add(this.menuItemMenu); // // menuItemFile // this.menuItemFile.MenuItems.Add(this.menuItemNew); this.menuItemFile.MenuItems.Add(this.menuItemOpen); this.menuItemFile.MenuItems.Add(this.menuItemSave); this.menuItemFile.MenuItems.Add(this.menuItemSaveAs); this.menuItemFile.MenuItems.Add(this.menuItemExit); this.menuItemFile.Text = "File"; // // menuItemNew // this.menuItemNew.Text = "&New"; this.menuItemNew.Click += new System.EventHandler(this.menuItemNew_Click); // // menuItemOpen // this.menuItemOpen.Text = "&Open"; this.menuItemOpen.Click += new System.EventHandler(this.menuItemOpen_Click); // // menuItemSave // this.menuItemSave.Text = "&Save"; this.menuItemSave.Click += new System.EventHandler(this.menuItemSave_Click); // // menuItemSaveAs // this.menuItemSaveAs.Text = "Save &As"; this.menuItemSaveAs.Click += new System.EventHandler(this.menuItemSaveAs_Click); // // menuItemExit // this.menuItemExit.Text = "E&xit"; this.menuItemExit.Click += new System.EventHandler(this.menuItemExit_Click); // // menuItemMenu // this.menuItemMenu.MenuItems.Add(this.menuItemEdit); this.menuItemMenu.MenuItems.Add(this.menuItemSeparator1); this.menuItemMenu.MenuItems.Add(this.menuItemFind); this.menuItemMenu.MenuItems.Add(this.menuItemReplace); this.menuItemMenu.MenuItems.Add(this.menuItem3); this.menuItemMenu.MenuItems.Add(this.menuItemWordWrap); this.menuItemMenu.MenuItems.Add(this.menuItemTextSize); this.menuItemMenu.MenuItems.Add(this.menuItemInsert); this.menuItemMenu.MenuItems.Add(this.menuItemSeparator2); this.menuItemMenu.MenuItems.Add(this.menuItemOptions); this.menuItemMenu.MenuItems.Add(this.menuItemAbout); this.menuItemMenu.Text = "Menu"; // // menuItemUndo // this.menuItemUndo.Text = "Undo"; this.menuItemUndo.Click += new System.EventHandler(this.menuItemUndo_Click); // // menuItemCut // this.menuItemCut.Text = "Cu&t"; this.menuItemCut.Click += new System.EventHandler(this.menuItemCut_Click); // // menuItemCopy // this.menuItemCopy.Text = "&Copy"; this.menuItemCopy.Click += new System.EventHandler(this.menuItemCopy_Click); // // menuItemPaste // this.menuItemPaste.Text = "&Paste"; this.menuItemPaste.Click += new System.EventHandler(this.menuItemPaste_Click); // // menuItemSelectAll // this.menuItemSelectAll.Text = "Select &All"; this.menuItemSelectAll.Click += new System.EventHandler(this.menuItemSelectAll_Click); // // menuItemSeparator1 // this.menuItemSeparator1.Text = "-"; // // menuItemFind // this.menuItemFind.Text = "&Find"; this.menuItemFind.Click += new System.EventHandler(this.menuItemFind_Click); // // menuItemReplace // this.menuItemReplace.Text = "&Replace"; this.menuItemReplace.Click += new System.EventHandler(this.menuItemReplace_Click); // // menuItem3 // this.menuItem3.Text = "-"; // // menuItemWordWrap // this.menuItemWordWrap.Checked = true; this.menuItemWordWrap.Text = "&Word Wrap"; this.menuItemWordWrap.Click += new System.EventHandler(this.menuItemWordWrap_Click); // // menuItemTextSize // this.menuItemTextSize.MenuItems.Add(this.menuItemTextSizeLarger); this.menuItemTextSize.MenuItems.Add(this.menuItemTextSizeNormal); this.menuItemTextSize.MenuItems.Add(this.menuItemTextSizeSmaller); this.menuItemTextSize.Text = "Text &Size"; // // menuItemTextSizeLarger // this.menuItemTextSizeLarger.Text = "Larger - &+"; this.menuItemTextSizeLarger.Click += new System.EventHandler(this.menuItemTextSizeLarger_Click); // // menuItemTextSizeNormal // this.menuItemTextSizeNormal.Text = "Normal - &0"; this.menuItemTextSizeNormal.Click += new System.EventHandler(this.menuItemTextSizeNormal_Click); // // menuItemTextSizeSmaller // this.menuItemTextSizeSmaller.Text = "Smaller - &-"; this.menuItemTextSizeSmaller.Click += new System.EventHandler(this.menuItemTextSizeSmaller_Click); // // menuItemInsert // this.menuItemInsert.MenuItems.Add(this.menuItemInsertTime); this.menuItemInsert.MenuItems.Add(this.menuItemInsertDate); this.menuItemInsert.MenuItems.Add(this.menuItemInsertDateTime); this.menuItemInsert.Text = "&Insert"; // // menuItemInsertTime // this.menuItemInsertTime.Text = "&Time"; this.menuItemInsertTime.Click += new System.EventHandler(this.menuItemInsertTime_Click); // // menuItemInsertDate // this.menuItemInsertDate.Text = "&Date"; this.menuItemInsertDate.Click += new System.EventHandler(this.menuItemInsertDate_Click); // // menuItemInsertDateTime // this.menuItemInsertDateTime.Text = "Date/Time"; this.menuItemInsertDateTime.Click += new System.EventHandler(this.menuItemInsertDateTime_Click); // // menuItemSeparator2 // this.menuItemSeparator2.Text = "-"; // // menuItemOptions // this.menuItemOptions.Text = "&Options"; this.menuItemOptions.Click += new System.EventHandler(this.menuItemOptions_Click); // // menuItemAbout // this.menuItemAbout.Text = "About"; this.menuItemAbout.Click += new System.EventHandler(this.menuItemAbout_Click); // // menuItemFindNext // this.menuItemFindNext.Text = "Next"; this.menuItemFindNext.Click += new System.EventHandler(this.menuItemFindNext_Click); // // menuItemCancel // this.menuItemCancel.Text = "Cancel"; this.menuItemCancel.Click += new System.EventHandler(this.menuItemCancel_Click); // // contextMenu1 // this.contextMenu1.MenuItems.Add(this.menuItemContextCut); this.contextMenu1.MenuItems.Add(this.menuItemContextCopy); this.contextMenu1.MenuItems.Add(this.menuItemContextPaste); this.contextMenu1.MenuItems.Add(this.menuItemContextSelectAll); this.contextMenu1.MenuItems.Add(this.menuItemContextSeparator); this.contextMenu1.MenuItems.Add(this.menuItemContextWordWrap); this.contextMenu1.MenuItems.Add(this.menuItemContextTextSize); this.contextMenu1.MenuItems.Add(this.menuItemContextInsert); // // menuItemContextCut // this.menuItemContextCut.Text = "Cut"; this.menuItemContextCut.Click += new System.EventHandler(this.menuItemCut_Click); // // menuItemContextCopy // this.menuItemContextCopy.Text = "Copy"; this.menuItemContextCopy.Click += new System.EventHandler(this.menuItemCopy_Click); // // menuItemContextPaste // this.menuItemContextPaste.Text = "Paste"; this.menuItemContextPaste.Click += new System.EventHandler(this.menuItemPaste_Click); // // menuItemContextSelectAll // this.menuItemContextSelectAll.Text = "Select All"; this.menuItemContextSelectAll.Click += new System.EventHandler(this.menuItemSelectAll_Click); // // menuItemContextSeparator // this.menuItemContextSeparator.Text = "-"; // // menuItemContextWordWrap // this.menuItemContextWordWrap.Checked = true; this.menuItemContextWordWrap.Text = "&Word Wrap"; this.menuItemContextWordWrap.Click += new System.EventHandler(this.menuItemWordWrap_Click); // // menuItemContextTextSize // this.menuItemContextTextSize.MenuItems.Add(this.menuItemContextTextSizeLarger); this.menuItemContextTextSize.MenuItems.Add(this.menuItemContextTextSizeNormal); this.menuItemContextTextSize.MenuItems.Add(this.menuItemContextTextSizeSmaller); this.menuItemContextTextSize.Text = "Text &Size"; // // menuItemContextTextSizeLarger // this.menuItemContextTextSizeLarger.Text = "Larger - &+"; this.menuItemContextTextSizeLarger.Click += new System.EventHandler(this.menuItemTextSizeLarger_Click); // // menuItemContextTextSizeNormal // this.menuItemContextTextSizeNormal.Text = "Normal - &0"; this.menuItemContextTextSizeNormal.Click += new System.EventHandler(this.menuItemTextSizeNormal_Click); // // menuItemContextTextSizeSmaller // this.menuItemContextTextSizeSmaller.Text = "Smaller - &-"; this.menuItemContextTextSizeSmaller.Click += new System.EventHandler(this.menuItemTextSizeSmaller_Click); // // menuItemContextInsert // this.menuItemContextInsert.MenuItems.Add(this.menuItemContextInsertTime); this.menuItemContextInsert.MenuItems.Add(this.menuItemContextInsertDate); this.menuItemContextInsert.MenuItems.Add(this.menuItemContextInsertDateTime); this.menuItemContextInsert.Text = "Insert"; // // menuItemContextInsertTime // this.menuItemContextInsertTime.Text = "Time"; this.menuItemContextInsertTime.Click += new System.EventHandler(this.menuItemInsertTime_Click); // // menuItemContextInsertDate // this.menuItemContextInsertDate.Text = "Date"; this.menuItemContextInsertDate.Click += new System.EventHandler(this.menuItemInsertDate_Click); // // menuItemContextInsertDateTime // this.menuItemContextInsertDateTime.Text = "Date/Time"; this.menuItemContextInsertDateTime.Click += new System.EventHandler(this.menuItemInsertDateTime_Click); // // textBoxDoc // this.textBoxDoc.AcceptsReturn = true; this.textBoxDoc.AcceptsTab = true; this.textBoxDoc.ContextMenu = this.contextMenu1; this.textBoxDoc.Dock = System.Windows.Forms.DockStyle.Fill; this.textBoxDoc.Font = new System.Drawing.Font("Courier New", 9F, System.Drawing.FontStyle.Regular); this.textBoxDoc.Location = new System.Drawing.Point(0, 0); this.textBoxDoc.MaxLength = 2147483647; this.textBoxDoc.Multiline = true; this.textBoxDoc.Name = "textBoxDoc"; this.textBoxDoc.ScrollBars = System.Windows.Forms.ScrollBars.Vertical; this.textBoxDoc.Size = new System.Drawing.Size(240, 268); this.textBoxDoc.TabIndex = 0; // // openFileDialog1 // this.openFileDialog1.Filter = "Text files|*.txt|XML files|*.xml|HTML files|*.html|All files|*.*"; // // saveFileDialog1 // this.saveFileDialog1.Filter = "Text files|*.txt|XML files|*.xml|HTML files|*.html|All files|*.*"; // // menuItemEdit // this.menuItemEdit.MenuItems.Add(this.menuItemUndo); this.menuItemEdit.MenuItems.Add(this.menuItemCut); this.menuItemEdit.MenuItems.Add(this.menuItemCopy); this.menuItemEdit.MenuItems.Add(this.menuItemPaste); this.menuItemEdit.MenuItems.Add(this.menuItemSelectAll); this.menuItemEdit.Text = "&Edit"; // // formNotepad // this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; this.AutoScroll = true; this.ClientSize = new System.Drawing.Size(240, 268); this.Controls.Add(this.textBoxDoc); this.Menu = this.mainMenu1; this.Name = "formNotepad"; this.Text = "Notepad"; this.ResumeLayout(false); }
protected override void Dispose(bool disposing) { if (disposing) { if (this.window != null) { this.icon = null; this.Text = string.Empty; this.UpdateIcon(false); this.window.DestroyHandle(); this.window = null; this.contextMenu = null; this.contextMenuStrip = null; } } else if ((this.window != null) && (this.window.Handle != IntPtr.Zero)) { System.Windows.Forms.UnsafeNativeMethods.PostMessage(new HandleRef(this.window, this.window.Handle), 0x10, 0, 0); this.window.ReleaseHandle(); } base.Dispose(disposing); }
private void initNotify () { try { System.Windows.Forms.ContextMenu menu = new System.Windows.Forms.ContextMenu(); System.Windows.Forms.MenuItem item_Open = new System.Windows.Forms.MenuItem(); item_Open.Index = 0; item_Open.Text = "Activate Orange"; item_Open.Click += item1_Open_Click; NotifyCurrentItem = new System.Windows.Forms.MenuItem(); NotifyCurrentItem.Index = 1; NotifyCurrentItem.Checked = Properties.Settings.Default.IsNotifyInfo; NotifyCurrentItem.Text = LanguagePack.NotifyText(); NotifyCurrentItem.Click += delegate(object sender, EventArgs args) { if (NotifyCurrentItem.Checked) { NotifyCurrentItem.Checked = false; } else { NotifyCurrentItem.Checked = true; } }; System.Windows.Forms.MenuItem item_Previous = new System.Windows.Forms.MenuItem(); item_Previous.Index = 2; item_Previous.Text = "Previous"; item_Previous.Click += delegate(object sender, EventArgs args) { Previous_item(); }; System.Windows.Forms.MenuItem item_Next = new System.Windows.Forms.MenuItem(); item_Next.Index = 3; item_Next.Text = "Next"; item_Next.Click += delegate(object sender, EventArgs args) { NextMusic(); }; System.Windows.Forms.MenuItem item_Play = new System.Windows.Forms.MenuItem(); item_Play.Index = 4; item_Play.Text = "Play"; item_Play.Click += delegate(object sender, EventArgs args) { if (Player_State.IsPlaying) { webBrowser.InvokeScript("playVideo"); } else { if (myPlayList.SelectedIndex != -1) { MusicItem item = (MusicItem)myPlayList.SelectedItem; PlayMusic(item); //MessageBoxOrange.ShowDialog(item.title); webBrowser.InvokeScript("playVideo"); Player_State.IsPlaying = true; } } }; System.Windows.Forms.MenuItem item_Pause = new System.Windows.Forms.MenuItem(); item_Pause.Index = 5; item_Pause.Text = "Pause"; item_Pause.Click += delegate(object sender, EventArgs args) { webBrowser.InvokeScript("pauseVideo"); }; System.Windows.Forms.MenuItem item_Close = new System.Windows.Forms.MenuItem(); item_Close.Index = 6; item_Close.Text = "Exit"; item_Close.Click += item_Close_Click; //menu.MenuItems.Add(item_Open); menu.MenuItems.Add(NotifyCurrentItem); menu.MenuItems.Add("-"); menu.MenuItems.Add(item_Previous); menu.MenuItems.Add(item_Next); menu.MenuItems.Add(item_Play); menu.MenuItems.Add(item_Pause); menu.MenuItems.Add("-"); menu.MenuItems.Add(item_Close); notify = new System.Windows.Forms.NotifyIcon(); Stream iconStream = Application.GetResourceStream(new Uri("pack://application:,,,/Orange;component/icon.ico")).Stream; notify.Icon = new System.Drawing.Icon(iconStream); ; notify.ContextMenu = menu; notify.Visible = true; if (Properties.Settings.Default.IsTray) { notify.Visible = true; } else { notify.Visible = false; } notify.DoubleClick += notify_DoubleClick; setBalloonTip("Welcome to Orange player"); } catch (Exception ex){ MessageBoxOrange.ShowDialog("Exception", ex.ToString()); } }
/// <summary> /// Построение иконки трея /// </summary> private void BuildIcon() { mExit = new System.Windows.Forms.MenuItem(); mExit.Text = "Exit"; ControlItem = new System.Windows.Forms.MenuItem(); ControlItem.Text = "CTFL + SHIFT"; ControlItem.RadioCheck = true; AltItem = new System.Windows.Forms.MenuItem(); AltItem.Text = "ALT + SHIFT"; AltItem.RadioCheck = true; cMenu = new System.Windows.Forms.ContextMenu(); cMenu.MenuItems.Add(ControlItem); cMenu.MenuItems.Add(AltItem); cMenu.MenuItems.Add("-"); cMenu.MenuItems.Add(mExit); TrayIcon = new System.Windows.Forms.NotifyIcon(); TrayIcon.Icon = new System.Drawing.Icon(Application.GetResourceStream(new Uri("pack://application:,,,/KBLCService;component/app_icon.ico")).Stream); TrayIcon.Visible = true; TrayIcon.Text = "Keyboard Layout Changer Service"; TrayIcon.ContextMenu = cMenu; mExit.Click += (s, e) => { Utils.CloseApp(); }; ControlItem.Click += (s, e) => { SetMode(true); }; AltItem.Click += (s, e) => { SetMode(false); }; }
/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.components = new System.ComponentModel.Container(); this.treeView1 = new System.Windows.Forms.TreeView(); this.contextMenu1 = new System.Windows.Forms.ContextMenu(); this.miMark = new System.Windows.Forms.MenuItem(); this.miDelete = new System.Windows.Forms.MenuItem(); this.miProperties = new System.Windows.Forms.MenuItem(); this.miLocScaleRot = new System.Windows.Forms.MenuItem(); this.miCenterCamera = new System.Windows.Forms.MenuItem(); this.miOpenNodeInNew = new System.Windows.Forms.MenuItem(); this.menuItem2 = new System.Windows.Forms.MenuItem(); this.miExportThisAndChildren = new System.Windows.Forms.MenuItem(); this.miExportOnlyChildren = new System.Windows.Forms.MenuItem(); this.menuItem5 = new System.Windows.Forms.MenuItem(); this.miImportReplace = new System.Windows.Forms.MenuItem(); this.miImportMerge = new System.Windows.Forms.MenuItem(); this.miImportMovie = new System.Windows.Forms.MenuItem(); this.mainMenu1 = new System.Windows.Forms.MainMenu(this.components); this.menuItem1 = new System.Windows.Forms.MenuItem(); this.miExport = new System.Windows.Forms.MenuItem(); this.miImport = new System.Windows.Forms.MenuItem(); this.miView = new System.Windows.Forms.MenuItem(); this.miCopy = new System.Windows.Forms.MenuItem(); this.miPaste = new System.Windows.Forms.MenuItem(); this.SuspendLayout(); // // treeView1 // this.treeView1.AllowDrop = true; this.treeView1.ContextMenu = this.contextMenu1; this.treeView1.Location = new System.Drawing.Point(0, 0); this.treeView1.Name = "treeView1"; this.treeView1.Size = new System.Drawing.Size(288, 232); this.treeView1.TabIndex = 0; this.treeView1.DoubleClick += new System.EventHandler(this.treeView1_DoubleClick); this.treeView1.BeforeSelect += new System.Windows.Forms.TreeViewCancelEventHandler(this.treeView1_BeforeSelect); this.treeView1.MouseDown += new System.Windows.Forms.MouseEventHandler(this.treeView1_MouseDown); // // contextMenu1 // this.contextMenu1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { this.miMark, this.miDelete, this.miProperties, this.miLocScaleRot, this.miCenterCamera, this.miOpenNodeInNew, this.menuItem2, this.menuItem5, this.miCopy, this.miPaste}); // // miMark // this.miMark.Index = 0; this.miMark.Shortcut = System.Windows.Forms.Shortcut.CtrlM; this.miMark.Text = "Mark"; this.miMark.Click += new System.EventHandler(this.miMark_Click); // // miDelete // this.miDelete.Index = 1; this.miDelete.Shortcut = System.Windows.Forms.Shortcut.Del; this.miDelete.Text = "Delete"; this.miDelete.Click += new System.EventHandler(this.miDelete_Click); // // miProperties // this.miProperties.Index = 2; this.miProperties.Shortcut = System.Windows.Forms.Shortcut.F2; this.miProperties.Text = "Properties"; this.miProperties.Click += new System.EventHandler(this.miProperties_Click); // // miLocScaleRot // this.miLocScaleRot.Index = 3; this.miLocScaleRot.Text = "Loc/Scale/Rot control"; this.miLocScaleRot.Click += new System.EventHandler(this.miLocScaleRot_Click); // // miCenterCamera // this.miCenterCamera.Index = 4; this.miCenterCamera.Text = "Center camera on it"; this.miCenterCamera.Click += new System.EventHandler(this.miCenterCamera_Click); // // miOpenNodeInNew // this.miOpenNodeInNew.Index = 5; this.miOpenNodeInNew.Text = "Open in new window"; this.miOpenNodeInNew.Click += new System.EventHandler(this.miOpenNodeInNew_Click); // // menuItem2 // this.menuItem2.Index = 6; this.menuItem2.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { this.miExportThisAndChildren, this.miExportOnlyChildren}); this.menuItem2.Text = "Export"; // // miExportThisAndChildren // this.miExportThisAndChildren.Index = 0; this.miExportThisAndChildren.Text = "This and children"; this.miExportThisAndChildren.Click += new System.EventHandler(this.miExportThisAndChildren_Click); // // miExportOnlyChildren // this.miExportOnlyChildren.Index = 1; this.miExportOnlyChildren.Text = "Only children"; this.miExportOnlyChildren.Click += new System.EventHandler(this.miExportOnlyChildren_Click); // // menuItem5 // this.menuItem5.Index = 7; this.menuItem5.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { this.miImportReplace, this.miImportMerge, this.miImportMovie}); this.menuItem5.Text = "Import"; // // miImportReplace // this.miImportReplace.Index = 0; this.miImportReplace.Text = "Replace"; this.miImportReplace.Click += new System.EventHandler(this.miImportReplace_Click); // // miImportMerge // this.miImportMerge.Index = 1; this.miImportMerge.Text = "Merge (N/A)"; this.miImportMerge.Click += new System.EventHandler(this.miImportMerge_Click); // // miImportMovie // this.miImportMovie.Index = 2; this.miImportMovie.Text = "Movie"; this.miImportMovie.Click += new System.EventHandler(this.miImportMovie_Click); // // mainMenu1 // this.mainMenu1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { this.menuItem1, this.miView}); // // menuItem1 // this.menuItem1.Index = 0; this.menuItem1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { this.miExport, this.miImport}); this.menuItem1.Text = "File"; // // miExport // this.miExport.Index = 0; this.miExport.Text = "Export..."; this.miExport.Click += new System.EventHandler(this.miExport_Click); // // miImport // this.miImport.Index = 1; this.miImport.Text = "Import..."; this.miImport.Click += new System.EventHandler(this.miImport_Click); // // miView // this.miView.Index = 1; this.miView.Text = "View"; // // miCopy // this.miCopy.Index = 8; this.miCopy.Text = "Copy"; this.miCopy.Click += new System.EventHandler(this.miCopy_Click); // // miPaste // this.miPaste.Index = 9; this.miPaste.Text = "Paste"; // // SceneGraphViewer // this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); this.ClientSize = new System.Drawing.Size(288, 241); this.Controls.Add(this.treeView1); this.Menu = this.mainMenu1; this.Name = "SceneGraphViewer"; this.StartPosition = System.Windows.Forms.FormStartPosition.Manual; this.Text = "SceneGraphViewer"; this.Resize += new System.EventHandler(this.SceneGraphViewer_Resize); this.Activated += new System.EventHandler(this.SceneGraphViewer_Activated); this.ResumeLayout(false); }
/// <summary> /// Creates notify icon and menu. /// </summary> private void CreateNotifyIcon() { System.Windows.Forms.NotifyIcon notifyicon; notifyicon = new System.Windows.Forms.NotifyIcon(); var currentBrightness = WmiFunctions.GetBrightnessLevel(); //System.Windows.Forms.MenuItem mnuPin = new System.Windows.Forms.MenuItem("Pin", new EventHandler(this.PinMenuEventHandler)); System.Windows.Forms.MenuItem mnuMonitorOff = new System.Windows.Forms.MenuItem("Power off display", new EventHandler(this.MonitorOffMenuEventHandler)); System.Windows.Forms.MenuItem mnuSleep = new System.Windows.Forms.MenuItem("Enter sleep mode", new EventHandler(this.SleepMenuEventHandler)); System.Windows.Forms.MenuItem mnuCaffiene = new System.Windows.Forms.MenuItem("Caffiene", new EventHandler(this.CaffieneMenuEventHandler)); mnuAutostart = new System.Windows.Forms.MenuItem("Autostart", new EventHandler(this.AutostartMenuEventHandler)); mnuAutostart.Checked = Autostart.CheckStartupFolderShortcutsExists(); System.Windows.Forms.MenuItem mnuExit = new System.Windows.Forms.MenuItem("Close", new EventHandler(this.ExitMenuEventHandler)); mnuLabel = new System.Windows.Forms.MenuItem(""); mnuLabel.Enabled = false; // greyed-out style label System.Windows.Forms.MenuItem[] menuitems = new System.Windows.Forms.MenuItem[] { mnuLabel, new System.Windows.Forms.MenuItem("-"), mnuMonitorOff, mnuSleep, new System.Windows.Forms.MenuItem("-"), mnuCaffiene, new System.Windows.Forms.MenuItem("-"), mnuAutostart, new System.Windows.Forms.MenuItem("-"), mnuExit }; System.Windows.Forms.ContextMenu contextmenu = new System.Windows.Forms.ContextMenu(menuitems); contextmenu.Popup += this.ContextMenuPopup; notifyicon.ContextMenu = contextmenu; notifyicon.MouseClick += this.NotifyIconClick; notifyicon.MouseDoubleClick += this.NotifyIconClick; notifyicon.Visible = true; DrawIcon.updateNotifyIcon(notifyicon, currentBrightness); this.NotifyIcon = notifyicon; }
/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.components = new System.ComponentModel.Container(); this.mainMenu1 = new System.Windows.Forms.MainMenu(this.components); this.menuItem1 = new System.Windows.Forms.MenuItem(); this.treeView1 = new System.Windows.Forms.TreeView(); this.listView1 = new System.Windows.Forms.ListView(); this.columnHeader1 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.columnHeader2 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.columnHeader3 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.columnHeader4 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.columnHeader5 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.splitter1 = new System.Windows.Forms.Splitter(); this.c_treeView = new System.Windows.Forms.ContextMenu(); this.menuItem2 = new System.Windows.Forms.MenuItem(); this.c_listView = new System.Windows.Forms.ContextMenu(); this.menuItem3 = new System.Windows.Forms.MenuItem(); this.SuspendLayout(); // // mainMenu1 // this.mainMenu1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { this.menuItem1}); // // menuItem1 // this.menuItem1.Index = 0; this.menuItem1.Text = "Rename Title ID Folders to Real Names"; this.menuItem1.Visible = false; this.menuItem1.Click += new System.EventHandler(this.menuItem1_Click); // // treeView1 // this.treeView1.Dock = System.Windows.Forms.DockStyle.Left; this.treeView1.Location = new System.Drawing.Point(0, 0); this.treeView1.Name = "treeView1"; this.treeView1.Size = new System.Drawing.Size(238, 393); this.treeView1.TabIndex = 0; this.treeView1.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.treeView1_AfterSelect); // // listView1 // this.listView1.AllowDrop = true; this.listView1.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { this.columnHeader1, this.columnHeader2, this.columnHeader3, this.columnHeader4, this.columnHeader5}); this.listView1.Dock = System.Windows.Forms.DockStyle.Fill; this.listView1.FullRowSelect = true; this.listView1.GridLines = true; this.listView1.LabelEdit = true; this.listView1.Location = new System.Drawing.Point(238, 0); this.listView1.MultiSelect = false; this.listView1.Name = "listView1"; this.listView1.ShowItemToolTips = true; this.listView1.Size = new System.Drawing.Size(697, 393); this.listView1.TabIndex = 2; this.listView1.UseCompatibleStateImageBehavior = false; this.listView1.View = System.Windows.Forms.View.Details; // // columnHeader1 // this.columnHeader1.Text = "Name"; this.columnHeader1.Width = 150; // // columnHeader2 // this.columnHeader2.Text = "Type"; this.columnHeader2.Width = 100; // // columnHeader3 // this.columnHeader3.Text = "Size"; this.columnHeader3.Width = 100; // // columnHeader4 // this.columnHeader4.Text = "Date"; this.columnHeader4.Width = 160; // // columnHeader5 // this.columnHeader5.Text = "STFS Name"; this.columnHeader5.Width = 160; // // splitter1 // this.splitter1.Location = new System.Drawing.Point(238, 0); this.splitter1.Name = "splitter1"; this.splitter1.Size = new System.Drawing.Size(3, 393); this.splitter1.TabIndex = 3; this.splitter1.TabStop = false; // // c_treeView // this.c_treeView.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { this.menuItem2}); // // menuItem2 // this.menuItem2.Index = 0; this.menuItem2.Text = "Open Folder Location"; this.menuItem2.Click += new System.EventHandler(this.menuItem2_Click); // // c_listView // this.c_listView.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { this.menuItem3}); // // menuItem3 // this.menuItem3.Index = 0; this.menuItem3.Text = "Open Location"; this.menuItem3.Click += new System.EventHandler(this.menuItem3_Click); // // CustomBackupViewer // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(935, 393); this.Controls.Add(this.splitter1); this.Controls.Add(this.listView1); this.Controls.Add(this.treeView1); this.Menu = this.mainMenu1; this.Name = "CustomBackupViewer"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.Text = "Custom Backup Viewer"; this.ResumeLayout(false); }
private void InitializeNotifyIcon() { Stream newMessageIconStream = System.Windows.Application.GetResourceStream(new Uri("pack://application:,,,/Toxy;component/Resources/Icons/icon2.ico")).Stream; Stream iconStream = System.Windows.Application.GetResourceStream(new Uri("pack://application:,,,/Toxy;component/Resources/Icons/icon.ico")).Stream; notifyIcon = new Icon(iconStream); newMessageNotifyIcon = new Icon(newMessageIconStream); this.nIcon.Icon = notifyIcon; nIcon.Click += nIcon_Click; var trayIconContextMenu = new System.Windows.Forms.ContextMenu(); var closeMenuItem = new System.Windows.Forms.MenuItem("Exit", closeMenuItem_Click); var openMenuItem = new System.Windows.Forms.MenuItem("Open", openMenuItem_Click); var statusMenuItem = new System.Windows.Forms.MenuItem("Status"); var setOnlineMenuItem = new System.Windows.Forms.MenuItem("Online", setStatusMenuItem_Click); var setAwayMenuItem = new System.Windows.Forms.MenuItem("Away", setStatusMenuItem_Click); var setBusyMenuItem = new System.Windows.Forms.MenuItem("Busy", setStatusMenuItem_Click); setOnlineMenuItem.Tag = 0; // Online setAwayMenuItem.Tag = 1; // Away setBusyMenuItem.Tag = 2; // Busy statusMenuItem.MenuItems.Add(setOnlineMenuItem); statusMenuItem.MenuItems.Add(setAwayMenuItem); statusMenuItem.MenuItems.Add(setBusyMenuItem); trayIconContextMenu.MenuItems.Add(openMenuItem); trayIconContextMenu.MenuItems.Add(statusMenuItem); trayIconContextMenu.MenuItems.Add(closeMenuItem); nIcon.ContextMenu = trayIconContextMenu; }