コード例 #1
0
 private void OnCmdFindDuplicates()
 {
     try
     {
         var dupliChecker = new DuplicateChecker();
         var dupliList    = dupliChecker.FindDuplicates(GetLogEntries).ToList();
         MessageBox.Show("Gefundene Duplikate: " + dupliList.Count.ToString(), "Duplikate");
     }
     catch (Exception)
     {
         MessageBox.Show("Es sind keine Daten vorhanden", "Keine Daten vorhanden, zersch Date lade du tubel",
                         MessageBoxButton.OK, MessageBoxImage.Error);
     }
 }
コード例 #2
0
        public string FindDuplicates()
        {
            string                    message          = "";
            DuplicateChecker          duplicateChecker = new DuplicateChecker();
            IEnumerable <VLogentries> logEnumerable    = LogList;
            List <VLogentries>        list             = new List <VLogentries>(logEnumerable);
            var duplicateList = duplicateChecker.FindDuplicates(list);

            foreach (VLogentries log in duplicateList)
            {
                message += log.ToString() + "\n";
            }

            return(message);
        }
コード例 #3
0
        private void OnCmdDuplicatCheck()
        {
            DuplicateChecker dupChecker = new DuplicateChecker();
            var dupList = dupChecker.FindDuplicates(LogEntries);

            if (dupList.Any())
            {
                var newEntities = new List <IEntity>();
                foreach (DuplicateCheckerLib.IEntity d in dupList)
                {
                    newEntities.Add(d as IEntity);
                }

                LogEntries.Clear();
                LogEntries = newEntities;
            }
            else
            {
                MessageBox.Show("There are no duplicated Log Entries");
            }
        }
コード例 #4
0
        private void RunDuplicatesChecker()
        {
            var dubChecker = new DuplicateChecker();
            var logRepo    = new LogEntryRepository();
            var logList    = logRepo.GetAll().ToList <LogEntry>();
            var dubList    = dubChecker.FindDuplicates(logList);

            if (dubList.Any())
            {
                for (int i = 0; i < dubList.Count(); i++)
                {
                    var log = (LogEntry)dubList.ElementAt(i);
                    for (int j = 0; j < logList.Count(); j++)
                    {
                        if (logList.ElementAt(j).Id == log.Id)
                        {
                            logList.ElementAt(j).IsDuplicate = true;
                        }
                    }
                }
            }
            this.LogEntriesList = logList;
            OnPropertyChanged("LogEntriesList");
        }