public static FKFieldProperties GetFKFieldProperties(System.Reflection.PropertyInfo AssociatedPropertyInfo, XtraFieldProperties XtraFieldProperties)
        {
            System.Reflection.PropertyInfo pi = DataAvail.Utils.Reflection.GetGetters(AssociatedPropertyInfo.ReflectedType, BindingFlags.Static).WhereCustomAttributes<FKDataSourceAttribute>(p => p.ThisField == AssociatedPropertyInfo.Name).FirstOrDefault();

            if (pi != null)
                return new FKFieldProperties(null, pi, XtraFieldProperties);
            else
                return null;
        }
        internal FKFieldPropertiesDictionary(XtraFieldProperties XtraFieldProperties, Dictionary<string, string> KeyNameDict)
            : base(XtraFieldProperties)
        {
            this.ValueMember = "Key";

            this.DisplayMember = "Value";

            SetDataSource(KeyNameDict, null);
        }
        protected override IFKFieldProperties GetFKFieldProperties(XtraFieldProperties XtraFieldProperties, System.Reflection.PropertyInfo Item)
        {
            System.Reflection.PropertyInfo pi = _associatedProps.WhereCustomAttributes<System.Data.Linq.Mapping.AssociationAttribute>(p => p.ThisKey == XtraFieldProperties.FieldName).SingleOrDefault();

            if (pi != null)
            {
                return new FKFieldProperties(_dataContext, GetTablesGetters(_dataContext).Single(p => p.PropertyType.GetGenericArguments()[0] == pi.PropertyType), XtraFieldProperties);
            }
            else
            {
                return null;
            }
        }
        internal FKFieldProperties(XtraFieldProperties XtraFieldProperties, System.Data.DataRelation DataRelation):
            base(XtraFieldProperties)
        {
            base.ValueMember = DataRelation.ParentColumns[0].ColumnName;

            System.Data.DataColumn displayCol = DataRelation.ParentTable.Columns.Cast<System.Data.DataColumn>().FirstOrDefault(p => p.DataType == typeof(string));

            base.DisplayMember = displayCol != null ? displayCol.ColumnName : base.ValueMember;

            string filter = DataAvail.Data.DataRelation.GetFilter(DataRelation);

            this.SetDataSource(new System.Data.DataView(DataRelation.ParentTable,filter, this.DisplayMember, System.Data.DataViewRowState.CurrentRows), filter);
        }
        public FKFieldProperties (object PropertyObject, PropertyInfo PropertyInfo, XtraFieldProperties XtraFieldProperties)
            : base(XtraFieldProperties)
        {
            object dataSource = PropertyInfo.GetValue(PropertyObject, BindingFlags.GetProperty, null, null, null);

            this.ValueMember = GetValueMember(PropertyInfo, XtraFieldProperties.FieldType);

            this.DisplayMember = GetDisplayMember(PropertyInfo);

            if (this.DisplayMember == null)
                this.DisplayMember = this.ValueMember;

            SetDataSource(dataSource, null);
        }
 public FKFieldPropertiesBase(XtraFieldProperties XtraFieldProperties)
     : base(XtraFieldProperties)
 {
 }
 public FKFieldProperties(object DataContext, PropertyInfo PropertyInfo, XtraFieldProperties XtraFieldProperties)
     : base(DataContext, PropertyInfo, XtraFieldProperties)
 {
 }