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

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

Sets the value for an entry inside a section.
If the INI file does not exist, it is created. The Profile.Changing event is raised before setting the value. If its ProfileChangingArgs.Cancel property is set to true, this method returns immediately without setting the value. After the value has been set, the Profile.Changed event is raised.
/// is true or /// is null or empty. /// Either section or entry is null. /// The API failed.
public SetValue ( string section, string entry, object value ) : void
section string /// The name of the section that holds the entry.
entry string /// The name of the entry where the value will be set.
value object /// The value to set. If it's null, the entry is removed.
Результат void
            public override void SetValue(string section, string entry, object value)
            {
                // If the value is null, remove the entry
                if (value == null)
                {
                    RemoveEntry(section, entry);
                    return;
                }

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

                if (!RaiseChangeEvent(true, ProfileChangeType.SetValue, section, entry, value))
                    return;

                if (WritePrivateProfileString(section, entry, value.ToString(), Name) == 0)
                    throw new Win32Exception();

                RaiseChangeEvent(false, ProfileChangeType.SetValue, section, entry, value);
            }