/// <summary> /// 实例化 /// </summary> public Container() { #if NET20 this.serviceDic = new Afx.Collections.SafeDictionary <Type, ServiceContext>(); #else this.serviceDic = new System.Collections.Concurrent.ConcurrentDictionary <Type, ServiceContext>(); #endif this.proxyGenerator = new DynamicProxy.ProxyGenerator(this.CreateAop); this.IsDisposed = false; }
/// <summary> /// 释放资源 /// </summary> public void Dispose() { if (this.IsDisposed) { return; } this.serviceDic.Clear(); this.serviceDic = null; this.assemblyDic.Clear(); this.assemblyDic = null; this.proxyGenerator.Dispose(); this.proxyGenerator = null; }