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

            _apiParams     = SecureStorage.GetEncryptedData <BtceAPIParams>(SecuredDataKeys.BtceAPI);
            txtKey.Text    = _apiParams.APIKey;
            txtSecret.Text = _apiParams.APISecret;
        }
Esempio n. 2
0
 /// <summary>
 /// Saves the new keys
 /// </summary>
 /// <returns>True if the data was saved correctly</returns>
 public bool Save()
 {
     if (txtSecret.Text != _apiParams.APISecret || txtKey.Text != _apiParams.APIKey)
     {
         var p = new BtceAPIParams
         {
             APIKey    = txtKey.Text,
             APISecret = txtSecret.Text,
         };
         SecureStorage.SaveEncryptedData(p, SecuredDataKeys.BtceAPI);
         ExchangeProxyFactory.NotifySettingsChanged(ExchangesInternalCodes.Btce);
         EventAggregator.Instance.Publish(new SecuredDataChanged {
             DataKey = ExchangesInternalCodes.Btce
         });
     }
     return(true);
 }