Example #1
0
 private void ArrayCacheCheck()
 {
     if (this.arrayCache == null)
     {
         this.arrayCache = new TypeArrayCache(this, this.OnMakeArray, this.OnMakeArray);
     }
 }
Example #2
0
 private void CacheCheck()
 {
     lock (this.syncObject)
         if (this.modifiedTypeCache == null)
         {
             this.modifiedTypeCache = new TypeModifiedCache();
         }
     if (this.arrayCache == null)
     {
         this.arrayCache = new TypeArrayCache(this, k => new ArrayType(this, k, this.manager), (lowerBounds, lengths) => new ArrayType(this, this.manager, lowerBounds, lengths));
     }
 }
Example #3
0
            public TypeArrayCache GetArrayCache(IType target)
            {
                if (target is _IType)
                {
                    return(((_IType)target).ArrayCache);
                }
                TypeArrayCache result;

                lock (arrayCache)
                    if (!arrayCache.TryGetValue(target, out result))
                    {
                        arrayCache.Add(target, result = new TypeArrayCache(target, r => new ArrayType(target, r, this.manager), (lowerBounds, lengths) => new ArrayType(target, this.manager, lowerBounds, lengths)));
                    }
                return(result);
            }
Example #4
0
        //#endregion

        //#region IDisposable Members

        public void Dispose()
        {
            try
            {
                if (this.arrayCache != null)
                {
                    this.arrayCache.Dispose();
                    this.arrayCache = null;
                }
                if (this.customAttributes != null)
                {
                    this.customAttributes.Dispose();
                    this.customAttributes = null;
                }
            }
            finally
            {
                this.OnDisposed();
                GC.SuppressFinalize(this);
            }
        }
Example #5
0
        //#endregion

        //#region IDisposable Members

        public void Dispose()
        {
            try
            {
                this.elementType = null;
                if (this.arrayCache != null)
                {
                    this.arrayCache.Dispose();
                    this.arrayCache = null;
                }
                if (this.metadata != null)
                {
                    this.metadata.Dispose();
                    this.metadata = null;
                }
            }
            finally
            {
                this.OnDisposed();
                this.Disposed = null;
                GC.SuppressFinalize(this);
            }
        }