Esempio n. 1
0
        public static string GetToken(IDictionary <string, string> items)
        {
            #region Contracts

            if (items == null)
            {
                throw new ArgumentException();
            }

            #endregion

            // Result
            string token = null;

            // TokenKey
            string tokenKey = HttpClientPropertiesHelper.GetTokenKey();

            // Get
            if (items.ContainsKey(tokenKey) == true)
            {
                // Token
                token = items[tokenKey];
            }

            // Return
            return(token);
        }
Esempio n. 2
0
        public static void SetToken(IDictionary <string, string> items, string token)
        {
            #region Contracts

            if (string.IsNullOrEmpty(token) == true)
            {
                throw new ArgumentException();
            }

            #endregion

            // TokenKey
            string tokenKey = HttpClientPropertiesHelper.GetTokenKey();

            // Set
            items[tokenKey] = token;
        }
Esempio n. 3
0
        // Methods
        internal protected override void SignIn(CommunicationProperties properties)
        {
            #region Contracts

            if (properties == null)
            {
                throw new ArgumentException();
            }

            #endregion

            // Properties
            string token = HttpClientPropertiesHelper.GetToken(properties.Items);

            // SignIn
            this.SignIn(token);
        }