/[AnywhereTS-MSSQL]/trunk/TSAdminTool/Environment.cs
ViewVC logotype

Annotation of /trunk/TSAdminTool/Environment.cs

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4 - (hide annotations) (download)
Wed Jul 11 14:19:13 2012 UTC (8 years, 11 months ago) by william
File size: 2511 byte(s)
imported from https://anywherets.svn.sourceforge.net/svnroot/anywherets/trunk/
Revision: 1
Author: beartown
Date: 3:10:40 AM, Monday, June 21, 2010
Message:
First upload. Still todo in order to get a fully working product: Replace Thinstation images with vanilla Thinstation, modify ImageDesigntimeConfig.cs, ImageRuntimeConfig.cs in order to support the Thinstation image
1 william 4 using System;
2     using System.Collections.Generic;
3     using System.Text;
4     using System.Data;
5    
6     namespace AnywhereTS
7     { // Represents the AnywhereTS environment
8     public static class AtsEnvironment
9     {
10     public static int ClientsConnected; // The number of clients that are connected to a ts, but not logged in
11    
12     public static List<AtsTerminalServer> TerminalServers = new List<AtsTerminalServer>();
13     public static List<AtsSession> Sessions = new List<AtsSession>();
14    
15     // Refresh the AnywhereTS environment objects
16     public static void Refresh()
17     {
18     TerminalServerRefresh(); // Refresh list of terminal servers
19     SessionsRefresh(); // Refresh the list of sessions
20     }
21    
22    
23     // Refresh the list of terminal servers.
24     public static void TerminalServerRefresh()
25     {
26     TerminalServers.Clear();
27    
28     // Add this computer if it is a terminal server
29     if (ATSGlobals.terminalServerConfig == 0)
30     { // This computer is a terminal server, add it.
31     TerminalServers.Add(new AtsTerminalServer());
32     AtsTerminalServer ts = TerminalServers[0];
33     ts.networkPath = "localhost";
34     ts.Update(); // Update the server with sessions etc.
35     }
36    
37     // Add external terminal servers
38     atsDataSet.TerminalServerDataTable datatableTerminalServer;
39     datatableTerminalServer = new atsDataSet.TerminalServerDataTable();
40     ProSupport.terminalServerTableAdapter.Fill(datatableTerminalServer);
41     foreach (DataRow row in datatableTerminalServer.Rows)
42     {
43     TerminalServers.Add(new AtsTerminalServer());
44     AtsTerminalServer ts = TerminalServers[TerminalServers.Count - 1];
45     ts.networkPath = row["Path"].ToString();
46     ts.Update(); // Update the server with sessions etc.
47     }
48     }
49    
50     // Refresh the list of terminal servers from the sessions on the terminal servers.
51     public static void SessionsRefresh()
52     {
53     Sessions.Clear();
54     foreach (AtsTerminalServer ts in TerminalServers)
55     {
56     foreach (AtsSession session in ts.Session)
57     {
58     Sessions.Add(session);
59     }
60     }
61     Sessions.Sort();
62     }
63    
64     } // AtsEnvironment
65     } // namespace

  ViewVC Help
Powered by ViewVC 1.1.22