示例#1
0
        public override void Loaded()
        {
            Instance = this;

            Logger.Info($"Core ETGMod init {FullVersion}");
            Logger.Info($"Game folder: {Paths.GameFolder}");

            if (AutoReloadMods)
            {
                _FSWatcher = new FileSystemWatcher {
                    Path         = Paths.ModsFolder,
                    NotifyFilter = NotifyFilters.Attributes | NotifyFilters.CreationTime
                                   | NotifyFilters.DirectoryName | NotifyFilters.FileName
                                   | NotifyFilters.LastWrite | NotifyFilters.Security
                                   | NotifyFilters.Size,
                    IncludeSubdirectories = true,
                };

                var deleg = new FileSystemEventHandler((source, e) => _ShouldAutoReload = true);
                _FSWatcher.Changed += deleg;
                _FSWatcher.Created += deleg;
                _FSWatcher.Deleted += deleg;
                _FSWatcher.Renamed += (source, e) => _ShouldAutoReload = true;

                _FSWatcher.EnableRaisingEvents = true;
            }
        }
示例#2
0
        public override void Loaded()
        {
            Instance = this;

            Logger.Info($"Core ETGMod init {FullVersion}");
            Logger.Info($"Game folder: {GameFolder}");
        }