Ejemplo n.º 1
0
        /// <summary>
        /// SharedTableEntryMetadata is Metadata that can be shared across multiple entries in a single table.
        /// The instance reference will be stored in <see cref="LocalizationTable.TableData"/> and <see cref="MetadataEntries"/>.
        /// </summary>
        /// <param name="md"></param>
        public void AddSharedMetadata(SharedTableEntryMetadata md)
        {
            if (!Table.Contains(md))
            {
                Table.AddMetadata(md);
            }

            md.Register(this);
            AddMetadata(md);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Removes the entry from the shared Metadata in the table and removes the
        /// shared Metadata if no other entires are using it.
        /// </summary>
        /// <param name="md"></param>
        public void RemoveSharedMetadata(SharedTableEntryMetadata md)
        {
            md.Unregister(this);
            RemoveMetadata(md);

            // Remove the shared data if it is no longer used
            if (md.Count == 0 && Table.Contains(md))
            {
                Table.RemoveMetadata(md);
            }
        }