private void RemoveLanguageVersions(
            [NotNull] ItemDefinition item,
            [NotNull] Language language,
            bool removeSharedData)
        {
            if (removeSharedData)
            {
                SharedFields.Remove(item.ID);
            }

            UnversionedFields[item.ID].Delete(r => r.Language == language.ToString());
            VersionedFields[item.ID].Delete(r => r.Language == language.ToString());
        }
 private void RemoveFields([NotNull] ID itemId, [NotNull] Language language, [NotNull] Data.Version version)
 {
     SharedFields.Remove(itemId);
     {
         var itemFields = UnversionedFields[itemId];
         itemFields.Where(r => r.Language == language.ToString()).ToList().Apply(r => itemFields.Remove(r));
     }
     {
         var itemFields = VersionedFields[itemId];
         itemFields.Where(r => (r.Language == language.ToString()) && (r.Version == version.ToInt32()))
         .ToList()
         .Apply(r => itemFields.Remove(r));
     }
 }
        public override bool DeleteItem([NotNull] ItemDefinition itemDefinition, [NotNull] CallContext context)
        {
            lock (this)
            {
                var parentId = GetParentID(itemDefinition, context);

                Items.Remove(itemDefinition.ID);
                SharedFields.Remove(itemDefinition.ID);
                UnversionedFields.Remove(itemDefinition.ID);
                VersionedFields.Remove(itemDefinition.ID);

                Items[parentId].Children.Remove(itemDefinition.ID);

                return(true);
            }
        }