Example #1
0
        /// <summary>
        /// Derived classes could use this method to initialize the IDictionary with datatype added
        /// at the beginning of ToDictionary
        /// </summary>
        /// <remarks>
        /// datatype is represented using int in the dictionary.
        /// </remarks>
        protected IDictionary InitIDictionaryFromType()
        {
            IDictionary dict = new ListDictionary();

            dict.Add(DictionaryData.DataTypeKey, (int)DictionaryDataUtil.GetDictionaryDataType(this.GetType()));
            return(dict);
        }
Example #2
0
        /**
         * Creates an <b>empty</b> DictionaryData object with the datatype info.
         * @return A reference to the newly created object.
         */
        protected static DictionaryData PrepareDictionaryData(DictionaryDataType type)
        {
            Type t = DictionaryDataUtil.GetDataType(type);

            return((DictionaryData)Activator.CreateInstance(t));
        }