Beispiel #1
0
 public static ArrayList getDataFromGoogle(String exchange, String symbol, String period, int interval)
 {
     DownloadURIBuilder db = new DownloadURIBuilder();
     WebClient wClient = new WebClient();
     String url = db.getGetPricesUri(symbol, exchange, period, interval);
     String downloadedData = wClient.DownloadString(url);
     MemoryStream ms = new MemoryStream(System.Text.Encoding.Default.GetBytes(downloadedData));
     DataProcessor dp = new DataProcessor();
     return dp.getHistory(ms, interval);
 }
Beispiel #2
0
        public static ArrayList getDataFromGoogle(String exchange, String symbol, String period, int interval)
        {
            DownloadURIBuilder db             = new DownloadURIBuilder();
            WebClient          wClient        = new WebClient();
            String             url            = db.getGetPricesUri(symbol, exchange, period, interval);
            String             downloadedData = wClient.DownloadString(url);
            MemoryStream       ms             = new MemoryStream(System.Text.Encoding.Default.GetBytes(downloadedData));
            DataProcessor      dp             = new DataProcessor();

            return(dp.getHistory(ms, interval));
        }
Beispiel #3
0
        public void getDataFromGoogle_Async(String exchange, String symbol, String period, int interval)
        {
            DownloadURIBuilder db = new DownloadURIBuilder();
            WebClient wClient = new WebClient();
            Uri urlAddress = new Uri(db.getGetPricesUri(symbol, exchange, period, interval));
            wClient.DownloadStringCompleted += new DownloadStringCompletedEventHandler((sender, e) => DownloadComplete(sender, e, symbol));
            wClient.DownloadStringAsync(urlAddress);

            foreach (Form frm in Application.OpenForms)
            {
                if (frm.Name == "frm_mainForm")
                {
                    frm_mainForm form = (frm_mainForm)frm;
                    form.isConnected = false;
                }
            }
        }
Beispiel #4
0
        public void getDataFromGoogle_Async(String exchange, String symbol, String period, int interval)
        {
            DownloadURIBuilder db      = new DownloadURIBuilder();
            WebClient          wClient = new WebClient();
            Uri urlAddress             = new Uri(db.getGetPricesUri(symbol, exchange, period, interval));

            wClient.DownloadStringCompleted += new DownloadStringCompletedEventHandler((sender, e) => DownloadComplete(sender, e, symbol));
            wClient.DownloadStringAsync(urlAddress);

            foreach (Form frm in Application.OpenForms)
            {
                if (frm.Name == "frm_mainForm")
                {
                    frm_mainForm form = (frm_mainForm)frm;
                    form.isConnected = false;
                }
            }
        }