private void checkCompareStatusAndSetExportMenuItems(object sender) { if (sender == this.pbAuditTrail) { this.exportToolStripMenuItem.DropDownItems[0].Enabled = false; this.exportToolStripMenuItem.DropDownItems[2].Enabled = false; } else { this.exportToolStripMenuItem.DropDownItems[0].Enabled = true; this.exportToolStripMenuItem.DropDownItems[2].Enabled = true; } if (sender == this.pbDeviceManager || sender == this.pbAuditTrail) { this.pbExport.Enabled = true; this.pbMail.Enabled = true; this.pbPrint.Enabled = true; this.exportToolStripMenuItem.Enabled = true; this.emailFilesToolStripMenuItem.Enabled = true; this.printFileToolStripMenuItem.Enabled = true; } else { DataManagerUC dmu = this.dataManager; if (dmu != null) { if (dmu.IsCompare) { this.pbExport.Enabled = false; this.pbMail.Enabled = false; this.pbPrint.Enabled = false; this.exportToolStripMenuItem.Enabled = false; this.emailFilesToolStripMenuItem.Enabled = false; this.printFileToolStripMenuItem.Enabled = false; } else { this.pbExport.Enabled = true; this.pbMail.Enabled = true; this.pbPrint.Enabled = true; this.exportToolStripMenuItem.Enabled = true; this.emailFilesToolStripMenuItem.Enabled = true; this.printFileToolStripMenuItem.Enabled = true; } } } }
private void InitPanel() { if (viewManager == null) { viewManager = new ViewManager(); viewManager.Size = new Size(pnContainer.Width, pnContainer.Height); //viewManager.Dock = DockStyle.Fill; } if (auditTrail == null) { auditTrail = new AuditTrail(); auditTrail.Dock = DockStyle.Fill; } if (dataManager == null) { dataManager = new DataManagerUC(); } AddDeviceManagerPanel();//默认显示device manager //订阅事件 this.viewManager.SaveRecordEvent += new EventHandler((a, b) => this.dataManager.InitHistoryData()); }