本文整理汇总了C#中LanguageType类的典型用法代码示例。如果您正苦于以下问题:C# LanguageType类的具体用法?C# LanguageType怎么用?C# LanguageType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
LanguageType类属于命名空间,在下文中一共展示了LanguageType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnCreateControl
protected override void OnCreateControl()
{
base.OnCreateControl();
LanguageType selected = null;
LanguageType temp = new LanguageType()
{
Language = NetLanguage.CSharp,
Text = "C#",
};
if (ApplicationLanguage == NetLanguage.CSharp)
selected = temp;
Items.Add(temp);
temp = new LanguageType()
{
Language = NetLanguage.VbNet,
Text = "VB.NET",
};
if (ApplicationLanguage == NetLanguage.VbNet)
selected = temp;
Items.Add(temp);
this.SelectedItem = selected;
LanguageChange += new EventHandler<EventLanguage>(LanguageSelector_LanguageChange);
}
示例2: GetRawCompetitorInt
private static List<RawCompetitor> GetRawCompetitorInt(BrokerType brokerType, LanguageType languageType, SportType sportType, GenderType genderType, string[] names)
{
if (genderType == GenderType.Unknown) {
_logger.Error("{0}: {1}", names.StrJoin(", "), genderType);
}
var competitorsRaw = RawCompetitor.DataSource.FilterByLanguage(languageType).FilterBySportType(sportType).FilterByBroker(brokerType)
.FilterByNameCompetitor(names)
.FilterByGender(genderType,
RawCompetitor.Fields.CompetitoruniqueID,
RawCompetitor.Fields.Name,
RawCompetitor.Fields.Linkstatus);
if (competitorsRaw.Count > 1) {
var groupBy = competitorsRaw.Where(c => c.CompetitoruniqueID != default(int)).GroupBy(c => c.CompetitoruniqueID).ToArray();
if (groupBy.Length > 1) {
_logger.Error("{0} {1} {2} {3} {4} <=> {5}", brokerType, sportType, genderType,
competitorsRaw.Select(cr => cr.ID).StrJoin(", "), names.StrJoin(", "), groupBy.Select(g => g.Select(ge => ge.Name).StrJoin(", ")).StrJoin(" | "));
return groupBy.First().ToList();
}
if (groupBy.Length == 1) {
foreach (var rawCompetitor in competitorsRaw.Where(cr => cr.CompetitoruniqueID == default(int))) {
rawCompetitor.CompetitoruniqueID = groupBy[0].Key;
rawCompetitor.Save();
}
}
}
return CreateRawCompetitor(names, competitorsRaw, brokerType, languageType, sportType, genderType);
}
示例3: CreateRawCompetitor
private static List<RawCompetitor> CreateRawCompetitor(string[] names, List<RawCompetitor> competitorsRaw, BrokerType brokerType, LanguageType languageType, SportType sportType, GenderType genderType)
{
var existNames = competitorsRaw.Select(cr => cr.Name).ToList();
names = names
.Where(name => !existNames.Contains(name))
.ToArray();
if (names.Any()) {
var lastCompetitorUniqueID = competitorsRaw.Any()
? competitorsRaw.First().CompetitoruniqueID
: default(int);
var raw = competitorsRaw;
names
.Where(name => !raw.Any(c => c.Name.Equals(name, StringComparison.InvariantCultureIgnoreCase)))
.Each(name => {
RawCompetitor competitorRaw = null;
try {
competitorRaw = BrokerEntityIfaceCreator.CreateEntity<RawCompetitor>(brokerType, languageType, sportType, genderType, LinkEntityStatus.Unlinked, new[] { name },
competitor => {
if (lastCompetitorUniqueID != default(int)) {
competitor.CompetitoruniqueID = lastCompetitorUniqueID;
competitor.Linkstatus = LinkEntityStatus.LinkByStatistics | LinkEntityStatus.Linked;
}
});
competitorRaw.Save();
raw.Add(competitorRaw);
} catch (Exception ex) {
_logger.Error("{0}\r\n{1}", competitorRaw?.ToString(), ex);
throw;
}
});
}
return competitorsRaw;
}
示例4: SolutionItem
public SolutionItem(Connect connect, Solution solution, bool recursive)
{
this._subItems = new List<SolutionItem>();
this._projectType = LanguageType.None;
if (connect == null)
{
throw new ArgumentNullException("connect");
}
if (solution == null)
{
throw new ArgumentNullException("solution");
}
this._incrementSetting = new SolutionItemIncrementSettings(this);
this._connect = connect;
this._item = solution;
this._itemType = SolutionItemType.Solution;
this._name = Path.GetFileNameWithoutExtension(solution.FileName);
this._filename = solution.FileName;
this._uniqueName = this._name;
this.GetGlobalVariables();
if (recursive)
{
SolutionItem.FillSolutionTree(connect, this, solution.Projects);
}
}
示例5: LanguagePackGet
public s_cache_language_pack LanguagePackGet(LanguageType lang)
{
if(languagePacks != null)
return languagePacks[(int)lang];
return null;
}
示例6: Configure
/// <summary>
/// Configures the component using the dictionary of attributes specified
/// in the configuration file.
/// </summary>
/// <param name="attributes">The attributes in the configuration element.</param>
public void Configure(System.Collections.Specialized.StringDictionary attributes)
{
if(attributes.ContainsKey(ProjectTypeArgument))
{
language = (LanguageType)Enum.Parse(typeof(LanguageType), attributes[ProjectTypeArgument]);
}
}
示例7: Start
// Use this for initialization
void Start()
{
if(this.GetComponent<UIPopupList>())
{
this.GetComponent<UIPopupList>().eventReceiver=this.gameObject;
this.GetComponent<UIPopupList>().selection=PlayerPrefs.GetString("language", "English");
}
string language = PlayerPrefs.GetString("language", "English");
if(lang==LanguageType.None)
{
if(language=="English")
{
lang=LanguageType.English;
}
else
{
lang=LanguageType.Japanese;
}
}
LanguageChange[] targetObjs = LanguageUI.GetComponentsInChildren<LanguageChange>();
foreach(LanguageChange lc in targetObjs)
{
lc.lang=lang;
lc.ChangeLanguage();
}
}
示例8: LanguageInfo
internal LanguageInfo(string name, string twoLetterCode, string threeLetterCode, LanguageFamily family, LanguageType type)
{
Name = name;
TwoLetterIsoCode = twoLetterCode;
ThreeLetterIsoCode = threeLetterCode;
Family = family;
Type = type;
}
示例9: ByLanguage
public IHttpActionResult ByLanguage(LanguageType language)
{
var codeSnipetTitles = this.data
.CodeSnipets
.All()
.Where(c => c.Language == language)
.Select(CodeSnipetsPartialDataModel.FromCodeSnipet);
return Ok(codeSnipetTitles);
}
示例10: GetRandomWordsAsync
public static async Task<List<string>> GetRandomWordsAsync(LanguageType language, SpeachPartType speachPart, int count) {
#if !NO_REDIS
var key = GetListKey(language, speachPart);
int listSize = (int)(await Db.ListLengthAsync(key));
var startIndex = listSize > count ? new Random().Next(listSize - count) : 0;
return Db.ListRange(key, startIndex, startIndex + count).Select(v => v.ToString()).ToList<string>();
#endif
return null;
}
示例11: Solution
public Solution(string name, string text, string ip, int port, int apport, string logindatabase, string loginsolution, LanguageType language)
{
_Name = name;
_Text = text;
_IP = ip;
_Port = port;
_ApPort = apport;
_LoginDataBase = logindatabase;
_LoginSolution = loginsolution;
_Language = language;
}
示例12: GetVkLanguage
private VkApiLanguage GetVkLanguage(LanguageType language)
{
switch (language)
{
case LanguageType.Russian:
return VkApiLanguage.Russian;
case LanguageType.English:
return VkApiLanguage.English;
default:
return VkApiLanguage.Russian;
}
}
示例13: GetMonthPlanDtoAsync
internal async Task<MonthPlanDto> GetMonthPlanDtoAsync(string userId, LanguageType languageType) {
MonthPlanDto statisticDto = Redis.GetMonthPlan(userId, languageType);
if (statisticDto == null) {
MonthPlan monthPlan = await _db.GetThisMonthPlanAsync(userId, languageType);
if (monthPlan == null) {
int planedCount = CalculateMonthPlan(userId, languageType);
monthPlan = await _db.CreateMonthPlanAsync(userId, languageType, planedCount);
}
statisticDto = new MonthPlanDto(monthPlan);
}
return statisticDto;
}
示例14: CompetitionItem
public ActionResult CompetitionItem(LanguageType languagetype, FilterModel<BrokerType> filter, StateFilter state = StateFilter.All)
{
var dateTime = DateTime.UtcNow.Date;
if (filter.date == DateTime.MinValue) {
filter.FixDates(dateTime, dateTime);
}
filter.FixDates(new DateTime(2014, 01, 01), dateTime.AddDays(14));
return View(new StaticPageBaseModel<WithFilterModel<BrokerType, List<RawCompetitionTransport>>>(this) {
ControllerModel = new WithFilterModel<BrokerType, List<RawCompetitionTransport>>(new FilterModel<BrokerType>("CompetitionItem", "SystemState", CurrentLanguage, FilterSettings.ToDate, filter, new RouteValueDictionary(new { languagetype, state }))) {
Data = _provider.GetCompetitionItems(filter.id, languagetype, filter.date, state)
}
});
}
示例15: AddRandomWordsAsync
private async Task AddRandomWordsAsync(List<dynamic> words, LanguageType language, SpeachPartType speachPart, int count) {
#if !NO_REDIS
List<string> list = await Redis.GetRandomWordsAsync(language, speachPart, count);
foreach (string word in list) {
words.Add(new {
id = ObjectId.GenerateNewId().ToString(),
language = language.ToString(),
speachPart = (int)speachPart,
word = word
});
}
#endif
}