コード例 #1
0
        public static void CheckMarketplaceCulture()
        {
            if (s_marketplaceCultureChecked)
            {
                return;
            }
            string marketplaceCulture1 = FeatureEnablement.GetMarketplaceCulture();

            if (string.IsNullOrEmpty(marketplaceCulture1))
            {
                return;
            }
            s_marketplaceCultureChecked = true;
            string strB = null;

            if (marketplaceCulture1.Length > 1)
            {
                strB = marketplaceCulture1.Substring(0, 2);
            }
            string strA1 = CultureInfo.CurrentUICulture.ToString();
            string strA2 = null;

            if (strA1.Length > 1)
            {
                strA2 = strA1.Substring(0, 2);
            }
            bool flag1 = 0 == string.Compare(strA2, strB, StringComparison.InvariantCultureIgnoreCase);
            bool flag2 = false;
            bool flag3 = false;

            if (!flag1)
            {
                string marketplaceCulture2 = ClientConfiguration.Shell.LastMarketplaceCulture;
                flag2 = 0 != string.Compare(marketplaceCulture1, marketplaceCulture2, StringComparison.InvariantCultureIgnoreCase);
                string lastClientCulture = ClientConfiguration.Shell.LastClientCulture;
                flag3 = 0 != string.Compare(strA1, lastClientCulture, StringComparison.InvariantCultureIgnoreCase);
            }
            ClientConfiguration.Shell.LastMarketplaceCulture = marketplaceCulture1;
            ClientConfiguration.Shell.LastClientCulture      = strA1;
            if (flag1 || !flag2 && !flag3)
            {
                return;
            }
            MessageBox.Show(Shell.LoadString(StringId.IDS_MARKETPLACE_CULTURE_MISMATCH_TITLE), Shell.LoadString(StringId.IDS_MARKETPLACE_CULTURE_MISMATCH), null);
        }