예제 #1
0
        void criterion_PropertyChanged(object sender, PropertyChangedEventArgs e)
        {
            if (e.PropertyName == "IsUse")
            {
                Criterion cr = sender as Criterion;
                if (cr.Type == CriterionType.LargerFileSize)
                {
                    var founded = _criterions.First(c => c.Type == CriterionType.SmallerFileSize);
                    founded.PropertyChanged -= criterion_PropertyChanged;
                    founded.IsUse            = false;
                    founded.PropertyChanged += criterion_PropertyChanged;
                }
                else if (cr.Type == CriterionType.SmallerFileSize)
                {
                    var founded = _criterions.First(c => c.Type == CriterionType.LargerFileSize);
                    founded.PropertyChanged -= criterion_PropertyChanged;
                    founded.IsUse            = false;
                    founded.PropertyChanged += criterion_PropertyChanged;
                }
            }
            else if (e.PropertyName == "Weight" && !calculateInProgress)
            {
                Criterion cr = sender as Criterion;
                if (cr.Weight > 1)
                {
                    cr.Weight = 0.99M;
                }

                calculateInProgress = true;
                SaatiHelper.RecalculateIndex(_criterions, cr);
                calculateInProgress = false;
            }
        }
예제 #2
0
        public ComparatorViewModel(DuplicateGroup group, ObservableCollection <DuplicateGroup> groups,
                                   ICollectionView groupsView, IUndoRedoEngine undoRedoEngine, WindowService windowService,
                                   IConfigurationModel configuration)
            : this(undoRedoEngine, windowService, configuration)
        {
            _group      = group;
            _groups     = groups;
            _groupsView = groupsView;

            _list    = new LinkedList <ImageInfoClass>(group.FileList);
            _current = _list.First;
            //_list.First.Next

            SaatiHelper.CalculateIndex(_list, configuration);
        }
예제 #3
0
        public ComparatorViewModel(DuplPairViewModel result, ObservableCollection <DuplPairViewModel> resultList,
                                   IEditableCollectionView collectionView, IUndoRedoEngine undoRedoEngine, WindowService windowService,
                                   IConfigurationModel configuration)
            : this(undoRedoEngine, windowService, configuration)
        {
            _result         = result;
            _resultList     = resultList;
            _collectionView = collectionView;

            List <ImageInfoClass> list = new List <ImageInfoClass>();

            list.Add(result.FirstFile);
            list.Add(result.SecondFile);
            _list    = new LinkedList <ImageInfoClass>(list);
            _current = _list.First;
            SaatiHelper.CalculateIndex(_list, configuration);
        }