Go to the documentation of this file.00001 using System;
00002 using System.Collections.Generic;
00003 using System.Linq;
00004 using System.Text;
00005 using System.Configuration;
00006
00007 namespace N2.Configuration
00008 {
00009 public class AssemblyElement : ConfigurationElement, IIdentifiable
00010 {
00011 static ConfigurationPropertyCollection properties;
00012 static ConfigurationProperty propAssembly;
00013
00014 static AssemblyElement()
00015 {
00016 propAssembly = new ConfigurationProperty("assembly", typeof(string), null, null, new StringValidator(1, 9999), ConfigurationPropertyOptions.IsKey | ConfigurationPropertyOptions.IsRequired);
00017 properties = new ConfigurationPropertyCollection();
00018 properties.Add(propAssembly);
00019 }
00020
00021 public AssemblyElement()
00022 {
00023 }
00024
00025 public AssemblyElement(string assemblyName)
00026 {
00027 Assembly = assemblyName;
00028 }
00029
00030 [StringValidator(MinLength = 1), ConfigurationProperty("assembly", IsRequired = true, IsKey = true, DefaultValue = "")]
00031 public string Assembly
00032 {
00033 get { return (string)base[propAssembly]; }
00034 set { base[propAssembly] = value; }
00035 }
00036
00037 protected override ConfigurationPropertyCollection Properties
00038 {
00039 get { return properties; }
00040 }
00041
00042 #region IIdentifiable Members
00043
00044 object IIdentifiable.ElementKey
00045 {
00046 get { return Assembly; }
00047 set { Assembly = (string)value; }
00048 }
00049
00050 #endregion
00051 }
00052 }