http://bugzilla.novell.com/show_bug.cgi?id=493143


           Summary: SettingsProviderAttribute does not work if applied to
                    class
    Classification: Mono
           Product: Mono: Class Libraries
           Version: 2.4.x
          Platform: x86
        OS/Version: Windows Vista
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: Configuration
        AssignedTo: [email protected]
        ReportedBy: [email protected]
         QAContact: [email protected]
          Found By: Community User


Using the SettingsProviderAttribute to provide a custom SettingsProvider does
not work when applied to the class, only when applied to a property of a class:

In the below example, MySettingsProvider is used
when reading the SomeFlag property from the config-file:

public class AppSettings : ApplicationSettingsBase
{
  [UserScopedSettings()]
  [SettingsProvider(typeof(MySettingsProvider))]
  public property bool SomeFlag
  {
    get
    {
      return (bool)this["SomeFlag"];
    }
    set
    {
      this["SomeFlag"] = value;
    }
  }
}

In MS.Net, you can apply the attribute to the class
to make valid for all properties in that class

In the below example, MySettingsProvider is not used
when reading the SomeFlag property from the config-file

[SettingsProvider(typeof(MySettingsProvider))]
public class AppSettings : ApplicationSettingsBase
{
  [UserScopedSettings()]
  public property bool SomeFlag
  {
    get
    {
      return (bool)this["SomeFlag"];
    }
    set
    {
      this["SomeFlag"] = value;
    }
  }
}

-- 
Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.
_______________________________________________
mono-bugs maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-bugs

Reply via email to