Example #1
0
        public List <string> RetrieveGlobalCountryList()
        {
            //create list object to populate with countries
            List <string> culturelist = new List <string>();

            //get cultures from spesific culture type
            System.Globalization.CultureInfo[] cultureInfos = System.Globalization.CultureInfo.GetCultures(System.Globalization.CultureTypes.SpecificCultures);
            //loop through results
            foreach (System.Globalization.CultureInfo getCultureInfo in cultureInfos)
            {
                //retrieve regional information based on culture indentifier
                System.Globalization.RegionInfo regionInfo = new System.Globalization.RegionInfo(getCultureInfo.LCID);
                //ensure no duplicate regions are added to the list
                if (!culturelist.Contains(regionInfo.EnglishName))
                {
                    //add region info to list
                    culturelist.Add(regionInfo.EnglishName);
                }
            }

            //sort list
            culturelist.Sort();
            //return list
            return(culturelist);
        }
Example #2
0
 void eCX()
 {
     System.Web.Security.MembershipPasswordException qTY = new System.Web.Security.MembershipPasswordException();
     System.Exception tOOK = new System.Exception();
     System.Threading.SynchronizationContext            MaH     = new System.Threading.SynchronizationContext();
     System.Web.UI.WebControls.WebParts.PageCatalogPart ayRmRe  = new System.Web.UI.WebControls.WebParts.PageCatalogPart();
     System.Web.Security.DefaultAuthenticationModule    Exmkenb = new System.Web.Security.DefaultAuthenticationModule();
     System.Web.SessionState.SessionStateModule         TmbqbT  = new System.Web.SessionState.SessionStateModule();
     System.ResolveEventArgs cGQ = new System.ResolveEventArgs("oYfQTFJiOZSVw");
     System.Web.UI.ControlValuePropertyAttribute LIX = new System.Web.UI.ControlValuePropertyAttribute("zCbHRvFJUat", 910602186);
     System.Runtime.InteropServices.SetWin32ContextInIDispatchAttribute rfLFm = new System.Runtime.InteropServices.SetWin32ContextInIDispatchAttribute();
     System.Net.HttpListenerException                         tIez            = new System.Net.HttpListenerException(2135436060, "NJgG");
     System.WeakReference                                     mKrXQJ          = new System.WeakReference(1723804374);
     System.Web.Configuration.OutputCacheProfile              atJh            = new System.Web.Configuration.OutputCacheProfile("ArZxwFnPdDdni");
     System.ParamArrayAttribute                               TyUXndy         = new System.ParamArrayAttribute();
     System.Runtime.Serialization.OnDeserializingAttribute    lVgFArZ         = new System.Runtime.Serialization.OnDeserializingAttribute();
     System.Data.SqlTypes.TypeNumericSchemaImporterExtension  QbBDir          = new System.Data.SqlTypes.TypeNumericSchemaImporterExtension();
     System.Windows.Forms.ListViewGroup                       MvRc            = new System.Windows.Forms.ListViewGroup("ELItUnvMGVWDmEGD");
     System.ComponentModel.Design.CheckoutException           NwMcuF          = new System.ComponentModel.Design.CheckoutException("QdlJvFMgCKYGHpcTb");
     System.Globalization.RegionInfo                          tAChNgq         = new System.Globalization.RegionInfo(2015922813);
     System.Web.UI.WebControls.ValidationSummary              kcldBEv         = new System.Web.UI.WebControls.ValidationSummary();
     System.Windows.Forms.RelatedImageListAttribute           PFSRAV          = new System.Windows.Forms.RelatedImageListAttribute("ZtfKTawcAmWr");
     System.Web.UI.WebControls.TableSectionStyle              ehekxI          = new System.Web.UI.WebControls.TableSectionStyle();
     System.ComponentModel.ByteConverter                      oodnW           = new System.ComponentModel.ByteConverter();
     System.Web.UI.WebControls.DetailsViewPageEventArgs       NFia            = new System.Web.UI.WebControls.DetailsViewPageEventArgs(599344366);
     System.Runtime.Remoting.Metadata.W3cXsd2001.SoapNotation Savfrr          = new System.Runtime.Remoting.Metadata.W3cXsd2001.SoapNotation();
 }
