示例#1
0
        /// <summary>
        /// Get Entry
        /// </summary>
        /// <param name="entryType"></param>
        /// <returns></returns>
        public ProxyEntryDao GetDaoEntry(Type entryType)
        {
            var lKey             = entryType.Assembly.FullName;
            ProxyAssemblyDao pxa = null;

            //Controlla presenza
            if (!this.mCacheDao.TryGetValue(lKey, out pxa))
            {
                //Lock Scrittura
                lock (this.mCacheDao.WriteLock)
                {
                    //Ricontrolla
                    if (!this.mCacheDao.TryGetValue(lKey, out pxa))
                    {
                        //Invia evento
                        pxa = new ProxyAssemblyDao()
                        {
                            Key            = lKey,
                            SrcAss         = entryType.Assembly,
                            TypeDaoEntries = new ProxyEntryDaoDic(100),
                        };

                        //Avvia evento
                        ProxyTypeBuilder.BuildDaoProxyFromAssembly(pxa);

                        //Rigenera nuovo elenco Proxy
                        var newCache = new ProxyAssemblyDaoDiz(this.mCacheDao);
                        newCache.Add(lKey, pxa);

                        //Rigenera nuovo elenco Resolvers
                        Dictionary <string, string> newResolver = new Dictionary <string, string>(this.mResolver);
                        newResolver.Add(pxa.DynAss.FullName, lKey);

                        //Assegnazione
                        this.mCacheDao = newCache;
                        this.mResolver = newResolver;
                    }
                }
            }

            //Ritorna entry
            return(pxa.TypeDaoEntries[entryType.TypeHandle.Value.ToInt64()]);
        }
示例#2
0
 public ProxyAssemblyDaoDiz(ProxyAssemblyDaoDiz other)
     : base(other)
 {
 }