Exemplo n.º 1
0
        /// <summary>
        /// Initialises a new instance of the class
        /// </summary>
        public TwitterKeysControl()
        {
            InitializeComponent();

            _apiParams = SecureStorage.GetEncryptedData<TwitterAPIParams>(SecuredDataKeys.TwitterAPI);
            txtKey.Text = _apiParams.ConsumerKey;
            txtSecret.Text = _apiParams.SecretKey;
        }
Exemplo n.º 2
0
        /// <summary>
        /// Saves the new API parameters
        /// </summary>
        /// <returns></returns>
        public bool Save()
        {
            if (txtSecret.Text != _apiParams.SecretKey || txtKey.Text != _apiParams.ConsumerKey)
            {
                var p = new TwitterAPIParams
                {
                    ConsumerKey = txtKey.Text,
                    SecretKey = txtSecret.Text,
                };
                SecureStorage.SaveEncryptedData(p, SecuredDataKeys.TwitterAPI);
                TwitterProxyFactory.NotifySettingsChanged();
            }
            return true;

        }