private bool Match(TaskUnitInfo taskunit, TreeShowObjectFilter filter)
        {
            switch ((E_VDA_TASK_UNIT_STATUS)taskunit.ImportStatus)
            {
            case E_VDA_TASK_UNIT_STATUS.E_TASK_UNIT_NOUSE:
            case E_VDA_TASK_UNIT_STATUS.E_TASK_UNIT_IMPORT_WAIT:
            case E_VDA_TASK_UNIT_STATUS.E_TASK_UNIT_IMPORT_READY:
            case E_VDA_TASK_UNIT_STATUS.E_TASK_UNIT_IMPORT_EXECUTING:
            case E_VDA_TASK_UNIT_STATUS.E_TASK_UNIT_IMPORT_FAILED:
            case E_VDA_TASK_UNIT_STATUS.E_TASK_UNIT_IMPORT_FINISH:
            case E_VDA_TASK_UNIT_STATUS.E_TASK_UNIT_PREANALYSE_EXECUTING:
            case E_VDA_TASK_UNIT_STATUS.E_TASK_UNIT_PREANALYSE_FAILED:
            case E_VDA_TASK_UNIT_STATUS.E_TASK_UNIT_PREANALYSE_WAIT:
                return(false);
            }

            if (filter == TreeShowObjectFilter.NoUse)
            {
                return(true);
            }

            bool retval = false;

            foreach (E_VDA_ANALYZE_TYPE type in taskunit.AnalyzeStatus.Keys)
            {
                E_VDA_TASK_UNIT_STATUS status = taskunit.AnalyzeStatus[type];
                if ((E_VDA_TASK_UNIT_STATUS)status != E_VDA_TASK_UNIT_STATUS.E_TASK_UNIT_ANALYSE_FINISH)
                {
                    continue;
                }

                //switch ((E_VDA_TASK_UNIT_STATUS)status)
                //{
                //    case E_VDA_TASK_UNIT_STATUS.E_TASK_UNIT_ANALYSE_WAIT:
                //    case E_VDA_TASK_UNIT_STATUS.E_TASK_UNIT_ANALYSE_EXECUTING:
                //    case E_VDA_TASK_UNIT_STATUS.E_TASK_UNIT_ANALYSE_FAILED:
                //        continue;
                //}

                if ((filter & TreeShowObjectFilter.Brief) > 0 && type == E_VDA_ANALYZE_TYPE.E_ANALYZE_BRIEAF)
                {
                    retval = true;
                }
                else if ((filter & TreeShowObjectFilter.Face) > 0 && type == E_VDA_ANALYZE_TYPE.E_ANALYZE_FACE)
                {
                    retval = true;
                }
                else if ((filter & TreeShowObjectFilter.Car) > 0 && type == E_VDA_ANALYZE_TYPE.E_ANALYZE_VEHICLE)
                {
                    retval = true;
                }
                else if ((filter & TreeShowObjectFilter.Object) > 0 && type == E_VDA_ANALYZE_TYPE.E_ANALYZE_OBJECT)
                {
                    retval = true;
                }
            }
            return(retval);
        }
        public VideoPictureTreeViewByTaskModelBase(TreeShowType viewType = TreeShowType.All, TreeShowObjectFilter filter = TreeShowObjectFilter.NoUse)
        {
            m_DTID2TaskUnitInfo           = new Dictionary <uint, TaskUnitInfo>();
            m_DTDisplayIndex2TaskUnitInfo = new SortedDictionary <string, TaskUnitInfo>();
            Framework.Container.Instance.EvtAggregator.GetEvent <TaskUnitAnalyseFinishedEvent>().Subscribe(OnTaskUnitAnalyseFinished, Microsoft.Practices.Prism.Events.ThreadOption.WinFormUIThread);
            Framework.Container.Instance.EvtAggregator.GetEvent <TaskUnitImportFinishedEvent>().Subscribe(OnTaskUnitImportFinished, Microsoft.Practices.Prism.Events.ThreadOption.WinFormUIThread);
            Framework.Container.Instance.EvtAggregator.GetEvent <TaskUnitAddedEvent>().Subscribe(OnTaskUnitAdded, Microsoft.Practices.Prism.Events.ThreadOption.WinFormUIThread);
            Framework.Container.Instance.EvtAggregator.GetEvent <TaskUnitDeletedEvent>().Subscribe(OnTaskUnitDeleted, Microsoft.Practices.Prism.Events.ThreadOption.WinFormUIThread);
            //Framework.Container.Instance.EvtAggregator.GetEvent<TaskAddedEvent>().Subscribe(OnTaskAdded, Microsoft.Practices.Prism.Events.ThreadOption.WinFormUIThread);
            Framework.Container.Instance.EvtAggregator.GetEvent <TaskModifiedEvent>().Subscribe(OnTaskModified, Microsoft.Practices.Prism.Events.ThreadOption.WinFormUIThread);
            Framework.Container.Instance.EvtAggregator.GetEvent <TaskDeletedEvent>().Subscribe(OnTaskDeleted, Microsoft.Practices.Prism.Events.ThreadOption.WinFormUIThread);

            Framework.Container.Instance.RegisterEventSubscriber(this);

            m_viewType = viewType;
            m_filter   = filter;

            UpdateTaskGroups();

            FillupResources();
        }
 public SearchVideoFilterViewModel(TreeShowObjectFilter filter)
     : base(TreeShowType.Camera)
 {
     Filter = filter;
 }