public LabManager() { Application.EnableVisualStyles(); this.StartPosition = FormStartPosition.CenterScreen; try { this.Icon = new Icon(System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("LabManager.LM-App.ico")); } catch { } InitializeComponent(); // inis = IniStructure.ReadIni(myThorDef.PathIniFile); InsertLoggingEntry((int)Definition.ThorLogWindows.ROUTING, "starting LabManager ..."); string[] args = Environment.GetCommandLineArgs(); foreach (string arg in args) { if (arg == "/minimize" || arg == "/minimized") { this.WindowState = FormWindowState.Minimized; } if (arg == "/nonvisible") { this.Visible = false; } } myHC.SetLabManagerConnectReady("WinCCReady", nTimeoutConnectionToWinCCStartup); ribbonLabel_WinCC.SmallImage = _imgList.Images["OrangeBlock"]; ribbonLabel_Connect.SmallImage = _imgList.Images["OrangeBlock"]; ribbonLabelRoutingCheck.SmallImage = _imgList.Images["RedBlock"]; _pipeServer = new PipeServer(); _pipeServer.PipeMessage += new DelegateMessage(PipesMessageHandler); }
private void LabManager_FormClosing(object sender, FormClosingEventArgs e) { if (MessageBox.Show("Do you really want to exit Labmanager?", "Question", System.Windows.Forms.MessageBoxButtons.OKCancel) != DialogResult.OK) { e.Cancel = true; } else { _pipeServer.PipeMessage -= new DelegateMessage(PipesMessageHandler); _pipeServer = null; } }