Subversion Repositories SoapBoxCore

Rev

Rev 8 | Rev 13 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 8 Rev 12
Line 28... Line 28...
28
using SoapBox.Core;
28
using SoapBox.Core;
29
using System.ComponentModel.Composition;
29
using System.ComponentModel.Composition;
30
 
30
 
31
namespace SoapBox.Demo.PinBall
31
namespace SoapBox.Demo.PinBall
32
{
32
{
33
    [Export("/Workbench/Tools/OptionsDialog/OptionsItems", typeof(IOptionsItem))]
33
    [Export(SoapBox.Core.ExtensionPoints.Options.OptionsDialog.OptionsItems, typeof(IOptionsItem))]
34
    class PinBallOptions : AbstractOptionsItem
34
    class PinBallOptions : AbstractOptionsItem, IPartImportsSatisfiedNotification
35
    {
35
    {
36
        [ImportingConstructor]
-
 
37
        public PinBallOptions(
36
        public PinBallOptions()
38
            [Import("/Services/ExtensionService")] IExtensionService extensionService,
-
 
39
            [ImportMany("/PinBall/PinBallOptionItems", typeof(IOptionsItem))] IEnumerable<IOptionsItem> items,
-
 
40
            [Import("/PinBall/PinBallOptionsPad", typeof(PinBallOptionsPad))] PinBallOptionsPad pad)
-
 
41
        {
37
        {
42
            Header = Resources.Strings.Options_PinBallOptions_Header;
38
            Header = Resources.Strings.Options_PinBallOptions_Header;
-
 
39
        }
-
 
40
 
-
 
41
        [Import(SoapBox.Core.Services.Host.ExtensionService)]
-
 
42
        private IExtensionService extensionService { get; set; }
-
 
43
 
-
 
44
        [ImportMany(ExtensionPoints.PinBall.PinBallOptionItems, typeof(IOptionsItem), AllowRecomposition=true)]
-
 
45
        private IEnumerable<IOptionsItem> items { get; set; }
-
 
46
 
-
 
47
        [Import(CompositionPoints.PinBall.OptionsPad, typeof(PinBallOptionsPad))]
-
 
48
        private PinBallOptionsPad pad { get; set; }
-
 
49
 
-
 
50
        public void OnImportsSatisfied()
-
 
51
        {
43
            Items = extensionService.Sort(items);
52
            Items = extensionService.Sort(items);
44
            Pad = pad;
53
            Pad = pad;
45
        }
54
        }
46
    }
55
    }
47
 
56
 
48
    /// <summary>
57
    /// <summary>
49
    /// By default, most options pages in Windows have a first sub-item
58
    /// By default, most options pages in Windows have a first sub-item
50
    /// that is the "General" one, which is the same options pad as the
59
    /// that is the "General" one, which is the same options pad as the
51
    /// parent in the tree.  This just mimics that.
60
    /// parent in the tree.  This just mimics that.
52
    /// </summary>
61
    /// </summary>
53
    [Export("/PinBall/PinBallOptionItems", typeof(IOptionsItem))]
62
    [Export(ExtensionPoints.PinBall.PinBallOptionItems, typeof(IOptionsItem))]
54
    class PinBallOptionsGeneral : AbstractOptionsItem
63
    class PinBallOptionsGeneral : AbstractOptionsItem, IPartImportsSatisfiedNotification
55
    {
64
    {
56
        [ImportingConstructor]
-
 
57
        public PinBallOptionsGeneral(
65
        public PinBallOptionsGeneral()
58
            [Import("/PinBall/PinBallOptionsPad", typeof(PinBallOptionsPad))] PinBallOptionsPad pad)
-
 
59
        {
66
        {
60
            Header = Resources.Strings.Options_PinBallOptions_General;
67
            Header = Resources.Strings.Options_PinBallOptions_General;
-
 
68
        }
-
 
69
 
-
 
70
        [Import(CompositionPoints.PinBall.OptionsPad, typeof(PinBallOptionsPad))]
-
 
71
        private PinBallOptionsPad pad { get; set; }
-
 
72
 
-
 
73
        public void OnImportsSatisfied()
-
 
74
        {
61
            Pad = pad;
75
            Pad = pad;
62
        }
76
        }
63
    }
77
    }
64
}
78
}
65
 
79