[Samples] Update section name handling

This commit is contained in:
cra0zy 2018-01-27 21:47:02 +01:00
parent c5ff4f2acb
commit 7c9efe3fe6
10 changed files with 13 additions and 13 deletions

View File

@ -134,8 +134,8 @@ namespace Samples
{ {
if (attribute is SectionAttribute a) if (attribute is SectionAttribute a)
{ {
_store.AppendValues(dict[a.Category], a.Name); _store.AppendValues(dict[a.Category], a.ContentType.Name);
_items[a.Name] = (type, null); _items[a.ContentType.Name] = (type, null);
} }
} }
} }

View File

@ -6,7 +6,7 @@ using Gtk;
namespace Samples namespace Samples
{ {
[Section(Name = "AboutDialog", Category = Category.Dialogs)] [Section(ContentType = typeof(AboutDialog), Category = Category.Dialogs)]
class AboutDialogSection : Box class AboutDialogSection : Box
{ {
public AboutDialogSection() : base(Orientation.Vertical, 0) public AboutDialogSection() : base(Orientation.Vertical, 0)

View File

@ -7,7 +7,7 @@ namespace Samples
{ {
class SectionAttribute : Attribute class SectionAttribute : Attribute
{ {
public string Name { get; set; } public Type ContentType { get; set; }
public Category Category { get; set; } public Category Category { get; set; }
} }

View File

@ -5,7 +5,7 @@ using Gtk;
namespace Samples namespace Samples
{ {
[Section(Name = "Button", Category = Category.Widgets)] [Section(ContentType = typeof(Button), Category = Category.Widgets)]
class ButtonSection : ListSection class ButtonSection : ListSection
{ {
public ButtonSection() public ButtonSection()

View File

@ -5,7 +5,7 @@ using Gtk;
namespace Samples namespace Samples
{ {
[Section(Name = "Color Button", Category = Category.Widgets)] [Section(ContentType = typeof(ColorButton), Category = Category.Widgets)]
class ColorButtonSection : ListSection class ColorButtonSection : ListSection
{ {
public ColorButtonSection() public ColorButtonSection()

View File

@ -5,7 +5,7 @@ using Gtk;
namespace Samples namespace Samples
{ {
[Section(Name= "Entry", Category = Category.Widgets)] [Section(ContentType = typeof(Entry), Category = Category.Widgets)]
class EntrySection : ListSection class EntrySection : ListSection
{ {
public EntrySection() public EntrySection()

View File

@ -6,7 +6,7 @@ using Gtk;
namespace Samples namespace Samples
{ {
[Section(Name = "Link Button", Category = Category.Widgets)] [Section(ContentType = typeof(LinkButton), Category = Category.Widgets)]
class LinkButtonSection : ListSection class LinkButtonSection : ListSection
{ {
public LinkButtonSection() public LinkButtonSection()

View File

@ -5,7 +5,7 @@ using Gtk;
namespace Samples namespace Samples
{ {
[Section(Name = "Spin Button", Category = Category.Widgets)] [Section(ContentType = typeof(SpinButton), Category = Category.Widgets)]
class SpinButtonSection : ListSection class SpinButtonSection : ListSection
{ {
public SpinButtonSection() public SpinButtonSection()

View File

@ -5,10 +5,10 @@ using Gtk;
namespace Samples namespace Samples
{ {
[Section(Name = "Switch Button", Category = Category.Widgets)] [Section(ContentType = typeof(Switch), Category = Category.Widgets)]
class SwitchButtonSection : ListSection class SwitchSection : ListSection
{ {
public SwitchButtonSection() public SwitchSection()
{ {
AddItem(CreateSwitchButton()); AddItem(CreateSwitchButton());
} }

View File

@ -5,7 +5,7 @@ using Gtk;
namespace Samples namespace Samples
{ {
[Section(Name = "Toggle Button", Category = Category.Widgets)] [Section(ContentType = typeof(ToggleButton), Category = Category.Widgets)]
class ToggleButtonSection : ListSection class ToggleButtonSection : ListSection
{ {
public ToggleButtonSection() public ToggleButtonSection()