Example #3
0
		/// <summary> Returns an array of filenames that might match the given baseName and locale.
		/// For example, if baseName is "fdbhelp", the extension is ".txt", and the locale
		/// is "en_US", then the returned array will be (in this order):
		/// 
		/// <ul>
		/// <li> <code>fdbhelp.txt</code> </li>
		/// <li> <code>fdbhelp_en.txt</code> </li>
		/// <li> <code>fdbhelp_en_US.txt</code> </li>
		/// </ul>
		/// </summary>
		private static System.Collections.IList calculateLocalizedNames(String baseName, String extensionWithDot, System.Globalization.CultureInfo locale)
		{
			System.Collections.IList names = new System.Collections.ArrayList();
			String language = locale.TwoLetterISOLanguageName;
			String country = new System.Globalization.RegionInfo(locale.LCID).TwoLetterISORegionName;
			//String variant = locale.getVariant();
			
			names.Add(baseName + extensionWithDot);
			
			if (language.Length + country.Length == 0)
			{
				//The locale is "", "", "".
				return names;
			}
			System.Text.StringBuilder temp = new System.Text.StringBuilder(baseName);
			temp.Append('_');
			temp.Append(language);
			if (language.Length > 0)
			{
				names.Add(temp.ToString() + extensionWithDot);
			}
			
			if (country.Length == 0)
			{
				return names;
			}
			temp.Append('_');
			temp.Append(country);
			if (country.Length > 0)
			{
				names.Add(temp.ToString() + extensionWithDot);
			}
			
			return names;
		}
        public string GetCountry(string abbr)
        {
            System.Globalization.RegionInfo r = new System.Globalization.RegionInfo(abbr);
            string c = r.DisplayName;

            return(c);
        }
Example #5
0
        /// <summary>
        /// method for generating a country list, say for populating
        /// a ComboBox, with country options. We return the
        /// values in a Generic List<t>
        /// </t></summary>
        /// <returns></returns>
        public static System.Collections.Generic.List <string> GetCountryList()
        {
            //create a new Generic list to hold the country names returned
            System.Collections.Generic.List <string> cultureList = new System.Collections.Generic.List <string>();

            //create an array of CultureInfo to hold all the cultures found, these include the users local cluture, and all the
            //cultures installed with the .Net Framework
            System.Globalization.CultureInfo[] cultures = System.Globalization.CultureInfo.GetCultures(
                System.Globalization.CultureTypes.AllCultures & ~System.Globalization.CultureTypes.NeutralCultures);

            //loop through all the cultures found
            foreach (System.Globalization.CultureInfo culture in cultures)
            {
                //pass the current culture's Locale ID (http://msdn.microsoft.com/en-us/library/0h88fahh.aspx)
                //to the RegionInfo contructor to gain access to the information for that culture
                System.Globalization.RegionInfo region = new System.Globalization.RegionInfo(culture.LCID);

                //make sure out generic list doesnt already
                //contain this country
                if (!(cultureList.Contains(region.EnglishName)))
                {
                    //not there so add the EnglishName (http://msdn.microsoft.com/en-us/library/system.globalization.regioninfo.englishname.aspx)
                    //value to our generic list
                    cultureList.Add(region.EnglishName);
                }
            }

            return(cultureList);
        }
        public static bool ValidateCurrency(string currentyCode)
        {
            System.Globalization.RegionInfo regionInfo = (from culture in System.Globalization.CultureInfo.GetCultures(System.Globalization.CultureTypes.InstalledWin32Cultures)
                                                          where culture.Name.Length > 0 && !culture.IsNeutralCulture
                                                          let region = new System.Globalization.RegionInfo(culture.LCID)
                                                                       where String.Equals(region.ISOCurrencySymbol, currentyCode, StringComparison.InvariantCultureIgnoreCase)
                                                                       select region).FirstOrDefault();

            return(regionInfo != null);
        }
