Ejemplo n.º 1
0
 static Cultures()
 {
     mItems[0] = new Culture(Language.es, Country.AR);
     mItems[1] = new Culture(Language.de, Country.AT);
     mItems[2] = new Culture(Language.en, Country.AU);
     mItems[3] = new Culture(Language.pt, Country.BR);
     mItems[4] = new Culture(Language.en, Country.CA);
     mItems[5] = new Culture(Language.fr, Country.CA);
     mItems[6] = new Culture(Language.ca, Country.CT);
     mItems[7] = new Culture(Language.es, Country.CL);
     mItems[8] = new Culture(Language.es, Country.CO);
     mItems[9] = new Culture(Language.cs, Country.CZ);
     mItems[10] = new Culture(Language.da, Country.DK);
     mItems[11] = new Culture(Language.fi, Country.FI);
     mItems[12] = new Culture(Language.fr, Country.FR);
     mItems[13] = new Culture(Language.de, Country.DE);
     mItems[14] = new Culture(Language.tzh, Country.HK);
     mItems[15] = new Culture(Language.hu, Country.HU);
     mItems[16] = new Culture(Language.id, Country.ID);
     mItems[17] = new Culture(Language.en, Country.IN);
     mItems[18] = new Culture(Language.he, Country.IL);
     mItems[19] = new Culture(Language.it, Country.IT);
     mItems[20] = new Culture(Language.ja, Country.JP);
     mItems[21] = new Culture(Language.ko, Country.KR);
     mItems[22] = new Culture(Language.en, Country.MY);
     mItems[23] = new Culture(Language.ms, Country.MY);
     mItems[24] = new Culture(Language.es, Country.MX);
     mItems[25] = new Culture(Language.nl, Country.NL);
     mItems[26] = new Culture(Language.no, Country.NO);
     mItems[27] = new Culture(Language.en, Country.NZ);
     mItems[28] = new Culture(Language.es, Country.PE);
     mItems[29] = new Culture(Language.en, Country.PH);
     mItems[30] = new Culture(Language.ro, Country.RO);
     mItems[31] = new Culture(Language.ru, Country.RU);
     mItems[32] = new Culture(Language.en, Country.SG);
     mItems[33] = new Culture(Language.es, Country.ES);
     mItems[34] = new Culture(Language.fr, Country.CH);
     mItems[35] = new Culture(Language.de, Country.CH);
     mItems[36] = new Culture(Language.it, Country.CH);
     mItems[37] = new Culture(Language.th, Country.TH);
     mItems[38] = new Culture(Language.tr, Country.TR);
     mItems[39] = new Culture(Language.tzh, Country.TW);
     mItems[40] = new Culture(Language.en, Country.UK);
     mItems[41] = new Culture(Language.en, Country.US);
     mItems[42] = new Culture(Language.es, Country.US);
     mItems[43] = new Culture(Language.es, Country.VE);
     mItems[44] = new Culture(Language.vi, Country.VN);
 }
Ejemplo n.º 2
0
 public static string CultureToParameters(Culture cult)
 {
     if (cult == null)
         throw new ArgumentNullException("cult", "Culture must have a value");
     return string.Format("&region={0}&lang={1}-{2}", cult.Country.ToString(), cult.Language.ToString(), cult.Country.ToString());
 }
Ejemplo n.º 3
0
        /*		/// <summary>
                /// Creates a new instance from an IDSearchResult
                /// </summary>
                /// <param name="searchResult"></param>
                /// <remarks></remarks>
                public YID(IDSearchData searchResult)
                {
                    if (searchResult != null)
                    {
                        this.SetID(searchResult.ID, false);
                        this.Name = searchResult.Name;
                        this.Industry = searchResult.Industry;
                        this.Type = searchResult.Type;

                        string exc = searchResult.Exchange.Replace("N/A", "").Trim();
                        if (exc != string.Empty)
                        {
                            StockExchange se = WorldMarket.GetStockExchangeByID(exc);
                            if (se == null)
                                se = WorldMarket.GetStockExchangeByName(exc);
                            if (se != null)
                            {
                                this.StockExchange = se;
						
                            }
                            else
                            {
                                se = WorldMarket.GetStockExchangeBySuffix(this.ID);
                                if (se != null)
                                {
                                    this.StockExchange = se;
							
                                }
                                else
                                {
                                    CountryInfo cnt = WorldMarket.GetDefaultCountry(Country.US);
                                    TradingTimeInfo tti = new TradingTimeInfo(0, new DayOfWeek[] {
                                    DayOfWeek.Monday,
                                    DayOfWeek.Tuesday,
                                    DayOfWeek.Wednesday,
                                    DayOfWeek.Thursday,
                                    DayOfWeek.Friday
                                }, null, new DateTime(), new TimeSpan(23, 59, 59), -5);
                                    this.StockExchange = new StockExchange(searchResult.Exchange, this.Suffix, searchResult.Exchange, cnt, tti);
                                }
                            }
                        }

                        if (searchResult.ISIN != null && searchResult.ISIN.Value.Replace("N/A", "").Trim() != string.Empty)
                        {
                            try
                            {
                                this.ISIN = new ISIN(searchResult.ISIN.Value);
                            }
                            catch (ArgumentException ex)
                            {
                                this.ISIN = null;
                            }
                        }

                    }
                    else
                    {
                        throw new ArgumentException("The passed result is null", "searchResult");
                    }
                }
        */
     
        /// <summary>
        /// Returns the URL of the Yahoo! RSS news feed.
        /// </summary>
        /// <param name="culture">The culture of the feed.</param>
        /// <returns></returns>
        /// <remarks></remarks>
        public string RssNewsURL(Culture culture = null)
        {
            Culture cult = culture;
            if (cult == null)
                cult = Cultures.UnitedStates_English;
            return "http://feeds.finance.yahoo.com/rss/2.0/headline?s=" + YFHelper.CleanYqlParam(mID) + YFHelper.CultureToParameters(cult);
        }