コード例 #1
0
ファイル: Stacker.cs プロジェクト: wally-fork/clasecsharp
  static void Main(){
    IStack stacy = new StackImpl1();
    StackDecorator1 orrico = new StackDecorator1(stacy);
    Observer StackObserver1 = new Observer();
    Observer StackObserver2 = new Observer();
    orrico.attach(StackObserver1);
    orrico.attach(StackObserver2);
    orrico.howMany();
    orrico.pushStack("Stella");
    orrico.pushStack("was");
    orrico.pushStack("a");
    orrico.pushStack("Diver");

    // Sin decorar
    stacy.pushStack("and");
    stacy.pushStack("she");
    stacy.pushStack("was");
    stacy.pushStack("always");
    stacy.pushStack("down");
    // decorar Sin

    orrico.howMany();
    orrico.popStack();
    orrico.howMany();
  }
コード例 #2
0
ファイル: Stacker.cs プロジェクト: wally-fork/clasecsharp
    static void Main()
    {
        StackImpl1 stacy = new StackImpl1();
        stacy.howMany();
        stacy.pushStack("Stella");
        stacy.pushStack("was");
        stacy.pushStack("a");
        stacy.pushStack("Diver");
        stacy.pushStack("and");
        stacy.pushStack("she");
        stacy.pushStack("was");
        stacy.pushStack("always");
        stacy.pushStack("down");

        stacy.howMany();
        stacy.popStack();
        stacy.howMany();
    }
コード例 #3
0
ファイル: Stacker.cs プロジェクト: wally-fork/clasecsharp
    static void Main()
    {
        StackImpl1 stacy = new StackImpl1();
        Observer StackObserver1 = new Observer();
        Observer StackObserver2 = new Observer();
        stacy.attach(StackObserver1);
        stacy.attach(StackObserver2);
        stacy.howMany();
        stacy.pushStack("Stella");
        stacy.pushStack("was");
        stacy.pushStack("a");
        stacy.pushStack("Diver");
        stacy.pushStack("and");
        stacy.pushStack("she");
        stacy.pushStack("was");
        stacy.pushStack("always");
        stacy.pushStack("down");

        stacy.howMany();
        stacy.popStack();
        stacy.howMany();
    }