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

Contents of /branches/TerminalServices/TSAdminTool/Environment.cs

Parent Directory Parent Directory | Revision Log Revision Log


Revision 271 - (show annotations) (download)
Sun Aug 26 00:04:01 2012 UTC (8 years, 1 month ago) by william
File size: 2405 byte(s)
+ switch TerminalServices backend to Cassia 2.0.0.60

1 using System;
2 using System.Collections.Generic;
3 using System.Text;
4 using System.Data;
5 using Cassia;
6
7 namespace AnywhereTS
8 { // Represents the AnywhereTS environment
9 public static class AtsEnvironment
10 {
11 public static int ClientsConnected; // The number of clients that are connected to a ts, but not logged in
12
13 public static List<AtsTerminalServer> TerminalServers = new List<AtsTerminalServer>();
14 public static List<ITerminalServicesSession> Sessions = new List<ITerminalServicesSession>();
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 var sesssions = TSManager.ListSessions();
55 foreach (var t in sesssions) { Sessions.Add(t); }
56 }
57
58 } // AtsEnvironment
59 } // namespace

  ViewVC Help
Powered by ViewVC 1.1.22