Exemplo n.º 1
0
    // ''
    // ''  Print the Symbols to System.Console
    // ''
    private static void printSymbols(feedapi fxfeed)
    {
        //
        //   Fetch the Symbols
        //
        Hashtable symbols = fxfeed.getAvailableSymbols(false);

        Console.WriteLine("-------- Symbols --------");
        if (fxfeed.getStatus().Equals("OK"))
        {
            //
            //   Get a Collection of values contained in HashMap
            //
            ICollection c = symbols.Values;

            //
            //   Obtain an Iterator for Collection
            //
            IEnumerator itr = c.GetEnumerator();

            //
            //   Iterate through the HashMap values iterator
            //
            while (itr.MoveNext())
            {
                Hashtable value = ((Hashtable)(itr.Current));
                Console.WriteLine(("Symbol: " + value["symbol"]));
                Console.WriteLine(("Title: " + value["title"]));
                Console.WriteLine(("Decimals: " + value["decimals"]));
                Console.WriteLine("");
            }
        }
        else
        {
            Console.WriteLine(("Status: " + fxfeed.getStatus()));
            Console.WriteLine(("ErrorCode: " + fxfeed.getErrorCode()));
            Console.WriteLine(("ErrorMessage: " + fxfeed.getErrorMessage()));
        }
    }
Exemplo n.º 2
0
        private List <string> GetAvailableSymbols()
        {
            List <string> returnList = new List <string>();

            Hashtable symbols = _api.getAvailableSymbols(false);

            if (_api.getStatus().Equals("OK"))
            {
                ICollection c = symbols.Values;
                foreach (var current in c)
                {
                    Hashtable value = (Hashtable)current;

                    returnList.Add((string)value["symbol"]);
                }
            }
            else
            {
                LogError("getAvailableSymbols");
            }

            return(returnList);
        }
Exemplo n.º 3
0
    // ''  
    // ''  Print the Symbols to System.Console
    // ''   
    private static void printSymbols(feedapi fxfeed) {
        //     
        //   Fetch the Symbols
        //      
        Hashtable symbols = fxfeed.getAvailableSymbols(false);
        Console.WriteLine("-------- Symbols --------");
        if (fxfeed.getStatus().Equals("OK")) {
            //       
            //   Get a Collection of values contained in HashMap
            //        
            ICollection c = symbols.Values;

            //       
            //   Obtain an Iterator for Collection
            //        
            IEnumerator itr = c.GetEnumerator();

            //       
            //   Iterate through the HashMap values iterator
            //        
            while (itr.MoveNext()) {
                Hashtable value = ((Hashtable)(itr.Current));
                Console.WriteLine(("Symbol: " + value["symbol"]));
                Console.WriteLine(("Title: " + value["title"]));
                Console.WriteLine(("Decimals: " + value["decimals"]));
                Console.WriteLine("");
            }
        }
        else {
            Console.WriteLine(("Status: " + fxfeed.getStatus()));
            Console.WriteLine(("ErrorCode: " + fxfeed.getErrorCode()));
            Console.WriteLine(("ErrorMessage: " + fxfeed.getErrorMessage()));
        }
    }