public void FormattedEventLogTraceListenerNodeDefaults()
        {
            FormattedEventLogTraceListenerNode formattedEventLogListener = new FormattedEventLogTraceListenerNode();

            Assert.AreEqual("Formatted EventLog TraceListener", formattedEventLogListener.Name);
            Assert.AreEqual(DefaultValues.EventLogListenerEventSource, formattedEventLogListener.Source);
            Assert.AreEqual(DefaultValues.EventLogListenerLogName, formattedEventLogListener.Log);
            Assert.AreEqual(string.Empty, formattedEventLogListener.MachineName);
        }
        /// <summary>
        /// Adds the <see cref="LoggingSettingsNode"/> and adds the default nodes.
        /// </summary>
        /// <param name="node">The <see cref="LoggingSettingsNode"/> added.</param>
        protected override void ExecuteCore(ConfigurationNode node)
        {
            base.ExecuteCore(node);
			LoggingSettingsNode loggingNode = ChildNode as LoggingSettingsNode;
			if (loggingNode == null) return;

            TextFormatterNode defaultTextFormatterNode = new TextFormatterNode();
            FormattedEventLogTraceListenerNode defaultTraceListenerNode = new FormattedEventLogTraceListenerNode();
            CategoryTraceSourceNode generalCategoryNode = new CategoryTraceSourceNode(new TraceSourceData(Resources.TraceSourceCategoryGeneral, SourceLevels.All));

			loggingNode.AddNode(new LogFilterCollectionNode());

			CategoryTraceSourceCollectionNode categoryTraceSourcesNode = new CategoryTraceSourceCollectionNode();
			TraceListenerReferenceNode generalCategoryListenerRef = new TraceListenerReferenceNode(new TraceListenerReferenceData(defaultTraceListenerNode.Name));
			categoryTraceSourcesNode.AddNode(generalCategoryNode);
			generalCategoryNode.AddNode(generalCategoryListenerRef);
			generalCategoryListenerRef.ReferencedTraceListener = defaultTraceListenerNode;
			loggingNode.AddNode(categoryTraceSourcesNode);			
			
			SpecialTraceSourcesNode specialTraceSourcesNode = new SpecialTraceSourcesNode();			
			ErrorsTraceSourceNode errorsTraceSourcesNode = new ErrorsTraceSourceNode(new TraceSourceData());
            TraceListenerReferenceNode errorsTraceListenerReferenceNode = new TraceListenerReferenceNode();
			errorsTraceSourcesNode.AddNode(errorsTraceListenerReferenceNode);
			errorsTraceListenerReferenceNode.ReferencedTraceListener = defaultTraceListenerNode;
			specialTraceSourcesNode.AddNode(errorsTraceSourcesNode);
			specialTraceSourcesNode.AddNode(new NotProcessedTraceSourceNode(new TraceSourceData()));
			specialTraceSourcesNode.AddNode(new AllTraceSourceNode(new TraceSourceData()));
			loggingNode.AddNode(specialTraceSourcesNode);

			TraceListenerCollectionNode traceListenerCollectionNode = new TraceListenerCollectionNode();
			traceListenerCollectionNode.AddNode(defaultTraceListenerNode);
			defaultTraceListenerNode.Formatter = defaultTextFormatterNode;
			loggingNode.AddNode(traceListenerCollectionNode);

			FormatterCollectionNode formattersNode = new FormatterCollectionNode();
			formattersNode.AddNode(defaultTextFormatterNode);
			loggingNode.AddNode(formattersNode);


            loggingNode.DefaultCategory = generalCategoryNode;
            loggingNode.LogWarningWhenNoCategoriesMatch = true;
			loggingNode.TracingEnabled = true;

            ServiceHelper.GetUIService(serviceProvider).RefreshPropertyGrid();
        }
        public void FormattedEventLogTraceListenerNodeDataTest()
        {
            string name = "some name";
            string source = "some source";
            string log = "some log";
            string machineName = "some machine";

            FormattedEventLogTraceListenerData formattedEventLogTraceListenerData = new FormattedEventLogTraceListenerData();
            formattedEventLogTraceListenerData.Name = name;
            formattedEventLogTraceListenerData.Log = log;
            formattedEventLogTraceListenerData.Source = source;
            formattedEventLogTraceListenerData.MachineName = machineName;

            FormattedEventLogTraceListenerNode formattedEventLogTraceListenerNode = new FormattedEventLogTraceListenerNode(formattedEventLogTraceListenerData);
            ApplicationNode.AddNode(formattedEventLogTraceListenerNode);

            Assert.AreEqual(name, formattedEventLogTraceListenerNode.Name);
            Assert.AreEqual(log, formattedEventLogTraceListenerNode.Log);
            Assert.AreEqual(source, formattedEventLogTraceListenerNode.Source);
            Assert.AreEqual(machineName, formattedEventLogTraceListenerNode.MachineName);
        }