Example #1
0
        public static FormField GetFormField(this ListFieldIterator listFieldITerator, List <FormField> formFields, SPField field)
        {
            FormField ff = (from form in formFields
                            where form.Field.Equals(field)
                            select form).FirstOrDefault();

            return(ff);
        }
Example #2
0
        public static List <FormField> GetFormField(this ListFieldIterator listFieldITerator, List <FormField> formFields, Type fieldType)
        {
            List <FormField> fields = (from form in formFields
                                       where form.Field.GetType().Equals(fieldType)
                                       select form).ToList <FormField>();

            return(fields);
        }
Example #3
0
        public static List <FormField> GetFormFields(this ListFieldIterator listFieldIterator)
        {
            if (listFieldIterator == null)
            {
                return(null);
            }

            return(FindFieldFormControls(listFieldIterator));
        }
Example #4
0
        public static FormField GetFormField(this ListFieldIterator listFieldIterator, List <FormField> formFields, string fieldName)
        {
            FormField formField = (from form in formFields
                                   where form.FieldName.Equals(fieldName, StringComparison.InvariantCultureIgnoreCase)
                                   select form).FirstOrDefault();

            if (formField == null)
            {
                throw new Exception("Could not find form field: " + fieldName);
            }

            return(formField);
        }
Example #5
0
 public static FormField GetFormField(this ListFieldIterator listFieldIterator, string fieldName)
 {
     return(GetFormField(listFieldIterator, GetFormFields(listFieldIterator), fieldName));
 }
Example #6
0
 public static List <FormField> GetFormFieldByType(this ListFieldIterator listFieldIterator, Type fieldType)
 {
     return(GetFormField(listFieldIterator, GetFormFields(listFieldIterator), fieldType));
 }
Example #7
0
 public static FormField GetFormFieldByField(this ListFieldIterator listFieldIterator, SPField field)
 {
     return(GetFormField(listFieldIterator, GetFormFields(listFieldIterator), field));
 }
 protected virtual bool IsFieldExcluded(SPControlMode controlMode, SPField field) {
     var fieldIterator = new ListFieldIterator();
     fieldIterator.ControlMode = controlMode;
     MethodInfo IsFieldExcluded = typeof(ListFieldIterator).GetMethod("IsFieldExcluded", BindingFlags.NonPublic | BindingFlags.Instance);
     return (bool)IsFieldExcluded.Invoke(fieldIterator, new object[] { field });
 }