本文整理汇总了C#中Languages类的典型用法代码示例。如果您正苦于以下问题:C# Languages类的具体用法?C# Languages怎么用?C# Languages使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Languages类属于命名空间,在下文中一共展示了Languages类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Post
public LanguagesResponse Post(Languages request)
{
if (request.Language.Id > 0)
{
Bm2s.Data.Common.BLL.Parameter.Language item = Datas.Instance.DataStorage.Languages[request.Language.Id];
item.Code = request.Language.Code;
item.Name = request.Language.Name;
Datas.Instance.DataStorage.Languages[request.Language.Id] = item;
}
else
{
Bm2s.Data.Common.BLL.Parameter.Language item = new Data.Common.BLL.Parameter.Language()
{
Code = request.Language.Code,
Name = request.Language.Name,
};
Datas.Instance.DataStorage.Languages.Add(item);
request.Language.Id = item.Id;
}
LanguagesResponse response = new LanguagesResponse();
response.Languages.Add(request.Language);
return response;
}
示例2: Resource
/// <summary>
/// Hidden constructor
/// </summary>
private Resource()
{
try
{
var app = new AppSetting();
lang = app.Language;
}
catch { }
switch (lang)
{
case Languages.pl:
{
resource = (new LearnByError.Internazional.Lang.Polish()).Resource;
}break;
case Languages.en:
{
resource = (new LearnByError.Internazional.Lang.English()).Resource;
}break;
default:
{
resource = (new LearnByError.Internazional.Lang.English()).Resource;
}break;
}
}
示例3: InitializeObjects
public void InitializeObjects(Languages language)
{
this.WelcomeView = new WelcomeViewLocalization(language);
this.MainView = new MainViewLocalization(language);
this.LoginView = new LoginViewLocalization(language);
//this.AboutView = new AboutViewLocalization(language);
}
示例4: Character
public Character()
{
_class = CharacterEnums.CharacterClass.Explorer;
_race = CharacterEnums.CharacterRace.Human;
_gender = CharacterEnums.Genders.Female;
_skinColor = CharacterEnums.SkinColors.Fair;
_skinType = CharacterEnums.SkinType.Flesh;
_hairColor = CharacterEnums.HairColors.Black;
_eyeColor = CharacterEnums.EyeColors.Brown;
_build = CharacterEnums.BodyBuild.Medium;
_koCount = new Tuple<int, DateTime>(0, DateTime.Now);
_actionState = CharacterActionState.None;
_stanceState = CharacterStanceState.Standing;
_primaryLanguage = CharacterEnums.Languages.Common;
KnownLanguages = new HashSet<Languages>();
KnownLanguages.Add(_primaryLanguage);
FirstName = "";
LastName = "";
Description = "";
Age = 17; //Do we want an age? And are we going to advance it every in game year? We'll need a birthdate for this.
Weight = 180; //pounds or kilos?
Height = 70; //inches or centimeters?
Location = "A1";
InCombat = false;
LastCombatTime = DateTime.MinValue.ToUniversalTime();
IsNPC = false;
Leveled = false;
MainHand = "WIELD_RIGHT";
NextLevelExperience = 300;
Level = 1;
Experience = 0;
PointsToSpend = 0;
Inventory = new Inventory();
Equipment = new Equipment();
Bonuses = new StatBonuses();
Inventory.playerID = this.ID;
Equipment.playerID = this.ID;
Attributes = new Dictionary<string, Attribute>();
Attributes.Add("Hitpoints", new Attribute(150, "Hitpoints", 150, 0.1, 1));
Attributes.Add("Dexterity", new Attribute(10, "Dexterity", 5, 0, 1));
Attributes.Add("Strength", new Attribute(10, "Strength", 5, 0, 1));
Attributes.Add("Intelligence", new Attribute(10, "Intelligence", 5, 0, 1));
Attributes.Add("Endurance", new Attribute(10, "Endurance", 5, 0, 1));
Attributes.Add("Charisma", new Attribute(10, "Charisma", 5, 0, 1));
SubAttributes = new Dictionary<string, double>();
SubAttributes.Add("Agility", 1);
SubAttributes.Add("Toughness", 1);
SubAttributes.Add("Cunning", 1);
SubAttributes.Add("Wisdom", 1);
SubAttributes.Add("Leadership", 1);
}
示例5: AboutCorningAsync
public IEnumerable<CorningLinks> AboutCorningAsync (Languages lang)
{
IEnumerable<CorningLinks> data;
if (lang == Languages.English) {
data = new CorningLinks[] {
new CorningLinks ("Contact Us", "https://www.corning.com/emea/en/contact-us.html"),
new CorningLinks ("Corporate", "https://www.corning.com/worldwide/en.html"),
new CorningLinks ("Data Protection", "http://www.corning.com/emea/en/privacy-policy.html"),
new CorningLinks ("Copyright", "https://www.corning.com/emea/en/legal-notices.html"),
new CorningLinks ("Imprint", "http://www.corning.com/emea/en/about-us/news-events/resources/corning-incorporated-logo-usage.html"),
new CorningLinks ("Newsletter Subscription", "http://www.corning.com/emea/en/about-us/news-events/news-releases.html"),
}.AsEnumerable();
} else {
data = new CorningLinks[] {
new CorningLinks ("Kontaktieren Sie Uns", "https://www.corning.com/emea/de/contact-us.html"),
new CorningLinks ("Firmen-", "https://www.corning.com/worldwide/en.html"),
new CorningLinks ("Datenschutz", "http://www.corning.com/emea/de/privacy-policy.html"),
new CorningLinks ("Rechtlicher Hinweis", "https://www.corning.com/emea/de/legal-notices.html"),
new CorningLinks ("Impressum", "http://www.corning.com/emea/de/about-us/news-events/resources/corning-incorporated-logo-usage.html"),
new CorningLinks ("Newsletter Abonnieren", "http://www.corning.com/emea/de/about-us/news-events/news-releases.html"),
}.AsEnumerable();
}
return data;
}
示例6: ScriptEngine
public ScriptEngine(Languages language)
{
Language = language;
code = "";
variables = "";
//domain = AppDomain.CurrentDomain;
if (domain == null) {
domain = AppDomain.CreateDomain("MyScriptEngine");
//foreach (System.Reflection.AssemblyName an in System.Reflection.Assembly.GetExecutingAssembly().GetReferencedAssemblies()) {
// Assembly d = domain.Load(an);
// Console.WriteLine(an.ToString());
//}
}
Parameters.GenerateInMemory = true;
/*Parameters.ReferencedAssemblies.Add("System.Core.dll");
Parameters.ReferencedAssemblies.Add("System.dll");
Parameters.ReferencedAssemblies.Add("Microsoft.CSharp.dll");*/
var assemblies = AppDomain.CurrentDomain
.GetAssemblies()
.Where(a => !a.IsDynamic)
.Select(a => a.Location);
Parameters.ReferencedAssemblies.AddRange(assemblies.ToArray());
}
示例7: Get
public string Get(string key, Languages language)
{
const string cacheKey = "lang_local";
LanguagePackage localLang = CacheFactory.Sington.GetResult<LanguagePackage>(
cacheKey,
() =>
{
LanguagePackage lang = new LanguagePackage();
try
{
string myLang = ResourceMap.XmlMyLangPackage;
if (myLang != null)
{
lang.LoadFromXml(myLang);
}
}
catch
{
throw new FileLoadException(String.Format(
"本地语言包无法识别!请参考:http://{0}/framework/local/lang_package.xml修改.",
Settings.SERVER_STATIC));
}
CacheFactory.Sington.Insert(cacheKey, lang, String.Concat(Cms.PyhicPath + "framework/local/lang_package.xml"));
return lang;
}
);
return localLang.GetOtherLangItemValue(key, language);
}
示例8: IsCompiled
public static bool IsCompiled(Languages lang)
{
if (lang == Languages.VCPP || lang == Languages.VC)
return true;
else
return false;
}
示例9: GetTranslator
public ITranslator GetTranslator(Languages language)
{
if (!dictionary.ContainsKey(language))
throw new Exception(string.Format("Could not find specified language: '{0}'", language.ToString()));
return dictionary[language];
}
示例10: GetApplicationsButton
public static String GetApplicationsButton(int site, Languages language, String encEmpNo, ICacheStorage adapter)
{
List<Applications> applications = BllApplications.GetApplicationsBySiteId(site, adapter);
if (applications == null)
return String.Empty;
StringBuilder sbr = new StringBuilder();
sbr.Append(@"<div style='border: 1px solid #000;'>");
sbr.Append(@"<ul>");
foreach (var a in applications)
{
sbr.Append(@"<li>");
sbr.Append(@"<input type='button' value='");
sbr.Append(language == Languages.Hindi ? a.ApplicationNameHi : a.ApplicationNameEn);
sbr.Append(@"' onclick='window.location = """);
sbr.Append(a.Url);
sbr.Append(@"?en=");
sbr.Append(encEmpNo);
sbr.Append(@"""");
sbr.Append(@"'");
sbr.Append(@"/>");
//sbr.Append(@"</a>");
sbr.Append(@"</li>");
}
sbr.Append(@"</ul></div>");
return sbr.ToString();
}
示例11: SayIt
public string SayIt(Languages langCode, string phrase)
{
string languagePair = BaseLanguage.ToString().ToLower() + "|" + langCode.ToString().ToLower();
string url = String.Format("http://translate.google.com/?hl=ru&ie=UTF8&text={0}&langpair={1}", phrase, languagePair);
string result = phrase;
string test = "<span title=\"" + phrase + "\"";
string codePage = String.Empty;
if (langCode != BaseLanguage)
{
switch (langCode)
{
case Languages.BG:
codePage = "ISO-8859-5";
break;
case Languages.RU:
codePage = "KOI8-R";
break;
default:
codePage = "ISO-8859-1";
break;
}
try
{
WebClient webClient = new WebClient();
webClient.Encoding = System.Text.Encoding.GetEncoding(codePage);
result = webClient.DownloadString(url);
result = result.Substring(result.IndexOf(test));
result = result.Substring(result.IndexOf(">") + 1, res
示例12: UpdatesForm
public UpdatesForm(Languages.Language language, Utils.AppSettings settings)
{
// Windows Forms designer support.
InitializeComponent();
// Show first panel
ShowPanel(panChecking);
// Setup settings reference
Settings = settings;
// Setup language for the form
Lang = language;
Text = Lang.Get("updates");
btnClose.Text = Lang.Get("close");
// Language setup
lblChecking.Text = Lang.Get("updates_checking") + "...";
lblUpdated.Text = Lang.Get("updates_updated");
lblError.Text = Lang.Get("updates_error");
chkAuto.Text = Lang.Get("updates_auto");
// Auto check
chkAuto.Checked = (Settings.Get("updates_auto").ToString() == "1");
chkAuto.CheckedChanged += delegate { Settings.Set("updates_auto", chkAuto.Checked ? 1 : 0); };
}
示例13: ChangeLanguage
public static void ChangeLanguage(Languages lang)
{
_CurrentCulture = new CultureInfo("zh-Cn");
if (lang == Languages.en)
_CurrentCulture = new CultureInfo("en-Us");
Thread.CurrentThread.CurrentCulture = _CurrentCulture;
//ResourceManager rm = new ResourceManager("HXMail.Resource.Lang", Assembly.GetExecutingAssembly());
}
示例14: WikiPage
public WikiPage(Languages Language, String PageName)
{
this.Language = Language;
HtmlPage = RetrievePage(PageName);
this.Title = Regex.Match(HtmlPage, "<h. id=" + '"' + "firstHeading" + '"' + " class=" + '"' + "firstHeading" + '"' + " lang=" + '"' + ".*" + '"' + @">([A-Za-z]+)<\/h.>").Groups[1].Value;
//this.Contents = Regex.Matches(HtmlPage, "<span class=" + '"' + "toctext" + '"' + @">(.*)<\/span>").Cast<Match>().Select(O => O.Groups[1].Value).Reverse().Skip(0).Reverse().ToList();
this.Contents = Regex.Matches(HtmlPage, "<span class="+'"'+"mw-headline"+'"'+" id="+'"'[email protected]"(.*(?="+'"'[email protected]">))..(.*(?=<\/span))").Cast<Match>().Select(O => O.Groups[2].Value).ToList();
}
示例15: CodePlagiarismDetectionResult
public CodePlagiarismDetectionResult(Languages language, string firstSourceCode, string secondSourceCode,
bool areEqual, double similarity)
{
Language = language;
FirstSourceCode = firstSourceCode;
SecondSourceCode = secondSourceCode;
AreEqual = areEqual;
Similarity = similarity;
}