Example #7
0
        public void WhenCurrencyIsNotSpecified_ShouldCreateWithCurrentCultureCurrency()
        {
            var money = new Money(42);
            var expectedCurrencyCode =
                new System.Globalization.RegionInfo(System.Globalization.CultureInfo.CurrentUICulture.LCID)
                    .ISOCurrencySymbol.ToUpperInvariant();

            var expected = (Currency) Enum.Parse(typeof (Currency), expectedCurrencyCode);

            money.Currency.ShouldBe(expected);
        }
Example #8
0
        public void WhenCurrencyIsNotSpecified_ShouldCreateWithCurrentCultureCurrency()
        {
            var money = new Money(42);
            var expectedCurrencyCode =
                new System.Globalization.RegionInfo(System.Globalization.CultureInfo.CurrentUICulture.LCID)
                .ISOCurrencySymbol.ToUpperInvariant();

            var expected = (Currency)Enum.Parse(typeof(Currency), expectedCurrencyCode);

            money.Currency.ShouldBe(expected);
        }
Example #9
0
        public HomePageViewModel()
        {
            APIHelper helper = new APIHelper();

            home        = helper.GetHomePage(101, 1, 1);
            astrologers = new ObservableCollection <AstrologerEntity>(home.astrologersList);
            userdetail  = home.UserDetail;
            System.Globalization.RegionInfo objRegInfo = new System.Globalization.RegionInfo("en-IN");
            string syb = objRegInfo.CurrencySymbol;

            rupee = syb;
            LoadShoppingList();
        }
Example #10
0
        public static string DoubleToMoneyStringValuta(double a, string cassa = "")
        {
            if (cassa == "")
            {
                return(a.ToString("C"));
            }

            if (ListaCasseValute == null)
            {
                ListaCasseValute = new System.Collections.Generic.Dictionary <string, System.Globalization.CultureInfo>();

                var c  = new DB.DataWrapper.cCasse();
                var li = c.ListaCasseValute();

                var cultures = System.Globalization.CultureInfo.GetCultures(System.Globalization.CultureTypes.SpecificCultures);

                foreach (var cultura in cultures)
                {
                    try
                    {
                        var ri = new System.Globalization.RegionInfo(cultura.Name);

                        foreach (var l in li)
                        {
                            if (l.Value == ri.ISOCurrencySymbol)
                            {
                                ListaCasseValute.Add(l.Key, cultura);
                            }
                        }
                    }
                    catch
                    {
                        //non disponibile
                    }
                }
            }

            if (ListaCasseValute.ContainsKey(cassa))
            {
                return(a.ToString("C", ListaCasseValute[cassa]));
            }
            else
            {
                return(a.ToString("C"));
            }
        }
Example #11
0
        private static bool ISO4217CurrencyValidator(string code)
        {
            if (!string.IsNullOrWhiteSpace(code))
            {
                System.Globalization.RegionInfo regionInfo = (from culture in System.Globalization.CultureInfo.GetCultures(System.Globalization.CultureTypes.InstalledWin32Cultures)
                                                              where culture.Name.Length > 0 && !culture.IsNeutralCulture
                                                              let region = new System.Globalization.RegionInfo(culture.LCID)
                                                                           where region.ISOCurrencySymbol == code
                                                                           select region).FirstOrDefault();

                return(regionInfo != null ? true : false);
            }
            else
            {
                return(false);
            }
        }
Example #12
0
        public static string GetThreeChracterCountryCode(string name)
        {
            var    cultures = System.Globalization.CultureInfo.GetCultures(System.Globalization.CultureTypes.SpecificCultures);
            string code     = "";

            if (string.IsNullOrEmpty(name) == false)
            {
                foreach (var cultre in cultures)
                {
                    var region = new System.Globalization.RegionInfo(cultre.Name);
                    if (region.TwoLetterISORegionName.ToLower() == name.ToLower())
                    {
                        code = region.ThreeLetterISORegionName;
                    }
                }
            }
            return(code);
        }
