예제 #1
0
        public void Initialize()
        {
            var boot = new Bootstrapper();

            boot.Run();

            if (boot.Container == null)
            {
                return;
            }

            Container = boot.Container;

            IApplicationAuthor author = new ApplicationAuthor_Model("Ben de Vries", "*****@*****.**");

            Container.RegisterInstance(author);

#if ACAD
            IClientInformation appclient = new ClientInformation_Model(Application_Helpers.Product(), Application_Helpers.Year());

            IAutoCADClientInformation acadclient = new AutoCADClientInformation_Model(appclient, Application_Helpers.Version());
            Container.RegisterInstance(acadclient, new ContainerControlledLifetimeManager());

            Container.RegisterType <IClient, Client>();
            Container.RegisterType <IMessageBoxService, MessageBox_Service>();
#elif NAVIS
            IClientInformation appclient = new ClientInformation_Model(Core.Enums.Products.NAVIS, Application_Helpers.Year());

            INavisworksClientInformation acadclient = new NavisworksClientInformation_Model(Application_Helpers.Year(), Application_Helpers.Version());
            Container.RegisterInstance(acadclient, new ContainerControlledLifetimeManager());

            Container.RegisterType <IClient, Client>();
            Container.RegisterType <IMessageBoxService, MessageBox_Service>();
#endif
        }
예제 #2
0
        public void InitializeRVT(UIControlledApplication uiapp)
        {
            if (uiapp == null)
            {
                throw new System.ArgumentNullException(nameof(uiapp));
            }

            Initialize();

            IClientInformation appclient = new ClientInformation_Model(Core.Enums.Products.REVIT, uiapp.GetYear());

            IRevitClientInformation revitclient = new RevitClientInformation_Model(uiapp.GetYear(), uiapp.GetProduct());

            Container.RegisterInstance(revitclient, new ContainerControlledLifetimeManager());

            Container.RegisterType <IClientRVT, Client>();
            Container.RegisterType <IMessageBoxService, MessageBox_Service>();
        }