Click here to Skip to main content
13,736,177 members
Click here to Skip to main content
Articles » Languages » C# » Windows Forms » Downloads

Stats

204.8K views
6.4K downloads
146 bookmarked
Posted 7 Jan 2016
Licenced CPOL

PropertyGrid utilities

, 7 Jan 2016
An article on sorting and globalization of properties in a PropertyGrid.
bin
FormsUtilsTest
FormsUtilsTest.exe
FormsUtils.dll
nl
FormsUtilsTest.resources.dll
FormsUtils
FormsUtils.dll
nl
FormsUtils.resources.dll
src
FormsUtils
FormsUtils.cmbx
FormsUtils.prjx
FormsUtilsKey.snk
FormsUtilsTest
FormsUtilsTest.cmbx
FormsUtilsTest.prjx
SomeOtherResources.resources
FormsUtils.dll
FormsUtilsTest.exe
nl
FormsUtils.resources.dll
FormsUtilsTest.resources.dll
FormsUtilsTest
FormsUtilsTest.SomeClassWithProperties.nl.resources
FormsUtilsTest.cmbx
FormsUtilsTest.prjx
MainForm.resources
MyNameSpace.MainForm.resources
MyNameSpace.PropertyGridUtilTest.resources
MyNameSpace.SomeClassWithProperties.resources
PropertyGridUtilTest.resources
SomeClassWithProperties.resources
SomeOtherResources.resources
FormsUtils
CustomPropertyGrid.nl.resources
CustomPropertyGrid.resources
FormsUtils.CustomPropertyGrid.resources
FormsUtilsKey.snk
PropertyGridUtils
bin
nl
PropertyGridUtils.resources.dll
PropertyGridUtils.dll
PropertyGridUtils.cmbx
PropertyGridUtils.CustomPropertyGrid.nl.resources
PropertyGridUtils.CustomPropertyGrid.resources
PropertyGridUtils.prjx
PropertyGridUtilsKey.snk
PropertyGridUtilsTest
bin
nl
PropertyGridUtils.resources.dll
PropertyGridUtilsTest.resources.dll
PropertyGridUtils.dll
PropertyGridUtilsTest.exe
MyNameSpace.MainForm.resources
MyNameSpace.PropertyGridUtilTest.resources
MyNameSpace.SomeClassWithProperties.nl.resources
MyNameSpace.SomeClassWithProperties.resources
PropertyGridUtilsTest.cmbx
PropertyGridUtilsTest.prjx
SomeOtherResources.resources
// Original ripped from Gerd Klevesaat,
// http://www.codeguru.com/Csharp/Csharp/cs_controls/propertygrid/comments.php/c4795
//
// Made minor improvements.
//
// (c) 2004 Wout de Zeeuw

using System;
using System.Resources;

namespace FormsUtils
{
	/// <summary>
	/// Optional attribute for detailed specification of where
	/// <see cref="PropertiesDeluxeTypeConverter"/> should look for its resources.
	/// </summary>
	/// <remarks>
	/// See also <seealso cref="GlobalizedTypeAttribute"/>
	/// </remarks>
    [AttributeUsage(AttributeTargets.Property)]
	public class GlobalizedPropertyAttribute : Attribute
	{
	    private string baseName;
	    private string displayNameId;
	    private string descriptionId;
	    private string categoryId;

        /// <summary>
        /// Place where <see cref="ResourceManager"/> can find its resources.
        /// </summary>
        public string BaseName {
            get {
                return baseName;
            }
            set {
                baseName = value;
            }
        }

        /// <summary>
        /// Resource name for a property's DisplayName.
        /// </summary>
        public string DisplayNameId {
            get {
                return displayNameId;
            }
            set {
                displayNameId = value;
            }
        }

        /// <summary>
        /// Resource name for a property's Description.
        /// </summary>
        public string DescriptionId {
            get {
                return descriptionId;
            }
            set {
                descriptionId = value;
            }
        }

        /// <summary>
        /// Resource name for a property's Category.
        /// </summary>
        public string CategoryId {
            get {
                return categoryId;
            }
            set {
                categoryId = value;
            }
        }
	}
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

wout de zeeuw
Software Developer (Senior)
Netherlands Netherlands
Wout works as a freelancer based in the Netherlands. His interests are .NET, 3D, DWG, DXF, OpenGL, Computational Geometry and playing Tank Ball!

One of his latest private projects is a commercial DWG DXF .NET library and small DWG DXF viewing application.

You may also be interested in...

Permalink | Advertise | Privacy | Cookies | Terms of Use | Mobile
Web01-2016 | 2.8.180920.1 | Last Updated 7 Jan 2016
Article Copyright 2016 by wout de zeeuw
Everything else Copyright © CodeProject, 1999-2018
Layout: fixed | fluid