Subversion Repositories SoapBoxCore

Rev

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

Rev 8 Rev 12
Line 40... Line 40...
40
    /// <summary>
40
    /// <summary>
41
    /// ViewModel for the Options Dialog
41
    /// ViewModel for the Options Dialog
42
    /// Inheriting from AbstractOptionsItem is just a hack
42
    /// Inheriting from AbstractOptionsItem is just a hack
43
    /// because it makes it easy to set the Items property.
43
    /// because it makes it easy to set the Items property.
44
    /// </summary>
44
    /// </summary>
45
    [Export("/Workbench/Tools/OptionsDialog", typeof(OptionsDialog))]
45
    [Export(CompositionPoints.Options.OptionsDialog, typeof(OptionsDialog))]
46
    class OptionsDialog : AbstractOptionsItem
46
    class OptionsDialog : AbstractOptionsItem, IPartImportsSatisfiedNotification
47
    {
47
    {
48
        [ImportingConstructor]
-
 
49
        public OptionsDialog(
48
        public OptionsDialog()
50
            [Import("/Services/LoggingService", typeof(ILoggingService))] ILoggingService l,
-
 
51
            [Import("/Services/ExtensionService")] IExtensionService extensionService,
-
 
52
            [ImportMany("/Workbench/Tools/OptionsDialog/OptionsItems", typeof(IOptionsItem))] IEnumerable<IOptionsItem> items)
-
 
53
        {
49
        {
54
            logger = l;
-
 
55
            Items = extensionService.Sort(items);
-
 
56
            OptionChanged += new EventHandler(OptionsDialog_OptionChanged);
50
            OptionChanged += new EventHandler(OptionsDialog_OptionChanged);
57
        }
51
        }
58
 
52
 
59
        void OptionsDialog_OptionChanged(object sender, EventArgs e)
53
        void OptionsDialog_OptionChanged(object sender, EventArgs e)
60
        {
54
        {
61
            m_dirtyCondition.SetCondition(true);
55
            m_dirtyCondition.SetCondition(true);
62
        }
56
        }
63
 
57
 
-
 
58
        [Import(Services.Logging.LoggingService, typeof(ILoggingService))]
64
        private ILoggingService logger { get; set; }
59
        private ILoggingService logger { get; set; }
65
 
60
 
-
 
61
        [Import(Services.Host.ExtensionService)]
-
 
62
        private IExtensionService extensionService { get; set; }
-
 
63
 
-
 
64
        [ImportMany(ExtensionPoints.Options.OptionsDialog.OptionsItems, typeof(IOptionsItem), AllowRecomposition=true)]
-
 
65
        private IEnumerable<IOptionsItem> items { get; set; }
-
 
66
 
-
 
67
        public void OnImportsSatisfied()
-
 
68
        {
-
 
69
            Items = extensionService.Sort(items);
-
 
70
        }
-
 
71
 
66
        [Import("/App/MainWindow")]
72
        [Import(CompositionPoints.Host.MainWindow)]
67
        private Lazy<Window> mainWindowExport { get; set; }
73
        private Lazy<Window> mainWindowExport { get; set; }
68
 
74
 
69
        /// <summary>
75
        /// <summary>
70
        /// Displays the Options Dialog as modal
76
        /// Displays the Options Dialog as modal
71
        /// </summary>
77
        /// </summary>