Esempio n. 1
0
        /// <summary>
        /// Releases unmanaged and - optionally - managed resources
        /// </summary>
        /// <remarks></remarks>
        public void Dispose()
        {
            lock (this)
            {
                if (disposed)
                {
                    return;
                }
                disposed = true;
            }

            if (!disableRemoting)
            {
                Log.Info("Disconnecting remote server: ");
                RemotingServices.Disconnect((MarshalByRefObject)server.CruiseManager);
                RemotingServices.Disconnect((MarshalByRefObject)server.CruiseServerClient);
                foreach (IChannel channel in ChannelServices.RegisteredChannels)
                {
                    Log.Info("Unregistering channel: " + channel.ChannelName);
                    ChannelServices.UnregisterChannel(channel);
                }
            }

            server.Dispose();
        }
 void IDisposable.Dispose()
 {
     if (_disposed)
     {
         return;
     }
     _disposed = true;
     Log.Info("Disconnecting remote server: ");
     RemotingServices.Disconnect((MarshalByRefObject)_server.CruiseManager);
     foreach (IChannel channel in ChannelServices.RegisteredChannels)
     {
         Log.Info("Unregistering channel: " + channel.ChannelName);
         ChannelServices.UnregisterChannel(channel);
     }
     _server.Dispose();
 }
 public void Dispose()
 {
     watcher.Dispose();
     server.Dispose();
 }
Esempio n. 4
0
 private void HandleControlEvent(object sender, EventArgs args)
 {
     server.Dispose();
 }