public SessionNotification(SessionNotificationType notificationType, LogOnIdentity identity, IEnumerable <string> fullNames, LicenseCapabilities capabilities)
 {
     NotificationType = notificationType;
     Identity         = identity;
     FullNames        = fullNames.Select(fn => fn.NormalizeFilePath());
     Capabilities     = capabilities;
 }
 public static void WTSRegisterSessionNotification(Control control, SessionNotificationType sessionNotificationType)
 {
     if (!Native.WTSRegisterSessionNotification(control.Handle, (int)sessionNotificationType))
     {
         throw new Win32Exception(Marshal.GetLastWin32Error());
     }
 }
Example #3
0
        protected SessionListener(SessionNotificationType notificationType, bool allowMultipleHooks, Type broadcastingType, Predicate <SessionBase> matchsession, DataPropertyDescriptor <TValue> descriptor)
            : base(notificationType, broadcastingType, matchsession)
        {
            this.dataPropertyDescriptor = descriptor;

            // We initialize without a listener because we are going to hook our listeners explicitly by overriding Hooksession.
            Initialize(null);
        }
        internal SessionListener(SessionNotificationType notificationType, object listeningObject, string broadcastingPath)
            : base()
        {
            this.NotificationType = notificationType;
            this.PathInfo         = new Path(this, broadcastingPath);
            Matchsession          = new Predicate <SessionBase>((session) => true);

            PathInfo.Initialize(listeningObject);
        }
Example #5
0
        public SessionListener(SessionNotificationType notificationType, SessionBase rootsession, string broadcastingPath, DataPropertyDescriptor <TValue> descriptor)
            : base(notificationType, rootsession, broadcastingPath)
        {
            this.dataPropertyDescriptor = descriptor;

            // When specifying a path, there shall never be two sessions hooked.
            this.allowMultipleHooks = false;

            // We initialize without a listener because we are going to hook our listeners explicitly by overriding Hooksession.
            Initialize(null);
        }
 internal SessionListener(SessionNotificationType notificationType, Type broadcastingType, Predicate <SessionBase> matchsession)
 {
     this.NotificationType = notificationType;
     this.BroadcastingType = broadcastingType;
     Matchsession          = matchsession ?? new Predicate <SessionBase>((session) => true);
 }
 protected LinkToSession(SessionNotificationType notificationType, Type broadcastingType, Predicate <SessionBase> matchsession)
     : base(notificationType, broadcastingType, matchsession)
 {
 }
 protected LinkToSession(SessionNotificationType notificationType, object listeningObject, string broadcastingPath)
     : base(notificationType, listeningObject, broadcastingPath)
 {
 }
Example #9
0
 /// <summary>
 /// .ctor that uses a path to determine which session to hook.
 /// </summary>
 /// <param name="notificationType">Type of event to hook</param>
 /// <param name="broadcastingPath">Path describing which session to hook.</param>
 /// <remarks>
 /// When this constructor is used, the path will be built up as the traits that contain sessions
 /// become available. When the full path has been built, the approriate event will be hooked.
 /// </remarks>
 public SessionListenerAttribute(SessionNotificationType notificationType, string broadcastingPath)
     : this(notificationType)
 {
     BroadcastingPath = broadcastingPath;
     //this.PathInfo = new Path(this, broadcastingPath);
 }
Example #10
0
 /// <summary>
 /// .ctor that uses a broadcasting type.
 /// </summary>
 /// <param name="notificationType">Type of event to hook</param>
 /// <param name="broadcastingType">Type of session to hook when it becomes available.</param>
 /// <remarks>
 /// When this constructor is used, if the session of type broadcastingType and Matchsession returns true,
 /// the broadcasting session shall be hooked whenever either the broadcasting or listening session is created.
 /// </remarks>
 public SessionListenerAttribute(SessionNotificationType notificationType, Type broadcastingType)
     : this(notificationType)
 {
     BroadcastingType = broadcastingType;
 }
Example #11
0
 public sessionBooleanListener(SessionNotificationType notificationType, SessionBase rootsession, string broadcastingPath, DataPropertyDescriptor <bool> descriptor)
     : base(notificationType, rootsession, broadcastingPath, descriptor)
 {
 }
Example #12
0
 /// <summary>
 /// private .ctor that takes a notification type.
 /// </summary>
 /// <param name="notificationType">Type of event to hook</param>
 private SessionListenerAttribute(SessionNotificationType notificationType)
 {
     NotificationType = notificationType;
 }
 public SessionNotification(SessionNotificationType notificationType, LogOnIdentity identity, string fullName)
     : this(notificationType, identity, new string[] { fullName }, New <LicensePolicy>().Capabilities)
 {
 }
Example #14
0
 public SessionListener(SessionNotificationType notificationType, Type broadcastingType, Predicate <SessionBase> matchsession, DataPropertyDescriptor <TValue> descriptor)
     : this(notificationType, false, broadcastingType, matchsession, descriptor)
 {
 }
 public SessionNotification(SessionNotificationType notificationType)
     : this(notificationType, LogOnIdentity.Empty, new string[0], New <LicensePolicy>().Capabilities)
 {
 }
 public SessionNotification(SessionNotificationType notificationType, LogOnIdentity identity, LicenseCapabilities capabilities)
     : this(notificationType, identity, new string[0], capabilities)
 {
 }
 public SessionNotification(SessionNotificationType notificationType, IEnumerable <string> fullNames)
     : this(notificationType, LogOnIdentity.Empty, fullNames, New <LicensePolicy>().Capabilities)
 {
 }