Example #1
0
        public object this[String PropertyName]
        {
            get
            {
                Object val = null;
                PropertyName = PropertyName.ToUpper();

                if (PropertyName == "THIS")
                {
                    return(ParentObject ?? this);
                }

                if (StaticValues != null)
                {
                    if (StaticValues.TryGetValue(PropertyName, out val))
                    {
                        return(val);
                    }
                }

                DynamicValues.TryGetValue(PropertyName, out val);
                return(val);
            }
            set
            {
                PropertyName = PropertyName.ToUpper();

                if (PropertyName != "THIS")
                {
                    if (StaticValues != null && StaticValues.ContainsKey(PropertyName))
                    {
                        StaticValues = StaticValues;
                    }
                    else
                    {
                        DynamicValues[PropertyName] = value;
                    }
                }

                if (ValueChanged != null)
                {
                    ValueChanged.Invoke(this, new EventArgs());
                }
            }
        }
Example #2
0
        public object this[String PropertyName]
        {
            get
            {
                Object val = null;

#if CASE_INSENSITIVE
                PropertyName = PropertyName.ToUpper();

                if (DynamicValues.TryGetValue(PropertyName, out val))
                {
                    return(val);
                }

                if (PropertyName == "THIS")
                {
                    return(ParentObject ?? this);
                }
#else
                if (DynamicValues.TryGetValue(PropertyName, out val))
                {
                    return(val);
                }

                if (PropertyName == "this")
                {
                    return(ParentObject ?? this);
                }
#endif

                return(null);
            }
            set
            {
                //PropertyName = PropertyName.ToUpper();

                DynamicValues[PropertyName] = value;

                if (ValueChanged != null)
                {
                    ValueChanged.Invoke(this, new System.EventArgs());
                }
            }
        }