當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。