GSF.ServiceProcess.ClientHelper.Dispose C# (CSharp) Метод

Dispose() защищенный Метод

Releases the unmanaged resources used by the ClientHelper object and optionally releases the managed resources.
protected Dispose ( bool disposing ) : void
disposing bool true to release both managed and unmanaged resources; false to release only unmanaged resources.
Результат void
        protected override void Dispose(bool disposing)
        {
            if (!m_disposed)
            {
                try
                {
                    // This will be done regardless of whether the object is finalized or disposed.
                    if (disposing)
                    {
                        // This will be done only when the object is disposed by calling Dispose().
                        Disconnect();
                        SaveSettings();

                        if ((object)m_remotingClient != null)
                        {
                            // Detach events from any existing instance
                            m_remotingClient.ConnectionEstablished -= RemotingClient_ConnectionEstablished;
                            m_remotingClient.ConnectionAttempt -= RemotingClient_ConnectionAttempt;
                            m_remotingClient.ConnectionException -= RemotingClient_ConnectionException;
                            m_remotingClient.ConnectionTerminated -= RemotingClient_ConnectionTerminated;
                            m_remotingClient.ReceiveDataComplete -= RemotingClient_ReceiveDataComplete;
                        }
                    }
                }
                finally
                {
                    m_disposed = true;          // Prevent duplicate dispose.
                    base.Dispose(disposing);    // Call base class Dispose().
                }
            }
        }