public TextWriter GetTextWriter(TextWriterType textWriterType, TextWriterParameters textReaderParameters)
        {
            LoadTextWriterFactories();

            if (_textWriterFactoriesHash.ContainsKey(textWriterType))
            {
                return _textWriterFactoriesHash[textWriterType].Create(textReaderParameters);
            }

            throw new ArgumentException(string.Format("No Factory defined for type {0}", textWriterType));
        }
Beispiel #2
0
        public static void WriteText(string text, TextWriterType textWriterType, LogWriterType logType)
        {
            switch (textWriterType)
            {
            case TextWriterType.Console:
                var writer = new ConsoleWriter();
                writer.WriteText(text);
                break;

            case TextWriterType.Oracle:
                throw new NotImplementedException();

            case TextWriterType.MangoDb:
                throw new NotImplementedException();

            default:
                throw new NotSupportedException();
            }

            switch (logType)
            {
            case LogWriterType.Console:
                var logger = new ConsoleLogger();
                logger.Log(text);
                break;

            case LogWriterType.Log4J:
                throw new NotImplementedException();

            case LogWriterType.ApplicationInsights:
                throw new NotImplementedException();

            default:
                throw new NotSupportedException();
            }
        }