/// <summary>Führt anwendungsspezifische Aufgaben durch, die mit der Freigabe, der Zurückgabe oder dem Zurücksetzen von nicht verwalteten Ressourcen zusammenhängen.</summary>
        public void Dispose()
        {
            var           proxy   = client.CreateProxy <IIpcWinSvcWatchDog>(watchDogName);
            ServiceConfig Section = JsonSettingsSection.GetSection <ServiceConfig>("GenericService_ServiceConfiguration");

            if (Section.UseExtConfig)
            {
                var cp = Process.GetCurrentProcess();
                proxy.RegisterRegularShutdown(cp.MachineName, Section.ServiceName, cp.ProcessName, cp.Id);
            }

            OnDisposed();
        }
        /// <summary>Initializes this deferred initializable object</summary>
        public void Initialize()
        {
            var           proxy   = client.CreateProxy <IIpcWinSvcWatchDog>(watchDogName);
            ServiceConfig Section = JsonSettingsSection.GetSection <ServiceConfig>("GenericService_ServiceConfiguration");

            if (Section.UseExtConfig)
            {
                var cp = Process.GetCurrentProcess();
                proxy.RegisterService(cp.MachineName, Section.ServiceName, cp.ProcessName, cp.Id);
            }
            else
            {
                LogEnvironment.LogEvent("Unable to register a service that is using xml-configuration", LogSeverity.Error);
            }

            Initialized = true;
        }
Пример #3
0
 /// <summary>
 /// Writes a specific JsonSettingsSection
 /// </summary>
 /// <param name="name">the name of the ConfigurationSection</param>
 /// <param name="section">the new value to be written to the target-configuration</param>
 public abstract void UpdateSetting(string name, JsonSettingsSection section);
Пример #4
0
 /// <summary>
 /// Writes a specific JsonSettingsSection
 /// </summary>
 /// <param name="name">the name of the ConfigurationSection</param>
 /// <param name="section">the new value to be written to the target-configuration</param>
 public override void UpdateSetting(string name, JsonSettingsSection section)
 {
     Server.UpdateSetting(name, section);
 }
 /// <summary>
 /// Writes a specific JsonSettingsSection
 /// </summary>
 /// <param name="name">the name of the ConfigurationSection</param>
 /// <param name="section">the new value to be written to the target-configuration</param>
 public override void UpdateSetting(string name, JsonSettingsSection section)
 {
     JsonSettings.Default.ReplaceSetting(name, section);
 }