AutoQuery.Systems.Ini.RemoveSection C# (CSharp) Метод

RemoveSection() публичный Метод

Removes a section.
The Profile.Changing event is raised before removing the section. If its ProfileChangingArgs.Cancel property is set to true, this method returns immediately without removing the section. After the section has been removed, the Profile.Changed event is raised.
/// is null or empty or /// is true. /// section is null. /// The API failed.
public RemoveSection ( string section ) : void
section string /// The name of the section to remove.
Результат void
            public override void RemoveSection(string section)
            {
                // Verify the section exists
                if (!HasSection(section))
                    return;

                VerifyNotReadOnly();
                VerifyName();
                VerifyAndAdjustSection(ref section);

                if (!RaiseChangeEvent(true, ProfileChangeType.RemoveSection, section, null, null))
                    return;

                if (WritePrivateProfileString(section, 0, "", Name) == 0)
                    throw new Win32Exception();

                RaiseChangeEvent(false, ProfileChangeType.RemoveSection, section, null, null);
            }