示例#1
0
        private void AppHelperForm_Load(object sender, EventArgs e)
        {
            //ServiceProvider.SetDefaultService<IExceptionProcess>(new WinFormExceptionProcess());

            //IPersistentCache c = new PersistentHashtableCache();
            //ServiceProvider.SetDefaultService<ICache>(c);
            //ServiceProvider.SetDefaultService<IPersistentCache>(c);

            Feng.DBDef def = new Feng.DBDef();
            ServiceProvider.SetDefaultService <IDefinition>(def);

            IDataBuffer buf = new Feng.DBDataBuffer();

            ServiceProvider.SetDefaultService <IDataBuffer>(buf);

            IDataBuffers bufs = new DataBuffers();

            bufs.AddDataBuffer(new Cache());
            bufs.AddDataBuffer(buf);
            bufs.AddDataBuffer(def);
            ServiceProvider.SetDefaultService <IDataBuffers>(bufs);

            ServiceProvider.SetDefaultService <IRepositoryFactory>(new Feng.NH.RepositoryFactory());
            ServiceProvider.SetDefaultService <Feng.NH.ISessionFactoryManager>(new Feng.NH.NHibernateSessionFactoryManager());

            //ServiceProvider.SetDefaultService<IEntityMetadataGenerator>(new NHDataEntityMetadataGenerator());

            //ServiceProvider.SetDefaultService<IMessageBox>(new Feng.Windows.Forms.MyMessageBox());

            IEntityScript script = new PythonScript();

            ServiceProvider.SetDefaultService <IScript>(script);
            ServiceProvider.SetDefaultService <IEntityScript>(script);

            IDataBuffers db = ServiceProvider.GetService <IDataBuffers>();

            if (db != null)
            {
                db.LoadData();
            }
        }
示例#2
0
        private void AppHelperForm_Load(object sender, EventArgs e)
        {
            //ServiceProvider.SetDefaultService<IExceptionProcess>(new WinFormExceptionProcess());

            //IPersistentCache c = new PersistentHashtableCache();
            //ServiceProvider.SetDefaultService<ICache>(c);
            //ServiceProvider.SetDefaultService<IPersistentCache>(c);

            Feng.DBDef def = new Feng.DBDef();
            ServiceProvider.SetDefaultService<IDefinition>(def);

            IDataBuffer buf = new Feng.DBDataBuffer();
            ServiceProvider.SetDefaultService<IDataBuffer>(buf);

            IDataBuffers bufs = new DataBuffers();
            bufs.AddDataBuffer(new Cache());
            bufs.AddDataBuffer(buf);
            bufs.AddDataBuffer(def);
            ServiceProvider.SetDefaultService<IDataBuffers>(bufs);

            ServiceProvider.SetDefaultService<IRepositoryFactory>(new Feng.NH.RepositoryFactory());
            ServiceProvider.SetDefaultService<Feng.NH.ISessionFactoryManager>(new Feng.NH.NHibernateSessionFactoryManager());

            //ServiceProvider.SetDefaultService<IEntityMetadataGenerator>(new NHDataEntityMetadataGenerator());

            //ServiceProvider.SetDefaultService<IMessageBox>(new Feng.Windows.Forms.MyMessageBox());

            IEntityScript script = new PythonScript();
            ServiceProvider.SetDefaultService<IScript>(script);
            ServiceProvider.SetDefaultService<IEntityScript>(script);

            IDataBuffers db = ServiceProvider.GetService<IDataBuffers>();
            if (db != null)
            {
                db.LoadData();
            }
        }