|
namespace ChoRegistrySectionHandler.Test
{
#region NameSpaces
using System;
using Cinchoo.Core.Configuration;
using Cinchoo.Core;
using Cinchoo.Core.Shell;
using Microsoft.Win32;
using System.Collections.Generic;
using System.Text;
#endregion NameSpaces
[ChoTypeFormatter("Application Settings")]
[ChoRegistryConfigurationSection("registrySectionHandlerTest/applicationSettings", @"HKCU\Software\Test")]
public class ApplicationSettings : ChoConfigurableObject
{
#region Instance Data Members (Public)
[ChoPropertyInfo("STREET")]
public string Street = "25, Melbloum Lane";
[ChoPropertyInfo("CITY", DefaultValue = "Edison")]
public string City;
[ChoPropertyInfo("STATE", DefaultValue = "NJ")]
public string State;
[ChoPropertyInfo("ZIP", DefaultValue = "08837")]
public string Zip;
[ChoPropertyInfo("BYTE_ZIP", DefaultValue = "1, 0")]
[ChoMemberRegistryInfo(RegistryValueKind.Binary)]
[ChoTypeConverter(typeof(ChoByteArrayToStringConverter))]
public byte[] ByteZip;
[ChoPropertyInfo("MULTI_VALUE", DefaultValue = "L1, L2")]
[ChoMemberRegistryInfo(RegistryValueKind.MultiString)]
[ChoTypeConverter(typeof(ChoArrayToStringConverter))]
public string[] MultiValue;
[ChoPropertyInfo("EXP_STRING", DefaultValue = @"%WinDir%\Raj")]
[ChoMemberRegistryInfo(RegistryValueKind.ExpandString)]
public string ExpString;
[ChoPropertyInfo("DWORD_VALUE", DefaultValue = "123")]
[ChoMemberRegistryInfo(RegistryValueKind.DWord)]
public int DWordValue = 123;
[ChoPropertyInfo("QWORD_VALUE", DefaultValue = "64")]
[ChoMemberRegistryInfo(RegistryValueKind.QWord)]
public Int64 QWordValue = 123;
#endregion
[ChoAfterConfigurationObjectLoadedHandler]
void OnAfterConfigurationObjectLoaded(object sender, ChoConfigurationObjectEventArgs e)
{
using (ChoConsoleSession console = new ChoConsoleSession(ConsoleColor.Green))
{
console.WriteLine(sender.ToString());
}
}
[ChoConfigurationObjectLoadErrorHandler]
void OnConfigurationObjectLoadError(object sender, ChoConfigurationObjectErrorEventArgs e)
{
using (ChoConsoleSession console = new ChoConsoleSession(ConsoleColor.Red))
{
console.WriteLine(e.Exception.ToString());
}
}
}
}
|
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.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.