public Form_certificates(ServerInfo _serverInfo, ConnManager _connMgr, CertManager _certMgr, Cert _masterCert, bool _connected, List<Cert> _certList) { InitializeComponent(); serverInfo = _serverInfo; masterCert = _masterCert; certMgr = _certMgr; connMgr = _connMgr; connected = _connected; certList = _certList; driveDetector = new DriveDetector(this); driveDetector.DeviceArrived += new DriveDetectorEventHandler(OnDriveArrived); driveDetector.DeviceRemoved += new DriveDetectorEventHandler(OnDriveRemoved); UpdateDriveList(); FillServerSettingsBoxes(); if (!connected) { groupBoxAdmin.Enabled = true; groupBoxPcLock.Enabled = false; } else if (masterCert.userType == "admin") { groupBoxAdmin.Enabled = true; } else { groupBoxAdmin.Enabled = false; } }
private void btnCertMgr_Click(object sender, EventArgs e) { var form_certManager = new Form_certificates(serverInfo, connMgr, certMgr, masterCert, connected, certList); form_certManager.ShowDialog(); serverInfo = connMgr.LoadServerInfo(); LoadCertificates(); if (serverInfo.address != null) CheckStatuses(); UpdateStatuses(); }
private void Form_main_Load(object sender, EventArgs e) { serverInfo = connMgr.LoadServerInfo(); LoadCertificates(); if (!serverInfo.loaded) { MessageBox.Show("Server settings are not ready yet!\nGo to Certificates manager and create new connection."); } else { CheckStatuses(); } UpdateStatuses(); }