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


C# ResourceSet.Dispose方法代码示例

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


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

示例1: LoadLanguage

        static ResourceManager LoadLanguage(CultureInfo culture, ref ResourceSet rs)
        {
            Current = culture;
            if (rs != null) { rs.Dispose(); rs = null; }

            try
            {
                ResourceManager rManager = new ResourceManager("XPloit.Res.Res", typeof(Lang).Assembly) { IgnoreCase = true };
                rs = rManager.GetResourceSet(culture, true, true);
                return rManager;
            }
            catch { }

            return null;
        }
开发者ID:0x0mar,项目名称:Xploit,代码行数:15,代码来源:Lang.cs

示例2: AddResourceSet

 // Private method in framework, had to be re-implemented here.
 private static void AddResourceSet(Hashtable localResourceSets, CultureInfo culture, ref ResourceSet resourceSet)
 {
     lock (localResourceSets)
     {
         ResourceSet localResourceSet = (ResourceSet)localResourceSets[culture];
         if (localResourceSet != null)
         {
             if (!Equals(localResourceSet, resourceSet))
             {
                 resourceSet.Dispose();
                 resourceSet = localResourceSet;
             }
         }
         else
         {
             localResourceSets.Add(culture, resourceSet);
         }
     }
 }
开发者ID:YuriyGuts,项目名称:unicode-virtual-keyboard,代码行数:20,代码来源:SingleAssemblyComponentResourceManager.cs

示例3: AddResourceSet

 //private method in framework, had to be re-specified
 private static void AddResourceSet(Hashtable localResourceSets, CultureInfo culture, ref ResourceSet rs)
 {
     lock (localResourceSets)
     {
         ResourceSet objA = (ResourceSet)localResourceSets[culture];
         if (objA != null)
         {
             if (!object.Equals(objA, rs))
             {
                 rs.Dispose();
                 rs = objA;
             }
         }
         else
         {
             localResourceSets.Add(culture, rs);
         }
     }
 }
开发者ID:TaoK,项目名称:UsbKeyBackup,代码行数:20,代码来源:SingleAssemblyComponentResourceManager.cs

示例4: AddResourceSet

 // Simple helper to ease maintenance and improve readability.
 private static void AddResourceSet(Dictionary<String,ResourceSet> localResourceSets, String cultureName, ref ResourceSet rs)
 {
     // InternalGetResourceSet is both recursive and reentrant - 
     // assembly load callbacks in particular are a way we can call
     // back into the ResourceManager in unexpectedly on the same thread.
     lock(localResourceSets) {
         // If another thread added this culture, return that.
         ResourceSet lostRace;
         if (localResourceSets.TryGetValue(cultureName, out lostRace)) {
             if (!Object.ReferenceEquals(lostRace, rs)) {
                 // Note: In certain cases, we can be trying to add a ResourceSet for multiple
                 // cultures on one thread, while a second thread added another ResourceSet for one
                 // of those cultures.  If there is a race condition we must make sure our ResourceSet 
                 // isn't in our dictionary before closing it.
                 if (!localResourceSets.ContainsValue(rs))
                     rs.Dispose();
                 rs = lostRace;
             }
         }
         else {
             localResourceSets.Add(cultureName, rs);
         }
     }
 }
开发者ID:l1183479157,项目名称:coreclr,代码行数:25,代码来源:ResourceManager.cs

示例5: AddResourceSet

        private static void AddResourceSet(IDictionary<CultureInfo, ResourceSet> localResourceSets, CultureInfo culture, ref ResourceSet rs)
        {
            lock (localResourceSets)
            {
                if (localResourceSets.ContainsKey(culture))
                {
                    var existing = localResourceSets[culture];

                    if (existing == null || Equals(existing, rs)) return;
                    rs.Dispose();
                    rs = existing;
                }
                else
                {
                    localResourceSets.Add(culture, rs);
                }
            }
        }
开发者ID:Veterini,项目名称:CsGettext,代码行数:18,代码来源:PoBasedResourceManager.cs

示例6: AddResourceSet

 private static void AddResourceSet(Dictionary<string, ResourceSet> localResourceSets, string cultureName, ref ResourceSet rs)
 {
     lock (localResourceSets)
     {
         ResourceSet set;
         if (localResourceSets.TryGetValue(cultureName, out set))
         {
             if (!object.ReferenceEquals(set, rs))
             {
                 if (!localResourceSets.ContainsValue(rs))
                 {
                     rs.Dispose();
                 }
                 rs = set;
             }
         }
         else
         {
             localResourceSets.Add(cultureName, rs);
         }
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:22,代码来源:ResourceManager.cs

示例7: AddResourceSet

 // Simple helper to ease maintenance and improve readability.
 private static void AddResourceSet(Hashtable localResourceSets, CultureInfo culture, ref ResourceSet rs)
 {
     // InternalGetResourceSet is both recursive and reentrant - 
     // assembly load callbacks in particular are a way we can call
     // back into the ResourceManager in unexpectedly on the same thread.
     lock(localResourceSets) {
         // If another thread added this culture, return that.
         ResourceSet lostRace = (ResourceSet) localResourceSets[culture];
         if (lostRace != null) {
             if (!Object.Equals(lostRace, rs)) {
                 rs.Dispose();
                 rs = lostRace;
             }
         }
         else {
             localResourceSets.Add(culture, rs);
         }
     }
 }
开发者ID:gbarnett,项目名称:shared-source-cli-2.0,代码行数:20,代码来源:resourcemanager.cs


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