/// <summary>
        /// Initializes a new instance of the <see cref="TerminalServicesSession" /> class.
        /// </summary>
        /// <param name="server">TerminalServer instance.</param>
        /// <param name="sessionId">Session Id.</param>
        internal TerminalServicesSession(TerminalServer server, int sessionId)
        {
            this._server    = server;
            this._sessionId = sessionId;

            this._clientBuildNumber  = new LazyLoadedProperty <int>(this.GetClientBuildNumber);
            this._clientIPAddress    = new LazyLoadedProperty <IPAddress>(this.GetClientIPAddress);
            this._remoteEndPoint     = new LazyLoadedProperty <EndPoint>(this.GetRemoteEndPoint);
            this._clientDisplay      = new LazyLoadedProperty <ClientDisplay>(this.GetClientDisplay);
            this._clientDirectory    = new LazyLoadedProperty <string>(this.GetClientDirectory);
            this._workingDirectory   = new LazyLoadedProperty <string>(this.GetWorkingDirectory);
            this._initialProgram     = new LazyLoadedProperty <string>(this.GetInitialProgram);
            this._applicationName    = new LazyLoadedProperty <string>(this.GetApplicationName);
            this._clientHardwareId   = new LazyLoadedProperty <int>(this.GetClientHardwareId);
            this._clientProductId    = new LazyLoadedProperty <short>(this.GetClientProductId);
            this._clientProtocolType = new LazyLoadedProperty <ClientProtocolType>(this.GetClientProtocolType);
            this._clientName         = new LazyLoadedProperty <string>(this.GetClientName);

            GroupPropertyLoader loader = IsVistaSp1OrHigher ? (GroupPropertyLoader)this.LoadWtsInfoProperties : this.LoadWinStationInformationProperties;

            this._windowStationName  = new GroupLazyLoadedProperty <string>(loader);
            this._connectState       = new GroupLazyLoadedProperty <ConnectState>(loader);
            this._connectTime        = new GroupLazyLoadedProperty <DateTime?>(loader);
            this._currentTime        = new GroupLazyLoadedProperty <DateTime?>(loader);
            this._disconnectTime     = new GroupLazyLoadedProperty <DateTime?>(loader);
            this._lastInputTime      = new GroupLazyLoadedProperty <DateTime?>(loader);
            this._loginTime          = new GroupLazyLoadedProperty <DateTime?>(loader);
            this._userName           = new GroupLazyLoadedProperty <string>(loader);
            this._domainName         = new GroupLazyLoadedProperty <string>(loader);
            this._incomingStatistics = new GroupLazyLoadedProperty <ProtocolStatistics>(loader);
            this._outgoingStatistics = new GroupLazyLoadedProperty <ProtocolStatistics>(loader);
        }
예제 #2
0
 public GroupLazyLoadedProperty(GroupPropertyLoader loader)
 {
     _loader = loader;
 }