Insert() public method

public Insert ( IntPtr targetIndex, ObjectHandle objectHandle ) : void
targetIndex System.IntPtr
objectHandle ObjectHandle
return void
Exemplo n.º 1
0
        public void Insert(int index, T item)
        {
            if (index < 0)
            {
                throw new ArgumentOutOfRangeException(nameof(index));
            }

            Execute(item, obj =>
            {
                AddObjectToRealmIfNeeded(obj);
                _listHandle.Insert(index, obj.ObjectHandle);
            },
                    value => _listHandle.Insert(index, value),
                    value => _listHandle.Insert(index, value),
                    value => _listHandle.Insert(index, value));
        }
Exemplo n.º 2
0
        public void Insert(int index, T item)
        {
            if (index < 0)
            {
                throw new ArgumentOutOfRangeException();
            }

            AddObjectToRealmIfNeeded(item);
            _listHandle.Insert((IntPtr)index, item.ObjectHandle);
        }
Exemplo n.º 3
0
        public void Insert(int index, T value)
        {
            if (index < 0)
            {
                throw new ArgumentOutOfRangeException(nameof(index));
            }

            var realmValue = Operator.Convert <T, RealmValue>(value);

            if (_isEmbedded)
            {
                Realm.ManageEmbedded(EnsureUnmanagedEmbedded(realmValue), _listHandle.InsertEmbedded(index));
                return;
            }

            AddToRealmIfNecessary(realmValue);
            _listHandle.Insert(index, realmValue);
        }