Ejemplo n.º 1
0
        // -------- Class Constructor -------
        public PVAPI64()
        {
            try
            {
                doingShutdown = false;
                ws            = new APLW.WSEngine();
                debug         = DebugMode();

                if (debug)
                {
                    LogEvent.Log("Created instance of APL WS Engine ...");
                    LogEvent.Log("ProVal application directory: " + SysDir);
                    LogEvent.Log("Working/User directory: " + UserDir);
                    LogEvent.Log("ProVal version: " + ProVer);
                    if (VisibleMode())
                    {
                        ws.Visible = 1;
                        // make sure the development version is being used in order for it to be visible
                    }
                }
            }
            catch (Exception e)
            {
                LogEvent.Log("Error: " + e.ToString());
                throw;
            }
        }
Ejemplo n.º 2
0
        protected virtual void Dispose(bool disposing)
        {
            if (!disposedValue)
            {
                if (disposing)
                {
                    // TODO: dispose managed state (managed objects).
                }

                // TODO: free unmanaged resources (unmanaged objects) and override a finalizer below.
                try
                {
                    if (ws != null)
                    {
                        try
                        {
                            if (debug)
                            {
                                LogEvent.Log("Closing the WSEngine.");
                            }
                            ws.Visible    = 0;
                            doingShutdown = true;
                            PVCall("SHUTDOWN");
                        }
                        finally
                        {
                            ws            = null;
                            doingShutdown = false;
                        }
                    }
                }
                catch (Exception e)
                {
                    if (debug)
                    {
                        LogEvent.Log("Error: " + e.ToString());
                    }
                    throw;
                }
                // TODO: set large fields to null.

                disposedValue = true;
            }
        }