Exemplo n.º 1
0
        /// <summary>
        /// Create entry for object from collection
        /// </summary>
        public static Entry CreateSub(object item, int index, ICustomSerialization customSerialization)
        {
            var subEntry = EntryConvert.EncodeObject(item, customSerialization);

            subEntry.DisplayName = GetEntryName(item);
            subEntry.Identifier  = index.ToString("D");

            return(subEntry);
        }
        public IEnumerable <Entry> Serialize()
        {
            var entries = new List <Entry>();

            foreach (var key in _dictionary.Keys)
            {
                var value     = _dictionary[key];
                var keyString = key.ToString();

                var subEntry = EntryConvert.EncodeObject(value, _serialization);
                subEntry.DisplayName = keyString;
                subEntry.Identifier  = keyString;

                entries.Add(subEntry);
            }
            return(entries);
        }