예제 #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SessionData"/> class.
 /// </summary>
 /// <param name="userName">Name of the user.</param>
 /// <param name="notificationUrl">The notification URL.</param>
 /// <param name="protocolVersion">The protocol version.</param>
 /// <param name="applicationIds">The application ids.</param>
 public SessionData(string userName, string notificationUrl, int protocolVersion, ApplicationIdList applicationIds)
 {
     UserName            = userName ?? string.Empty;
     NotificationUrl     = notificationUrl ?? string.Empty;
     ProtocolVersion     = protocolVersion;
     NotificationEnabled = false;
     ApplicationIds      = applicationIds ?? new ApplicationIdList();
 }
예제 #2
0
        /// <summary>
        /// Logins the specified user name.
        /// </summary>
        /// <param name="userName">Name of the user.</param>
        /// <param name="password">The password.</param>
        /// <param name="notificationUrl">The notification URL.</param>
        /// <param name="protocolVersion">The protocol version.</param>
        /// <param name="effectiveProtocolVersion">[out]The effective protocol version.</param>
        /// <param name="applicationIds">The application ids.</param>
        /// <returns>The session id.</returns>
        public int login(string userName, string password, string notificationUrl, int protocolVersion, out int effectiveProtocolVersion, params string[] applicationIds)
        {
            ApplicationIdList list = new ApplicationIdList();

            list.Capacity = applicationIds.Length;
            list.AddRange(applicationIds);
            loginInputBody body    = new loginInputBody(userName, password, notificationUrl, list, protocolVersion);
            loginInput     request = new loginInput(body);

            loginOutput result = login(request);

            effectiveProtocolVersion = result.Body.effectiveProtocolVersion;
            return(result.Body.sessionId);
        }