Exemplo n.º 1
0
        private static IObjectPoolContainer I_GetObjectPoolContainer(ObjectPoolKey _key)
        {
            IObjectPoolContainer objectPoolContainer;

            if (!ObjectPoolManager.ms_ObjPools.TryGetValue(_key, out objectPoolContainer))
            {
                bool     flag             = true;
                object[] customAttributes = _key.GetObjType().GetCustomAttributes(false);
                for (int i = 0; i < customAttributes.Length; i++)
                {
                    ObjectPoolAttribute objectPoolAttribute  = (ObjectPoolAttribute)customAttributes[i];
                    ObjectPoolAttribute objectPoolAttribute2 = objectPoolAttribute;
                    if (objectPoolAttribute2 != null)
                    {
                        objectPoolContainer = objectPoolAttribute2.CreatePoolContainerStaticPrivate(objectPoolAttribute2);
                        ObjectPoolManager.ms_ObjPools.Add(_key, objectPoolContainer);
                        flag = false;
                        break;
                    }
                }
                if (flag)
                {
                    TsLog.LogError("ObjectPoolManager.I_GetObjectPoolContainer(...). Fail creation {0}", new object[]
                    {
                        _key.GetObjType()
                    });
                }
            }
            return(objectPoolContainer);
        }