Exemplo n.º 1
0
        public MainWindow(string path, Type editor)
        {
            if (!typeof(IEditorControl).IsAssignableFrom(editor))
            {
                MessageBox.Show("Editor type iCommandBinding_OnExecutednitialize");
                Close();
            }

            if (!File.Exists(path))
            {
                MessageBox.Show("Startup file does not exist!", "Failed to initialize");
                Close();
            }

            InitializeComponents();

            IEditorControl editorControl = OpenTab(editor);
            Exception      openResult    = editorControl.Open(path);

            if (!(openResult is null))
            {
                Logger.DumpException(openResult);
                TabController.Items.RemoveAt(TabController.Items.Count - 1);
                MessageBox.Show("Failed to load file.\nReason: " + openResult.Message, "Tabbed Editor - Failed to load file");
            }