コード例 #1
0
        private void BtDemo_Click(object sender, RoutedEventArgs e)
        {
            Window demowindown = null;

            if (_currentcontent.Equals("Singleton"))
            {
                demowindown = new SingletonDemo.SingletonDemo();
            }
            if (_currentcontent.Equals("AbstractFactoryPatern"))
            {
                demowindown = new AbstractFactoryDemo.AbstractFactoryPaternDemo();
            }
            if (_currentcontent.Equals("BuilderPattern"))
            {
                demowindown = new BuilderDemo.BuilderPatternDemo();
            }
            if (_currentcontent.Equals("AdapterPattern"))
            {
                demowindown = new AdapterDemo.AdapterDemo();
            }
            if (_currentcontent.Equals("Methodfactory"))
            {
                demowindown = new MethodFactoryDemo.MethodFactoryDemo();
            }
            if (_currentcontent.Equals("CompositePattern"))
            {
                demowindown = new CompositeDemo.CompositeDemo();
            }
            if (_currentcontent.Equals("PrototypePattern"))
            {
                demowindown = new PrototypeDemo.PrototypeDemo();
            }
            if (_currentcontent.Equals("DecoratorPattern"))
            {
                demowindown = new DecoratorDemo.DecoratorDemo();
            }
            if (_currentcontent.Equals("BridgePattern"))
            {
                demowindown = new BridgeDemo.BridgeDemo();
            }
            if (_currentcontent.Equals("FacadePattern"))
            {
                demowindown = new FacadeDemo.FacadeDemo();
            }
            if (_currentcontent.Equals("FlyweightPattern"))
            {
                demowindown = new LightweightDemo.LightweightDemo();
            }
            if (_currentcontent.Equals("StrategyPattern"))
            {
                demowindown = new StrategyDemo.StrategyDemo();
            }
            if (_currentcontent.Equals("StatePattern"))
            {
                demowindown = new StateDemo.StateDemo();
            }
            if (demowindown != null)
            {
                demowindown.Closed      += Demowindown_Closed;
                demoBackGroud.Visibility = Visibility.Visible;
                demowindown.Show();
            }
        }
コード例 #2
0
        private void Btcopy_Click(object sender, RoutedEventArgs e)
        {
            PrototypeDemo demo = new PrototypeDemo(prototype.Clone());

            demo.Show();
        }