示例#1
0
        public bool?GetNullableBoolean(IntPtr propertyIndex)
        {
            var hasValue = MarshalHelpers.IntPtrToBool(NativeMethods.get_nullable_bool(this, propertyIndex, out var value, out var nativeException));

            nativeException.ThrowIfNecessary();
            return(hasValue ? MarshalHelpers.IntPtrToBool(value) : (bool?)null);
        }
示例#2
0
        public bool IsSameInstance(SharedRealmHandle other)
        {
            var result = NativeMethods.is_same_instance(this, other, out var nativeException);

            nativeException.ThrowIfNecessary();
            return(MarshalHelpers.IntPtrToBool(result));
        }
示例#3
0
        public bool IsInTransaction()
        {
            var result = NativeMethods.is_in_transaction(this, out var nativeException);

            nativeException.ThrowIfNecessary();
            return(MarshalHelpers.IntPtrToBool(result));
        }
示例#4
0
        public bool Refresh()
        {
            var result = NativeMethods.refresh(this, out var nativeException);

            nativeException.ThrowIfNecessary();
            return(MarshalHelpers.IntPtrToBool(result));
        }
示例#5
0
        public bool GetBoolean(IntPtr propertyIndex)
        {
            var result = NativeMethods.get_bool(this, propertyIndex, out var nativeException);

            nativeException.ThrowIfNecessary();
            return(MarshalHelpers.IntPtrToBool(result));
        }
示例#6
0
        public static bool GetBoolean(TableHandle tableHandle, IntPtr columnIndex, IntPtr rowIndex)
        {
            NativeException nativeException;
            var             result = get_bool(tableHandle, columnIndex, rowIndex, out nativeException);

            nativeException.ThrowIfNecessary();
            return(MarshalHelpers.IntPtrToBool(result));
        }
        public bool LinklistIsEmpty(IntPtr propertyIndex)
        {
            NativeException nativeException;
            var             result = NativeMethods.list_is_empty(this, propertyIndex, out nativeException);

            nativeException.ThrowIfNecessary();
            return(MarshalHelpers.IntPtrToBool(result));
        }
示例#8
0
        protected bool GetBooleanValue(string propertyName)
        {
            Debug.Assert(_realm != null, "Object is not managed, but managed access was attempted");

            var rowIndex = _rowHandle.RowIndex;

            return(MarshalHelpers.IntPtrToBool(NativeTable.get_bool(_metadata.Table, _metadata.ColumnIndices[propertyName], (IntPtr)rowIndex)));
        }
示例#9
0
        public static bool LinklistIsEmpty(TableHandle tableHandle, IntPtr columnIndex, IntPtr rowIndex)
        {
            NativeException nativeException;
            var             result = linklist_is_empty(tableHandle, columnIndex, rowIndex, out nativeException);

            nativeException.ThrowIfNecessary();
            return(MarshalHelpers.IntPtrToBool(result));
        }
        public DateTimeOffset?GetNullableDateTimeOffset(IntPtr propertyIndex)
        {
            NativeException nativeException;
            long            ticks;
            var             hasValue = MarshalHelpers.IntPtrToBool(NativeMethods.get_nullable_timestamp_ticks(this, propertyIndex, out ticks, out nativeException));

            nativeException.ThrowIfNecessary();
            return(hasValue ? new DateTimeOffset(ticks, TimeSpan.Zero) : (DateTimeOffset?)null);
        }
示例#11
0
        public static bool?GetNullableBoolean(TableHandle tableHandle, IntPtr columnIndex, IntPtr rowIndex)
        {
            NativeException nativeException;
            IntPtr          value;
            var             hasValue = MarshalHelpers.IntPtrToBool(NativeTable.get_nullable_bool(tableHandle, columnIndex, rowIndex, out value, out nativeException));

            nativeException.ThrowIfNecessary();
            return(hasValue ? MarshalHelpers.IntPtrToBool(value) : (bool?)null);
        }
        public double?GetNullableDouble(IntPtr propertyIndex)
        {
            NativeException nativeException;
            double          value;
            var             hasValue = MarshalHelpers.IntPtrToBool(NativeMethods.get_nullable_double(this, propertyIndex, out value, out nativeException));

            nativeException.ThrowIfNecessary();
            return(hasValue ? value : (double?)null);
        }
        public long?GetNullableInt64(IntPtr propertyIndex)
        {
            NativeException nativeException;
            long            value;
            var             hasValue = MarshalHelpers.IntPtrToBool(NativeMethods.get_nullable_int64(this, propertyIndex, out value, out nativeException));

            nativeException.ThrowIfNecessary();
            return(hasValue ? value : (long?)null);
        }
