Exemplo n.º 1
0
        public static void Create()
        {
            // Called via reflection in test cases. Creates instance
            // of the test shell that code can access during the test run.
            // other shell objects may choose to create their own
            // replacements. For example, interactive editor tests
            // need smaller MEF catalog which excludes certain
            // VS-specific implementations.
            UIThreadHelper.Instance.Invoke(() => {
                lock (_shellLock) {
                    if (_instance == null)
                    {
                        _instance = new TestVsAppShell();
                        RToolsSettings.Current = new TestRToolsSettings();

                        var batch = new CompositionBatch()
                                    .AddValue <IRSettings>(RToolsSettings.Current)
                                    .AddValue(RToolsSettings.Current)
                                    .AddValue <ICoreShell>(_instance)
                                    .AddValue <IEditorShell>(_instance)
                                    .AddValue <IApplicationShell>(_instance)
                                    .AddValue(_instance);
                        VsTestCompositionCatalog.Current.Container.Compose(batch);

                        VsAppShell.Current = _instance;
                    }
                }
            });
        }
Exemplo n.º 2
0
        public static void Create()
        {
            // Called via reflection in test cases. Creates instance
            // of the test shell that code can access during the test run.
            // other shell objects may choose to create their own
            // replacements. For example, interactive editor tests
            // need smaller MEF catalog which excludes certain
            // VS-specific implementations.
            UIThreadHelper.Instance.Invoke(() => {
                _instance = new TestVsAppShell();

                VsAppShell.Current     = _instance;
                RToolsSettings.Current = new TestRToolsSettings();
            });
        }