private void button_LayerParameter_Click(object sender, EventArgs e) { try { // Wait cursor if it is performance demanding to open the view... Cursor.Current = Cursors.WaitCursor; // Set active view _activeView = ActiveView.LayerParameter; // Create view _viewLayerParameter = new TpsFormLayerParameter(this._tpsRm, this.rwSystem, this.layerParameter); // Set up subscription to Closing event of Production view _viewLayerParameter.Closing += new System.ComponentModel.CancelEventHandler(_onViewClosing); _viewLayerParameter.Closed += new EventHandler(_viewClosed); _viewLayerParameter.ShowMe(this); // Ask Production view to set up its subscriptions to controller events _viewLayerParameter.Activate(); } catch (System.Exception ex) { DisplayErrorMessage(ex.Message); } finally { Cursor.Current = Cursors.Default; } }
/// <summary> /// This method is called by TAF when the control goes from the passive state to the active state, /// i.e. becomes visible in the client view. Normally, this is where subscriptions to controller events are set up. /// </summary> void ITpsViewActivation.Activate() { try { if (_activeView == ActiveView.Desktop) // If first view is active { //this.pictureBox_Logo.Image = Properties.Resources.Logo; } else if (_activeView == ActiveView.PipeGrooveModel) { _viewPipeGrooveModel.Activate(); } else if (_activeView == ActiveView.Setting) { _viewSetting.Activate(); } else if (_activeView == ActiveView.WeldingParameter) { _viewWeldingParameter.Activate(); } else if (_activeView == ActiveView.WobjCurrent) { _viewWobjCurrent.Activate(); } else if (_activeView == ActiveView.LayerParameter) { _viewLayerParameter.Activate(); } _appInFocus = true; } catch (Exception ex) { // Add error message to "ProdScr.log" file ErrorHandler.AddErrorMessage(CURRENT_MODULE_NAME, ex.ToString()); ExceptionHandler.ReThrowException("TpsViewEbara", "ITpsViewActivation.Activate", ex); } }