protected override ResourceSet InternalGetResourceSet(CultureInfo culture, bool createIfNotExists, bool tryParents)
 {
     DatabaseResourceSet databaseResourceSet = null;
     if (this.ResourceSets.Contains(culture.Name))
     {
         databaseResourceSet = (this.ResourceSets[culture.Name] as DatabaseResourceSet);
     }
     else
     {
         Hashtable resourceSets;
         Monitor.Enter(resourceSets = this.ResourceSets);
         try
         {
             if (this.ResourceSets.Contains(culture.Name))
             {
                 databaseResourceSet = (this.ResourceSets[culture.Name] as DatabaseResourceSet);
             }
             else
             {
                 databaseResourceSet = new DatabaseResourceSet(this.dsn, culture, this.sp);
                 this.ResourceSets.Add(culture.Name, databaseResourceSet);
             }
         }
         finally
         {
             Monitor.Exit(resourceSets);
         }
     }
     return databaseResourceSet;
 }
Example #2
0
        protected override ResourceSet InternalGetResourceSet(CultureInfo culture, bool createIfNotExists, bool tryParents)
        {
            DatabaseResourceSet databaseResourceSet = null;

            if (this.ResourceSets.Contains(culture.Name))
            {
                databaseResourceSet = (this.ResourceSets[culture.Name] as DatabaseResourceSet);
            }
            else
            {
                Hashtable resourceSets;
                Monitor.Enter(resourceSets = this.ResourceSets);
                try
                {
                    if (this.ResourceSets.Contains(culture.Name))
                    {
                        databaseResourceSet = (this.ResourceSets[culture.Name] as DatabaseResourceSet);
                    }
                    else
                    {
                        databaseResourceSet = new DatabaseResourceSet(this.dsn, culture, this.sp);
                        this.ResourceSets.Add(culture.Name, databaseResourceSet);
                    }
                }
                finally
                {
                    Monitor.Exit(resourceSets);
                }
            }
            return(databaseResourceSet);
        }