コード例 #1
0
        private static void SetupTracing()
        {
            try {
                Trace.AddTraceSource(new TraceSource("AppTraceSource"));

                var appConfigWatcher = new ConfigTraceSwitchWatcher();
                appConfigWatcher.Changed += ConfigTraceSwitchWatcherChanged;

                Trace.UpdateConfigurationAttributes();
            }
            catch (Exception ex) {
                throw new Exception("Error raised while trying to update the traceSources by their config file settings", ex);
            }
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: radtek/MNN---WiSSWizard
        private static void SetupTracing(bool WatchAppConfigFileForChanges)
        {
            try
            {
                Trace.AddTraceSource(new TraceSource("AppTraceSource"));

                if (WatchAppConfigFileForChanges)
                {
                    ConfigTraceSwitchWatcher AppConfigWatcher = new ConfigTraceSwitchWatcher();
                    AppConfigWatcher.Changed += new ConfigTraceSwitchWatcher.FileChangedHandler(ConfigTraceSwitchWatcher_Changed);
                }

                Trace.UpdateConfigurationAttributes();
            }
            catch (Exception ex)
            {
                throw new Exception("Error raised while trying to update the traceSources by their config file settings", ex);
            }
        }