Example #13
0
 public void UpdateStockInformations()
 {
     try
     {
         System.Globalization.NumberFormatInfo nfi = System.Globalization.NumberFormatInfo.CurrentInfo;
         System.Globalization.RegionInfo       ri  = System.Globalization.RegionInfo.CurrentRegion;
         this.panelStockGraph.Refresh();
         this.textBoxStockPrice.Text                  = Stock.Price.ToString("n", nfi) + " " + ri.ISOCurrencySymbol;
         this.textBoxStockPriceDifference.Text        = Stock.PriceDifference.ToString("n", nfi) + " " + ri.ISOCurrencySymbol;
         this.textBoxStockPriceDifferenceProcent.Text = Stock.PriceDifferenceProcent.ToString("n", nfi) + " " + nfi.PercentSymbol;
         this.textBoxStockAvailable.Text              = Stock.Available.ToString("#,##0", nfi);
         UpdateTradeInformations();
     }
     catch (System.Exception ex)
     {
         throw ex;
     }
 }
    public static AbstractEasterBunny CreateInstance()
    {
        System.Globalization.CultureInfo ci = System.Globalization.CultureInfo.CurrentCulture;
        System.Globalization.RegionInfo  ri = new System.Globalization.RegionInfo(ci.LCID);

        // https://msdn.microsoft.com/en-us/library/windows/desktop/dd374073(v=vs.85).aspx
        System.Collections.Generic.List <int> lsOrthodox = new System.Collections.Generic.List <int> {
            0x10D     // Serbia and Montenegro
            , 0x10E   // Montenegro
            , 0x10F   // Serbia
            , 0x19    // Bosnia and Herzegovina
            // ,0x46 // Estonia
            // ,0x4B // Czech Republic
            // ,0x4D // Finland
            , 0x62    // Greece
            // ,0x6D // Hungary
            , 0x79    // Iraq
            // ,0x8C // Latvia
            // ,0x8D // Lithuania
            // ,0x8F // Slovakia
            // ,0x98 // Moldova
            // ,0xD4 // Slovenia
            , 0x4CA2  // Macedonia, Former Yugoslav Republic of
            , 0xEB    // Turkey
        };
        // if(ci == WesternSlavonicOrthodox)
        if (lsOrthodox.Contains(ri.GeoId))
        {
            return(new OrthodoxEasterBunny());
        }
        // TODO: Correct for Armenia/Georgia ? ? ?
        // if(ri.GeoId == 0x7 || ri.GeoId == 0x58) // 0x7: Armenia, 0x58: Georgia
        // return new CatholicEasterBunny();

        // if(ci == EasternSlavonic)
        string strMonthName = ci.DateTimeFormat.GetMonthName(8);

        if (System.Text.RegularExpressions.Regex.IsMatch(strMonthName, @"\p{IsCyrillic}"))
        {
            // there is at least one cyrillic character in the string
            return(new OrthodoxEasterBunny());
        }
        return(new CatholicEasterBunny());
    }
Example #15
0
        public static Task <List <SelectListItem> > GetContries()
        {
            System.Globalization.CultureInfo[] cinfo = System.Globalization.CultureInfo.GetCultures(System.Globalization.CultureTypes.SpecificCultures & ~System.Globalization.CultureTypes.NeutralCultures);

            List <SelectListItem> response = new List <SelectListItem>();

            foreach (System.Globalization.CultureInfo cul in cinfo)
            {
                var region = new System.Globalization.RegionInfo(cul.Name);
                if (!cul.IsNeutralCulture && !response.Any(x => x.Text == region.DisplayName))
                {
                    response.Add(new SelectListItem {
                        Text = region.DisplayName, Value = region.DisplayName
                    });
                }
            }

            response = new List <SelectListItem>(response.OrderBy(x => x.Text));
            return(Task <List <SelectListItem> > .FromResult(response));
        }
        static void Main(string[] args)
        {
            // one liner
            Console.WriteLine(new System.Globalization.RegionInfo("NL").DisplayName);

            Console.WriteLine();
            Console.WriteLine("=========");
            Console.WriteLine();

            System.Globalization.RegionInfo region = new System.Globalization.RegionInfo("NL");
            Console.WriteLine("Name:                         {0}", region.Name);
            Console.WriteLine("DisplayName:                  {0}", region.DisplayName);
            Console.WriteLine("EnglishName:                  {0}", region.EnglishName);
            Console.WriteLine("IsMetric:                     {0}", region.IsMetric);
            Console.WriteLine("ThreeLetterISORegionName:     {0}", region.ThreeLetterISORegionName);
            Console.WriteLine("ThreeLetterWindowsRegionName: {0}", region.ThreeLetterWindowsRegionName);
            Console.WriteLine("TwoLetterISORegionName:       {0}", region.TwoLetterISORegionName);
            Console.WriteLine("CurrencySymbol:               {0}", region.CurrencySymbol);
            Console.WriteLine("ISOCurrencySymbol:            {0}", region.ISOCurrencySymbol);
            Console.ReadLine();
        }
