Esempio n. 1
0
        static void AttachToLocalLog(string filePath)
        {
            SimpleMessageSender sender;
            var cache = new FileTapeStream(filePath);
            var store = new LocalEventStore(null, cache);

            var directoryName = Path.GetDirectoryName(filePath) ?? "";
            var dir = new DirectoryInfo(directoryName);
            FileStorageConfig config;

            if (dir.Name == Topology.TapesContainer)
            {
                // we are in proper tapes container
                config = FileStorage.CreateConfig(dir.Parent);
            }
            else
            {
                var temp = Path.Combine(dir.FullName, string.Format("temp-{0:yyyy-MM-dd-HHmm}", DateTime.Now));
                config = FileStorage.CreateConfig(temp);
            }

            var send = config.CreateQueueWriter(Topology.RouterQueue);
            var endpoint = new SimpleMessageSender(EnvelopeStreamer, send);
            Application.Run(new DomainLogView(store, endpoint, EnvelopeStreamer));
        }
Esempio n. 2
0
        static void AttachToLocalLog(string filePath)
        {
            var config = FileStorage.CreateConfig(Path.GetDirectoryName(filePath) ?? "");

            var cache = new FileTapeStream(filePath);

            var store = new LocalEventStore(null, cache);
            var send = config.CreateQueueWriter(Topology.RouterQueue);
            var endpoint = new SimpleMessageSender(EnvelopeStreamer, send);

            Application.Run(new DomainLogView(store, endpoint, EnvelopeStreamer));
        }