当前位置: 首页>>代码示例>>C#>>正文


C# ResourceSet.GetObject方法代码示例

本文整理汇总了C#中System.Resources.ResourceSet.GetObject方法的典型用法代码示例。如果您正苦于以下问题:C# ResourceSet.GetObject方法的具体用法?C# ResourceSet.GetObject怎么用?C# ResourceSet.GetObject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Resources.ResourceSet的用法示例。


在下文中一共展示了ResourceSet.GetObject方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetResource

		object GetResource(CallExpression callExpression)
		{
			IResourceReader reader = componentCreator.GetResourceReader(CultureInfo.InvariantCulture);
			if (reader != null) {
				using (ResourceSet resources = new ResourceSet(reader)) {
					List<object> args = deserializer.GetArguments(callExpression);
					return resources.GetObject(args[0] as String);
				}
			}
			return null;
		}
开发者ID:rbrunhuber,项目名称:SharpDevelop,代码行数:11,代码来源:PythonComponentWalker.cs

示例2: SetLocalImages

        /// <summary>
        ///     Populates all the publically accessible images for use on load.
        /// </summary>
        /// <param name="resourceSet"></param>
        private void SetLocalImages(ResourceSet resourceSet)
        {
            // Populate the app images.
            app_Reset = (Bitmap) resourceSet.GetObject("app_reset");

            // Populate the class images Original One
            cls_Alchemist = (Bitmap) resourceSet.GetObject("Alc");
            cls_Armorer = (Bitmap) resourceSet.GetObject("Arm");
            cls_Blacksmith = (Bitmap) resourceSet.GetObject("Bsm");
            cls_Carpenter = (Bitmap) resourceSet.GetObject("Cpt");
            cls_Culinarian = (Bitmap) resourceSet.GetObject("Cul");
            cls_Goldsmith = (Bitmap) resourceSet.GetObject("Gsm");
            cls_Leatherworker = (Bitmap) resourceSet.GetObject("Ltw");
            cls_Weaver = (Bitmap) resourceSet.GetObject("Wvr");

            // Populate the baseskill images.
            all_GreatStrides = (Bitmap) resourceSet.GetObject("all_GreatStrides");
            all_InnerQuiet = (Bitmap) resourceSet.GetObject("all_InnerQuiet");
            all_MastersMend = (Bitmap) resourceSet.GetObject("all_MastersMend");
            all_MastersMendII = (Bitmap) resourceSet.GetObject("all_MastersMendII");
            all_Observe = (Bitmap) resourceSet.GetObject("all_Observe");
            all_SteadyHand = (Bitmap) resourceSet.GetObject("all_SteadyHand");
            all_CollectableSynthesis = (Bitmap) resourceSet.GetObject("all_CollectableSynthesis");
            all_ByregotsBrow = (Bitmap) resourceSet.GetObject("all_ByregotsBrow");


            all_InnovativeTouch = (Bitmap) resourceSet.GetObject("all_InnovativeTouch");
            all_ByregotsMiracle = (Bitmap) resourceSet.GetObject("all_ByregotsMiracle");
            all_NymeiasWheel = (Bitmap) resourceSet.GetObject("all_NymeiasWheel");
            all_TrainedHand = (Bitmap) resourceSet.GetObject("all_TrainedHand");
            all_Satisfaction = (Bitmap) resourceSet.GetObject("all_Satisfaction");
            all_Heart = (Bitmap) resourceSet.GetObject("all_Heart");
            all_WhistleWhileYouWork = (Bitmap) resourceSet.GetObject("all_WhistleWhileYouWork");

            all_PHTouch = (Bitmap) resourceSet.GetObject("all_PHTouch");


            // Carpenter Crafting Skill Icons
            crp_BrandOfWind = (Bitmap) resourceSet.GetObject("crp_BrandOfWind");
            crp_ByregotsBlessing = (Bitmap) resourceSet.GetObject("crp_ByregotsBlessing");
            crp_Rumination = (Bitmap) resourceSet.GetObject("crp_Rumination");
            crp_NameofWind = (Bitmap) resourceSet.GetObject("crp_NameofWind");
            crp_BBCheck = (Bitmap) resourceSet.GetObject("crp_BBCheck");
            crp_BBCheck2 = (Bitmap) resourceSet.GetObject("crp_BBCheck2");

            // Blacksmith Crafting Skill Icons
            bsm_BrandOfFire = (Bitmap) resourceSet.GetObject("bsm_BrandOfFire");
            bsm_Ingenuity = (Bitmap) resourceSet.GetObject("bsm_Ingenuity");
            bsm_IngenuityII = (Bitmap) resourceSet.GetObject("bsm_IngenuityII");
            bsm_NameofFire = (Bitmap) resourceSet.GetObject("bsm_NameofFire");

            // Armorer Crafting Skill Icons
            arm_BrandOfIce = (Bitmap) resourceSet.GetObject("arm_BrandOfIce");
            arm_PieceByPiece = (Bitmap) resourceSet.GetObject("arm_PieceByPiece");
            arm_RapidSynthesis = (Bitmap) resourceSet.GetObject("arm_RapidSynthesis");
            arm_NameofIce = (Bitmap) resourceSet.GetObject("arm_NameofIce");

            // Goldsmith Crafting Skill Icons
            gsm_FlawlessSynthesis = (Bitmap) resourceSet.GetObject("gsm_FlawlessSynthesis");
            gsm_Innovation = (Bitmap) resourceSet.GetObject("gsm_Innovation");
            gsm_Manipulation = (Bitmap) resourceSet.GetObject("gsm_Manipulation");
            gsm_MakersMark = (Bitmap) resourceSet.GetObject("gsm_MakersMark");

            // Leatherworker Crafting Skill Icons
            ltw_BrandOfEarth = (Bitmap) resourceSet.GetObject("ltw_BrandOfEarth");
            ltw_WasteNot = (Bitmap) resourceSet.GetObject("ltw_WasteNot");
            ltw_WasteNotII = (Bitmap) resourceSet.GetObject("ltw_WasteNotII");
            ltw_NameofEarth = (Bitmap) resourceSet.GetObject("ltw_NameofEarth");

            // Weaver Crafting Skill Icons
            wvr_BrandOfLightning = (Bitmap) resourceSet.GetObject("wvr_BrandOfLightning");
            wvr_CarefulSynthesis = (Bitmap) resourceSet.GetObject("wvr_CarefulSynthesis");
            wvr_CarefulSynthesisII = (Bitmap) resourceSet.GetObject("wvr_CarefulSynthesisII");
            wvr_NameofLightning = (Bitmap) resourceSet.GetObject("wvr_NameofLightning");

            // Alchemist Crafting Skill Icons
            alc_BrandOfWater = (Bitmap) resourceSet.GetObject("alc_BrandOfWater");
            alc_ComfortZone = (Bitmap) resourceSet.GetObject("alc_ComfortZone");
            alc_TricksOfTheTrade = (Bitmap) resourceSet.GetObject("alc_TricksOfTheTrade");
            alc_NameofWater = (Bitmap) resourceSet.GetObject("alc_NameofWater");

            // Culinarian Crafting Skill Icons
            cul_HastyTouch = (Bitmap) resourceSet.GetObject("cul_HastyTouch");
            cul_Reclaim = (Bitmap) resourceSet.GetObject("cul_Reclaim");
            cul_SteadyHandII = (Bitmap) resourceSet.GetObject("cul_SteadyHandII");
            cul_MuscleMemory = (Bitmap) resourceSet.GetObject("cul_MuscleMemory");
        }
