Beispiel #1
0
 public FormEventHandler(SAPbouiCOM.Application sapApp, PermissionManager permissionManager,
     B1SResourceManager resourceManager)
 {
     this.sapApp = sapApp;
     this.permissionManager = permissionManager;
     this.resourceManager = resourceManager;
 }
Beispiel #2
0
 public FormEventHandler(SAPbouiCOM.Application sapApp, PermissionManager permissionManager,
                         B1SResourceManager resourceManager)
 {
     this.sapApp            = sapApp;
     this.permissionManager = permissionManager;
     this.resourceManager   = resourceManager;
 }
Beispiel #3
0
        internal void Run()
        {
            var setup = new AppDomainSetup();

            setup.ApplicationName = "Dover.Inception";
            setup.ApplicationBase = Environment.CurrentDirectory;
            var domain = AppDomain.CreateDomain("Dover.AddIn", null, setup);

            domain.SetData("shutdownEvent", shutdownEvent); // Thread synchronization
            domain.SetData("assemblyName", asm.Name);       // Used to get current AssemblyName for logging and reflection
            domain.SetData("frameworkManager", frameworkAddinManager);
            Application app = (Application)domain.CreateInstanceAndUnwrap("Framework", "Dover.Framework.Application");

            SAPServiceFactory.PrepareForInception(domain);
            addinB1SResourceManager = app.Resolve <B1SResourceManager>();
            addinFormEventHandler   = app.Resolve <FormEventHandler>();
            addinLoader             = app.Resolve <AddinLoader>();
            eventDispatcher         = app.Resolve <EventDispatcher>();
            Sponsor <Application>        appSponsor       = new Sponsor <Application>(app);
            Sponsor <B1SResourceManager> b1sSponsor       = new Sponsor <B1SResourceManager>(addinB1SResourceManager);
            Sponsor <FormEventHandler>   formEventSponsor = new Sponsor <FormEventHandler>(addinFormEventHandler);
            Sponsor <AddinLoader>        loaderSponsor    = new Sponsor <AddinLoader>(addinLoader);
            Sponsor <EventDispatcher>    eventSponsor     = new Sponsor <EventDispatcher>(eventDispatcher);

            try
            {
                app.RunAddin();
                AppDomain.Unload(domain);
            }
            catch (AppDomainUnloadedException e)
            {
                // ignore and continue shutdown.
            }
            finally
            {
                runningAddins.Remove(this);
                runningAddinsHash.Remove(asm.Name);
            }
        }
Beispiel #4
0
 public DoverUDOFormBase()
 {
     b1UIDAO = ContainerManager.Container.Resolve<BusinessOneUIDAO>();
     resourceManager = ContainerManager.Container.Resolve<B1SResourceManager>();
 }
Beispiel #5
0
 public DoverSystemFormBase()
 {
     formEventHandler = ContainerManager.Container.Resolve<IFormEventHandler>();
     b1UIDAO = ContainerManager.Container.Resolve<BusinessOneUIDAO>();
     resourceManager = ContainerManager.Container.Resolve<B1SResourceManager>();
 }