private ClrValue[] GetValueList(ICorDebugValueEnum valueEnum) { uint count; valueEnum.GetCount(out count); ClrValue[] result = new ClrValue[count]; ICorDebugValue[] tmp = new ICorDebugValue[1]; uint fetched; int i = 0; while (i < result.Length && valueEnum.Next(1, tmp, out fetched) >= 0 && fetched == 1) { result[i] = new CorDebugValue(_runtime, tmp[0]); i++; } return(result); }
private void GetClrValueAddressAndCodeTypeId(ClrValue clrValue, out ulong address, out int clrTypeId) { try { ClrType clrType = clrValue.Type; clrTypeId = GetClrTypeId(clrType); address = clrValue.Address; if (!clrType.IsPointer) { if (clrValue.ElementType == ClrElementType.Class) { address += (uint)IntPtr.Size; } } } catch { address = 0; clrTypeId = -1; } }
private static CompareFilter <ClrValue> Binary(PropertyPath path, CompareOperator @operator, ClrValue value) { return(new CompareFilter <ClrValue>(path, @operator, value ?? ClrValue.Null)); }
public static CompareFilter <ClrValue> In(PropertyPath path, ClrValue value) { return(Binary(path, CompareOperator.In, value)); }
public static CompareFilter <ClrValue> StartsWith(PropertyPath path, ClrValue value) { return(Binary(path, CompareOperator.StartsWith, value)); }
public static CompareFilter <ClrValue> Contains(PropertyPath path, ClrValue value) { return(Binary(path, CompareOperator.Contains, value)); }
public static CompareFilter <ClrValue> Ge(PropertyPath path, ClrValue value) { return(Binary(path, CompareOperator.GreaterThanOrEqual, value)); }
public static CompareFilter <ClrValue> Ne(PropertyPath path, ClrValue value) { return(Binary(path, CompareOperator.NotEquals, value)); }
public static ClrValue Convert(JsonSchema schema, IJsonValue value, PropertyPath path, List <string> errors) { ClrValue result = null; switch (GetType(schema)) { case JsonObjectType.Boolean: { if (value is JsonArray jsonArray) { result = ParseArray <bool>(errors, path, jsonArray, TryParseBoolean); } else if (TryParseBoolean(errors, path, value, out var temp)) { result = temp; } break; } case JsonObjectType.Integer: case JsonObjectType.Number: { if (value is JsonArray jsonArray) { result = ParseArray <double>(errors, path, jsonArray, TryParseNumber); } else if (TryParseNumber(errors, path, value, out var temp)) { result = temp; } break; } case JsonObjectType.String: { if (schema.Format == JsonFormatStrings.Guid) { if (value is JsonArray jsonArray) { result = ParseArray <Guid>(errors, path, jsonArray, TryParseGuid); } else if (TryParseGuid(errors, path, value, out var temp)) { result = temp; } } else if (schema.Format == JsonFormatStrings.DateTime) { if (value is JsonArray jsonArray) { result = ParseArray <Instant>(errors, path, jsonArray, TryParseDateTime); } else if (TryParseDateTime(errors, path, value, out var temp)) { result = temp; } } else { if (value is JsonArray jsonArray) { result = ParseArray <string>(errors, path, jsonArray, TryParseString); } else if (TryParseString(errors, path, value, out var temp)) { result = temp; } } break; } default: { errors.Add($"Unsupported type {schema.Type} for {path}."); break; } } return(result); }