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


C# ResourceManager.DeleteDynamicResource方法代码示例

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


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

示例1: AddUpdateDeleteDynamicDataTest

        private static void AddUpdateDeleteDynamicDataTest()
        {
            Console.WriteLine("Add_Update_Delete_DynamicData Test");
            //arrange
            ICacheProvider cacheProvider =
                new CacheProvider(new CacheItemPolicy
                {
                    AbsoluteExpiration = DateTimeOffset.MinValue,
                    SlidingExpiration = TimeSpan.Zero
                });
            IResourceManager resourceManager = new ResourceManager(cacheProvider);

            string expectedvalue = "5";
            string expectedNewValue = "6";

            var dynamicData = new DynamicTranslationsData
            {
                DescriptionValue = "5",
                DynamicKey = "5",
                Value = "5",
                LanguageId = 1
            };

            //Add dynamic data
            resourceManager.AddResource(dynamicData);
            Console.WriteLine("The dynamic data were added successfully");

            string actualValue = resourceManager.GetResource(TranslationTypeEnum.DynamicTranslation,
                dynamicData.DynamicKey, "uk");

            Console.WriteLine("ADDING... Actual value:{0} \t Expected value:{1}", actualValue, expectedvalue);
            Console.WriteLine("Press anykey to continue...");
            Console.ReadKey();

            //Update dynamic data
            dynamicData.Value = "6";
            resourceManager.UpdateResource(dynamicData);
            Console.WriteLine("The dynamic data were updateded successfully");

            string actualNewValue = resourceManager.GetResource(TranslationTypeEnum.DynamicTranslation,
                dynamicData.DynamicKey, "uk");

            Console.WriteLine("UPDATING... Actual value:{0} \t Expected value:{1}", actualNewValue, expectedNewValue);
            Console.WriteLine("Press anykey to continue...");
            Console.ReadKey();

            //Delete dynamic data
            resourceManager.DeleteDynamicResource(new List<string>(){"5"});
            Console.WriteLine("The dynamic data were deleted successfully");
            Console.WriteLine("Press anykey to finish current test.");
            Console.WriteLine("-----------------------------");
        }
开发者ID:Jos1k,项目名称:Roads,代码行数:52,代码来源:Program.cs


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