示例#1
0
        int IList.Add(object value)
        {
            if (value.GetType() == typeof(PhonebookEntry))
            {
                PhonebookEntry pe = (PhonebookEntry)value;

                uint result = SimWritePhonebookEntry(m_sim.Handle, m_storage, SIM_PBINDEX_FIRSTAVAILABLE, pe.ToByteArray());
            }
            else
            {
                throw new ArgumentException("value must be of type PhonebookEntry");
            }

            return(0);
        }
示例#2
0
		/// <summary>
		/// Returns the <see cref="PhonebookEntry"/> at the specified index.
		/// </summary>
		public PhonebookEntry this[int index]
		{
			get
			{
				PhonebookEntry result = new PhonebookEntry();
				uint hresult = SimReadPhonebookEntry(m_sim.Handle, m_storage, (uint)index + 1, result.ToByteArray());

				if(hresult != 0)
				{
					//empty slot
					if(hresult==0x88000345)
					{
						return null;
					}
					else
					{
						throw new ExternalException("Error retrieving phonebook entry");
					}
				}

				return result;
			}
		}
示例#3
0
        /// <summary>
        /// Returns the <see cref="PhonebookEntry"/> at the specified index.
        /// </summary>
        public PhonebookEntry this[int index]
        {
            get
            {
                PhonebookEntry result  = new PhonebookEntry();
                uint           hresult = SimReadPhonebookEntry(m_sim.Handle, m_storage, (uint)index + 1, result.ToByteArray());

                if (hresult != 0)
                {
                    //empty slot
                    if (hresult == 0x88000345)
                    {
                        return(null);
                    }
                    else
                    {
                        throw new ExternalException("Error retrieving phonebook entry");
                    }
                }

                return(result);
            }
        }