开发者ID:Lycorisrda,项目名称:CraftExportEx,代码行数:91,代码来源:ResourceLibrary.cs

示例3: LoadImageList

        /// <summary>
        ///     Populates the ClassImageList based on the passed Class Type.
        /// </summary>
        /// <param name="resourceSet"></param>
        /// <param name="classType"></param>
        private void LoadImageList(ResourceSet resourceSet, ClassJobType classType)
        {
            // Clear the current entries.
            ClassSkillImages.Clear();
            // Switch based on the class type.
            switch (classType)
            {
                case ClassJobType.Carpenter:
                    ClassSkillImages.Add("crp_BasicSynthesis", (Bitmap) resourceSet.GetObject("crp_BasicSynthesis"));
                    ClassSkillImages.Add("crp_StandardSynthesis",
                        (Bitmap) resourceSet.GetObject("crp_StandardSynthesis"));
                    ClassSkillImages.Add("crp_BasicTouch", (Bitmap) resourceSet.GetObject("crp_BasicTouch"));
                    ClassSkillImages.Add("crp_StandardTouch", (Bitmap) resourceSet.GetObject("crp_StandardTouch"));
                    ClassSkillImages.Add("crp_AdvancedTouch", (Bitmap) resourceSet.GetObject("crp_AdvancedTouch"));
                    ClassSkillImages.Add("crp_PreciseTouch", (Bitmap) resourceSet.GetObject("crp_PreciseTouch"));
                    break;
                case ClassJobType.Blacksmith:
                    ClassSkillImages.Add("bsm_BasicSynthesis", (Bitmap) resourceSet.GetObject("bsm_BasicSynthesis"));
                    ClassSkillImages.Add("bsm_StandardSynthesis",
                        (Bitmap) resourceSet.GetObject("bsm_StandardSynthesis"));
                    ClassSkillImages.Add("bsm_BasicTouch", (Bitmap) resourceSet.GetObject("bsm_BasicTouch"));
                    ClassSkillImages.Add("bsm_StandardTouch", (Bitmap) resourceSet.GetObject("bsm_StandardTouch"));
                    ClassSkillImages.Add("bsm_AdvancedTouch", (Bitmap) resourceSet.GetObject("bsm_AdvancedTouch"));
                    ClassSkillImages.Add("bsm_PreciseTouch", (Bitmap) resourceSet.GetObject("bsm_PreciseTouch"));
                    break;
                case ClassJobType.Armorer:
                    ClassSkillImages.Add("arm_BasicSynthesis", (Bitmap) resourceSet.GetObject("arm_BasicSynthesis"));
                    ClassSkillImages.Add("arm_StandardSynthesis",
                        (Bitmap) resourceSet.GetObject("arm_StandardSynthesis"));
                    ClassSkillImages.Add("arm_BasicTouch", (Bitmap) resourceSet.GetObject("arm_BasicTouch"));
                    ClassSkillImages.Add("arm_StandardTouch", (Bitmap) resourceSet.GetObject("arm_StandardTouch"));
                    ClassSkillImages.Add("arm_AdvancedTouch", (Bitmap) resourceSet.GetObject("arm_AdvancedTouch"));
                    ClassSkillImages.Add("arm_PreciseTouch", (Bitmap) resourceSet.GetObject("arm_PreciseTouch"));
                    break;

                case ClassJobType.Goldsmith:
                    ClassSkillImages.Add("gsm_BasicSynthesis", (Bitmap) resourceSet.GetObject("gsm_BasicSynthesis"));
                    ClassSkillImages.Add("gsm_StandardSynthesis",
                        (Bitmap) resourceSet.GetObject("gsm_StandardSynthesis"));
                    ClassSkillImages.Add("gsm_BasicTouch", (Bitmap) resourceSet.GetObject("gsm_BasicTouch"));
                    ClassSkillImages.Add("gsm_StandardTouch", (Bitmap) resourceSet.GetObject("gsm_StandardTouch"));
                    ClassSkillImages.Add("gsm_AdvancedTouch", (Bitmap) resourceSet.GetObject("gsm_AdvancedTouch"));
                    ClassSkillImages.Add("gsm_PreciseTouch", (Bitmap) resourceSet.GetObject("gsm_PreciseTouch"));
                    break;
                case ClassJobType.Leatherworker:
                    ClassSkillImages.Add("ltw_BasicSynthesis", (Bitmap) resourceSet.GetObject("ltw_BasicSynthesis"));
                    ClassSkillImages.Add("ltw_StandardSynthesis",
                        (Bitmap) resourceSet.GetObject("ltw_StandardSynthesis"));
                    ClassSkillImages.Add("ltw_BasicTouch", (Bitmap) resourceSet.GetObject("ltw_BasicTouch"));
                    ClassSkillImages.Add("ltw_StandardTouch", (Bitmap) resourceSet.GetObject("ltw_StandardTouch"));
                    ClassSkillImages.Add("ltw_AdvancedTouch", (Bitmap) resourceSet.GetObject("ltw_AdvancedTouch"));
                    ClassSkillImages.Add("ltw_PreciseTouch", (Bitmap) resourceSet.GetObject("ltw_PreciseTouch"));
                    break;
                case ClassJobType.Weaver:
                    ClassSkillImages.Add("wvr_BasicSynthesis", (Bitmap) resourceSet.GetObject("wvr_BasicSynthesis"));
                    ClassSkillImages.Add("wvr_StandardSynthesis",
                        (Bitmap) resourceSet.GetObject("wvr_StandardSynthesis"));
                    ClassSkillImages.Add("wvr_BasicTouch", (Bitmap) resourceSet.GetObject("wvr_BasicTouch"));
                    ClassSkillImages.Add("wvr_StandardTouch", (Bitmap) resourceSet.GetObject("wvr_StandardTouch"));
                    ClassSkillImages.Add("wvr_AdvancedTouch", (Bitmap) resourceSet.GetObject("wvr_AdvancedTouch"));
                    ClassSkillImages.Add("wvr_PreciseTouch", (Bitmap) resourceSet.GetObject("wvr_PreciseTouch"));
                    break;
                case ClassJobType.Alchemist:
                    ClassSkillImages.Add("alc_BasicSynthesis", (Bitmap) resourceSet.GetObject("alc_BasicSynthesis"));
                    ClassSkillImages.Add("alc_StandardSynthesis",
                        (Bitmap) resourceSet.GetObject("alc_StandardSynthesis"));
                    ClassSkillImages.Add("alc_BasicTouch", (Bitmap) resourceSet.GetObject("alc_BasicTouch"));
                    ClassSkillImages.Add("alc_StandardTouch", (Bitmap) resourceSet.GetObject("alc_StandardTouch"));
                    ClassSkillImages.Add("alc_AdvancedTouch", (Bitmap) resourceSet.GetObject("alc_AdvancedTouch"));
                    ClassSkillImages.Add("alc_PreciseTouch", (Bitmap) resourceSet.GetObject("alc_PreciseTouch"));
                    break;
                case ClassJobType.Culinarian:
                    ClassSkillImages.Add("cul_BasicSynthesis", (Bitmap) resourceSet.GetObject("cul_BasicSynthesis"));
                    ClassSkillImages.Add("cul_StandardSynthesis",
                        (Bitmap) resourceSet.GetObject("cul_StandardSynthesis"));
                    ClassSkillImages.Add("cul_BasicTouch", (Bitmap) resourceSet.GetObject("cul_BasicTouch"));
                    ClassSkillImages.Add("cul_StandardTouch", (Bitmap) resourceSet.GetObject("cul_StandardTouch"));
                    ClassSkillImages.Add("cul_AdvancedTouch", (Bitmap) resourceSet.GetObject("cul_AdvancedTouch"));
                    ClassSkillImages.Add("cul_PreciseTouch", (Bitmap) resourceSet.GetObject("cul_PreciseTouch"));
                    break;
            }
        }
开发者ID:Lycorisrda,项目名称:CraftExportEx,代码行数:87,代码来源:ResourceLibrary.cs

示例4: LoadTimeZone

 /// <summary>
 /// Loads a time zone with the given name from the given resource manager.
 /// </summary>
 /// <param name="source">The <see cref="ResourceSet"/> to load from.</param>
 /// <param name="name">The resource name.</param>
 /// <param name="id">The time zone id for the loaded time zone.</param>
 /// <returns>The <see cref="DateTimeZone"/> or <c>null</c> if there is no such resource.</returns>
 internal static DateTimeZone LoadTimeZone(ResourceSet source, string name, string id)
 {
     if (source == null)
     {
         throw new ArgumentNullException("source");
     }
     var normalizedName = NormalizeAsResourceName(name);
     var bytes = source.GetObject(normalizedName) as byte[];
     if (bytes != null)
     {
         using (var stream = new MemoryStream(bytes))
         {
             var reader = new DateTimeZoneCompressionReader(stream);
             return reader.ReadTimeZone(id);
         }
     }
     return null;
 }
开发者ID:manirana007,项目名称:NodaTime,代码行数:25,代码来源:ResourceHelper.cs


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