void mainPropertyGrid_PropertyValueChanged(object s, PropertyValueChangedEventArgs e)
{
if (e.ChangedItem.PropertyDescriptor.Name == "ProviderName" && _security.UseCustomScript && !string.IsNullOrEmpty(_security.Script))
{
var result = MessageBox.Show("The custom script for this security provider will not be valid anymore, the 'Use Custom Script' property will be set to false. Do you want to continue ?", "Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
if (result == DialogResult.Yes)
{
_security.UseCustomScript = false;
}
else
{
_security.ProviderName = e.OldValue.ToString();
return;
}
}
}