private void ArrayCacheCheck() { if (this.arrayCache == null) { this.arrayCache = new TypeArrayCache(this, this.OnMakeArray, this.OnMakeArray); } }
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)); } }
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); }
//#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); } }
//#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); } }