本文整理汇总了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;
}
示例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);
}
}
}
示例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);
}
}
}
示例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);
}
}
}
示例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);
}
}
}
示例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);
}
}
}