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

Contents of /trunk/TSAdminTool/Session.cs

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4 - (show annotations) (download)
Wed Jul 11 14:19:13 2012 UTC (7 years, 7 months ago) by william
File size: 2407 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 using System;
2 using System.Collections.Generic;
3 using System.Text;
4
5 namespace AnywhereTS
6 { // Represents a session on a terminal server
7 public class AtsSession:IComparable
8 {
9 public uint sessionID;
10 public string ipAddress; // The IP address of the client
11 public string macAddress; // The MAC address of the client
12 public string name; // The (netbios) name of the client
13 public string username; // User logged in to the session, if any.
14 public TSManager.WTS_CONNECTSTATE_CLASS state; // The state of the session
15 public int HorizontalResolution; // Vertical screen res for the session
16 public int VerticalResolution; // Horiz screen res for the session
17 public int ColorDepth; // Screen color depth for the session
18 public string TerminalServerName;
19 int IComparable.CompareTo(object x)
20 {
21 AtsSession other = (AtsSession)x;
22 /* LEGEND
23 * < 0 means that this object is less than other
24 * 0 means that both objects are equal
25 * > 0 means that this object is greater than other
26 * */
27
28 int returnValue = -1;
29 if (this.sessionID == 0)
30 {
31 if (other.sessionID == 0)
32 { // We are dealing with two console seesions.
33 returnValue = 0; // No further sorting
34 }
35 }
36 else if (this.sessionID == 65536)
37 {
38 if (other.sessionID == 65536)
39 { // We are dealing with two console seesions.
40 returnValue = 0; // No further sorting
41 }
42 else
43 {
44 returnValue = 1;
45 }
46 }
47 else
48 { // This session is an ordinary session
49 if (other.sessionID == 0)
50 {
51 returnValue = 1;
52 }
53 else if (other.sessionID == 65536)
54 {
55 returnValue = -1;
56 }
57 else
58 {
59 // Both sessions are ordinary sessions
60 other.username.CompareTo(this.username);
61 }
62 }
63 return returnValue;
64 }
65 }
66 }

  ViewVC Help
Powered by ViewVC 1.1.22