[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)
{
_store.AppendValues(dict[a.Category], a.Name);
_items[a.Name] = (type, null);
_store.AppendValues(dict[a.Category], a.ContentType.Name);
_items[a.ContentType.Name] = (type, null);
}
}
}

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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