Esempio n. 1
0
        public Form1()
        {
            InitializeComponent();
            commands.Add("Down", new MoveCommand(0, 2, Keys.Down));
            commands.Add("Up", new MoveCommand(0, -2, Keys.Up));
            commands.Add("Right", new MoveCommand(2, 0, Keys.Right));
            commands.Add("Left", new MoveCommand(-2, 0, Keys.Left));
            commands.Add("Add", new ResizeCommand(2, Keys.Add));
            commands.Add("Subtract", new ResizeCommand(-2, Keys.Subtract));
            commands.Add("Create", new CreateCommand());
            commands.Add("Load", new LoadCommand());
            commands.Add("Group", new GroupCommand());
            commands.Add("Ungroup", new UngroupCommand());
            commands.Add("Delete", new DeleteCommand());
            commands.Add("Select", new SelectCommand());
            commands.Add("ChangeColor", new ChangeColorCommand());
            commands.Add("StickyObject", new StickyObjCommand());
            commands.Add("MoveByMouse", new MoveByMouseCommand());

            treeView1.BackColor         = System.Drawing.SystemColors.ControlLight;
            treeView1.Dock              = System.Windows.Forms.DockStyle.Right;
            treeView1.Location          = new System.Drawing.Point(800 - 150, 28);
            treeView1.Name              = "treeView1";
            treeView1.Size              = new System.Drawing.Size(150, 423);
            treeView1.TabIndex          = 1;
            treeView1.Anchor            = AnchorStyles.Top;
            this.treeView1.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.treeView1_AfterSelect);
            tree = new CTree(treeView1);
            storage.addObserver(tree);
        }