private void SearchFinshFunc(object BehaviorInfoListObj)
        {
            m_behaviorList = (List <BehaviorInfo>)BehaviorInfoListObj;
            if (m_behaviorList.Count == 0)
            {
                this.searchBtn.Enabled = true;
                MyLog4Net.Container.Instance.Log.Debug("ucBehaviorSearch SearchFinshFunc " + " not have any Data");
                noDataLabel.Visible = true;
                return;
            }
            MyLog4Net.Container.Instance.Log.Debug("ucBehaviorSearch SearchFinshFunc end");
            int id = 0;

            foreach (var item in m_behaviorList)
            {
                item.ObjectId = (uint)id;
                BehaviorProperty proItem = new BehaviorProperty(item);
                dataGridViewX1.Rows.Add(item.CameraID,
                                        item.StartTime,
                                        item.EndTime,
                                        proItem.EventType);
                dataGridViewX1.Rows[id].Tag = proItem;
                id++;
                m_EventList.Add(proItem);
            }
            this.searchBtn.Enabled = true;
            MyLog4Net.Container.Instance.Log.Debug("ucBehaviorSearch SearchFinshFunc Add Data End");
        }
示例#2
0
 void m_viewModel_BehaviorEventReceived(BehaviorInfo obj)
 {
     if (InvokeRequired)
     {
         this.Invoke(new Action <BehaviorInfo>(m_viewModel_BehaviorEventReceived), obj);
     }
     else
     {
         if (behaviorEventList.Count >= 50)
         {
             var item = behaviorEventList[behaviorEventList.Count - 1];
             item.Dispose();
             behaviorEventList.RemoveAt(behaviorEventList.Count - 1);
             advTreeBehaviourEvent.Nodes.RemoveAt(behaviorEventList.Count - 1);
         }
         var property = new BehaviorProperty(obj);
         behaviorEventList.Insert(0, property);
         //advTreeTrafficEvent.RefreshItems();
         DevComponents.AdvTree.Node n = new DevComponents.AdvTree.Node(property.EventType);
         n.Cells.Add(new DevComponents.AdvTree.Cell(property.StartTime));
         n.Cells.Add(new DevComponents.AdvTree.Cell(property.EndTime));
         n.Cells.Add(new DevComponents.AdvTree.Cell(property.ObjectId));
         n.Cells.Add(new DevComponents.AdvTree.Cell(property.ObjType));
         n.Cells.Add(new DevComponents.AdvTree.Cell(property.CameraCode));
         n.Tag = property;
         advTreeBehaviourEvent.Nodes.Insert(0, n);
     }
 }
 private void dataGridViewX1_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
 {
     //获取当前的数据  并显示
     if (dataGridViewX1.CurrentRow.Tag is BehaviorProperty)
     {
         BehaviorProperty item            = (BehaviorProperty)dataGridViewX1.CurrentRow.Tag;
         FormSingleBehaviourEvnetDetail f = new FormSingleBehaviourEvnetDetail();
         f.ImageUseURL = true;
         f.Init(m_EventList);
         f.ShowResult(item);
         f.ShowDialog();
     }
 }
示例#4
0
        IBehaviorProperty <T> CreateProperty <T>(T initialValue, Action <T> onSet, IObservable <bool> isReadOnly = null)
        {
            isReadOnly = isReadOnly ?? Observable.Return(false);

            var subject = new BehaviorSubject <T>(initialValue);

            var property = BehaviorProperty.Create(subject, _invalidated.Update(Unit.Default), isReadOnly);

            property.Skip(1)
            .DistinctUntilChanged()
            .Do(onSet)
            .Subscribe();

            return(property);
        }