public ManageNonLocatedSTLT() { InitializeComponent(); dtGridViewNonLocated.AutoGenerateColumns = false; _gtApp = GTClassFactory.Create <IGTApplication>(); // Bind Data Property to Street Light Non Located data grid dtGridViewNonLocated.Columns["StltIdentifier"].DataPropertyName = "StltIdentifier"; dtGridViewNonLocated.Columns["ConnectionStatus"].DataPropertyName = "ConnectionStatus"; dtGridViewNonLocated.Columns["DisconnectDate"].DataPropertyName = "DisconnectDate"; dtGridViewNonLocated.Columns["ConnectDate"].DataPropertyName = "ConnectDate"; dtGridViewNonLocated.Columns["Location"].DataPropertyName = "Location"; dtGridViewNonLocated.Columns["AdditionalLocation"].DataPropertyName = "AdditionalLocation"; ((DataGridViewComboBoxColumn)dtGridViewNonLocated.Columns["ConnectionStatus"]).DisplayMember = "Value"; ((DataGridViewComboBoxColumn)dtGridViewNonLocated.Columns["ConnectionStatus"]).ValueMember = "Key"; stltNonLocatedCtx = new ManageNonLocatedSTLTContext(); ((DataGridViewComboBoxColumn)dtGridViewNonLocated.Columns["ConnectionStatus"]).DataSource = stltNonLocatedCtx.GetConnectionStatusVL(); isJobActive = !string.IsNullOrEmpty(_gtApp.DataContext.ActiveJob); //check Job is active if (isJobActive) { dtGridViewNonLocated.ReadOnly = false; dtGridViewNonLocated.AllowUserToAddRows = true; dtGridViewNonLocated.AllowUserToDeleteRows = true; } else { //Disable all button except Exit and set all rows in grid set to readonly dtGridViewNonLocated.ReadOnly = true; EnableButtonCtrls(false); } dtGridViewNonLocated.SelectionMode = DataGridViewSelectionMode.RowHeaderSelect; this.FormClosing += ManageNonLocatedSTLT_FormClosing; }
/// <summary> /// /// </summary> private void CleanUp() { SubscribEvents(false); if (_gtFeatureExplorerSrvc != null) { _gtFeatureExplorerSrvc.Clear(); _gtFeatureExplorerSrvc.Dispose(); _gtFeatureExplorerSrvc = null; } if (_gtPlacementSrvc != null) { _gtPlacementSrvc.Dispose(); _gtPlacementSrvc = null; } streetLights = null; if (stltNonLocatedCtx != null) { stltNonLocatedCtx.Dispose(); } stltNonLocatedCtx = null; streetLightAcct = null; _gtKeyObj = null; _gtKeyEditObj = null; }