~halega/+junk/sharpdevelop

« back to all changes in this revision

Viewing changes to src/AddIns/DisplayBindings/FormsDesigner/Project/Src/Services/DefaultServiceContainer.cs

  • Committer: sk
  • Date: 2011-09-10 05:17:57 UTC
  • Revision ID: halega@halega.com-20110910051757-qfouz1llya9m6boy
4.1.0.7915 Release Candidate 1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
 
2
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
 
3
 
 
4
/*
 
5
 * Currently known logged missing services for the Windows.Forms designer:
 
6
 * 
 
7
 * System.ComponentModel.ContainerFilterService
 
8
 *              can modify (filter) a component collection
 
9
 *              not needed
 
10
 * 
 
11
 * System.ComponentModel.TypeDescriptionProvider
 
12
 *              can modify the type information of components at runtime
 
13
 *              probably not needed
 
14
 * 
 
15
 * System.ComponentModel.Design.DesignerCommandSet
 
16
 * System.ComponentModel.Design.DesignerActionService
 
17
 * System.ComponentModel.Design.DesignerActionUIService
 
18
 *              these seem to be added automatically when required
 
19
 *              for managing designer verbs and smart tags
 
20
 * 
 
21
 * System.ComponentModel.Design.Serialization.ComponentCache
 
22
 *              added automatically at some stage during code generation
 
23
 *              by an internal code serializer class
 
24
 * 
 
25
 * System.Windows.Forms.Design.IMenuEditorService
 
26
 *              required for editing .NET 1.x Menus (?), not supported by SharpDevelop
 
27
 * 
 
28
 * System.Windows.Forms.Design.ISelectionUIService
 
29
 *              added automatically by ComponentDocumentDesigner or ComponentTray
 
30
 * 
 
31
 * System.Windows.Forms.Design.IWindowsFormsEditorService
 
32
 *              provided by the PropertyGrid, the designer seems to find this somehow
 
33
 * 
 
34
 * 
 
35
 * System.ComponentModel.Design.IDesignerEventService
 
36
 *              provided by the DesignSurfaceManager
 
37
 *              (this is only logged as missing because the DesignSurfaceManager tries the external service provider first)
 
38
 * 
 
39
 * 
 
40
 * During unloading of the designer some standard services like IDesignerHost are
 
41
 * logged as missing as they have already been removed. This is probably expected.
 
42
 * 
 
43
*/
 
44
 
 
45
 
 
46
// Uncomment the following line to log all service requests
 
47
//#define WFDESIGN_LOG_SERVICE_REQUESTS
 
48
 
 
49
 
 
50
using System;
 
51
using System.ComponentModel.Design;
 
52
 
 
53
using ICSharpCode.Core;
 
54
 
 
55
namespace ICSharpCode.FormsDesigner.Services
 
56
{
 
57
        public sealed class DefaultServiceContainer : ServiceContainer
 
58
        {
 
59
                public DefaultServiceContainer()
 
60
                        : base()
 
61
                {
 
62
                }
 
63
                
 
64
                public DefaultServiceContainer(IServiceContainer parent)
 
65
                        : base(parent)
 
66
                {
 
67
                }
 
68
                
 
69
                #if WFDESIGN_LOG_SERVICE_REQUESTS
 
70
                public override object GetService(Type serviceType)
 
71
                {
 
72
                        object service = base.GetService(serviceType);
 
73
                        if (service == null) {
 
74
                                LoggingService.InfoFormatted("request missing service : {0} from Assembly {1} is not available.", serviceType, serviceType.Assembly.FullName);
 
75
                        } else {
 
76
                                LoggingService.DebugFormatted("get service : {0} from Assembly {1}.", serviceType, serviceType.Assembly.FullName);
 
77
                        }
 
78
                        return service;
 
79
                }
 
80
                #endif
 
81
        }
 
82
}