コード例 #1
0
        protected override ResourceSet InternalGetResourceSet(CultureInfo culture, bool createIfNotExists, bool tryParents)
        {
            DatabaseResourceSet rs = null;
 
            if (ResourceSets.Contains(culture.Name))
            {
                rs = ResourceSets[culture.Name] as DatabaseResourceSet;
            }
            else
            {
                lock (ResourceSets)
                {
                    // Check hash table once again after lock is set
                    if (ResourceSets.Contains(culture.Name))
                    {
                        rs = ResourceSets[culture.Name] as DatabaseResourceSet;
                    }
                    else
                    {
                        rs = new DatabaseResourceSet(dsn, culture, sp);
                        ResourceSets.Add(culture.Name, rs);
                    }
                }
            }
            
            return rs; 
        }
コード例 #2
0
        protected override ResourceSet InternalGetResourceSet(CultureInfo culture, bool createIfNotExists, bool tryParents)
        {
            DatabaseResourceSet rs = null;

            if (ResourceSets.Contains(culture.Name))
            {
                rs = ResourceSets[culture.Name] as DatabaseResourceSet;
            }
            else
            {
                lock (ResourceSets)
                {
                    // Check hash table once again after lock is set
                    if (ResourceSets.Contains(culture.Name))
                    {
                        rs = ResourceSets[culture.Name] as DatabaseResourceSet;
                    }
                    else
                    {
                        rs = new DatabaseResourceSet(dsn, culture, sp);
                        ResourceSets.Add(culture.Name, rs);
                    }
                }
            }

            return(rs);
        }