예제 #1
0
        public DomainController(IDomainModel model, IDomainView view)
        {
            System.Diagnostics.Debug.Assert(model != null && view != null);

            //assign refs
            Model = model;
            View  = view;

            //subscribe to refs (publishers)
            if (!Model.AddSubscriber(this))
            {
                throw new DomainControllerException("Could not add view to model.");
            }
            if (!View.SetSubscriber(this))
            {
                throw new DomainControllerException("Could not attach model to view.");
            }
        }