示例#1
0
 public bool GetDoShow(IReportEmptiness data, bool showNormallyHiddenFields)
 {
     return(_enabled &&
            ((showNormallyHiddenFields ||
              (data != null && data.ShouldCountAsFilledForPurposesOfConditionalDisplay)) ||
             (_visibility == CommonEnumerations.VisibilitySetting.Visible ||
              _visibility == CommonEnumerations.VisibilitySetting.ReadOnly)));
 }
示例#2
0
        private int AddOneCustomField(PalasoDataObject target,
                                      Field customField,
                                      int insertAtRow,
                                      int rowCount)
        {
            IReportEmptiness data = target.GetProperty <IReportEmptiness>(customField.FieldName);

            if (!customField.GetDoShow(data, ShowNormallyHiddenFields))
            {
                return(rowCount);
            }
            Control box;

            switch (customField.DataTypeName)
            {
            case "Picture":
                box = MakePictureWidget(target, customField, _detailList);
                if (box == null)
                {
                    return(rowCount);                            // other code does the user notification
                }
                break;

            case "Flag":
                box = MakeCheckBoxWidget(target, customField);
                break;

            case "Option":
                box = MakeOptionWidget(target, customField);
                break;

            case "OptionCollection":
                box = MakeOptionCollectionWidget(target, customField);
                break;

            case "MultiText":
                box =
                    MakeBoundControl(
                        target.GetOrCreateProperty <MultiText>(customField.FieldName),
                        customField);
                break;

            default:
                LexRelationType lexRelType = GetRelationType(customField.DataTypeName);
                if (lexRelType != null)
                {
                    box = MakeRelationWidget(target, lexRelType, customField);
                }
                else
                {
                    throw new ApplicationException(
                              string.Format("WeSay doesn't understand how to layout a {0}",
                                            customField.DataTypeName));
                }
                break;
            }

            string label = StringCatalog.Get(customField.DisplayName);

            //for checkboxes, the label is part of the control
            if (customField.DataTypeName == "Flag")
            {
                label = string.Empty;
            }

            Control c = DetailList.AddWidgetRow(StringCatalog.Get(label),
                                                false,
                                                box,
                                                insertAtRow,
                                                false);

            DetailList.GetRow(c);
            ++rowCount;
            return(rowCount);
        }
示例#3
0
文件: Field.cs 项目: bbriggs/wesay
		public bool GetDoShow(IReportEmptiness data, bool showNormallyHiddenFields)
		{
			return _enabled &&
				   ((showNormallyHiddenFields ||
					 (data != null && data.ShouldCountAsFilledForPurposesOfConditionalDisplay)) ||
					(_visibility == CommonEnumerations.VisibilitySetting.Visible ||
					 _visibility == CommonEnumerations.VisibilitySetting.ReadOnly));
		}