本文整理汇总了C#中Video.Save方法的典型用法代码示例。如果您正苦于以下问题:C# Video.Save方法的具体用法?C# Video.Save怎么用?C# Video.Save使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Video
的用法示例。
在下文中一共展示了Video.Save方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: _watcher_Created
void _watcher_Created(object sender, FileSystemEventArgs e)
{
if (e.Name.EndsWith(".m4v"))
{
//除去后缀.m4v
int cameraId;
DateTime timeLocal;
if (Util.TryParsePath(e.FullPath, out cameraId, out timeLocal))
{
using (var session = new DevExpress.Xpo.Session())
{
var dtoVideo = new Video(session);
dtoVideo.Path = e.FullPath;
dtoVideo.CaptureTime = timeLocal;
dtoVideo.CameraId = cameraId;
dtoVideo.Save();
}
}
}
}
示例2: DoWalk
private void DoWalk()
{
try
{
using (var uow = new UnitOfWork())
{
var filesToBeAdded = new List<string>();
foreach (var m4VFile in Directory.EnumerateFiles(
_directoryToWalk, "*.m4v", SearchOption.AllDirectories))
{
var c = DevExpress.Data.Filtering.CriteriaOperator.Parse("Path = ?", m4VFile);
var v = uow.FindObject(typeof(Video), c);
if (v == null)
{
filesToBeAdded.Add(m4VFile);
}
}
foreach (var newFilePath in filesToBeAdded)
{
int cameraId;
DateTime time;
if (Util.TryParsePath(newFilePath, out cameraId, out time))
{
var nv = new Video(uow);
nv.Path = newFilePath;
nv.CaptureTime = time;
nv.CameraId = cameraId;
nv.Save();
}
}
uow.CommitChanges();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine(ex.Message);
}
}