本文整理汇总了C#中IGalleryObject.ExtractMetadata方法的典型用法代码示例。如果您正苦于以下问题:C# IGalleryObject.ExtractMetadata方法的具体用法?C# IGalleryObject.ExtractMetadata怎么用?C# IGalleryObject.ExtractMetadata使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IGalleryObject
的用法示例。
在下文中一共展示了IGalleryObject.ExtractMetadata方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RebuildMetaItem
private static void RebuildMetaItem(IMetadataDefinition metaDef, IGalleryObject galleryObject, string userName)
{
galleryObject.ExtractMetadata(metaDef);
IGalleryObjectMetadataItem metaItem;
if (galleryObject.MetadataItems.TryGetMetadataItem(metaDef.MetadataItem, out metaItem))
{
Factory.SaveGalleryObjectMetadataItem(metaItem, userName);
}
if (galleryObject.GalleryObjectType == GalleryObjectType.Album)
{
foreach (var go in galleryObject.GetChildGalleryObjects())
{
RebuildMetaItem(metaDef, go, userName);
}
}
}
示例2: RefreshOriginalVideoMetadata
/// <summary>
/// Re-extract several metadata values from the file. Call this function when performing an action on a file
/// that may render existing metadata items inaccurate, such as width and height. The new values are not persisted;
/// it is expected a subsequent function will do that.
/// </summary>
private static void RefreshOriginalVideoMetadata(IGalleryObject mediaObject)
{
mediaObject.ExtractMetadata(mediaObject.MetaDefinitions.Find(MetadataItemName.Width));
mediaObject.ExtractMetadata(mediaObject.MetaDefinitions.Find(MetadataItemName.Height));
mediaObject.ExtractMetadata(mediaObject.MetaDefinitions.Find(MetadataItemName.VideoFormat));
mediaObject.ExtractMetadata(mediaObject.MetaDefinitions.Find(MetadataItemName.BitRate));
mediaObject.ExtractMetadata(mediaObject.MetaDefinitions.Find(MetadataItemName.VideoBitRate));
mediaObject.ExtractMetadata(mediaObject.MetaDefinitions.Find(MetadataItemName.Dimensions));
mediaObject.ExtractMetadata(mediaObject.MetaDefinitions.Find(MetadataItemName.FileSizeKb));
mediaObject.ExtractMetadata(mediaObject.MetaDefinitions.Find(MetadataItemName.Orientation));
}