public WindowElementBinder()
 {
     _bindings = new Dictionary<IWindowElement, List<IBinding>>();
     _logger = new DefaultActivityLogger();
     _persistantBindings = new SerializableBindings();
     //_logger.Tap.Register( new ActivityLoggerConsoleSink() );
 }
Пример #2
0
        static void Main(string[] args)
        {
            var cs = args[0];
            var path = args.Length == 2 ? args[1] : Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);

            var logger = new DefaultActivityLogger();
            logger.Tap.Register(new ActivityLoggerTextWriterSink(Console.Out));

            using (var fs = File.OpenWrite(Path.Combine(path, "DbSetup.log")))
            using (var w = new StreamWriter(fs, Encoding.UTF8))
            {
                logger.Tap.Register(new ActivityLoggerTextWriterSink(w));
                SetupManager.Setup(cs, path, logger);
            }
        }
Пример #3
0
        private Stream DoSetup()
        {
            var ms = new MemoryStream();
            var w = new StreamWriter(ms, Encoding.UTF8);

            var console = new ActivityLoggerTextWriterSink(w);
            var logger = new DefaultActivityLogger();
            logger.Tap.Register(console);

            SetupManager.Setup(Core.Config.Current.ConnectionString, Path.Combine(Core.Config.Current.AppPath, "bin"), logger);

            w.Flush();
            ms.Seek(0, SeekOrigin.Begin);
            return ms;
        }
Пример #4
0
        public void logtest()
        {
            IDefaultActivityLogger Logger = new DefaultActivityLogger();
            Logger.Tap.Register( new ListImpl() );

            var tag1 = ActivityLogger.RegisteredTags.FindOrCreate( "Product" );
            var tag2 = ActivityLogger.RegisteredTags.FindOrCreate( "Sql" );
            var tag3 = ActivityLogger.RegisteredTags.FindOrCreate( "Combined Tag|Sql|Engine V2|Product" );

            Logger.UnfilteredLog( tag1, LogLevel.Fatal, "Fatal Log ", DateTime.UtcNow );
            Logger.UnfilteredLog( tag1, LogLevel.Fatal, "Fatal Log ", DateTime.UtcNow );
            Logger.UnfilteredLog( tag3, LogLevel.Trace, "Trace Log ", DateTime.UtcNow );

            Console.WriteLine( Logger.Tap.RegisteredSinks.OfType<ListImpl>().Single().LoggerContent );
            Logger.UnfilteredLog( tag2, LogLevel.Info, "Info Log ", DateTime.UtcNow );
            Console.WriteLine( Logger.Tap.RegisteredSinks.OfType<ListImpl>().Single().LoggerContent );
        }
 public WindowManagerExecutor()
 {
     _placeholder = new PreviewBindingInfo();
     _logger = new DefaultActivityLogger();
     //_logger.Tap.Register( new ActivityLoggerConsoleSink() );
 }