예제 #1
0
        /// <summary>Returns true if this code contains the field with the given name.</summary>
        public bool ContainsField(string fieldName)
        {
            if (string.IsNullOrEmpty(fieldName))
            {
                return(false);
            }

                        #if !NoNitroRuntime
            if (BaseScript != null)
            {
                return(BaseScript.ContainsField(fieldName));
            }
                        #endif

            // Grab the field off this type:

                        #if NETFX_CORE
            FieldInfo fInfo = GetType().GetTypeInfo().GetDeclaredField(fieldName.ToLower());
                        #else
            FieldInfo fInfo = GetType().GetField(fieldName.ToLower());
                        #endif

            // Field is contained if we found something:
            return(fInfo != null);
        }