public LongTaskDialog(IServiceController controller) { InitializeComponent(); Controller = controller; backgroundWorker1.RunWorkerAsync(); }
public MainForm() { InitializeComponent(); listView1.MouseWheel += OnMouseWheel; Instance = this; tsmFile.Text = IDS.Menu_File; tsmFile_ConnectToLocalMachine.Text = IDS.Menu_File_ConnectToLocalMachine; tsmFile_ConnectToRemoteMachine.Text = IDS.Menu_File_ConnectToRemoteMachine; tsmFile_ApplyTemplate.Text = IDS.Menu_File_ApplyTemplate; tsmFile_SaveAsXML.Text = IDS.Menu_File_SaveAsXML; tsmFile_CopyToClipboard.Text = IDS.Menu_File_CopyToClipboard; tsmFile_Print.Text = IDS.Menu_File_Print; tsmFile_PrintPreview.Text = IDS.Menu_File_PrintPreview; tsmFile_PageSetup.Text = IDS.Menu_File_PageSetup; tsmFile_Exit.Text = IDS.Menu_File_Exit; tsmOptions.Text = IDS.Menu_Options; tsmOptions_ChooseColumns.Text = IDS.Menu_Options_ChooseColumns; tsmOptions_Font.Text = IDS.Menu_Options_Font; tsmView.Text = IDS.Menu_View; tsmView_Services.Text = IDS.Menu_View_Services; tsmView_Devices.Text = IDS.Menu_View_Devices; tsmView_Windows.Text = IDS.Menu_View_Windows; tsmView_Uninstaller.Text = IDS.Menu_View_Uninstaller; tsmView_SystemEvents.Text = IDS.Menu_View_SystemJournal; tsmView_SecurityEvents.Text = IDS.Menu_View_SecurityJournal; tsmView_ApplicationEvents.Text = IDS.Menu_View_ApplicationJournal; tsmView_Processes.Text = IDS.Menu_View_Processes; tsmView_Modules.Text = IDS.Menu_View_Modules; tsmView_Refresh.Text = IDS.Menu_View_Refresh; tsmHelp.Text = IDS.Menu_Help; tsmHelp_About.Text = IDS.Menu_Help_About; tsbServices.Text = IDS.Button_Services_Text; tsbServices.ToolTipText = IDS.Button_Services_ToolTip; tsbDevices.Text = IDS.Button_Devices_Text; tsbDevices.ToolTipText = IDS.Button_Devices_ToolTip; tsbWindows.Text = IDS.Button_Windows_Text; tsbWindows.ToolTipText = IDS.Button_Windows_ToolTip; tsbUninstaller.Text = IDS.Button_Uninstall_Text; tsbUninstaller.ToolTipText = IDS.Button_Uninstall_ToolTip; tsbProcesses.Text = IDS.Button_Processes_Text; tsbProcesses.ToolTipText = IDS.Button_Processes_ToolTip; tsbModules.Text = IDS.Button_Modules_Text; tsbModules.ToolTipText = IDS.Button_Modules_ToolTip; tsbItemStart.Text = IDS.Button_Item_Start; tsbItemStop.Text = IDS.Button_Item_Stop; tsbItemRestart.Text = IDS.Button_Item_Restart; tsbItemPause.Text = IDS.Button_Item_Pause; tsbItemContinue.Text = IDS.Button_Item_Continue; toolStripLabel1.Text = IDS.Button_Filter; tsbProperties.Text = IDS.Button_Properties_Text; tsbProperties.ToolTipText = IDS.Button_Properties_ToolTip; tsbRefresh.Text = IDS.Button_Refresh_Text; tsbRefresh.ToolTipText = IDS.Button_Refresh_ToolTip; listView1.VirtualMode = true; listView1.RetrieveVirtualItem += new RetrieveVirtualItemEventHandler(listView1_RetrieveVirtualItem); listView1.CacheVirtualItems += new CacheVirtualItemsEventHandler(listView1_CacheVirtualItems); Settings settings = new Settings(); listView1.Font = new Font(settings.FontFace, settings.FontHeight); ServicesController = new Services.ServicesController(listView1); DevicesController = new Services.DevicesController(listView1); WindowsController = new Windows.WindowsController(listView1); UninstallerController = new Uninstaller.UninstallerController(listView1); ProcessesController = new Processes.ProcessesController(listView1); ModulesController = new Modules.ModulesController(listView1); SystemEventsController = new EventJournal.EventJournalController(listView1, "System"); SecurityEventsController = new EventJournal.EventJournalController(listView1, "Security"); ApplicationEventsController = new EventJournal.EventJournalController(listView1, "Application"); Sorter = new ListViewColumnSorter(this); SwitchController(ServicesController); }
private void SwitchController(IServiceController scon) { CurrentController = scon; CurrentController.SetView(this); listView1.ContextMenu = CurrentController.CreateContextMenu(); listView1.Columns.Clear(); // take columns, replace by list of visible columns VisibleColumns.Clear(); HiddenColumns.Clear(); RefreshDisplay(); listView1_SelectedIndexChanged(null, null); bool CanConnectToRemoteMachine = CurrentController.CanConnectToRemoteMachine(); tsmFile_ConnectToLocalMachine.Enabled = CanConnectToRemoteMachine; tsmFile_ConnectToRemoteMachine.Enabled = CanConnectToRemoteMachine; }