Click here to Skip to main content
15,881,089 members
Articles / Programming Languages / C#

Data Binding an Enum with Descriptions

Rate me:
Please Sign up or sign in to vote.
4.46/5 (67 votes)
30 Dec 2007CPOL4 min read 304.5K   2.6K   159  
A simple solution for binding an enum to a UI control using data binding.
// ---------------------------------------------------------------------------
// Campari Software
//
// AssemblyInfo.cs
//
// Provides a cental location for Assembly attributes. Assembly attributes 
// are values that provide information about an assembly. The attributes are
// divided into the following sets of information: 
//
//    * Assembly identity attributes. 
//    * Informational attributes. 
//    * Assembly manifest attributes. 
//    * Strong name attributes. 
//
// ---------------------------------------------------------------------------
// Copyright (C) 2006 Campari Software
// All rights reserved.
//
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY
// OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT
// LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR
// FITNESS FOR A PARTICULAR PURPOSE.
// ---------------------------------------------------------------------------
using System;
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Security.Permissions;

#region Assembly identity attributes
[assembly: SatelliteContractVersionAttribute("1.0.0.0")]
#endregion

#region Informational attributes

// String value specifying the Win32 file version number. This normally defaults to the assembly version.
// [assembly: AssemblyFileVersion("")] 

// String value specifying version information that is not used by the runtime, such as a full product version number.
// [assembly: AssemblyInformationalVersionAttribute("")] 
// [assembly: SecurityPermission(SecurityAction.RequestMinimum, UnmanagedCode = false)]
[assembly:CLSCompliant(true)]
[assembly:ComVisible(false)]

#endregion

#region Assembly manifest attributes

#if Debug
[assembly: AssemblyConfiguration("Debug")]
#else
[assembly: AssemblyConfiguration("Release")]
#endif

// String value specifying a default alias to be used by referencing assemblies. This value provides
// a friendly name when the name of the assembly itself is not friendly (such as a GUID value). This
// value can also be used as a short form of the full assembly name.
// [assembly: AssemblyDefaultAliasAttribute("")]

[assembly: AssemblyDescription("Provides core functionality.")]
[assembly: AssemblyTitle("Campari Software Common Library for .NET 2.0 Core")]

#endregion

#region Strong name attributes

[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("")]
[assembly: AssemblyKeyName("")]

#endregion

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)


Written By
Software Developer (Senior)
United States United States
I am a Microsoft C# MVP, author, speaker, blogger, and software developer. I also created the WP Requests and WinStore Requests sites for Windows Phone and Windows Sotre apps as well as several open source projects.

I've been involved with computers in one way or another for as long as I can remember, but started professionally in 1993. Although my primary focus right now is commercial software applications, I prefer building infrastructure components, reusable shared libraries and helping companies define, develop and automate process and code standards and guidelines.

Comments and Discussions