Beispiel #1
0
        //Scan Method
        private void Scan()
        {
            //Enable Analyze Button
            this.Button_Analyze.Enabled = true;

            //Clear Global Files List
            GlobalFilesList.Clear();

            //Set Flag
            RecursiveFlag = false;

            //Init Labels
            this.Label_Selection_Extensions.Text = "Extensions ";
            this.Label_Selection_Files.Text      = "Files ";

            //Scanning
            this.Label_Folder_Files.Text = "Files Scanning...";
            this.Label_Extensions.Text   = "Extensions Scanning...";
            this.Label_Folders.Text      = "Folders 1";
            this.Label_Mode.Text         = "Mode: Scan";

            //Clear CheckList
            this.Checklist_Types.Items.Clear();
            ExtensionList.Clear();

            //Scan
            string[] Files = Directory.GetFiles(SelectedFolderPath);

            //Unique Extensions Added to Extenstion List
            try
            {
                foreach (string File in Files)
                {
                    GlobalFilesList.Add(File);
                    string FileExtension = Path.GetExtension(File);
                    if (ExtensionList.Contains(FileExtension) == false)
                    {
                        ExtensionList.Add(FileExtension);
                    }
                }
            }

            catch { }

            //Add to CheckList
            foreach (string Extension in ExtensionList)
            {
                this.Checklist_Types.Items.Add(Extension);
            }

            //Set Folder Information
            Label_Folder_Files.Text = "Files " + (Files.Count()).ToString();
            Label_Extensions.Text   = "Extensions " + (ExtensionList.Count()).ToString();
            if (RecursiveFlag == false)
            {
                this.Label_Mode.Text = "Mode Non Recursive";
            }
            else
            {
                this.Label_Mode.Text = "Mode Recursive";
            }

            //Enable Remove Button
            this.Label_Remove.Enabled = true;

            //Init Mode
            this.Label_Mode.Text = "Mode ";
        }