Skip to content

Commit

Permalink
Add secondary constructors with params settings
Browse files Browse the repository at this point in the history
  • Loading branch information
marcel2215 committed Nov 8, 2024
1 parent 772c23f commit 77c6062
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/Settings/SettingsGroup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,16 @@ public SettingsGroup(string key, string? title = null, string? description = nul
Settings = settings ?? [];
}

[SetsRequiredMembers]
public SettingsGroup(string key, string? title = null, string? description = null, bool isDisabled = false, params IPluginSetting[] settings)
{
Key = key;
Title = title;
Description = description;
IsDisabled = isDisabled;
Settings = settings;
}

public virtual required string Key { get; set; }

public virtual string? Title { get; set; }
Expand Down
10 changes: 10 additions & 0 deletions src/Settings/SettingsSection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,16 @@ public SettingsSection(string key, string? title = null, string? description = n
Settings = settings ?? [];
}

[SetsRequiredMembers]
public SettingsSection(string key, string? title = null, string? description = null, bool isDisabled = false, params IPluginSetting[] settings)
{
Key = key;
Title = title;
Description = description;
IsDisabled = isDisabled;
Settings = settings;
}

public virtual required string Key { get; set; }

public virtual string? Title { get; set; }
Expand Down

0 comments on commit 77c6062

Please sign in to comment.