コード例 #1
0
        public void AddFacade(Proxy.IFacade facade)
        {
            if (!facade.IsConcrete && !RegisteredFacades.ContainsKey(facade))
            {
                RegisteredFacades[facade] = false;

                if (_dependencyCount == null)
                {
                    _dependencyCount = 1;
                }
                else
                {
                    _dependencyCount++;
                }

                facade.BaseCured += OnFacadeCured;
            }
        }
コード例 #2
0
        private void OnFacadeCured(object sender, EventArgs e)
        {
            Proxy.IFacade facade = sender as Proxy.IFacade;

            if (facade != null)
            {
                if (RegisteredFacades.ContainsKey(facade))
                {
                    RegisteredFacades[facade] = true;
                    _dependencyCount--;

                    if (_dependencyCount == 0)
                    {
                        if (FacadesCompleted != null)
                        {
                            FacadesCompleted(this, new EventArgs());
                        }
                    }
                }
            }
        }