Exemplo n.º 1
0
        public virtual T1 GetProperty <T1>(int key)
        {
            Object property;

            if ((property = properties.Get(key)) != null || properties.ContainsKey(key))
            {
                return((T1)property);
            }
            if (modelElement != null && ((property = modelElement.GetProperty <T1>(key)) != null ||
                                         modelElement.HasProperty(key)))
            {
                return((T1)property);
            }
            // TODO in some situations we will want to check inheritance with additional info, such as parent and descendant.
            if (parent != null && Property.IsPropertyInherited(key) && (property = parent.GetProperty <T1>(key)) != null)
            {
                return((T1)property);
            }
            property = this.GetDefaultProperty <T1>(key);
            if (property != null)
            {
                return((T1)property);
            }
            return(modelElement != null?modelElement.GetDefaultProperty <T1>(key) : (T1)(Object
                                                                                         )null);
        }