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 is where you clean up any remaining resources used by your application before /// the application itself is disposed of by the host (TAF - TeachPendant Application Framework). /// The method is called by the host when the application is closed down. /// </summary> protected override void Dispose(bool disposing) { if (!IsDisposed) { try { if (disposing) { //ToDo: Call the Dispose method of all FP SDK instances that may otherwise cause memory leak if (this.rwSystem != null) { this.rwSystem.Dispose(); this.rwSystem = null; } if (this._viewPipeGrooveModel != null) { this._viewPipeGrooveModel.Dispose(); this._viewPipeGrooveModel = null; } if (this._viewSetting != null) { this._viewSetting.Dispose(); this._viewSetting = null; } if (this._viewWeldingParameter != null) { this._viewWeldingParameter.Dispose(); this._viewWeldingParameter = null; } if (this._viewWobjCurrent != null) { this._viewWobjCurrent.Dispose(); this._viewWobjCurrent = null; } if (this._viewLayerParameter != null) { this._viewLayerParameter.Dispose(); this._viewLayerParameter = null; } if (this.pipeGrooveModel != null) { this.pipeGrooveModel.Dispose(); this.pipeGrooveModel = null; } if (this.weldProcedure != null) { this.weldProcedure.Dispose(); this.weldProcedure = null; } if (this.layerParameter != null) { this.layerParameter.Dispose(); this.layerParameter = null; } if (this._tpsRm != null) { this._tpsRm = null; } } } catch (System.Exception ex) { GTPUMessageBox.Show(this.Parent.Parent, null , "An unexpected error occurred while closing down the application.\n\nError message: " + ex.Message , "Application Error" , MessageBoxIcon.Hand, MessageBoxButtons.OK); } finally { base.Dispose(disposing); } } }