Esempio n. 1
0
 protected override void Dispose(bool disposingManagedResources)
 {
     if (disposingManagedResources)
     {
     }
     DB?.Close();
     DB?.Dispose();
     base.Dispose(disposingManagedResources);
 }
Esempio n. 2
0
        /// <summary>
        /// Free all resources created by the server factory
        /// </summary>
        public void Dispose()
        {
            StopAllServers();

            foreach (KeyValuePair <string, TemplateServer> server in servers)
            {
                server.Value.Dispose();
            }

            databaseDriver.Dispose();
        }
Esempio n. 3
0
 protected override void Dispose(bool disposingManageResource)
 {
     if (_disposed)
     {
         return;
     }
     _disposed = true;
     if (disposingManageResource)
     {
     }
     DB?.Close();
     DB?.Dispose();
 }
Esempio n. 4
0
 protected override void Dispose(bool disposingManagedResources)
 {
     if (_disposed)
     {
         return;
     }
     _disposed = true;
     if (disposingManagedResources)
     {
     }
     DB.Close();
     DB.Dispose();
     base.Dispose(disposingManagedResources);
 }
Esempio n. 5
0
        protected virtual void Dispose(bool disposing)
        {
            if (Disposed)
            {
                return;
            }

            if (disposing)
            {
                // TODO: 释放托管状态(托管对象)。
                StopServer();
            }
            databaseDriver?.Dispose();

            // TODO: 释放未托管的资源(未托管的对象)并在以下内容中替代终结器。
            // TODO: 将大型字段设置为 null。

            Disposed = true;
        }
Esempio n. 6
0
 protected override void Dispose(bool disposingManagedResources)
 {
     if (_disposed)
     {
         return;
     }
     _disposed = true;
     if (disposingManagedResources)
     {
     }
     PollTimer?.Stop();
     PollTimer?.Dispose();
     StatusTimer?.Stop();
     StatusTimer?.Dispose();
     // Disconnected all connected clients
     Console.WriteLine("Disconnecting all users...");
     //Parallel.ForEach(LoggedInSession.Values, client => client.DisconnectByReason(DisconnectReason.ForcedServerShutdown));
     //Parallel.ForEach(InLoginSession.Values, client => client.DisconnectByReason(DisconnectReason.ForcedServerShutdown));
     //LoginQuery.ResetAllStatusAndSessionKey();
     LoggedInSession.Clear();
     DB.Dispose();
     base.Dispose(disposingManagedResources);
 }