public void Awake()
        {
            var extraInstallers = new List<IInstaller>();

            if (_staticSettings != null)
            // Static settings are needed if creating a SceneCompositionRoot dynamically
            {
                extraInstallers = _staticSettings.Installers;
                OnlyInjectWhenActive = _staticSettings.OnlyInjectWhenActive;
                ParentNewObjectsUnderRoot = _staticSettings.ParentNewObjectsUnderRoot;
                _staticSettings = null;
            }

            // We always want to initialize GlobalCompositionRoot as early as possible
            GlobalCompositionRoot.Instance.EnsureIsInitialized();

            Assert.IsNull(Container);
            Assert.IsNull(RootFacade);

            Log.Debug("Initializing SceneCompositionRoot in scene '{0}'", this.gameObject.scene.name);
            _container = CreateContainer(
                false, GlobalCompositionRoot.Instance.Container, extraInstallers);

            Log.Debug("SceneCompositionRoot: Finished install phase.  Injecting into scene...");
            InjectObjectsInScene();

            Log.Debug("SceneCompositionRoot: Resolving root IFacade...");
            _rootFacade = _container.Resolve<IFacade>();

            DecoratedScenes.Clear();

            Assert.IsNotNull(Container);
            Assert.IsNotNull(RootFacade);
        }
        protected object autoMVC(Type type)
        {
            string fullName = type.FullName;
            string beanID   = Singleton.getAliasName(fullName);
            object source;

            if (beanID == null)
            {
                if (type.IsSubclassOf(typeof(Component)))
                {
                    Debug.Log(fullName);
                    return(null);
                }

                if (Singleton.isInUnique(fullName) == true)
                {
                    return(Singleton.getInstance(fullName));
                }

                if (type.IsClass)
                {
                    //Debug.Log(fullName);
                    return(Activator.CreateInstance(type));
                }
                else
                {
                    throw new Exception("请为非类类型指定别名:" + fullName);
                }
            }

            IFacade facade = Facade.getInstance();

            if (facade.hasMediator(beanID))
            {
                return(facade.getMediator(beanID));
            }
            if (facade.hasProxy(beanID))
            {
                return(facade.getProxy(beanID));
            }

            source = facade.getInjectLock(beanID);
            if (source == null)
            {
                source = Singleton.getOneInstance(beanID);
                if (source is IInjectable)
                {
                    source = inject(source);
                }
                if (source is IMediator)
                {
                    facade.registerMediator(source as IMediator);
                }
                else if (source is IProxy)
                {
                    facade.registerProxy(source as IProxy);
                }
            }
            return(source);
        }
        /// <summary>
        /// Default constructor
        /// </summary>
        public FacadeTests()
        {
            // Copy the database prepared for the tests (ovveride an existing db test)
            System.IO.File.Copy(_dbTestsModel, _dbTests, true);

            _facade = new Facade(_dbTests);
        }
Example #4
0
        public static IMediator RegisterMediator <T>(this IFacade facade, params object[] list) where T : IMediator
        {
            var mediator = Container.Instantiate <T>(list);

            facade.RegisterMediator(mediator);
            return(mediator);
        }
        protected override void Initialize()
        {
            InitContainer();
            InitialInject();

            _rootFacade = _container.Resolve<IFacade>();
        }
Example #6
0
        protected override void Initialize()
        {
            InitContainer();
            InitialInject();

            _rootFacade = _container.Resolve <IFacade>();
        }
Example #7
0
 public static void RegisterCommandForMultipleNotice <T>(this IFacade facade, object[] list, params string[] notifications) where T : ICommand
 {
     foreach (var notificationName in notifications)
     {
         facade.RegisterCommand <T>(notificationName, list);
     }
 }
Example #8
0
 public BlogsController(IBlogService blogService, IMapper mapper, ICommentService commentService, IFacade facade)
 {
     _facade         = facade;
     _blogService    = blogService;
     _mapper         = mapper;
     _commentService = commentService;
 }
Example #9
0
        public static IMediator RegisterMediator <T>(this IFacade facade) where T : IMediator
        {
            var mediator = Container.Instantiate <T>();

            facade.RegisterMediator(mediator);
            return(mediator);
        }
Example #10
0
        public static IProxy RegisterProxy <T>(this IFacade facade) where T : IProxy
        {
            var proxy = Container.Instantiate <T>();

            facade.RegisterProxy(proxy);
            return(proxy);
        }