示例#14
0
        public static double?GetNullableDouble(TableHandle tableHandle, IntPtr columnIndex, IntPtr rowIndex)
        {
            NativeException nativeException;
            double          value;
            var             hasValue = MarshalHelpers.IntPtrToBool(NativeTable.get_nullable_double(tableHandle, columnIndex, rowIndex, out value, out nativeException));

            nativeException.ThrowIfNecessary();
            return(hasValue ? value : (double?)null);
        }
示例#15
0
        public static DateTimeOffset?GetNullableDateTimeOffset(TableHandle tableHandle, IntPtr columnIndex,
                                                               IntPtr rowIndex)
        {
            NativeException nativeException;
            long            ticks;
            var             hasValue = MarshalHelpers.IntPtrToBool(NativeTable.get_nullable_timestamp_ticks(tableHandle, columnIndex, rowIndex, out ticks, out nativeException));

            nativeException.ThrowIfNecessary();
            return(hasValue ? new DateTimeOffset(ticks, TimeSpan.Zero) : (DateTimeOffset?)null);
        }
示例#16
0
        protected double?GetNullableDoubleValue(string propertyName)
        {
            Debug.Assert(_realm != null, "Object is not managed, but managed access was attempted");

            var rowIndex = _rowHandle.RowIndex;

            var retVal   = 0.0d;
            var hasValue = MarshalHelpers.IntPtrToBool(NativeTable.get_nullable_double(_metadata.Table, _metadata.ColumnIndices[propertyName], (IntPtr)rowIndex, ref retVal));

            return(hasValue ? retVal : (double?)null);
        }
示例#17
0
        protected bool?GetNullableBooleanValue(string propertyName)
        {
            Debug.Assert(_realm != null, "Object is not managed, but managed access was attempted");

            var rowIndex = _rowHandle.RowIndex;

            var retVal   = IntPtr.Zero;
            var hasValue = MarshalHelpers.IntPtrToBool(NativeTable.get_nullable_bool(_metadata.Table, _metadata.ColumnIndices[propertyName], (IntPtr)rowIndex, ref retVal));

            return(hasValue ? MarshalHelpers.IntPtrToBool(retVal) : (bool?)null);
        }
示例#18
0
        protected DateTimeOffset?GetNullableDateTimeOffsetValue(string propertyName)
        {
            Debug.Assert(_realm != null, "Object is not managed, but managed access was attempted");

            var rowIndex = _rowHandle.RowIndex;

            long unixTimeSeconds = 0;
            var  hasValue        = MarshalHelpers.IntPtrToBool(NativeTable.get_nullable_datetime_seconds(_metadata.Table, _metadata.ColumnIndices[propertyName], (IntPtr)rowIndex, ref unixTimeSeconds));

            return(hasValue ? DateTimeOffsetExtensions.FromUnixTimeSeconds(unixTimeSeconds) : (DateTimeOffset?)null);
        }
示例#19
0
 /// <summary>
 /// Update a Realm and outstanding objects to point to the most recent data for this Realm.
 /// This is only necessary when you have a Realm on a non-runloop thread that needs manual refreshing.
 /// </summary>
 /// <returns>
 /// Whether the realm had any updates. Note that this may return true even if no data has actually changed.
 /// </returns>
 public bool Refresh()
 {
     return(MarshalHelpers.IntPtrToBool(NativeSharedRealm.refresh(SharedRealmHandle)));
 }
示例#20
0
 /// <summary>
 /// Determines whether this instance is the same core instance as the specified rhs.
 /// </summary>
 /// <remarks>
 /// You can, and should, have multiple instances open on different threads which have the same path and open the same Realm.
 /// </remarks>
 /// <returns><c>true</c> if this instance is the same core instance the specified rhs; otherwise, <c>false</c>.</returns>
 /// <param name="rhs">The Realm to compare with the current Realm.</param>
 public bool IsSameInstance(Realm rhs)
 {
     return(MarshalHelpers.IntPtrToBool(NativeSharedRealm.is_same_instance(SharedRealmHandle, rhs.SharedRealmHandle)));
 }