コード例 #1
0
        public static void Main(string[] args)
        {
            Text     paragraph = new Text();
            ICommand bold      = new BoldCommand(paragraph);
            ICommand unbold    = new UnboldCommand(paragraph);

            RichTextEditorInvoker richTextEditor = new RichTextEditorInvoker();

            richTextEditor.StoreAndExecute(bold);
            richTextEditor.StoreAndExecute(unbold);
        }
コード例 #2
0
ファイル: command.cs プロジェクト: is25/design-patterns
        public static void Main(string[] args)
        {
            Text paragraph = new Text();
            ICommand bold = new BoldCommand(paragraph);
            ICommand unbold = new UnboldCommand(paragraph);

            RichTextEditorInvoker richTextEditor  = new RichTextEditorInvoker();
            richTextEditor.StoreAndExecute(bold);
            richTextEditor.StoreAndExecute(unbold);
        }