public TimestampTicksNotEqual ( IntPtr columnIndex, DateTimeOffset value ) : void | ||
columnIndex | IntPtr | |
value | DateTimeOffset | |
Résultat | void |
private static void AddQueryNotEqual(QueryHandle queryHandle, string columnName, object value, Type columnType) { var columnKey = queryHandle.GetColumnKey(columnName); switch (value) { case null: queryHandle.NullNotEqual(columnKey); break; case string stringValue: queryHandle.StringNotEqual(columnKey, stringValue, caseSensitive: true); break; case bool boolValue: queryHandle.BoolNotEqual(columnKey, boolValue); break; case DateTimeOffset date: queryHandle.TimestampTicksNotEqual(columnKey, date); break; case byte[] buffer: if (buffer.Length == 0) { // see RealmObject.SetByteArrayValue queryHandle.BinaryNotEqual(columnKey, (IntPtr)0x1, IntPtr.Zero); return; } unsafe { fixed(byte *bufferPtr = (byte[])value) { queryHandle.BinaryNotEqual(columnKey, (IntPtr)bufferPtr, (IntPtr)buffer.Length); } } break; case RealmObject obj: queryHandle.Not(); queryHandle.ObjectEqual(columnKey, obj.ObjectHandle); break; default: // The other types aren't handled by the switch because of potential compiler applied conversions AddQueryForConvertibleTypes(columnKey, value, columnType, queryHandle.NumericNotEqualMethods); break; } }
private static void AddQueryNotEqual(QueryHandle queryHandle, string columnName, object value) { var columnIndex = queryHandle.GetColumnIndex(columnName); if (value == null) { queryHandle.NullNotEqual(columnIndex); } else if (value is string) { queryHandle.StringNotEqual(columnIndex, (string)value, caseSensitive: true); } else if (value is bool) { queryHandle.BoolNotEqual(columnIndex, (bool)value); } else if (value is char) { queryHandle.IntNotEqual(columnIndex, (int)value); } else if (value is int) { queryHandle.IntNotEqual(columnIndex, (int)value); } else if (value is long) { queryHandle.LongNotEqual(columnIndex, (long)value); } else if (value is float) { queryHandle.FloatNotEqual(columnIndex, (float)value); } else if (value is double) { queryHandle.DoubleNotEqual(columnIndex, (double)value); } else if (value is DateTimeOffset) { queryHandle.TimestampTicksNotEqual(columnIndex, (DateTimeOffset)value); } else if (value is byte[]) { var buffer = (byte[])value; if (buffer.Length == 0) { // see RealmObject.SetByteArrayValue queryHandle.BinaryNotEqual(columnIndex, (IntPtr)0x1, IntPtr.Zero); return; } unsafe { fixed(byte *bufferPtr = (byte[])value) { queryHandle.BinaryNotEqual(columnIndex, (IntPtr)bufferPtr, (IntPtr)buffer.LongCount()); } } } else if (value is RealmObject) { queryHandle.Not(); queryHandle.ObjectEqual(columnIndex, ((RealmObject)value).ObjectHandle); } else { throw new NotImplementedException(); } }
private static void AddQueryNotEqual(QueryHandle queryHandle, string columnName, object value) { var columnIndex = queryHandle.GetColumnIndex(columnName); switch (value) { case null: queryHandle.NullNotEqual(columnIndex); break; case string stringValue: queryHandle.StringNotEqual(columnIndex, stringValue, caseSensitive: true); break; case bool boolValue: queryHandle.BoolNotEqual(columnIndex, boolValue); break; case char charValue: queryHandle.IntNotEqual(columnIndex, charValue); break; case byte byteValue: queryHandle.IntNotEqual(columnIndex, byteValue); break; case short shortValue: queryHandle.IntNotEqual(columnIndex, shortValue); break; case int intValue: queryHandle.IntNotEqual(columnIndex, intValue); break; case long longValue: queryHandle.LongNotEqual(columnIndex, longValue); break; case float floatValue: queryHandle.FloatNotEqual(columnIndex, floatValue); break; case double doubleValue: queryHandle.DoubleNotEqual(columnIndex, doubleValue); break; case DateTimeOffset date: queryHandle.TimestampTicksNotEqual(columnIndex, date); break; case byte[] buffer: if (buffer.Length == 0) { // see RealmObject.SetByteArrayValue queryHandle.BinaryNotEqual(columnIndex, (IntPtr)0x1, IntPtr.Zero); return; } unsafe { fixed(byte *bufferPtr = (byte[])value) { queryHandle.BinaryNotEqual(columnIndex, (IntPtr)bufferPtr, (IntPtr)buffer.LongCount()); } } break; case RealmObject obj: queryHandle.Not(); queryHandle.ObjectEqual(columnIndex, obj.ObjectHandle); break; case RealmInteger <byte> byteValue: queryHandle.IntNotEqual(columnIndex, byteValue); break; case RealmInteger <short> shortValue: queryHandle.IntNotEqual(columnIndex, shortValue); break; case RealmInteger <int> intValue: queryHandle.IntNotEqual(columnIndex, intValue); break; case RealmInteger <long> longValue: queryHandle.LongNotEqual(columnIndex, longValue); break; default: throw new NotImplementedException(); } }