コード例 #1
0
        protected internal override void  discover(System.Type clazz, System.String propertyName)
        {
            try {
                Introspector introspector = rsvc.Introspector;
                property = introspector.getProperty(clazz, propertyName);
                if (property != null)
                {
                    if (property.PropertyType.Equals(typeof(Boolean)))
                    {
                        return;
                    }
                }

                /*
                 *  now the convenience, flip the 1st character
                 */
                propertyName = propertyName.Substring(0, 1).ToUpper() + propertyName.Substring(1);
                property     = introspector.getProperty(clazz, propertyName);
                if (property != null)
                {
                    if (property.PropertyType.Equals(typeof(Boolean)))
                    {
                        return;
                    }
                }

                property = null;
            } catch (System.Exception e) {
                rsvc.error("PROGRAMMER ERROR : BooleanPropertyExector() : " + e);
            }
        }
コード例 #2
0
ファイル: PropertyExecutor.cs プロジェクト: minskowl/MY
        protected internal virtual void discover(System.Type clazz, System.String propertyName)
        {
            /*
             *  this is gross and linear, but it keeps it straightforward.
             */

            try {
                Introspector introspector = rsvc.Introspector;
                propertyUsed = propertyName;
                property     = introspector.getProperty(clazz, propertyUsed);
                if (property != null)
                {
                    return;
                }

                /*
                 *  now the convenience, flip the 1st character
                 */
                propertyUsed = propertyName.Substring(0, 1).ToUpper() + propertyName.Substring(1);
                property     = introspector.getProperty(clazz, propertyUsed);
                if (property != null)
                {
                    return;
                }

                propertyUsed = propertyName.Substring(0, 1).ToLower() + propertyName.Substring(1);
                property     = introspector.getProperty(clazz, propertyUsed);
                if (property != null)
                {
                    return;
                }

                // check for a method that takes no arguments
                propertyUsed = propertyName;
                method       = introspector.getMethod(clazz, propertyUsed, new Object[0]);
                if (method != null)
                {
                    return;
                }

                // check for a method that takes no arguments, flipping 1st character
                propertyUsed = propertyName.Substring(0, 1).ToUpper() + propertyName.Substring(1);
                method       = introspector.getMethod(clazz, propertyUsed, new Object[0]);
                if (method != null)
                {
                    return;
                }

                propertyUsed = propertyName.Substring(0, 1).ToLower() + propertyName.Substring(1);
                method       = introspector.getMethod(clazz, propertyUsed, new Object[0]);
                if (method != null)
                {
                    return;
                }
            } catch (System.Exception e) {
                rsvc.error("PROGRAMMER ERROR : PropertyExector() : " + e);
            }
        }