Beispiel #1
0
            public Logger()
            {
                if (File.Exists(@"C:\Users\User\source\repos\C#\2 kurs\3\3\LABA3\conf.xml"))
                {
                    Presset = Parser.SettingsXML();
                }
                else if (File.Exists(@"C:\Users\User\source\repos\C#\2 kurs\3\3\LABA3\pressets.json"))
                {
                    Presset = Parser.SettingsJson();
                }

                else
                {
                    LogTxt("default config applied \n\r");
                }
                Watcher = new FileSystemWatcher(Presset.sourceDir);
                con     = Presset.Connection;
                target  = Presset.targetDir;
                Watcher.IncludeSubdirectories = true;
                Watcher.EnableRaisingEvents   = true;
                Watcher.Created += FSW_Created;
                Watcher.Deleted += FSW_Deleted;
                Watcher.Renamed += FSW_Renamed;
                Watcher.Changed += FSW_Changed;
            }