mCleaner.Logics.Commands.CommandLogic_Delete.Search_File C# (CSharp) Method

Search_File() public method

public Search_File ( ) : void
return void
        public void Search_File()
        {
            string path = Action.path;

            if (Glob.HasGlobPattern(path))
            {
                IEnumerable<string> files = Glob.GetMatches(path, Glob.Constants.PathName);
                string[] _files = new List<string>(files).ToArray();
                path = _files.Length > 0 ? _files[0] : null;
            }

            if (path != null)
            {
                FileInfo fi = new FileInfo(path);
                if (fi.Exists)
                {
                    if (!IsWhitelisted(fi.FullName))
                    {
                        ProgressWorker.I.EnQ("Queueing file: " + fi.FullName);

                        // enqueue file for deletion
                        Worker.I.EnqueTTD(new Model_ThingsToDelete()
                        {
                            FullPathName = Action.path,
                            IsWhitelisted = false,
                            OverWrite = false,
                            WhatKind = THINGS_TO_DELETE.file,
                            command = COMMANDS.delete,
                            search = SEARCH.file,
                            path = string.Empty,
                            level = Action.parent_option.level,
                            cleaner_name = Action.parent_option.label
                        });
                    }
                }
            }
        }