本文整理汇总了C#中XPCollection.Load方法的典型用法代码示例。如果您正苦于以下问题:C# XPCollection.Load方法的具体用法?C# XPCollection.Load怎么用?C# XPCollection.Load使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XPCollection
的用法示例。
在下文中一共展示了XPCollection.Load方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnActivated
protected override void OnActivated()
{
base.OnActivated();
subjectAreaCollection = ObjectSpace.CreateObject<XPCollection<SubjectArea>>();
subjectAreaCollection.Load();
PopulateSubjectAreaList();
}
示例2: LoadPersonOfInterests
private TargetPerson[] LoadPersonOfInterests()
{
using (var session = new Session())
{
var xpc = new XPCollection<TargetPerson>();
xpc.Load();
return xpc.ToArray();
}
}
示例3: UpdateFaceStatus
private void UpdateFaceStatus()
{
if (_videos.Count > 0)
{
var min = _videos.Min(v => v.CapturedAt);
var max = _videos.Max(v => v.CapturedAt);
_portraits = new XPCollection<Portrait>();
var cretia = CriteriaOperator.Parse("CaptureTime >= ? and CaptureTime < ?",
min, max);
_portraits.Criteria = cretia;
_portraits.Load();
var gq = from Portrait item in _portraits
group item by item.CaptureTime.Date.AddHours(item.CaptureTime.Hour).AddMinutes(item.CaptureTime.Minute)
into g
orderby g.Key ascending
select g;
foreach (var v in _videos)
{
var video = v;
_cts.Token.ThrowIfCancellationRequested();
var hasFace = gq.Where(g => g.Key == video.CapturedAt).Count() != 0;
Action ac = () => video.HasFaceCaptured = hasFace;
this.BeginInvoke(ac);
}
}
}
示例4: DoSearch
private void DoSearch()
{
var videos =
new FileSystemStorage(
Properties.Settings.Default.OutputPath).
VideoFilesBetween(_selectedCamera.Id,
_currentRange.From, _currentRange.To).ToList();
var watch = System.Diagnostics.Stopwatch.StartNew();
var range = new DateTimeRange(_currentRange.From, _currentRange.To.AddMinutes(1));
watch.Stop();
System.Diagnostics.Debug.WriteLine("frames search took " + watch.Elapsed);
watch.Start();
_portraits = new XPCollection<Portrait>();
var cretia = CriteriaOperator.Parse("CaptureTime >= ? and CaptureTime < ?",
range.From, range.To);
_portraits.Criteria = cretia;
_portraits.Load();
var gq = from item in _portraits
group item by item.CaptureTime.Date.AddHours(item.CaptureTime.Hour).AddMinutes(item.CaptureTime.Minute) into g
orderby g.Key ascending
select g;
watch.Stop();
System.Diagnostics.Debug.WriteLine("portraits search took " + watch.Elapsed);
this._screen.ClearAll();
foreach (var v in videos)
{
if (v.CapturedAt.Ticks < _currentRange.From.Ticks || v.CapturedAt.Ticks > _currentRange.To.Ticks)
{
continue;
}
v.HasFaceCaptured = gq.Where(g => g.Key == v.CapturedAt).Count() != 0;
if ((_scope & SearchScope.FaceCapturedVideo)
== SearchScope.FaceCapturedVideo)
{
if (v.HasFaceCaptured)
{
_screen.AddVideo(v);
}
}
if ((_scope & SearchScope.MotionWithoutFaceVideo)
== SearchScope.MotionWithoutFaceVideo)
{
if (v.HasMotionDetected && !v.HasFaceCaptured)
{
_screen.AddVideo(v);
}
}
if ((_scope & SearchScope.MotionLessVideo)
== SearchScope.MotionLessVideo)
{
if (!v.HasFaceCaptured &&
!v.HasMotionDetected)
{
_screen.AddVideo(v);
}
}
}
}
示例5: LoadPersonOfInterests
private PortraitCapturer.DAL.DTO.TargetPerson[] LoadPersonOfInterests()
{
using (var session = new Session())
{
var xpc = new XPCollection<PortraitCapturer.DAL.DTO.TargetPerson>();
xpc.Load();
return xpc.ToArray();
}
}