﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
//I Decided to create this class because I figured that with my current design I would have to
//Repeat a lot of code to disable and enable elements, I used the class so that I could streamline this down to 
//a single line of code
namespace C_Malware_Scanner
{
    //create the view change class
    class viewchange
    {
        //create a public function to disable all of the form elements in form 1
        //the code which allowed me to control a specific form from a seperate class 
        //came from this link: http://stackoverflow.com/questions/8499160/changing-an-objects-properties-in-another-class
        public void disableAll(Form1 form)
        {
            disableMD5folderSelection(form);
            disableProcessList(form);
        }
        public void enableMD5folderSelection(Form1 form)
        {
            //The code below allows me to control any of the 'public' elements on a form
            form.MD5Label.Visible = true;
            form.selectFolderMD5.Visible = true;
            form.MD5ScanButton.Visible = true;
            form.MD5ScanButton.Refresh();
            form.MD5Label.Refresh();
            form.selectFolderMD5.Refresh();
        }
        public void disableMD5folderSelection(Form1 form)
        {
            form.MD5Label.Visible = false;
            form.selectFolderMD5.Visible = false;
            form.MD5Label.Refresh();
            form.MD5ScanButton.Visible = false;
            form.MD5ScanButton.Refresh();
            form.selectFolderMD5.Refresh();
            form.MD5ScanListBox.Visible = false;
            form.MD5ScanListBox.Refresh();
        }
        public void enableProcessList(Form1 form)
        {
            form.ProcessListBox.Visible = true;
            form.ProcessListScanButton.Visible = true;
            form.ProcessListBox.Refresh();
            form.ProcessListScanButton.Refresh();
        }
        public void disableProcessList(Form1 form)
        {
            form.ProcessListBox.Visible = false;
            form.ProcessListScanButton.Visible = false;
            form.ProcessListBox.Refresh();
            form.ProcessListScanButton.Refresh();
        }
    }
}
