Beispiel #1
0
        /// <summary>
        /// Reads the token information
        /// </summary>
        /// <param name="tokendata"></param>
        /// <returns></returns>
        public virtual ICloudStorageAccessToken LoadToken(Dictionary <String, String> tokendata)
        {
            ICloudStorageAccessToken at = null;

            String type = tokendata[CloudStorage.TokenCredentialType];

            if (type.Equals(typeof(GenericNetworkCredentials).ToString()))
            {
                var username = tokendata[TokenGenericCredUsername];
                var password = tokendata[TokenGenericCredPassword];

                GenericNetworkCredentials bc = new GenericNetworkCredentials();
                bc.UserName = username;
                bc.Password = password;

                at = bc;
            }
#if !WINDOWS_PHONE
            else if (type.Equals(typeof(GenericCurrentCredentials).ToString()))
            {
                at = new GenericCurrentCredentials();
            }
#endif

            return(at);
        }
Beispiel #2
0
        /// <summary>
        /// Reads the token information
        /// </summary>
        /// <param name="tokendata"></param>
        /// <returns></returns>
        public virtual ICloudStorageAccessToken LoadToken(Dictionary <string, string> tokendata)
        {
            ICloudStorageAccessToken at = null;

            var type = tokendata[CloudStorage.TokenCredentialType];

            if (type.Equals(typeof(GenericNetworkCredentials).ToString()))
            {
                var username = tokendata[TokenGenericCredUsername];
                var password = tokendata[TokenGenericCredPassword];

                var bc = new GenericNetworkCredentials {
                    UserName = username, Password = password
                };

                at = bc;
            }
            else if (type.Equals(typeof(GenericCurrentCredentials).ToString()))
            {
                at = new GenericCurrentCredentials();
            }

            return(at);
        }
        /// <summary>
        /// Reads the token information
        /// </summary>        
        /// <param name="tokendata"></param>
        /// <returns></returns>       
        public virtual ICloudStorageAccessToken LoadToken(Dictionary<String, String> tokendata)
        {
            ICloudStorageAccessToken at = null;

            String type = tokendata[CloudStorage.TokenCredentialType];

            if (type.Equals(typeof(GenericNetworkCredentials).ToString()))
            {
                var username = tokendata[TokenGenericCredUsername];
                var password = tokendata[TokenGenericCredPassword];

                GenericNetworkCredentials bc = new GenericNetworkCredentials();
                bc.UserName = username;
                bc.Password = password;

                at = bc;
            }
#if !WINDOWS_PHONE
            else if (type.Equals(typeof(GenericCurrentCredentials).ToString()))
            {
                at = new GenericCurrentCredentials();
            }
#endif

            return at;
        }