Example #11
0
        public static IProxy RegisterProxy <T>(this IFacade facade, params object[] list) where T : IProxy
        {
            var proxy = Container.Instantiate <T>(list);

            facade.RegisterProxy(proxy);
            return(proxy);
        }
        DependencyCollection ISoapTransactionLinkExecutor.UpdateDependencies()
        {
            ISoapTransactionLinkExecutor executor = (ISoapTransactionLinkExecutor)this;

            foreach (KeyValuePair <ConnectionType, INode> nodePairs in ProxyNodeConnections)
            {
                IFacade iFacadeNode = nodePairs.Value as IFacade;

                if (iFacadeNode != null)
                {
                    if (!iFacadeNode.IsConcrete)
                    {
                        FacadeNode facadeNode = iFacadeNode as FacadeNode;
                        InProcess.InProcessNode inProcessNode = facadeNode.BaseNode as InProcess.InProcessNode;

                        if (inProcessNode != null && inProcessNode.OriginLink != null && inProcessNode.OriginLink.OriginChain != OriginChain)
                        {
                            executor.Dependencies.AddFacade(iFacadeNode);
                        }
                    }
                }
            }

            return(executor.Dependencies);
        }
Example #13
0
 public MainWindowViewModel(IFacade facade, IOpenFilteredCommand openFiltered)
 {
     _facade      = facade;
     OpenFiltered = openFiltered;
     _cosmetics   = _facade.CosmeticService.GetAll();
     _path        = ConfigurationManager.AppSettings.Get("SerializationPath");
 }
        public void Awake()
        {
            var extraInstallers = new List <IInstaller>();

            if (_staticSettings != null)
            // Static settings are needed if creating a SceneCompositionRoot dynamically
            {
                extraInstallers           = _staticSettings.Installers;
                OnlyInjectWhenActive      = _staticSettings.OnlyInjectWhenActive;
                ParentNewObjectsUnderRoot = _staticSettings.ParentNewObjectsUnderRoot;
                _staticSettings           = null;
            }

            // We always want to initialize GlobalCompositionRoot as early as possible
            GlobalCompositionRoot.Instance.EnsureIsInitialized();

            Assert.IsNull(Container);
            Assert.IsNull(RootFacade);

            Log.Debug("Initializing SceneCompositionRoot in scene '{0}'", this.gameObject.scene.name);
            _container = CreateContainer(
                false, GlobalCompositionRoot.Instance.Container, extraInstallers);

            Log.Debug("SceneCompositionRoot: Finished install phase.  Injecting into scene...");
            InjectObjectsInScene();

            Log.Debug("SceneCompositionRoot: Resolving root IFacade...");
            _rootFacade = _container.Resolve <IFacade>();

            DecoratedScenes.Clear();

            Assert.IsNotNull(Container);
            Assert.IsNotNull(RootFacade);
        }
Example #15
0
 private Engine(IFrontEnd frontEnd, IStorage reccordStorage, IFacade facade, Command userCommand)
 {
     this.rankList    = reccordStorage;
     this.frontEnd    = frontEnd;
     this.facade      = facade;
     this.UserCommand = userCommand;
 }
Example #16
0
 public ServiceLocate(IFacade facade)
 {
     _facade = facade;
     if (_map == null)
     {
         _map = new MapList <Type, IService>();
     }
 }
Example #17
0
 public static IFacade getInstance()
 {
     if (ins == null)
     {
         ins = new Facade();
     }
     return(ins);
 }
Example #18
0
        public void SendRotateComand(IFacade facadeI, Vector3 vec)
        {
            ComandDataRotate cmm = new ComandDataRotate();

            cmm.LookAtVector3 = vec;

            facadeI.ComandGet(cmm);
        }
Example #19
0
 public static IFacade GetInstance()
 {
     if (instance == null)
     {
         instance = new Facade();
     }
     return(instance);
 }
Example #20
0
 /// <summary>
 /// On destroy.
 /// </summary>
 protected virtual void OnDestroy()
 {
     if (facade != null)
     {
         facade.Dispose();
         facade = null;
     }
 }
Example #21
0
 static void AfterRegisterCall()
 {
     if (fa == null)
     {
         string name = typeof(FacadeEnter).Name;
         fa = Facade.GetInstance(name, () => new Facade(name));//之前注册的是否可调用
     }
 }
Example #22
0
 public static IFacade GetInstance()
 {
     if (facade == null)
     {
         facade = new Facade();
     }
     return(facade);
 }
Example #23
0
        public void SendFallComand(IFacade facadeI, Rigidbody rigidbody)
        {
            ComandDataFall cmf = new ComandDataFall();

            cmf.HumanRigidbody = rigidbody;

            facadeI.ComandGet(cmf);
        }
        public void ShottedComand(IFacade facadeI)
        {
            ComandInDataShotted cshottd = new ComandInDataShotted();

            //cmm.LookAtVector3 = vec;

            facadeI.ComandGet(cshottd);
        }
