本文整理汇总了C#中CameraControl.Core.Classes.FileItem.AddTemplates方法的典型用法代码示例。如果您正苦于以下问题:C# FileItem.AddTemplates方法的具体用法?C# FileItem.AddTemplates怎么用?C# FileItem.AddTemplates使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CameraControl.Core.Classes.FileItem
的用法示例。
在下文中一共展示了FileItem.AddTemplates方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PhotoCaptured
//.........这里部分代码省略.........
}
if (!eventArgs.CameraDevice.CaptureInSdRam && session.DeleteFileAfterTransfer)
eventArgs.CameraDevice.DeleteObject(new DeviceObject() {Handle = eventArgs.Handle});
if (File.Exists(tempFile))
File.Delete(tempFile);
if (session.WriteComment)
{
if (!string.IsNullOrEmpty(session.Comment))
Exiv2Helper.SaveComment(fileName, session.Comment);
if (session.SelectedTag1 != null && !string.IsNullOrEmpty(session.SelectedTag1.Value))
Exiv2Helper.AddKeyword(fileName, session.SelectedTag1.Value);
if (session.SelectedTag2 != null && !string.IsNullOrEmpty(session.SelectedTag2.Value))
Exiv2Helper.AddKeyword(fileName, session.SelectedTag2.Value);
if (session.SelectedTag3 != null && !string.IsNullOrEmpty(session.SelectedTag3.Value))
Exiv2Helper.AddKeyword(fileName, session.SelectedTag3.Value);
if (session.SelectedTag4 != null && !string.IsNullOrEmpty(session.SelectedTag4.Value))
Exiv2Helper.AddKeyword(fileName, session.SelectedTag4.Value);
}
if (session.ExternalData != null)
session.ExternalData.FileName = fileName;
// prevent crash og GUI when item count updated
Dispatcher.Invoke(new Action(delegate
{
try
{
_selectedItem = session.GetNewFileItem(fileName);
_selectedItem.BackupFileName = backupfile;
_selectedItem.Series = session.Series;
_selectedItem.AddTemplates(eventArgs.CameraDevice, session);
ServiceProvider.Database.Add(new DbFile(_selectedItem, eventArgs.CameraDevice.DisplayName,
eventArgs.CameraDevice.SerialNumber, session.Name));
}
catch (Exception ex)
{
}
}));
foreach (AutoExportPluginConfig plugin in ServiceProvider.Settings.DefaultSession.AutoExportPluginConfigs)
{
if(!plugin.IsEnabled)
continue;
var pl = ServiceProvider.PluginManager.GetAutoExportPlugin(plugin.Type);
try
{
pl.Execute(_selectedItem, plugin);
ServiceProvider.Analytics.PluginExecute(plugin.Type);
Log.Debug("AutoexportPlugin executed " + plugin.Type);
}
catch (Exception ex)
{
plugin.IsError = true;
plugin.Error = ex.Message;
plugin.IsRedy = true;
Log.Error("Error to apply plugin", ex);
}
}
Dispatcher.Invoke(() =>
{
_selectedItem.RemoveThumbs();