Exemplo n.º 1
0
        public MainWindow()
        {
            InitializeComponent();

            Logger.Init();

            EditorKernel.Inject(this);

            ThemeResourceDictionary.ApplyTheme(this, Settings.Theme);

            removeInvalidRecents();

            workspacePanel.Loaded += WorkspacePanel_Loaded;
            Width  = Settings.WindowSize.Width != 0 ? Settings.WindowSize.Width : 800;
            Height = Settings.WindowSize.Height != 0 ? Settings.WindowSize.Height : 600;

            if (Settings.ReopenMostRecentProject && Settings.RecentProjects.Count > 0)
            {
                // TODO: reopen project
                string  path    = Settings.RecentProjects[0];
                Project project = Controls.Workspace.Extensions.ReadFromBinaryFile <Project>(path);
                ProjectExplorer.Project = project;
            }

            AddHandler(ActionPerformedEvent, new RoutedActionPerformedEventHandler(actionPerformedHandler));
            AddHandler(FileOpenedEvent, new RoutedFileOpenedEventHandler(fileOpenedHandler));
            AddHandler(PropertyGrid.ValueEditedEvent, new RoutedValueEditedEventHandler(valueEditedHandler));

            AddHandler(WorkspacePanel.SelectionChangedEvent, new RoutedSelectionChangedEventHandler(selectionChangedHandler));
            AddHandler(WorkspacePanel.PanelFocusedEvent, new PanelActionEventHandler(panelFocused));

            Logger.OnLog += Logger_OnLog;
        }
Exemplo n.º 2
0
        public WelcomePage()
        {
            InitializeComponent();

            EditorKernel.Inject(this);

            recentProjects.ItemsSource = Settings.RecentProjects.Select(path => new ResourceFile(path, ResourceContext, ThumbnailRenderer)).ToList();
            recentFiles.ItemsSource    = Settings.RecentFiles.Select(path => new ResourceFile(path, ResourceContext, ThumbnailRenderer)).ToList();
        }
Exemplo n.º 3
0
        public SettingsWindow()
        {
            InitializeComponent();

            EditorKernel.Inject(this);

            propertyGrid.PropertyEditorFactory = new PropertyEditorFactory();
            propertyGrid.SelectedObject        = Settings;

            ThemeResourceDictionary.ApplyTheme(this, Settings.Theme);
        }
Exemplo n.º 4
0
        public ResourceManagerPanel()
        {
            InitializeComponent();

            EditorKernel.Inject(this);

            supportedExtensions = ResourceFormat.Values.Map(format => format.Extension).Filter(extension => extension != null).ToArray();

            foreach (string library in Settings.Libraries)
            {
                loadLibrary(library);
            }
        }
Exemplo n.º 5
0
 public IDockablePanel MakePanel(Type type)
 {
     return(EditorKernel.GetService(type) as IDockablePanel);
 }