Example #25
0
 /// <summary>
 /// On destroy.
 /// </summary>
 protected virtual void OnDestroy()
 {
     if (coreFacade != null)
     {
         coreFacade.Dispose();
         coreFacade = null;
     }
 }
        public AnonymousUserFacade getLoginToken()
        {
            //create Anonymous User Facade:
            ILoginToken AnonymUserLoginToken = FlyingCenterSystem.GetFlyingCenterSystemInstance().Login(null, null);
            IFacade     AnonymIFacade        = FlyingCenterSystem.GetFlyingCenterSystemInstance().GetFacade(AnonymUserLoginToken);

            return((AnonymousUserFacade)AnonymIFacade);
        }
Example #27
0
 public static IFacade GetInstance(Func <IFacade> facadeFunc)
 {
     if (instance == null)
     {
         instance = facadeFunc();
     }
     return(instance);
 }
Example #28
0
        public void SelectNextWeaponComand(IFacade facadeI, bool forward)
        {
            ComandDataSelectWeapon cmm = new ComandDataSelectWeapon();

            cmm.IsForward = forward;

            facadeI.ComandGet(cmm);
        }
Example #29
0
 public TopicsController(ITopicService topicService, IMapper mapper, ICommentService commentService,
                         IFacade facade)
 {
     _facade         = facade;
     _topicService   = topicService;
     _mapper         = mapper;
     _commentService = commentService;
 }
Example #30
0
        public void GetInstance()
        {
            // Test Factory Method
            IFacade facade = Facade.Instance;

            // test assertions
            Assert.IsNotNull(facade, "Expecting instance not null");
            Assert.IsTrue(facade != null, "Expecting instance implements IFacade");
        }
Example #31
0
        public void TestGetInstance()
        {
            // Test Factory Method
            IFacade facade = Facade.GetInstance(() => new Facade());

            // test assertions
            Assert.IsTrue(facade != null, "Expecting instance not null");
            Assert.IsTrue(facade is IFacade, "Expecting instance implements IFacade");
        }
Example #32
0
        public void SendMovePathFindComand(IFacade facadeI, Vector3 vec)
        {
            ComandDataMove cmm = new ComandDataMove();

            cmm.Vector3          = vec;
            cmm.IsMoveByPathFind = true;

            facadeI.ComandGet(cmm);
        }
        protected override void Initialize()
        {
            DontDestroyOnLoad(gameObject);

            // Is this a good idea?
            //go.hideFlags = HideFlags.HideInHierarchy;

            _container = CreateContainer(false, this);
            _rootFacade = _container.Resolve<IFacade>();
        }
        void Initialize()
        {
            Log.Debug("Initializing GlobalCompositionRoot");

            Assert.IsNull(Container);
            Assert.IsNull(RootFacade);

            DontDestroyOnLoad(gameObject);

            _container = CreateContainer(false, this);
            _rootFacade = _container.Resolve<IFacade>();

            Assert.IsNotNull(Container);
            Assert.IsNotNull(RootFacade);
        }
Example #35
0
        public void Awake()
        {
            // We always want to initialize GlobalCompositionRoot as early as possible
            GlobalCompositionRoot.Instance.EnsureIsInitialized();

            Assert.IsNull(Container);
            Assert.IsNull(RootFacade);

            Log.Debug("Initializing SceneCompositionRoot in scene '{0}'", this.gameObject.scene.name);
            InitContainer();

            Log.Debug("SceneCompositionRoot: Finished install phase.  Injecting into scene...");
            InjectObjectsInScene();

            Log.Debug("SceneCompositionRoot: Resolving root IFacade...");
            _rootFacade = _container.Resolve<IFacade>();

            DecoratedScenes.Clear();

            Assert.IsNotNull(Container);
            Assert.IsNotNull(RootFacade);
        }
Example #36
0
 public BaseController(IBus bus, IFacade facade)
 {
     _bus = bus;
     _facade = facade;
 }
 public CustomerController(IBus bus, IFacade facade)
     : base(bus, facade)
 {
 }
 public CustomerController()
 {
     facade = new Facade();
 }
 public ProjectsController(IFacade facade, IProjectService service, IApplicationUserRepository userRepository)
 {
     _facade = facade;
     _service = service;
     _userRepo = userRepository;
 }
Example #40
0
 public VoucherController(IBus bus, IFacade facade)
     : base(bus, facade)
 {
 }
