Ejemplo n.º 1
0
        private void GameStudioLoaded(object sender, RoutedEventArgs e)
        {
            if (!Editor.Session.IsEditorInitialized)
            {
                // Size the window to best fit the current screen size
                InitializeWindowSize();
                // Load the docking layout
                dockingLayout.ReloadCurrentLayout();
                // Restore visible/hidden status of panes
                GameStudioViewModel.GameStudio.Panels.LoadFromSettings();
                // Initialize plugins
                Editor.Session.ServiceProvider.Get <IAssetsPluginService>().Plugins.ForEach(x => x.InitializeSession(Editor.Session));
                // Open assets that were being edited in the previous session
                ReopenAssetEditors(dockingLayout.LoadOpenAssets().ToList()).Forget();

                // Listen to clipboard
                ClipboardMonitor.RegisterListener(this);
                // Notify start
                Program.NotifyGameStudioStarted();

                Editor.Session.PluginsInitialized();

                foreach (var window in Application.Current.Windows.Cast <Window>().Where(x => !Equals(x, this)))
                {
                    var childHwnd  = new WindowInteropHelper(window).Handle;
                    var parentHwnd = new WindowInteropHelper(this).Handle;
                    var handleRef  = new HandleRef(window, childHwnd);
                    NativeHelper.SetWindowLong(handleRef, NativeHelper.WindowLongType.HwndParent, parentHwnd);
                }
            }
        }