~halega/+junk/sharpdevelop

« back to all changes in this revision

Viewing changes to src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/PropertyGrid/TypeEditorAttribute.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
using System;
 
5
 
 
6
namespace ICSharpCode.WpfDesign.PropertyGrid
 
7
{
 
8
        /// <summary>
 
9
        /// Attribute to specify that the decorated class is a editor for properties with the specified
 
10
        /// return type.
 
11
        /// </summary>
 
12
        [AttributeUsage(AttributeTargets.Class, AllowMultiple=true, Inherited=false)]
 
13
        public sealed class TypeEditorAttribute : Attribute
 
14
        {
 
15
                readonly Type supportedPropertyType;
 
16
                
 
17
                /// <summary>
 
18
                /// Creates a new TypeEditorAttribute that specifies that the decorated class is a editor
 
19
                /// for properties with the return type "<paramref name="supportedPropertyType"/>".
 
20
                /// </summary>
 
21
                public TypeEditorAttribute(Type supportedPropertyType)
 
22
                {
 
23
                        if (supportedPropertyType == null)
 
24
                                throw new ArgumentNullException("supportedPropertyType");
 
25
                        this.supportedPropertyType = supportedPropertyType;
 
26
                }
 
27
                
 
28
                /// <summary>
 
29
                /// Gets the supported property type.
 
30
                /// </summary>
 
31
                public Type SupportedPropertyType {
 
32
                        get { return supportedPropertyType; }
 
33
                }
 
34
        }
 
35
}