Example #41
0
 public ProductController(IBus bus, IFacade facade)
     : base(bus, facade)
 {
 }
Example #42
0
 protected AppFactory()
 {
     m_AppFacade = AppFacade.Instance();
 }
 public virtual void SetUp()
 {
     FacadeMock = MockRepository.StrictMock<IFacade>();
 }
 public FacadeBase(IFacade parent)
 {
     ParentFacade = parent;
 }
Example #45
0
        public DriverBase()
        {
            // Set up logging - will participate in the standard toolkit log
            log = log4net.LogManager.GetLogger("KaiTrade");

            wireLog = log4net.LogManager.GetLogger("KaiTradeWireLog");
            driverLog = log4net.LogManager.GetLogger("KaiDriverLog");

            _state = new DriverState();
            _facade = AppFacade.Instance();

            _clOrdIDOrderMap = new Dictionary<string, OrderContext>();
            _apiIDOrderMap = new Dictionary<string, OrderContext>();
            _pXContexts = new Dictionary<string, PXUpdateContext>();

            _clients = new List<KaiTrade.Interfaces.IClient>();
            _publisherRegister = new Dictionary<string, KaiTrade.Interfaces.IPublisher>();
            _productGenericNameRegister = new Dictionary<string, string>();
            _productRegister = new Dictionary<string, KaiTrade.Interfaces.IProduct>();
            _externalProduct = new Dictionary<string, object>();
            _sessions = new Dictionary<string, IDriverSession>();
            _priceAgregators = new Dictionary<string, List<IPriceAgregator>>();
            _identity = System.Guid.NewGuid().ToString();

            // setup the components info - used on status messages
            SetComponentInfo(out _module, this, this.m_ID, "DriverManager", 0, "");

            // creat a last status object - used to report status when requested
            _lastStatus = new K2DataObjects.Message();

            _lastStatus.Label = "Status";
            _lastStatus.Data = "Loaded";
            _lastStatus.AppState = (int)KaiTrade.Interfaces.Status.loaded;
            _activeContextMap = new Dictionary<string, OrderContext>();
            _runningState = new DriverStatus();


            log.Info("MainMessageHandler Created");

            pxUpdates = new BlockingCollection<KaiTrade.Interfaces.IPXUpdate>();
            _pxUpdateProcessor = new PxUpdateProcessor(this, pxUpdates);
            _pXUpdateThread = new Thread(_pxUpdateProcessor.ThreadRun);
            _pXUpdateThread.Start();

            replaceRequests = new BlockingCollection<RequestData>();
            _replaceProcessor = new OrderReplaceProcessor(this, replaceRequests);
            _replaceUpdateThread = new Thread(_replaceProcessor.ThreadRun);
            _replaceUpdateThread.Start();

            //private BlockingCollection<List<KaiTrade.Interfaces.IDOMSlot>> slotUpdates;
            inboundMessages = new BlockingCollection<KaiTrade.Interfaces.IMessage>();      
            _inboundProcessor = new MessageProcessorThread(this, inboundMessages);
            _inboundProcessorThread = new Thread(_inboundProcessor.ThreadRun);
            _inboundProcessorThread.Start();

            outboundMessages = new BlockingCollection<KaiTrade.Interfaces.IMessage>();
            _outboundProcessor = new MessageProcessorThread(ref _clients, outboundMessages);
            _outboundProcessorThread = new Thread(_outboundProcessor.ThreadRun);
            _outboundProcessorThread.Start();

        }
Example #46
0
 /// <summary>
 /// Set the APP Facade in the plugin - this lets the plugin do things with KTA
 /// </summary>
 /// <param name="myFacade"></param>
 public void SetFacade(IFacade myFacade)
 {
     _facade = myFacade;
 }
 public ConfigurationFormController(IFacade facade, IUIFactory uiFactory)
 {
     facadeImpl = facade;
     this.uiFactory = uiFactory;
     settings = facade.CreateConfiguration();
 }
 /// <summary>
 /// Constructor:
 /// </summary>
 public LogController()
 {
     facade = new Facade();
     repository = facade.GetLogRepository();
 }
 public EmployeeController()
 {
     facade = new Facade();
     repository = facade.GetEmployeeRepository();
 }
 public DBManager(IFacade facade)
 {
     workFacade = facade;
 }
 public DependencyValidator(IFacade facade) {
     this.facade = facade;
 }
 /// <summary>
 /// Constructor: 
 /// </summary>
 public CompanyController()
 {
     facade = new Facade();
     repository = facade.GetCompanyRepository();
 }
Example #53
0
 public CartController(IBus bus, IFacade facade)
     : base(bus, facade)
 {
 }