示例#1
0
        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);
        }
示例#4
0
        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);
        }
示例#5
0
 bool ICollection <KeyValuePair <string, object> > .Remove(KeyValuePair <string, object> item)
 {
     return(InnerProperties.Remove(item));
 }
示例#6
0
 void ICollection <KeyValuePair <string, object> > .CopyTo(KeyValuePair <string, object>[] array, int arrayIndex)
 {
     InnerProperties.CopyTo(array, arrayIndex);
 }
示例#7
0
 bool ICollection <KeyValuePair <string, object> > .Contains(KeyValuePair <string, object> item)
 {
     return(InnerProperties.Contains(item));
 }
示例#8
0
 void ICollection <KeyValuePair <string, object> > .Clear()
 {
     InnerProperties.Clear();
 }
示例#9
0
 bool IDictionary <string, object> .Remove(string key)
 {
     return(InnerProperties.Remove(key));
 }
示例#10
0
 bool IDictionary <string, object> .ContainsKey(string key)
 {
     return(InnerProperties.ContainsKey(key));
 }
示例#11
0
        //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());
        }
示例#12
0
 public bool Delete(string name)
 {
     return(InnerProperties.Remove(getInnerName(name)));
 }
示例#13
0
 public bool HasProperty(string name)
 {
     return(InnerProperties.ContainsKey(getInnerName(name)));
 }