示例#1
0
        /// <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;
        }
示例#2
0
 /// <summary>
 /// Dispose
 /// </summary>
 public void Dispose()
 {
     if (this.IsDisposed)
     {
         return;
     }
     this.IsDisposed             = true;
     this.assemblyDynamicBuilder = null;
     this.m_classProxyDic.Clear();
     this.m_classProxyDic = null;
 }
示例#3
0
 /// <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;
 }
示例#4
0
 /// <summary>
 /// Dispose
 /// </summary>
 public virtual void Dispose()
 {
     if (!this.isDisposed)
     {
         this.isDisposed = true;
         this.Reset();
         this.MsgCmdCallDic.Clear();
         this.MsgIdCallDic.Clear();
         this.tcpClient.Dispose();
         this.MsgCmdCallDic = null;
         this.MsgIdCallDic  = null;
         this.tcpClient     = null;
     }
 }
示例#5
0
        /// <summary>
        /// ClassProxy
        /// </summary>
        /// <param name="assemblyDynamicBuilder"></param>
        public ClassProxy(AssemblyDynamicBuilder assemblyDynamicBuilder, Func <Type, IAop> func)
        {
            if (assemblyDynamicBuilder == null)
            {
                throw new ArgumentNullException("assemblyDynamicBuilder");
            }
            this.assemblyDynamicBuilder = assemblyDynamicBuilder;
#if NET20
            this.m_classProxyDic = new Afx.Collections.SafeDictionary <Type, Type>();
#else
            this.m_classProxyDic = new System.Collections.Concurrent.ConcurrentDictionary <Type, Type>();
#endif
            this.AopFunc    = func;
            this.IsDisposed = false;
        }
示例#6
0
 private static Afx.Collections.SafeDictionary <Type, List <EnumInfoModel> > GetLangueDic(string langue)
 {
     Afx.Collections.SafeDictionary <Type, List <EnumInfoModel> > dic = null;