public MDIParent() { InitializeComponent(); this.messageNumber = 0; LoginForm loginForm = new LoginForm(); loginForm.ShowDialog(); /* this.petriNetworkToolStripMenuItem.Enabled = false; if (CryptoHelper.getInstance().HasKey) { this.petriNetworkToolStripMenuItem.Enabled = true; }*/ CryptoHelper.getInstance().cryptoEvent += new CryptoHandler(MDIParent_cryptoEvent); CryptoHelper.getInstance().initTrustStore(); this.rand = new Random(); this.horizontalToolStripMenuItem.Tag = MdiLayout.TileHorizontal; this.verticalToolStripMenuItem.Tag = MdiLayout.TileVertical; this.cascadeToolStripMenuItem.Tag = MdiLayout.Cascade; this.arrangeIconsToolStripMenuItem.Tag = MdiLayout.ArrangeIcons; this.updateCulture(); CultureHelper.getInstance().changeCulture += new CultureHandler(updateCulture); this.StartPosition = FormStartPosition.Manual; this.Location = Properties.Settings.Default.Location; this.WindowState = Properties.Settings.Default.State; if (this.WindowState == FormWindowState.Normal) this.Size = Properties.Settings.Default.Size; this.initToolWindows(); this.tsslSelectRectangle.Text = ""; this.lToken.Visible = false; this.refreshToolWindowsPetriNetwork(null); this.numberOfMdiChildren = 0; this.showGridToolStripMenuItem.Checked = Properties.Settings.Default.ShowGrid; this.alignToGridToolStripMenuItem.Checked = Properties.Settings.Default.AlignToGrid; this.loadRecentFiles(); this.writeConsole("PetriNetworkSimulator started."); this.tsbFire.Tag = StateMatrixAction.FIRE; this.tsbAutoFire.Tag = StateMatrixAction.AUTOFIRE; this.tsbStop.Tag = StateMatrixAction.STOPAUTOFIRE; }
private void loginToolStripMenuItem_Click(object sender, EventArgs e) { bool restoreCheck = false; if (!this.toolWindowsAlwaysOnTopToolStripMenuItem.Checked) { restoreCheck = true; this.toolWindowsAlwaysOnTopToolStripMenuItem.Checked = true; } LoginForm loginForm = new LoginForm(); loginForm.ShowDialog(); this.updateCulture(); /* this.petriNetworkToolStripMenuItem.Enabled = false; if (CryptoHelper.getInstance().HasKey) { this.petriNetworkToolStripMenuItem.Enabled = true; } */ if (this.numberOfMdiChildren > 0) { if (CryptoHelper.getInstance().HasKey) { this.saveToolStripMenuItem.Enabled = true; this.saveAsToolStripMenuItem.Enabled = true; } } if (restoreCheck) { this.toolWindowsAlwaysOnTopToolStripMenuItem.Checked = false; } }