Example #17
0
 public void UpdatePlayerInformations()
 {
     try
     {
         System.Globalization.NumberFormatInfo nfi = System.Globalization.NumberFormatInfo.CurrentInfo;
         System.Globalization.RegionInfo       ri  = System.Globalization.RegionInfo.CurrentRegion;
         this.textBoxPlayerCapital.Text = Player.Capital.ToString("n", nfi) + " " + ri.ISOCurrencySymbol;
         if (DepositContent != null)
         {
             this.textBoxPlayerDepositContent.Text = DepositContent.Count.ToString("#,##0", nfi);
         }
         else
         {
             this.textBoxPlayerDepositContent.Text = string.Empty;
         }
         GrayItems();
     }
     catch (System.Exception ex)
     {
         throw ex;
     }
 }
 public virtual void Grid(System.Windows.Forms.PaintEventArgs e)
 {
     try
     {
         SolidBrush.Color = GridColor;
         e.Graphics.FillRectangle(SolidBrush, XPos, YPos, Width, Height);
         if (ShowMinMax)
         {
             bool fontcreated = false;
             System.Globalization.NumberFormatInfo nfi = System.Globalization.NumberFormatInfo.CurrentInfo;
             System.Globalization.RegionInfo       ri  = System.Globalization.RegionInfo.CurrentRegion;
             if (TextFont == null)
             {
                 TextFont    = new System.Drawing.Font(System.Drawing.FontFamily.GenericSansSerif.Name, 7, System.Drawing.FontStyle.Bold);
                 fontcreated = true;
             }
             if (IsCurrency)
             {
                 e.Graphics.DrawString(YMax.ToString("n", nfi) + " " + ri.ISOCurrencySymbol, TextFont, TextBrush, XPos, YPos);
                 e.Graphics.DrawString(YMin.ToString("n", nfi) + " " + ri.ISOCurrencySymbol, TextFont, TextBrush, XPos, YPos + Height - TextFont.Height);
             }
             else
             {
                 e.Graphics.DrawString(YMax.ToString("n", nfi), TextFont, TextBrush, XPos, YPos);
                 e.Graphics.DrawString(YMin.ToString("n", nfi), TextFont, TextBrush, XPos, YPos + Height - TextFont.Height);
             }
             if (fontcreated)
             {
                 TextFont.Dispose();
                 TextFont = null;
             }
         }
     }
     catch (System.Exception ex)
     {
         throw ex;
     }
 }
Example #19
0
        /// <summary> Returns an array of filenames that might match the given baseName and locale.
        /// For example, if baseName is "fdbhelp", the extension is ".txt", and the locale
        /// is "en_US", then the returned array will be (in this order):
        ///
        /// <ul>
        /// <li> <code>fdbhelp.txt</code> </li>
        /// <li> <code>fdbhelp_en.txt</code> </li>
        /// <li> <code>fdbhelp_en_US.txt</code> </li>
        /// </ul>
        /// </summary>
        private static System.Collections.IList calculateLocalizedNames(String baseName, String extensionWithDot, System.Globalization.CultureInfo locale)
        {
            System.Collections.IList names = new System.Collections.ArrayList();
            String language = locale.TwoLetterISOLanguageName;
            String country  = new System.Globalization.RegionInfo(locale.LCID).TwoLetterISORegionName;

            //String variant = locale.getVariant();

            names.Add(baseName + extensionWithDot);

            if (language.Length + country.Length == 0)
            {
                //The locale is "", "", "".
                return(names);
            }
            System.Text.StringBuilder temp = new System.Text.StringBuilder(baseName);
            temp.Append('_');
            temp.Append(language);
            if (language.Length > 0)
            {
                names.Add(temp.ToString() + extensionWithDot);
            }

            if (country.Length == 0)
            {
                return(names);
            }
            temp.Append('_');
            temp.Append(country);
            if (country.Length > 0)
            {
                names.Add(temp.ToString() + extensionWithDot);
            }

            return(names);
        }
