public void RemoveMetadata(NotifyingMetadataItem metadata) { Presentation presentation = m_UrakawaSession.DocumentProject.Presentations.Get(0); MetadataRemoveCommand cmd = presentation.CommandFactory.CreateMetadataRemoveCommand (metadata.UrakawaMetadata); presentation.UndoRedoManager.Execute(cmd); }
//remove metadata entries with empty names public void removeEmptyMetadata() { Presentation presentation = m_UrakawaSession.DocumentProject.Presentations.Get(0); List <MetadataRemoveCommand> removalsList = new List <MetadataRemoveCommand>(); foreach (Metadata m in presentation.Metadatas.ContentsAs_Enumerable) { if (string.IsNullOrEmpty(m.NameContentAttribute.Name) || m.NameContentAttribute.Name == SupportedMetadata_Z39862005.MagicStringEmpty) { MetadataRemoveCommand cmd = presentation.CommandFactory.CreateMetadataRemoveCommand(m); removalsList.Add(cmd); } } foreach (MetadataRemoveCommand cmd in removalsList) { presentation.UndoRedoManager.Execute(cmd); } }