public GestoreFondiTests()
 {
     convertitore  = new TestConvertitore();
     valutaFactory = new ValutaFactory(convertitore);
     gestoreFondi  = new GestoreFondi();
     exchange      = new TestExchange();
     blockchain    = new TestBlockchain();
 }
 public EthereumEtherscan(String indirizzo, ValutaFactory factory)
 {
     if (indirizzo == null || indirizzo == "")
     {
         throw new ArgumentException("Indirizzo non valido");
     }
     Portafoglio = new Portafoglio(indirizzo);
     _factory    = factory ?? throw new ArgumentException("factory non può essere null!");
 }
 public BinanceExchange(string publicKey, string privateKey, ValutaFactory factory)
 {
     if (publicKey == null || publicKey.Length != 64 || privateKey == null || privateKey.Length != 64)
     {
         throw new ArgumentException("Binance: chiavi non valide!");
     }
     _apiClient = new ApiClient(publicKey, privateKey);
     _factory   = factory ?? throw new ArgumentException("factory non può essere null!");
 }
Beispiel #4
0
 public BitcoinBlockexplorer(String indirizzo, ValutaFactory factory)
 {
     if (indirizzo == null || indirizzo == "")
     {
         throw new ArgumentException("Indirizzo non valido");
     }
     Portafoglio = new Portafoglio(indirizzo);
     _factory    = factory ?? throw new ArgumentException("factory non può essere null");
 }
Beispiel #5
0
 public MainWindow(string password)
 {
     InitializeComponent();
     this.password = password;
     convertitore  = new CryptoCompareConvertitore();
     valutaFactory = new ValutaFactory(convertitore);
     gestoreFondi  = new GestoreFondi();
     //TestInizializza();
     CaricaApi();
 }
Beispiel #6
0
 public BitfinexExchange(String publicKey, String privateKey, ValutaFactory factory)
 {
     if (publicKey == null || publicKey == "" || privateKey == null || privateKey == "")
     {
         throw new ArgumentException("chiavi non valide!");
     }
     _apiClient     = new BitfinexApi(publicKey, privateKey);
     ChiavePubblica = publicKey;
     ChiavePrivata  = privateKey;
     _factory       = factory ?? throw new ArgumentException("factory non può essere null!");
 }
 public GestoreFondiTests()
 {
     convertitore  = new CryptoCompareConvertitore();
     valutaFactory = new ValutaFactory(convertitore);
     gestoreFondi  = new GestoreFondi();
     bitfinex      = new BitfinexExchange("5RMqfG7b2qOBkoPIi97UjCpPxnIhAUsDMelbT5K3pB2",
                                          "hnQNJgD80w1WJeZW7zclyJvFkTWNSN0N4r98t7oRrWw", valutaFactory);
     binance = new BinanceExchange("VhP4edkGMEmL51YSIXSdva0IkcGxC68r8dOIGg6G5PcNMr3srPcm4rXEled5KeMs",
                                   "1ET6MkbrkS2U1sIvQDu6gDzYzNuYgPX2ujG2Lt8tL5SFTygMKUeyDRFDJPT8Ry6Y", valutaFactory);
     btc = new BitcoinBlockexplorer("18cBEMRxXHqzWWCxZNtU91F5sbUNKhL5PX", valutaFactory);
     eth = new EthereumEtherscan("0x901476A5a3C504398967C745F236124201298016", valutaFactory);
 }
        private static T LeggiDatiApi <T>(ValutaFactory factory)
        {
            ConfigurationManager.RefreshSection("appSettings");
            var    configurazione = ConfigurationManager.OpenExeConfiguration(Assembly.GetExecutingAssembly().Location);
            string nomeClasse     = typeof(T).FullName;

            var valoriCifrati = configurazione.AppSettings.Settings[nomeClasse];

            if (valoriCifrati == null)
            {
                return(default(T));
            }
            else
            {
                string   strValoriDecifrati   = DecifraStringa(valoriCifrati.Value, configPassword);
                string[] valori               = strValoriDecifrati.Split(new char[] { ';' });
                object[] parametriCostruttore = new object[valori.Length + 1];
                Array.Copy(valori, parametriCostruttore, valori.Length);
                parametriCostruttore[parametriCostruttore.Length - 1] = factory;
                T oggetto = (T)Activator.CreateInstance(typeof(T), parametriCostruttore);
                return(oggetto);
            }
        }
 public BitfinexExchangeTests()
 {
     convertitore = new TestConvertitore();
     factory      = new ValutaFactory(convertitore);
 }
 public static T LeggiDatiBlockchain <T>(ValutaFactory factory) where T : IBlockchain
 {
     return(LeggiDatiApi <T>(factory));
 }
 public static T LeggiDatiExchange <T>(ValutaFactory factory) where T : IExchange
 {
     return(LeggiDatiApi <T>(factory));
 }
Beispiel #12
0
 public EthereumEtherscanTests()
 {
     convertitore = new TestConvertitore();
     factory      = new ValutaFactory(convertitore);
 }
Beispiel #13
0
 public BitcoinBlockExplorerTests()
 {
     convertitore = new TestConvertitore();
     factory      = new ValutaFactory(convertitore);
 }