public FileTypeElement() { s_extension = new ConfigurationProperty( "Extension", typeof(string), null, ConfigurationPropertyOptions.IsRequired | ConfigurationPropertyOptions.IsKey); s_connectionString = new ConfigurationProperty( "ConnectionString", typeof(string)); InnerProperties.Add(s_extension); InnerProperties.Add(s_connectionString); }
/*=========================*/ #endregion #region Constructor /*=========================*/ public PhaseElement() { s_name = new ConfigurationProperty( "Name", typeof(string), null, ConfigurationPropertyOptions.IsRequired | ConfigurationPropertyOptions.IsKey); s_handlerType = new ConfigurationProperty( "HandlerType", typeof(string), null, ConfigurationPropertyOptions.IsRequired); InnerProperties.Add(s_name); InnerProperties.Add(s_handlerType); }
/*=========================*/ #endregion #region Constructor /*=========================*/ public DirectoryElement() { s_path = new ConfigurationProperty( "Path", typeof(string), null, ConfigurationPropertyOptions.IsRequired | ConfigurationPropertyOptions.IsKey); /* * s_handler = new ConfigurationProperty( * "HandlerService", * typeof(ElementReference<ServiceElement>), * new ElementReference<ServiceElement>(), * new Easynet.Edge.Core.Configuration.Converters.ElementReferenceConverter<ServiceElement>(this, "HandlerService"), * null, * ConfigurationPropertyOptions.IsRequired); */ s_handler = new ConfigurationProperty( "HandlerService", typeof(string), null, ConfigurationPropertyOptions.IsRequired); s_filter = new ConfigurationProperty( "Filter", typeof(string)); s_includeSubdirs = new ConfigurationProperty( "IncludeSubdirectories", typeof(bool), true); s_handlerParameters = new ConfigurationProperty( "HandlerServiceParameters", typeof(string), String.Empty); InnerProperties.Add(s_path); InnerProperties.Add(s_handler); InnerProperties.Add(s_filter); InnerProperties.Add(s_includeSubdirs); InnerProperties.Add(s_handlerParameters); }
protected bool TryGetMember(string name, Type type, out object result) { object value = null; name = getInnerName(name); bool success = String.IsNullOrEmpty(name) ? false : InnerProperties.TryGetValue(name, out value); if (!success) { if (AllowMissingProperties) { if (type == typeof(object)) { result = MissingPropertyValue; } else { result = Types.DefaultValue(type); } success = true; } else { throw new MissingMemberException("There is no property named \"" + name + "\"."); } } else { if (type == typeof(object)) { result = value; } else { result = Types.Parse(value, type); } } return(success); }
bool ICollection <KeyValuePair <string, object> > .Remove(KeyValuePair <string, object> item) { return(InnerProperties.Remove(item)); }
void ICollection <KeyValuePair <string, object> > .CopyTo(KeyValuePair <string, object>[] array, int arrayIndex) { InnerProperties.CopyTo(array, arrayIndex); }
bool ICollection <KeyValuePair <string, object> > .Contains(KeyValuePair <string, object> item) { return(InnerProperties.Contains(item)); }
void ICollection <KeyValuePair <string, object> > .Clear() { InnerProperties.Clear(); }
bool IDictionary <string, object> .Remove(string key) { return(InnerProperties.Remove(key)); }
bool IDictionary <string, object> .ContainsKey(string key) { return(InnerProperties.ContainsKey(key)); }
//public override bool TryBinaryOperation(BinaryOperationBinder binder, object arg, out object result) //{ // if (binder.Operation == System.Linq.Expressions.ExpressionType.Equal) // { // JsObject compare = arg.ToExpando(); // return this.Equals(arg); // } // else // { // return base.TryBinaryOperation(binder, arg, out result); // } //} public IEnumerator <KeyValuePair <string, object> > GetEnumerator() { return(InnerProperties.GetEnumerator()); }
public bool Delete(string name) { return(InnerProperties.Remove(getInnerName(name))); }
public bool HasProperty(string name) { return(InnerProperties.ContainsKey(getInnerName(name))); }