public void AddFieldInfoToCache(IDataFieldInfo fieldInfo) { if (fieldInfo != null) { this.cachedFieldDescriptions[fieldInfo.Name] = fieldInfo; } }
/// <summary> /// Deep copies content from src instance to this. /// <param name="source">Source for copy.</param> /// <returns>this.</returns> /// </summary> protected override IRecordInterface CopyFromImpl(IRecordInfo source) { base.CopyFromImpl(source); if (typeof(IDataFieldInfo).IsInstanceOfType(source)) { IDataFieldInfo typedSource = ((IDataFieldInfo)(source)); if ((typedSource.DataType != null)) { if (((this.DataType == null) || (this.DataType.GetType() == typedSource.DataType.GetType()))) { this.DataType = ((DataType)(typedSource.DataType.Clone())); } else { this.DataType.CopyFrom(typedSource.DataType); } } else { this.DataType = null; } } return(this); }
private DataGridColumn CreateColumn(IDataFieldInfo fieldInfo) { var context = new GenerateColumnContext(); if (fieldInfo != null) { context.FieldInfo = fieldInfo; } this.GridView.CommandService.ExecuteCommand(CommandId.GenerateColumn, context); if (context.Result == null) { // user have not specified a result, we assume that this means to skip the current column return(null); } DataGridTypedColumn typedColumn = context.Result as DataGridTypedColumn; if (typedColumn != null) { typedColumn.PropertyInfo = fieldInfo; } context.Result.IsAutoGenerated = true; return(context.Result); }
private void CheckDataDescriptorsCompatibility(IList descriptors) { // group descriptors for (int i = 0; i < descriptors.Count; i++) { var descriptor = descriptors[i] as DataDescriptor; if (descriptor.IsDelegate) { continue; } IDataFieldInfo field = null; if (this.CurrentDataProvider.FieldDescriptions != null) { field = this.CurrentDataProvider.FieldDescriptions.GetFieldDescriptionByMember(descriptor.EngineDescription.PropertyName); } if (field == null || !field.Equals(descriptor.EngineDescription.MemberAccess as IDataFieldInfo)) { // descriptor is incompatible, remove it descriptors.RemoveAt(i); i--; } } }
public bool Equals(IDataFieldInfo info) { var propertyField = info as PropertyInfoFieldInfo; if (propertyField == null) { return(false); } return(propertyField.propertyInfo.DeclaringType.GetTypeInfo().IsAssignableFrom(this.propertyInfo.DeclaringType.GetTypeInfo())); }
/// <inheritdoc /> internal override IGroupDescription GetGroupDescriptionForFieldDescription(IDataFieldInfo description) { if (description == null) { throw new ArgumentNullException(nameof(description)); } return(new PropertyGroupDescription() { PropertyName = description.Name }); }
/// <inheritdoc /> internal override SortDescription GetSortDescriptionForFieldDescription(IDataFieldInfo description) { if (description == null) { throw new ArgumentNullException("description"); } return(new PropertySortDescription() { PropertyName = description.Name }); }
public bool Equals(IDataFieldInfo info) { var propertyField = info as TypedDictionaryFieldInfo; if (propertyField == null) { return(false); } return(string.Compare(_name, propertyField._name, StringComparison.OrdinalIgnoreCase) == 0 && _dataType.Equals(propertyField._dataType)); }
public bool Equals(IDataFieldInfo info) { // TODO: return(false); ////var expandoField = info as ExpandoObjectFieldInfo; ////if (expandoField == null) ////{ //// return false; ////} ////return this.name == expandoField.Name; }
private void UpdatePropertyInfo(string path) { if (this.propertyInfo == null) { return; } if (this.propertyInfo.Name != path) { if (this.Model != null && this.Model.FieldInfoData != null) { this.propertyInfo = this.Model.FieldInfoData.GetFieldDescriptionByMember(this.PropertyName); } this.UpdateHeader(); } }
public bool Equals(IDataFieldInfo info) { var expandoField = info as ExpandoObjectFieldInfo; if (expandoField == null) { return(false); } if (this.name != expandoField.Name) { return(false); } return(this.dataType == expandoField.dataType); }
/// <inheritdoc /> internal override IGroupDescription GetGroupDescriptionForFieldDescription(IDataFieldInfo description) { if (description == null) { throw new ArgumentNullException(nameof(description)); } ////if (FieldInfoHelper.IsNumericType(description.DataType)) ////{ //// return new DoubleGroupDescription() { PropertyName = description.Name }; ////} ////if (description.DataType == typeof(DateTime) || description.DataType == typeof(Nullable<DateTime>)) ////{ //// return new DateTimeGroupDescription() { PropertyName = description.Name }; ////} return(new PropertyGroupDescription() { PropertyName = description.Name }); }
private void SetPropertyInfo() { string propertyName = this.PropertyName; this.PropertyInfo = this.Model.FieldInfoData.GetFieldDescriptionByMember(propertyName); int dotIndex = propertyName.IndexOf("."); if (this.propertyInfo == null && dotIndex != -1) { string parentPath = propertyName.Substring(0, dotIndex); var parentFieldInfo = this.Model.FieldInfoData.GetFieldDescriptionByMember(parentPath); if (parentFieldInfo != null) { IDataFieldInfo info = GridModel.InitializePropertyInfo(propertyName, parentFieldInfo.DataType, parentFieldInfo.RootClassType); if (info != null) { this.PropertyInfo = info; this.Model.FieldInfoData.AddFieldInfoToCache(info); } } } }
internal static void UpdateFilterMemberAccess(IFieldInfoData data, IEnumerable <FilterDescriptorBase> descriptors) { foreach (var filterDescriptor in descriptors) { var propertyFilterDescriptor = filterDescriptor as PropertyFilterDescriptor; if (propertyFilterDescriptor != null) { IDataFieldInfo field = data.GetFieldDescriptionByMember(propertyFilterDescriptor.PropertyName); if (field != null) { propertyFilterDescriptor.MemberAccess = field as IMemberAccess; } } else { var compositeFilter = filterDescriptor as CompositeFilterDescriptor; if (compositeFilter != null) { UpdateFilterMemberAccess(data, compositeFilter.Descriptors); } } } }
private void UpdateColumnFieldInfo(FieldInfoNode fieldInfoNode) { foreach (var column in this.columns) { var typedColumn = column as DataGridTypedColumn; if (typedColumn != null && !typedColumn.IsAutoGenerated) { IDataFieldInfo fieldInfo = fieldInfoNode.FieldInfo; if (typedColumn.PropertyName == fieldInfo.Name) { typedColumn.PropertyInfo = fieldInfoNode.FieldInfo; } else if (typedColumn.PropertyName.Contains(NestedPropertySeparator)) { IDataFieldInfo info = GridModel.InitializePropertyInfo(typedColumn.PropertyName, fieldInfo.DataType, fieldInfo.RootClassType); if (info != null) { typedColumn.PropertyInfo = info; this.FieldInfoData.AddFieldInfoToCache(info); } } } } }
/// <inheritdoc /> internal abstract IGroupDescription GetGroupDescriptionForFieldDescription(IDataFieldInfo description);
public void AddFieldInfoToCache(IDataFieldInfo fieldInfo) { }
/// <summary> /// Initializes a new instance of the <see cref="FieldInfoNode"/> class. /// </summary> /// <param name="info">The <see cref="IDataFieldInfo"/> associated with this node.</param> public FieldInfoNode(IDataFieldInfo info) : base(info.Name, info.DisplayName, ContainerNodeRole.Selectable) { this.FieldInfo = info; }
IAggregateDescription IDataProvider.GetAggregateDescriptionForFieldDescription(IDataFieldInfo description) { return(this.GetAggregateDescriptionForFieldDescription(description)); }
SortDescription IDataProvider.GetSortDescriptionForFieldDescription(IDataFieldInfo description) { return(this.GetSortDescriptionForFieldDescription(description)); }
public IAggregateDescription GetAggregateDescriptionForFieldDescription(IDataFieldInfo description) { throw new NotImplementedException(); }
/// <inheritdoc /> internal abstract SortDescription GetSortDescriptionForFieldDescription(IDataFieldInfo description);
/// <inheritdoc /> internal abstract FilterDescription GetFilterDescriptionForFieldDescription(IDataFieldInfo description);
/// <inheritdoc /> internal override IAggregateDescription GetAggregateDescriptionForFieldDescription(IDataFieldInfo description) { if (description == null) { throw new ArgumentNullException(nameof(description)); } var aggregateDescription = new PropertyAggregateDescription() { PropertyName = description.Name }; if (!FieldInfoHelper.IsNumericType(description.DataType)) { ////aggregateDescription.AggregateFunction = AggregateFunctions.Count; } return(aggregateDescription); }
public SortDescription GetSortDescriptionForFieldDescription(IDataFieldInfo description) { throw new NotImplementedException(); }
internal override SortDescription GetSortDescriptionForFieldDescription(IDataFieldInfo description) { throw new NotImplementedException(); }
internal override IAggregateDescription GetAggregateDescriptionForFieldDescription(IDataFieldInfo description) { throw new NotImplementedException(); }
/// <inheritdoc /> internal abstract IAggregateDescription GetAggregateDescriptionForFieldDescription(IDataFieldInfo description);
public bool Equals(IDataFieldInfo info) { return(false); }
/// <summary> /// Deep copies content from src instance to this. /// <param name="source">Source for copy.</param> /// <returns>this.</returns> /// </summary> protected override IRecordInterface CopyFromImpl(IRecordInfo source) { base.CopyFromImpl(source); if (typeof(IRecordClassDescriptorInfo).IsInstanceOfType(source)) { IRecordClassDescriptorInfo typedSource = ((IRecordClassDescriptorInfo)(source)); if ((typedSource.Parent != null)) { if (((this.Parent == null) || (this.Parent.GetType() == typedSource.Parent.GetType()))) { this.Parent = ((RecordClassDescriptor)(typedSource.Parent.Clone())); } else { this.Parent.CopyFrom(typedSource.Parent); } } else { this.Parent = null; } if ((typedSource.HasIsAbstract() == true)) { this.IsAbstract = typedSource.IsAbstract; } else { this.NullifyIsAbstract(); } if ((typedSource.HasIsContentClass() == true)) { this.IsContentClass = typedSource.IsContentClass; } else { this.NullifyIsContentClass(); } if ((typedSource.DataFields != null)) { this.DataFields = new List <IDataFieldInterface>(typedSource.DataFields.Count); int i; for (i = 0; (i < typedSource.DataFields.Count); i = (i + 1)) { IDataFieldInfo item = typedSource.DataFields[i]; if ((item == null)) { this.DataFields.Add(null); } else { this.DataFields.Add(((IDataFieldInterface)(item.Clone()))); } } } else { this.DataFields = null; } } return(this); }