Ejemplo n.º 1
0
        public ServiceSettingsConfigProxy(string serviceName, string computerName)
        {
            _runMode = ServiceRunMode.Unknown;
            ServiceEnvironment.ServiceName = serviceName;
            ServiceEnvironment.ComputerNameForConfiguration = computerName;

            _section             = IICConfigSection.CreateDefault <ServiceSettingsConfigSection>();
            _section.ServiceName = serviceName;
        }
        //
        // Nothing in
        public ServiceSettingsConfigProxy(string serviceName, string computerName)
        {
            _runMode             = ServiceRunMode.Unknown;
            _section             = IICConfigSection.CreateDefault <ServiceSettingsConfigSection>();
            _serviceName         = serviceName;
            _section.ServiceName = serviceName;

            Process process = Process.GetCurrentProcess();

            _computerName = computerName.ToUpper();
            _workPath     = AppDomain.CurrentDomain.BaseDirectory;
        }
Ejemplo n.º 3
0
        static TracingManager()
        {
            _queueTracing  = new LazyQueue <TracingEvent>("TracingManager.QueueTracing", 32, 50, TracingDequeueAction);
            _queueLog      = new LazyQueue <SystemLogEvent>("TracingManager.QueueLog", 32, 50, SystemLogDequeueAction);
            _configSection = IICConfigSection.CreateDefault <TracingConfigSection>();
            _level         = TracingLevel.Off;
            ReloadConfiguration();

            //AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(UnhandledException);
            //Trace.Listeners.Add(new DebugTraceListener());

            ObserverManager.RegisterObserver("Tracing", ObserveProc, ClearObserver);
        }
Ejemplo n.º 4
0
        public static IICConfigSection CreateDefault(Type sectionType)
        {
            IICConfigSectionAttribute attr = AttributeHelper.GetAttribute <IICConfigSectionAttribute>(sectionType);

            if (attr.IsRequired)
            {
                return(null);
            }
            else
            {
                IICConfigSection ret = (IICConfigSection)Activator.CreateInstance(sectionType);
                ret.SetDefaultValue();
                return(ret);
            }
        }