示例#1
0
        private void AddNameAndUrlName(List <string> fieldNames, ContentView cv, IDictionary <string, Field> fields)
        {
            if (ContentListFieldsOnly)
            {
                return;
            }

            // name and urlname comes first
            if (ExcludedList == null || !ExcludedList.Contains("DisplayName"))
            {
                var nameField = fieldNames.Where(f => f == "DisplayName").FirstOrDefault();
                if (nameField != null)
                {
                    Field field = null;
                    if (fields.TryGetValue(nameField, out field))
                    {
                        AddFieldControl(cv, field);
                    }
                }
            }
            if (ExcludedList == null || !ExcludedList.Contains("Name"))
            {
                var urlNameField = fieldNames.Where(f => f == "Name").FirstOrDefault();
                if (urlNameField != null)
                {
                    Field field = null;
                    if (fields.TryGetValue(urlNameField, out field))
                    {
                        AddFieldControl(cv, field);
                    }
                }
            }
        }
示例#2
0
        private void AddAllFields(ContentView cv, IDictionary <string, Field> fields)
        {
            var visibleFieldNames = GetVisibleFieldNames(this.Content, this.ContentView.ViewMode);

            AddNameAndUrlName(visibleFieldNames, cv, fields);

            foreach (var fieldName in visibleFieldNames)
            {
                if (fieldName == "Name" || fieldName == "DisplayName")
                {
                    continue;
                }

                if (ExcludedList != null && ExcludedList.Contains(fieldName))
                {
                    continue;
                }

                if (ContentListFieldsOnly && !fieldName.StartsWith("#"))
                {
                    continue;
                }

                Field field;
                if (!fields.TryGetValue(fieldName, out field))
                {
                    continue;
                }

                AddFieldControl(cv, field);
            }

            if (EnablePaging)
            {
                AddThankYouPage();
            }
        }