public override bool UseWhen() { // do deep property binding if (!(ColumnName.Contains('.'))) { return(false); } var propertyNames = ColumnName.Split('.'); if (propertyNames.Count() <= 1) { throw new Exception(string.Format("Can not find any property represented by deep-binding syntax: \"{0}\"", ColumnName)); } Info = PropertyInfoHelper.GetCaseInsensitivePropertyInfo(TargetType, propertyNames[0]); var nextColumnName = string.Join(".", propertyNames.Skip(1).ToList()); deepAction = ColumnActionFactory.GetAction <IComparerColumnAction>(Info.PropertyType, nextColumnName); if (deepAction == null) { return(false); } return(deepAction.UseWhen()); }
public override bool UseWhen() { if (!DeepHelper.IsDeep(ColumnName)) { return(false); } var columnNameParts = DeepHelper.SplitColumnName(ColumnName); if (!UseWhenProperty(columnNameParts.FirstColumn)) { return(false); } _deepAction = ColumnActionFactory.GetAction <IComparerColumnAction>( _info.PropertyType, columnNameParts.OtherColumns); if (_deepAction == null) { return(false); } return(_deepAction.UseWhen()); }
public override bool UseWhen() { if (!DeepHelper.IsDeep(ColumnName)) return false; var columnNameParts = DeepHelper.SplitColumnName(ColumnName); if (!UseWhenProperty(columnNameParts.FirstColumn)) return false; _deepAction = ColumnActionFactory.GetAction<IComparerColumnAction>( _info.PropertyType, columnNameParts.OtherColumns); if (_deepAction == null) return false; return _deepAction.UseWhen(); }
public override bool UseWhen() { // do deep property binding if (!(ColumnName.Contains('.'))) { return false; } var propertyNames = ColumnName.Split('.'); if (propertyNames.Count() <= 1) { throw new Exception(string.Format("Can not find any property represented by deep-binding syntax: \"{0}\"", ColumnName)); } Info = PropertyInfoHelper.GetCaseInsensitivePropertyInfo(TargetType, propertyNames[0]); var nextColumnName = string.Join(".", propertyNames.Skip(1).ToList()); deepAction = ColumnActionFactory.GetAction<IComparerColumnAction>(Info.PropertyType, nextColumnName); if (deepAction == null) { return false; } return deepAction.UseWhen(); }