Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?xml version="1.0" encoding="utf-8" ?>
- <CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
- <CodeSnippet Format="1.0.0">
- <Header>
- <Title>AH List Data Item</Title>
- <Shortcut>ahList_DataItem</Shortcut>
- <Description>Code snippet for creating a ListDataItem class</Description>
- <Author>Andrew Hodgson</Author>
- <SnippetTypes>
- <SnippetType>Expansion</SnippetType>
- </SnippetTypes>
- </Header>
- <Snippet>
- <Code Language="csharp">
- <![CDATA[
- #region ListDataItem class
- public class ListDataItem<KeyType> {
- KeyType _key;
- string _display;
- public KeyType Key {
- get {
- return _key;
- }
- set {
- _key = value;
- }
- }
- public string Display {
- get {
- return _display;
- }
- set {
- _display = value;
- }
- }
- public override string ToString() {
- return Display;
- }
- public ListDataItem() {}
- public ListDataItem(KeyType keyValue,string displayValue) {
- Key = keyValue;
- Display = displayValue;
- }
- public ListDataItem(string displayValue) {
- Display = displayValue;
- Key = default(KeyType);
- }
- }
- #endregion
- ]]>
- </Code>
- </Snippet>
- </CodeSnippet>
- </CodeSnippets>
Advertisement
Add Comment
Please, Sign In to add comment