Пример #1
0
        private Control viewFromDisk(DiskFacade disk)
        {
            MouseEventHandler callback = (object sender, MouseEventArgs e) => openDisk(disk);

            var view = new FlowLayoutPanel
            {
                FlowDirection = FlowDirection.TopDown,
                Width         = 50,
                Height        = 100,
            };

            var pictureBox = new PictureBox()
            {
                Image  = new Bitmap(".../disk.png"),
                Width  = 50,
                Height = 32,
            };

            pictureBox.MouseClick += callback;
            view.Controls.Add(pictureBox);

            var label = new Label()
            {
                Text      = disk.name,
                TextAlign = ContentAlignment.TopCenter,
                Padding   = new Padding(0, 0, 66, 0)
            };

            label.MouseClick += callback;
            view.Controls.Add(label);

            view.MouseClick += callback;
            return(view);
        }
Пример #2
0
        public DiskFacade createDisk(string name, int size)
        {
            var disk = new DiskFacade(name, size);

            disks.Add(disk);
            return(disk);
        }
Пример #3
0
 private void openDisk(DiskFacade disk)
 {
     service.setActiveDisk(disk);
     pathField.Text = service.activePath;
     flowLayoutPanel1.Controls.Clear();
     setContextMenu(false);
     service.frontHistory.Clear();
     service.setActivePath(null);
     service.activeDisk.disk.viewDirectory("/").ForEach(
         path => flowLayoutPanel1.Controls.Add(viewFromFolder("/" + path))
         );
 }
Пример #4
0
 public void setActiveDisk(DiskFacade disk)
 {
     activeDisk = disk;
     backHistory.Push(disk.name + ":/");
 }