Example #1
0
        public FilerView2()
        {
            InitializeComponent();

            AddFilePanel.Hide();
            AddLinkPanel.Hide();

            AppDomain.CurrentDomain.ProcessExit += OnProcessExit;

            //Set background image for ClassesPanel(brown one).
            string ClassesBackPath = Path.Combine(ResourcesPath, "Images");

            ClassesBackPath = Path.Combine(ClassesBackPath, "Classes_Background.png");
            ClassesPanel.BackgroundImage = System.Drawing.Image.FromFile(ClassesBackPath);

            //Set background image for ResourcesPanel(The big book).
            string ResBackPath = Path.Combine(ResourcesPath, "Images");

            ResBackPath = Path.Combine(ResBackPath, "Open_Books");
            ResBackPath = Path.Combine(ResBackPath, "Blue_Green_Open_Book.png");
            ResourcePanel.BackgroundImage = null;
            ResourcePanel.BackColor       = Color.Transparent;
            ResourcePanel.AllowDrop       = true;

            //Build ClassesPanelHelper. The ClassesPanelHelper is used for the background when showing the ClassesPanel.
            Panel ClassesPanelHelper = new Panel();

            ClassesPanelHelper.Size            = ResourcePanel.Size;
            ClassesPanelHelper.Location        = ResourcePanel.Location;
            ClassesPanelHelper.BackgroundImage = ResourcePanel.BackgroundImage;
            //Add ClassesPanelHelper to the View.
            ClassesPanelHelper.Parent = this;
            ClassesPanel.Parent       = ClassesPanelHelper;
            ClassesPanelHelper.BringToFront();
            //ControlHelper.SuspendDrawing(ResourcePanel); //Keeping this here in case we need is somewhere else in the code.

            //Build ClassesMediator. This is used to make the ClassesPanel act like a flow layout panel.
            ClassesMediator           = new FlowLayoutPanel();
            ClassesMediator.BackColor = Color.Transparent;
            ClassesPanel.Controls.Add(ClassesMediator);
            ClassesMediator.Location = new Point(0, 0);
            ClassesMediator.Size     = new Size(ClassesPanel.Size.Width - 20, ClassesPanel.Size.Height - 20);

            Copy_Right_Label.BringToFront();

            EndLoading();
        }
Example #2
0
 /// <summary>
 /// This function takes care of transitioning from The Resources View to the Classes View when the top left Arrow is clicked.
 /// It also clears out the CurrentResources.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void ArrowPanel_Click(object sender, EventArgs e)
 {
     if (ClassView)
     {
         return;
     }
     else
     {
         AddFilePanel.Hide();
         AddLinkPanel.Hide();
         CurrentPage            = 0;
         CurrentClassLabel.Text = "";
         DeleteSempahore.WaitOne();
         ClassView = true;
         CurrentResources.Clear(); //Throw away the resources because the class is changing.
         ClassesPanel.Location = new Point(136, 150);
         ClassesPanel.BringToFront();
         ClassesPanel.Show();
         ResourcePanel.Hide();
     }
 }