Click here to Skip to main content
15,884,298 members
Articles / Mobile Apps

CEDB .NET

Rate me:
Please Sign up or sign in to vote.
4.38/5 (6 votes)
24 Apr 2005CPOL13 min read 87.4K   564   29  
Implementing a managed wrapper to the CEDB database engine with some C++ help.
using System;
using System.Collections;
using System.Collections.Specialized;

namespace Primeworks.CeDb
{
	/// <summary>
	/// Summary description for CeDbPropertyCollection.
	/// </summary>
	public class CeDbPropertyCollection : System.Collections.IDictionary
	{
		private HybridDictionary	m_mapProp;

		public CeDbPropertyCollection()
		{
			m_mapProp = new HybridDictionary();
		}

		public void Add(CeDbProperty propVal)
		{
			m_mapProp.Add(propVal.PropID, propVal);
		}

		public CeDbProperty this[uint propid]
		{
			get
			{
				return m_mapProp[propid] as CeDbProperty;
			}

			set
			{
				m_mapProp[propid] = value;
			}
		}

		public void Clear()
		{
			m_mapProp.Clear();
		}

		public bool Contains(uint propid)
		{
			return m_mapProp.Contains(propid);
		}

		#region IDictionary Members

		public bool IsReadOnly
		{
			get
			{
				return false;
			}
		}

		public IDictionaryEnumerator GetEnumerator()
		{
			return m_mapProp.GetEnumerator();
		}

		object System.Collections.IDictionary.this[object key]
		{
			get
			{
				return m_mapProp[key];
			}
			set
			{
				m_mapProp[key] = value;
			}
		}

		public void Remove(object key)
		{
			m_mapProp.Remove(key);
		}

		bool System.Collections.IDictionary.Contains(object key)
		{
			return m_mapProp.Contains(key);
		}

		public ICollection Values
		{
			get
			{
				return m_mapProp.Values;
			}
		}

		void System.Collections.IDictionary.Add(object key, object value)
		{
			m_mapProp.Add(key, value);
		}

		public ICollection Keys
		{
			get
			{
				return m_mapProp.Keys;
			}
		}

		public bool IsFixedSize
		{
			get
			{
				return m_mapProp.IsFixedSize;
			}
		}

		#endregion

		#region ICollection Members

		public bool IsSynchronized
		{
			get
			{
				return m_mapProp.IsSynchronized;
			}
		}

		public int Count
		{
			get
			{
				return m_mapProp.Count;
			}
		}

		public void CopyTo(Array array, int index)
		{
			m_mapProp.CopyTo(array, index);
		}

		public object SyncRoot
		{
			get
			{
				return m_mapProp.SyncRoot;
			}
		}

		#endregion

		#region IEnumerable Members

		IEnumerator System.Collections.IEnumerable.GetEnumerator()
		{
			// TODO:  Add CeDbPropertyCollection.System.Collections.IEnumerable.GetEnumerator implementation
			return null;
		}

		#endregion
	}
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior) Frotcom International
Portugal Portugal
I work on R&D for Frotcom International, a company that develops web-based fleet management solutions.

Comments and Discussions