示例#1
0
        /// <summary>
        /// This method is called by TAF when the control is installed in the framework (after the constructor is called).
        /// </summary>
        bool ITpsViewSetup.Install(object sender, object data)
        {
            try
            {
                // Do install
                this.rwSystem        = new RWSystem();
                this.pipeGrooveModel = new PipeGrooveModel();
                this.weldProcedure   = new WeldProcedure();
                this.layerParameter  = new LayerParameter();

                if (sender is ITpsViewLaunchServices)
                {
                    this._iTpsSite = sender as ITpsViewLaunchServices;
                    return(true);
                }
                return(true);
            }
            catch (Exception ex)
            {
                // Add error message to "ProdScr.log" file
                ErrorHandler.AddErrorMessage(CURRENT_MODULE_NAME, ex.ToString());
                ExceptionHandler.ReThrowException("TpsViewEbaraV2", "ITpsViewActivation.Install", ex);
                return(false);
            }
        }
 public TpsFormWobjCurrent(TpsResourceManager rM, RWSystem rwSystem, PipeGrooveModel pipeGrooveModel)
 {
     try
     {
         InitializeComponent();
         this._tpsRm          = rM;
         this.rwSystem        = rwSystem;
         this.pipeGrooveModel = pipeGrooveModel;
         InitializeTexts();
     }
     catch (System.Exception ex)
     {
         // If initialization of application fails a message box is shown
         GTPUMessageBox.Show(this.Parent
                             , null
                             , string.Format("An unexpected error occurred while starting up Sample Application. \n\n{0}", ex.Message)
                             , "Sample Application Start-up Error"
                             , MessageBoxIcon.Hand, MessageBoxButtons.OK);
     }
 }
示例#3
0
        /// <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);
                }
            }
        }