本文整理汇总了C#中Country.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# Country.ToString方法的具体用法?C# Country.ToString怎么用?C# Country.ToString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Country
的用法示例。
在下文中一共展示了Country.ToString方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetAll
public List<Question> GetAll(Category category , int count , Country country)
{
string catId = "Agreeableness_us";
if (string.IsNullOrEmpty(catId)) throw new ArgumentNullException();
switch (country)
{
case Country.us:
catId = category + "_" + country.ToString();
break;
default:
break;
}
var ques = qctx.GetAllForPartition(catId);
var posQues = ques.Where(q => q.IsPositive == true).Take(count/2);
var posNeg = ques.Where(q => q.IsPositive == false).Take(count / 2);
List<Question> questions = new List<Question>();
questions.AddRange(posQues);
questions.AddRange(posNeg);
return questions;
}
示例2: AbstractYahooMarketServer
public AbstractYahooMarketServer(Country country)
{
this.country = country;
this.stockServer = getStockServer(country);
/* Hack on Malaysia Market! The format among Yahoo and CIMB are difference. */
if (country == Country.Malaysia)
{
List<Index> tmp = new List<Index>();
foreach (Index index in Utils.getStockIndices(country))
{
if (IndexHelper.Instance().GetIndexCode(index).toString().StartsWith("^"))
{
tmp.Add(index);
}
}
this.indicies = tmp;
}
else
{
this.indicies = Utils.getStockIndices(country);
}
if (this.indicies.Count == 0)
{
throw new ArgumentException(country.ToString());
}
foreach (Index index in indicies)
{
Code curCode = IndexHelper.Instance().GetIndexCode(index);
codes.Add(curCode);
codeToIndexMap.Add(curCode, index);
}
}
示例3: ConvertCountryToString
protected string ConvertCountryToString(Country country)
{
if (country == Country.Default)
{
return string.Empty;
}
return country.ToString();
}
示例4: GoogleMarketServer
/**
* Constructs a stock market index server based on country.
*
* @param country the country
*/
public GoogleMarketServer(Country country)
{
this.country = country;
this.indicies = Utils.getStockIndices(country);
if (this.indicies.Count == 0)
{
throw new ArgumentException(country.ToString());
}
foreach (Index index in indicies)
{
Code curCode = IndexHelper.Instance().GetIndexCode(index);
codes.Add(curCode);
codeToIndexMap.Add(curCode, index);
}
}
示例5: GetByCountry
public IList<CalendarEvent> GetByCountry(Country country)
{
return _calendarEventRepository.GetByCountry(country.ToString(), country.TimeZoneIds);
}
示例6: ShowContry
public static void ShowContry(Country c)
{
Logger.Log(c.ToString());
}
示例7: Culture
public Culture(Language lang, Country cnt)
: base(lang.ToString().Replace("no", "nn").Replace("tzh", "zh") + "-" + cnt.ToString().Replace("CT", "ES").Replace("UK", "GB"))
{
mLanguage = lang;
mCountry = cnt;
}
示例8: DiscoverSubCategories
public override int DiscoverSubCategories(Category parentCategory)
{
Settings.Categories.Clear();
Settings.DynamicCategoriesDiscovered = false;
country = (Country)Enum.Parse(typeof(Country), parentCategory.Name);
List<OnlineVideos.Reflection.FieldPropertyDescriptorByRef> props = GetUserConfigurationProperties();
OnlineVideos.Reflection.FieldPropertyDescriptorByRef prop = props.First(p => p.DisplayName == "Country");
SetConfigValueFromString(prop, country.ToString());
int ret = DiscoverDynamicCategories();
parentCategory.SubCategories = new List<Category>();
parentCategory.SubCategories.AddRange(Settings.Categories);
return ret;
}