示例#1
0
        public void Initialize()
        {
            _container.RegisterInstance <IUiAgent>(AgentId, this, new ContainerControlledLifetimeManager());
            _container.RegisterInstance <IProvideManualEntryViews>(AgentId, this, new ContainerControlledLifetimeManager());
            _container.RegisterType <object, LanAddEditInstrumentView>(new PerResolveLifetimeManager());

            _addInterfaceView   = _container.Resolve <SampleAddEditInterfaceView>();
            _editInterfaceView  = _container.Resolve <SampleAddEditInterfaceView>();
            _addInstrumentView  = _container.Resolve <SampleAddEditInstrumentView>();
            _editInstrumentView = _container.Resolve <SampleAddEditInstrumentView>();

            if (_rm != null)
            {
                _rm.AddToRegion(InfrastructureConstants.EditDeviceConfigurationRegion, _editInterfaceView);
                _rm.AddToRegion(InfrastructureConstants.AddDeviceConfigurationRegion, _addInterfaceView);
                _rm.AddToRegion(InfrastructureConstants.EditDeviceConfigurationRegion, _editInstrumentView);
                _rm.AddToRegion(InfrastructureConstants.AddDeviceConfigurationRegion, _addInstrumentView);
            }
        }
        public void Initialize()
        {
            _container.RegisterInstance<IUiAgent>(AgentId, this, new ContainerControlledLifetimeManager());
            _container.RegisterInstance<IProvideManualEntryViews>(AgentId, this, new ContainerControlledLifetimeManager());
            _container.RegisterType<object, LanAddEditInstrumentView>(new PerResolveLifetimeManager());

            _addInterfaceView = _container.Resolve<SampleAddEditInterfaceView>();
            _editInterfaceView = _container.Resolve<SampleAddEditInterfaceView>();
            _addInstrumentView = _container.Resolve<SampleAddEditInstrumentView>();
            _editInstrumentView = _container.Resolve<SampleAddEditInstrumentView>();

            if (_rm != null)
            {
                _rm.AddToRegion(InfrastructureConstants.EditDeviceConfigurationRegion, _editInterfaceView);
                _rm.AddToRegion(InfrastructureConstants.AddDeviceConfigurationRegion, _addInterfaceView);
                _rm.AddToRegion(InfrastructureConstants.EditDeviceConfigurationRegion, _editInstrumentView);
                _rm.AddToRegion(InfrastructureConstants.AddDeviceConfigurationRegion, _addInstrumentView);
            }
        }