Beispiel #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();
        }
Beispiel #2
0
        /// <summary>
        /// This function is called when a Class Item is clicked. It sets the name of the current class and takes
        /// care of the transition from the ClassesPanel to the ResourcesPanel. It launches the ClassClick event
        /// so that the controller can get all of the Resources from the server for that class.
        /// </summary>
        /// <param name="ClassName"></param>
        private void ClassClicked(string ClassName)
        {
            CurrentClass           = ClassName;
            CurrentClassLabel.Text = CurrentClass.Substring(0, CurrentClass.Length - 3);
            string BackImage = GetBackImage(ClassName);

            ResourcePanel.BackgroundImage = System.Drawing.Image.FromFile(BackImage);
            string Ext = ClassName.Substring(ClassName.Length - 3);

            CurrentBookColorIdx        = ColorExtensions.IndexOf(Ext);
            CurrentBookColorComplement = GetComplement(CurrentBookColorIdx);
            ClassView    = false;
            MoveUpThread = new Thread(new ThreadStart(SwitchToResourcesPanel));
            MoveUpThread.Start();
            AddFilePanel.Show();
            AddLinkPanel.Show();
            ClassClick?.Invoke(ClassName);
        }
Beispiel #3
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();
     }
 }