Exemplo n.º 1
0
        static void Main(string[] args)
        {
            log4net.Config.XmlConfigurator.Configure();
            Logger.Debug("Hello World");


            ArchiveDuplicateDetector worker = new ArchiveDuplicateDetector();

            worker.Notify += new ArchiveDuplicateDetector.NotifyEventHandler(worker_Notify);

            List <string> paths = new List <string>();

            paths.Add(@"D:\New Folder");
            DuplicateSearchOption option = new DuplicateSearchOption()
            {
                Paths = paths
            };
            List <DuplicateArchiveInfoList> list = worker.Search(option);

            foreach (var item in list)
            {
                System.Console.WriteLine(item.Original.ToString());
                foreach (var dup in item.Duplicates)
                {
                    System.Console.WriteLine(" - " + dup.ToString());
                }
            }

            System.Console.ReadLine();
        }
Exemplo n.º 2
0
        public ArchiveComparer2Form()
        {
            InitializeComponent();

            Assembly        assembly = Assembly.GetExecutingAssembly();
            FileVersionInfo fvi      = FileVersionInfo.GetVersionInfo(assembly.Location);

            this.Text += fvi.ProductVersion;

            log4net.GlobalContext.Properties["Date"] = DateTime.Now.ToString("yyyy-MM-dd HH.mm.ss");
            log4net.Config.XmlConfigurator.Configure();
            if (Logger == null)
            {
                Logger = LogManager.GetLogger(typeof(ArchiveComparer2Form));
            }
            Logger.Info("Starting Up Archive Comparer " + fvi.ProductVersion);

            detector         = new ArchiveDuplicateDetector();
            detector.Notify += new ArchiveDuplicateDetector.NotifyEventHandler(detector_Notify);

            if (Properties.Settings.Default.UpdateRequired)
            {
                Logger.Info("Upgrading application settings");
                Properties.Settings.Default.Upgrade();
                Properties.Settings.Default.UpdateRequired = false;
                Properties.Settings.Default.Save();
            }

            cbxPriority.SelectedIndex = Properties.Settings.Default.threadPriority;

            AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
        }