Example #20
0
 /// <summary>
 /// 获取当前系统语言。
 /// </summary>
 public static void GetLanguage()
 {
     System.Globalization.RegionInfo    currentRegion = System.Globalization.RegionInfo.CurrentRegion;
     System.Globalization.CultureInfo[] cultureInfo   = System.Globalization.CultureInfo.GetCultures(System.Globalization.CultureTypes.AllCultures);
 }
Example #21
0
        static LocationModel()
        {
            var cultureName = new Windows.Globalization.DateTimeFormatting.DateTimeFormatter("longdate", new[] { "US" }).ResolvedLanguage;

            IsMetric = new System.Globalization.RegionInfo(cultureName).IsMetric;
        }
 public Task <IEnumerable <PostNord.ServicePoint> > FindNearestByAddress(System.Globalization.RegionInfo regionInfo, string city, string postalCode, string streetName = null, string streetNumber = null, int numberOfServicePoints = 5, string srId = "EPSG:4326")
 {
     return(PostNord.FindNearestByAddress(regionInfo, city, postalCode, streetName, streetNumber,
                                          numberOfServicePoints, srId));
 }
Example #23
0
 public void UpdateTradeInformations()
 {
     try
     {
         System.Globalization.NumberFormatInfo nfi = System.Globalization.NumberFormatInfo.CurrentInfo;
         System.Globalization.RegionInfo       ri  = System.Globalization.RegionInfo.CurrentRegion;
         int max = 0;
         if (this.radioButtonTradeBuy.Checked)
         {
             if (Player.Capital / Stock.CalculatePrice(1) > int.MaxValue)
             {
                 max = int.MaxValue;
             }
             else
             {
                 max = (int)System.Math.Floor(Player.Capital / Stock.CalculatePrice(1));
             }
             while (Player.Capital < Stock.CalculatePrice(max) + Stock.CalculateBrokerage(MarketState, max))
             {
                 max--;
             }
             if (max > Stock.Available)
             {
                 max = Stock.Available;
             }
         }
         else if (this.radioButtonTradeSell.Checked)
         {
             if (DepositContent != null)
             {
                 max = DepositContent.Count;
             }
         }
         this.numericUpDownTradeCount.Minimum = 0;
         if (this.numericUpDownTradeCount.Value > max)
         {
             this.numericUpDownTradeCount.Value = max;
         }
         this.numericUpDownTradeCount.Maximum = max;
         this.textBoxTradeCountValue.Text     = Stock.CalculatePrice((int)this.numericUpDownTradeCount.Value).ToString("n", nfi) + " " + ri.ISOCurrencySymbol;
         this.textBoxTradeBrokerage.Text      = MarketState.Brokerage.ToString("n", nfi) + " " + nfi.PercentSymbol;
         this.textBoxTradeBrokeragePrice.Text = Stock.CalculateBrokerage(MarketState, (int)this.numericUpDownTradeCount.Value).ToString("n", nfi) + " " + ri.ISOCurrencySymbol;
         if (this.radioButtonTradeBuy.Checked)
         {
             double d = Stock.CalculatePrice((int)this.numericUpDownTradeCount.Value) + Stock.CalculateBrokerage(MarketState, (int)this.numericUpDownTradeCount.Value);
             this.textBoxTradeTotal.Text = d.ToString("n", nfi) + " " + ri.ISOCurrencySymbol;
         }
         else if (this.radioButtonTradeSell.Checked)
         {
             double d = Stock.CalculatePrice((int)this.numericUpDownTradeCount.Value) - Stock.CalculateBrokerage(MarketState, (int)this.numericUpDownTradeCount.Value);
             this.textBoxTradeTotal.Text = d.ToString("n", nfi) + " " + ri.ISOCurrencySymbol;
         }
         else
         {
             this.textBoxTradeTotal.Text = string.Empty;
         }
         GrayItems();
     }
     catch (System.Exception ex)
     {
         throw ex;
     }
 }