public AttributeParameterSpec(string ParameterName, CoreDataValue ParameterValue, int?ParameterPosition = null) { this.ParameterName = ParameterName; this.ParameterValue = ParameterValue; this.ParameterPosition = ParameterPosition; }
public EnumLiteralSpec(ClrEnumName DeclaringTypeName, ClrEnumLiteralName Name, CoreDataValue LiteralValue = null, int?DeclarationOrder = null, CodeDocumentationSpec Documentation = null, IEnumerable <AttributionSpec> Attributions = null) : base(DeclaringTypeName, Name, Documentation, DeclarationOrder, ClrAccessKind.Default, false, Attributions, ClrCustomMemberIdentifier.Empty) => this.LiteralValue = LiteralValue;
public LiteralValueSpec(CoreDataValue LiteralValue) { if (isNull(LiteralValue)) { throw new System.ArgumentNullException(); } this.LiteralValue = LiteralValue; }
public static IClrExpressionSpec SpecifyCoreExpression(this CoreDataValue v) { if (v.IsDateTime()) { var items = v.ToClrValue <DateTime>().GetItemArray(); var args = mapi(items, (idx, value) => SpecifyArgumentValue(value, idx)); return(new ConstructorInvocationSpec(v.ClrType.GetReference(), args.ToArray())); } else { return(new LiteralValueSpec(v)); } }
public static MethodArgumentValueSpec SpecifyArgumentValue(this CoreDataValue v, int idx) => new MethodArgumentValueSpec(idx, v.SpecifyCoreExpression());
static MethodArgumentValueSpec SpecifyArgumentValue(NamedValue pv) => (isNull(pv.Value) || object.Equals(pv.Value, DBNull.Value)) ? new MethodArgumentValueSpec(pv.Name, null) : new MethodArgumentValueSpec(pv.Name, new LiteralValueSpec(CoreDataValue.FromObject(pv.Value).Require()));
public static bool IsNumber(this CoreDataValue v) => v.DataType.IsNumber();
public static bool IsUInt64(this CoreDataValue v) => v.DataType.IsUInt64();
public static bool IsInt32(this CoreDataValue v) => v.DataType.IsInt32();
public static bool IsEnum(this CoreDataValue v) => v.DataType.IsEnum();
public static bool IsDecimal(this CoreDataValue v) => v.DataType.IsDecimal();
public static bool IsDateTime(this CoreDataValue v) => v.DataType.IsDateTime();
public ClrEnumLiteralInfo(ClrEnumLiteralName LiteralName, CoreDataValue LiteralValue) { this.Name = LiteralName; this.Value = LiteralValue; }
static CoreDataValue GetLiteralValue(FieldInfo ReflectedElement) => ~CoreDataValue.FromObject(Convert.ChangeType( ReflectedElement.GetValue(null), Enum.GetUnderlyingType(ReflectedElement.DeclaringType) ));