public GameStudioWindow(EditorViewModel editor)
        {
            if (editor == null)
            {
                throw new ArgumentNullException(nameof(editor));
            }
            if (editor.Session == null)
            {
                throw new ArgumentException($@"A valid session must exist before creating a {nameof(GameStudioWindow)}", nameof(editor));
            }
            DataContext = editor; // Must be set before calling InitializeComponent

            dockingLayout       = new DockingLayoutManager(this, editor.Session);
            assetEditorsManager = new AssetEditorsManager(dockingLayout, editor.Session);
            editor.ServiceProvider.Get <IEditorDialogService>().AssetEditorsManager = assetEditorsManager;

            OpenDebugWindowCommand     = new AnonymousCommand(editor.ServiceProvider, OpenDebugWindow);
            CreateTestAssetCommand     = new AnonymousCommand(editor.ServiceProvider, CreateTestAsset);
            CreateUnitTestAssetCommand = new AnonymousCommand(editor.ServiceProvider, CreateUnitTestAsset);
            BreakDebuggerCommand       = new AnonymousCommand(editor.ServiceProvider, BreakDebugger);
            EditorSettings.ResetEditorLayout.Command = new AnonymousTaskCommand(editor.ServiceProvider, ResetAllLayouts);

            InitializeComponent();
            Application.Current.Activated += (s, e) => editor.ServiceProvider.Get <IEditorDialogService>().ShowDelayedNotifications();
            Loaded += GameStudioLoaded;
        }
Beispiel #2
0
        public AssetEditorsManager([NotNull] DockingLayoutManager dockingLayoutManager, [NotNull] SessionViewModel session)
        {
            if (dockingLayoutManager == null)
            {
                throw new ArgumentNullException(nameof(dockingLayoutManager));
            }
            if (session == null)
            {
                throw new ArgumentNullException(nameof(session));
            }

            this.dockingLayoutManager = dockingLayoutManager;
            this.session = session;
            session.DeletedAssetsChanged += AssetsDeleted;
        }