Пример #1
0
        public void Replace(ContactsList list, int[] idArray)
        {
            int error = Interop.Database.ReplaceRecords(list._listHandle, idArray, idArray.Length);

            if ((int)ContactsError.None != error)
            {
                Log.Error(Globals.LogTag, "Replace Failed with error " + error);
                throw ContactsErrorFactory.CheckAndCreateException(error);
            }
        }
Пример #2
0
        public void Update(ContactsList list)
        {
            int error = Interop.Database.UpdateRecords(list._listHandle);

            if ((int)ContactsError.None != error)
            {
                Log.Error(Globals.LogTag, "Update Failed with error " + error);
                throw ContactsErrorFactory.CheckAndCreateException(error);
            }
        }
Пример #3
0
        /// <summary>
        /// Clones a child record list corresponding to the property ID.
        /// </summary>
        /// <param name="propertyId">The property ID.</param>
        /// <returns>
        /// The record list.
        /// </returns>
        /// <feature>http://tizen.org/feature/contact</feature>
        /// <exception cref="NotSupportedException">Thrown when the feature is not supported.</exception>
        /// <exception cref="ArgumentException">Thrown when one of the arguments provided to a method is not valid.</exception>
        /// <since_tizen> 4 </since_tizen>
        public ContactsList CloneChildRecordList(uint propertyId)
        {
            IntPtr listHandle;

            int error = Interop.Record.CloneChildRecordList(_recordHandle, propertyId, out listHandle);

            if ((int)ContactsError.None != error)
            {
                Log.Error(Globals.LogTag, "CloneChildRecordList Failed with error " + error);
                throw ContactsErrorFactory.CheckAndCreateException(error);
            }
            ContactsList list = new ContactsList(listHandle);

            return(list);
        }
Пример #4
0
        public int[] Insert(ContactsList list)
        {
            IntPtr ids;
            int    count;
            int    error = Interop.Database.InsertRecords(list._listHandle, out ids, out count);

            if ((int)ContactsError.None != error)
            {
                Log.Error(Globals.LogTag, "Insert Failed with error " + error);
                throw ContactsErrorFactory.CheckAndCreateException(error);
            }

            int[] idArr = new int[count];
            Marshal.Copy(ids, idArr, 0, count);

            return(idArr);
        }
Пример #5
0
        /// <summary>
        /// Get all list.
        /// </summary>
        public List <RecordItem> GetAll()
        {
            var itemList = new List <RecordItem>();

            TPC.ContactsList list = manager.Database.GetAll(Contact.Uri, 0, 0);

            int i;

            for (i = 0; i < list.Count; i++)
            {
                var record = list.GetCurrentRecord();
                var item   = new RecordItem();
                RecordToItem(record, item);
                itemList.Add(item);
                list.MoveNext();
            }
            return(itemList);
        }