Esempio n. 1
0
        public static ConfigWatcher Startup(string configurationFile)
        {
            if (instance == null)
            {
                instance = new ConfigWatcher(configurationFile);
                instance.StartWatchers();
            }

            return(instance);
        }
Esempio n. 2
0
        public bool ServiceCommand(uint eventId, string objectId)
        {
            ConfigWatcher instance = ConfigWatcher.Instance;

            switch (eventId)
            {
            case STARTUP:
                if (string.IsNullOrEmpty(objectId))
                {
                    instance.StartWatchers();
                }
                else
                {
                    instance.StartWatcher(objectId);
                }
                break;

            case SHUTDOWN:
                if (string.IsNullOrEmpty(objectId))
                {
                    instance.StopWatchers();
                }
                else
                {
                    instance.StopWatcher(objectId);
                }
                break;

            case RESTART:
                instance.RestartWatchers();
                break;

            case STATS:
                instance.RestartWatchers();
                break;
            }
            return(true);
        }