Пример #1
0
        public MainWindow()
        {
            if (Instance != null)
            {
                // I know, this "single-instance" thing is hardly ideal. I might come back to it.
                throw new InvalidOperationException("Only one instance of this class should be created");
            }

            Instance = this;

            InitializeComponent();

            OutputLog debug = LogView.Supplier.Start(
                "MainWindow_Output", "Debug", ViewSupplier.Category_Main);

            ILogEventSink output = new Output(new OutputLogWriter(debug));

            Logs.AddSink(output);

            ILogEventSink status = new StatusOutput(StatusView, this);

            Logs.AddSink(status);

            FileView.FileOpened += OnOpenFile;

            SetupViewHiding(ScreenView, ScreenTab, OutputTabs);
            SetupViewHiding(MemoryView, MemoryTab, InfoTabs);

            foreach (FileOpenedEventArgs item in FileView.EnumerateOpenedFiles())
            {
                OnOpenFile(FileView, item);
            }
        }