public override bool TryParseAndSet(Parser.QueryFieldValue value) { // Set the parsed value. value.Set(value.StringValue.ToLower()); // Successful. return(true); }
public override bool TryParseAndSet(Parser.QueryFieldValue value) { value.Set(value.StringValue.ToLower()); if (value.StringValue.StartsWith("/root")) { return(true); } return(false); }
public override void ConvertToTermValue(Parser.QueryFieldValue value) { var path = ((string)value.InputObject).ToLower(); if (!path.StartsWith("/root")) { throw new ApplicationException(String.Concat("Invalid path: '", path, "'. It must be absolute: '/root' or '/root/...'.")); } value.Set(path); }
public override bool TryParseAndSet(Parser.QueryFieldValue value) { Int32 intValue; if (!Int32.TryParse(value.StringValue, out intValue)) { return(false); } value.Set(intValue); return(true); }
public override bool TryParseAndSet(Parser.QueryFieldValue value) { DateTime dateTimeValue; if (!DateTime.TryParse(value.StringValue, CultureInfo.InvariantCulture, DateTimeStyles.None, out dateTimeValue)) { return(false); } value.Set(dateTimeValue.Ticks); return(true); }
public override bool TryParseAndSet(Parser.QueryFieldValue value) { Double doubleValue; if (!Double.TryParse(value.StringValue, System.Globalization.NumberStyles.AllowDecimalPoint, System.Globalization.CultureInfo.InvariantCulture, out doubleValue)) { return(false); } value.Set(doubleValue); return(true); }
public override void ConvertToTermValue(Parser.QueryFieldValue value) { if (value.InputObject == null) { value.Set(String.Empty); } else { value.Set(((string)value.InputObject).ToLower()); } }
public override bool TryParseAndSet(Parser.QueryFieldValue value) { int intValue; if (Int32.TryParse(value.StringValue, out intValue)) { value.Set(intValue.ToString()); } else { value.Set(LucQuery.NullReferenceValue); } return(true); }
public override void ConvertToTermValue(Parser.QueryFieldValue value) { if (value.InputObject == null) { value.Set(LucQuery.NullReferenceValue); return; } var node = value.InputObject as Node; if (node != null) { value.Set(node.Id.ToString()); return; } var enumerable = value as System.Collections.IEnumerable; if (enumerable != null) { throw new NotImplementedException("ReferenceIndexHandler.ConvertToTermValue() isn't implemented when value is IEnumerable."); } throw new NotSupportedException(String.Format("Type {0} is not supported as value of ReferenceField", value.InputObject.GetType().ToString())); }
public override bool TryParseAndSet(Parser.QueryFieldValue value) { var v = value.StringValue.ToLower(); if (YesList.Contains(v)) { value.Set(YES); return(true); } if (NoList.Contains(v)) { value.Set(NO); return(true); } bool b; if (Boolean.TryParse(v, out b)) { value.Set(b ? YES : NO); return(true); } return(false); }
public override void ConvertToTermValue(Parser.QueryFieldValue value) { value.Set((string)value.InputObject); }
public override bool TryParseAndSet(Parser.QueryFieldValue value) { value.Set(value.StringValue); return(true); }
public override void ConvertToTermValue(Parser.QueryFieldValue value) { value.Set(((DateTime)value.InputObject).Ticks); }
public override void ConvertToTermValue(Parser.QueryFieldValue value) { var doubleValue = Convert.ToDouble(value.InputObject); value.Set(doubleValue); }
/// <summary> /// For LINQ /// </summary> /// <param name="value"></param> public abstract void ConvertToTermValue(Parser.QueryFieldValue value);
public override bool TryParseAndSet(Parser.QueryFieldValue value) { return(false); }
/// <summary> /// For SnLucParser /// </summary> /// <param name="value"></param> /// <returns></returns> public abstract bool TryParseAndSet(Parser.QueryFieldValue value);
public override void ConvertToTermValue(Parser.QueryFieldValue value) { value.Set(((bool)value.InputObject) ? YES : NO); }
public override void ConvertToTermValue(Parser.QueryFieldValue value) { value.Set(value.InputObject.ToString()); }