コード例 #1
0
        public void Test1()
        {
            IFactoryWithNotifier           factory   = new ConcreteFactory();
            Subscribe                      subscribe = new Subscribe();
            ObjectCreateHandler <IProduct> callback  = new ObjectCreateHandler <IProduct>(subscribe.SetProduct);

            Assert.IsNull(subscribe.GetProduct());
            factory.Create(callback);
            Assert.IsNotNull(subscribe.GetProduct());
        }
コード例 #2
0
            public void Create(ObjectCreateHandler <IProduct> callback)
            {
                IProduct product = Create();

                callback(product);
            }