mCleaner.Logics.Commands.CommandLogic_Ini.ReadIni C# (CSharp) Method

ReadIni() public method

public ReadIni ( ) : void
return void
        public void ReadIni()
        {
            string section = Action.section;
            string key = Action.parameter;
            string path = Action.path;

            FileInfo fi = new FileInfo(path);
            if (fi.Exists)
            {
                bool add = false;

                if (Win32API.IniHelper.IsSectionExists(path, section))
                {
                    add = key == null ? true : trueorfalse(() =>
                    {
                        bool ret = false;

                        foreach (string k in Win32API.IniHelper.GetKeyNames(section, path))
                        {
                            if (k == key)
                            {
                                ret = true;
                                break;
                            }
                        }

                        return ret;
                    });
                }

                if (add)
                {
                    Worker.I.EnqueTTD(new Model_ThingsToDelete()
                    {
                        FullPathName = path + section + key,

                        path = path, // this should be the parent directory of the file name
                        // but for this case, we will use it to set the filename

                        IsWhitelisted = false,
                        OverWrite = false,
                        WhatKind = THINGS_TO_DELETE.file,
                        command = COMMANDS.ini,
                        search = SEARCH.file,

                        section = section,
                        key = key,
                        level = Action.parent_option.level,
                        cleaner_name = Action.parent_option.label
                    });
                }
            }
        }