Наследование: ICustomFieldInfo, ICustomFieldConfigHolder
Пример #1
0
		public Field(Field other)
		{
			Name = other.Name;
			EntityFieldName = other.EntityFieldName;
			FieldType = other.FieldType;
			Required = other.Required;
			Value = other.Value;
			DefaultValue = other.DefaultValue;
			CalculationModel = other.CalculationModel;
			Units = other.Units;
			Items = new List<string>(other.Items);
		}
		private static string AppendCustomFields(string initialValue, Field[] customFieldsMetaInfo)
		{
			if (customFieldsMetaInfo == null) return initialValue;
			var result = new StringBuilder(initialValue);
			foreach (
				var cfValue in
					customFieldsMetaInfo
						.Where(x =>
							x.FieldType == FieldTypeEnum.Text || x.FieldType == FieldTypeEnum.RichText ||
							x.FieldType == FieldTypeEnum.DropDown || x.FieldType == FieldTypeEnum.TemplatedURL)
						.Where(x => !string.IsNullOrEmpty(x.Value)).Select(x => x.Value))
			{
				result.AppendFormat(" {0}", cfValue);
			}

			foreach (
				var cfValue in
					customFieldsMetaInfo.Where(x => x.FieldType == FieldTypeEnum.MultipleSelectionList)
						.SelectMany(x => x.ParseMultipleSelectionListFieldValue()))
			{
				result.AppendFormat(" {0}", cfValue);
			}

			return result.ToString();
		}
Пример #3
0
		public bool Equals(Field other)
		{
			if (ReferenceEquals(null, other)) return false;
			if (ReferenceEquals(this, other)) return true;
			return Equals(other.Name, Name)
			       && Equals(other.FieldType, FieldType)
			       && Equals(other.Value, Value);
		}