public Literal(object[] pair) { switch ((int)pair[0]) { case 0: Vid = LiteralVidEnumeration.unknown; break; case 1: Vid = LiteralVidEnumeration.integer; Value = pair[1]; break; case 2: Vid = LiteralVidEnumeration.text; object[] text_pair = (object[])pair[1]; Value = new Text() { Value = (string)text_pair[0], Lang = (string)text_pair[1] }; break; case 3: Vid = LiteralVidEnumeration.date; Value = pair[1]; // Надо как-то по-другому break; default: throw new Exception("Err: 20901"); } }
internal static Expression LiteraExpression(Expression literalValueExpr, LiteralVidEnumeration literalVidEnumeration) { Type type = null; switch (literalVidEnumeration) { case LiteralVidEnumeration.text: return(Expression.Property( Expression.Convert(literalValueExpr, typeof(Text)), "Value")); case LiteralVidEnumeration.typedObject: return(Expression.Property( Expression.Convert(literalValueExpr, typeof(TypedObject)), "Value")); case LiteralVidEnumeration.integer: { return(Expression.Call(typeof(Query).GetMethod("Convert"), literalValueExpr)); } break; case LiteralVidEnumeration.date: type = typeof(long); break; case LiteralVidEnumeration.boolean: type = typeof(bool); break; case LiteralVidEnumeration.nil: throw new NotImplementedException(); } return(Expression.ConvertChecked(literalValueExpr, type)); }
public Literal(LiteralVidEnumeration literalVidEnumeration) { this.vid = literalVidEnumeration; }
public Literal(LiteralVidEnumeration vid, IGraph graph) { this.vid = vid; Graph = graph; }
public Literal(LiteralVidEnumeration vid) { this.vid = vid; }