• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# Languages类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Languages的典型用法代码示例。如果您正苦于以下问题:C# Languages类的具体用法?C# Languages怎么用?C# Languages使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Languages类属于命名空间,在下文中一共展示了Languages类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
        }
开发者ID:Csluikidikilest,项目名称:Bm2sServer,代码行数:25,代码来源:LanguagesService.cs


示例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;
            }
        }
开发者ID:DrZeil,项目名称:nbn-csharp,代码行数:28,代码来源:Resource.cs


示例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);
 }
开发者ID:gatm50,项目名称:SaltApp,代码行数:7,代码来源:LocalizationManager.cs


示例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);
        }
开发者ID:vadian,项目名称:Novus,代码行数:60,代码来源:Character.cs


示例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;
		}
开发者ID:CorningWebServices,项目名称:SolutionsKiosk,代码行数:25,代码来源:Library.cs


示例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());
        }
开发者ID:KillerGoldFisch,项目名称:GCharp,代码行数:26,代码来源:ScriptEngine.cs


示例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);
        }
开发者ID:AntonWong,项目名称:cms,代码行数:35,代码来源:CmsLanguagePackage.cs


示例8: IsCompiled

 public static bool IsCompiled(Languages lang)
 {
     if (lang == Languages.VCPP || lang == Languages.VC)
         return true;
     else
         return false;
 }
开发者ID:ren85,项目名称:rextester_win,代码行数:7,代码来源:Utils.cs


示例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];
        }
开发者ID:kravasb,项目名称:Ints_to_words,代码行数:7,代码来源:TranslatorFactory.cs


示例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();
        }
开发者ID:raazalok,项目名称:IntranetHome,代码行数:29,代码来源:BllUtility.cs


示例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
开发者ID:NikolayGenov,项目名称:TelerikAcademy,代码行数:28,代码来源:Personel.cs


示例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); };
        }
开发者ID:suxiaojack,项目名称:todomoo,代码行数:26,代码来源:UpdatesForm.cs


示例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());
 }
开发者ID:hanwest00,项目名称:HXMail,代码行数:8,代码来源:LanguageSelect.cs


示例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();
 }
开发者ID:ShiveringCat,项目名称:WikiHelper,代码行数:8,代码来源:WikiPage.cs


示例15: CodePlagiarismDetectionResult

 public CodePlagiarismDetectionResult(Languages language, string firstSourceCode, string secondSourceCode,
     bool areEqual, double similarity)
 {
     Language = language;
     FirstSourceCode = firstSourceCode;
     SecondSourceCode = secondSourceCode;
     AreEqual = areEqual;
     Similarity = similarity;
 }
开发者ID:jaywant1503,项目名称:code-plagiarism-detector,代码行数:9,代码来源:Detector.cs


示例16: DoWork

 public Result DoWork(string Program, Languages Language, string user, string pass, bool bytes) {
     object[] results = this.Invoke("DoWork", new object[] {
                 Program,
                 Language,
                 user,
                 pass,
                 bytes});
     return ((Result)(results[0]));
 }
开发者ID:mulamrkreddy,项目名称:rextester,代码行数:9,代码来源:Reference.cs


示例17: Delete

        public LanguagesResponse Delete(Languages request)
        {
            Bm2s.Data.Common.BLL.Parameter.Language item = Datas.Instance.DataStorage.Languages[request.Language.Id];
              Datas.Instance.DataStorage.Languages.Remove(item);

              LanguagesResponse response = new LanguagesResponse();
              response.Languages.Add(request.Language);
              return response;
        }
开发者ID:Csluikidikilest,项目名称:Bm2sServer,代码行数:9,代码来源:LanguagesService.cs


示例18: GetBytes

 public static byte[] GetBytes(string data, int limit, Languages language)
 {
     data = CharacterEncoding.ConvertToLanguage(data, language);
     byte[] finalData = new byte[limit * 2];
     for (int i = 0; i < data.Length; i++) {
         BigEndian.WriteUInt16(data[i], finalData, i * 2);
     }
     return finalData;
 }
开发者ID:trigger-death,项目名称:TriggersPC,代码行数:9,代码来源:GCCharacterEncoding.cs


示例19: SearchAsync

 public Task<WebhoseResponse> SearchAsync(string searchQuery, int performanceScore, int responseCount, Languages language)
 {
     (performanceScore >= 0).CheckCondition("performanceScore can't be negative.", "performanceScore");
     (responseCount >= 0).CheckCondition("responseCount can't be negative.", "responseCount");
     return Task.Run(() =>
     {
         return webhoseRequest.getResponse(CreateUrl(searchQuery, performanceScore, responseCount, language));
     });
 }
开发者ID:udeyrishi,项目名称:grind-back,代码行数:9,代码来源:WebhoseClient.cs


示例20: TargetPlatformFeature

		/// <summary>
		/// Создать <see cref="TargetPlatformFeature"/>.
		/// </summary>
		/// <param name="localizationKey">Ключ для <see cref="LocalizedStrings"/>, по которому будет получено локализованное название.</param>
		/// <param name="preferLanguage">Целевая аудитория.</param>
		/// <param name="platform">Платформа.</param>
		public TargetPlatformFeature(string localizationKey, Languages preferLanguage = Languages.English, Platforms platform = Platforms.AnyCPU)
		{
			if (localizationKey.IsEmpty())
				throw new ArgumentNullException("localizationKey");

			LocalizationKey = localizationKey;
			PreferLanguage = preferLanguage;
			Platform = platform;
		}
开发者ID:jackman0925,项目名称:StockSharp,代码行数:15,代码来源:TargetPlatformFeature.cs



注:本文中的Languages类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# LastWritten类代码示例发布时间:2022-05-24
下一篇:
C# LanguageVersion类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap