本文整理汇总了C#中System.ComponentModel.Composition.Hosting.ExportProvider.GetExportedValue方法的典型用法代码示例。如果您正苦于以下问题:C# ExportProvider.GetExportedValue方法的具体用法?C# ExportProvider.GetExportedValue怎么用?C# ExportProvider.GetExportedValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.ComponentModel.Composition.Hosting.ExportProvider
的用法示例。
在下文中一共展示了ExportProvider.GetExportedValue方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Initialize
protected override void Initialize()
{
base.Initialize();
_componentModel = (IComponentModel)GetService(typeof(SComponentModel));
_exportProvider = _componentModel.DefaultExportProvider;
_vim = _exportProvider.GetExportedValue<IVim>();
}
示例2: RHistoryIntegrationTest
public RHistoryIntegrationTest(RComponentsMefCatalogFixture catalog) {
_exportProvider = catalog.CreateExportProvider();
_textBufferFactory = _exportProvider.GetExportedValue<ITextBufferFactoryService>();
_textEditorFactory = _exportProvider.GetExportedValue<ITextEditorFactoryService>();
_workflowProvider = _exportProvider.GetExportedValue<IRInteractiveWorkflowProvider>();
_contentTypeRegistryService = _exportProvider.GetExportedValue<IContentTypeRegistryService>();
_interactiveWindowComponentContainerFactory = _exportProvider.GetExportedValue<IInteractiveWindowComponentContainerFactory>();
_historyVisualComponentContainerFactory = _exportProvider.GetExportedValue<IRHistoryVisualComponentContainerFactory>();
}
示例3: Initialize
protected override void Initialize()
{
base.Initialize();
_componentModel = (IComponentModel)GetService(typeof(SComponentModel));
_exportProvider = _componentModel.DefaultExportProvider;
_vim = _exportProvider.GetExportedValue<IVim>();
// Add our command handlers for menu (commands must exist in the .vsct file)
OleMenuCommandService mcs = GetService(typeof(IMenuCommandService)) as OleMenuCommandService;
if (null != mcs)
{
// Create the command for the menu item.
var optionsId = new CommandID(GuidList.VsVimCommandSet, (int)CommandIds.Options);
var optionsMenuItem = new MenuCommand(OnOptionsClick, optionsId);
mcs.AddCommand(optionsMenuItem);
}
}
示例4: GetCommands
public static IEnumerable<MenuCommand> GetCommands(ExportProvider exportProvider) {
var interactiveWorkflowProvider = exportProvider.GetExportedValue<IRInteractiveWorkflowProvider>();
var interactiveWorkflowComponentContainerFactory = exportProvider.GetExportedValue<IInteractiveWindowComponentContainerFactory>();
var interactiveWorkflow = interactiveWorkflowProvider.GetOrCreate();
var projectServiceAccessor = exportProvider.GetExportedValue<IProjectServiceAccessor>();
var plotHistoryProvider = exportProvider.GetExportedValue<IPlotHistoryProvider>();
var plotHistory = plotHistoryProvider.GetPlotHistory(interactiveWorkflow.RSession);
var textViewTracker = exportProvider.GetExportedValue<IActiveWpfTextViewTracker>();
var debuggerModeTracker = exportProvider.GetExportedValue<IDebuggerModeTracker>();
return new List<MenuCommand> {
new GoToOptionsCommand(),
new GoToEditorOptionsCommand(),
new ImportRSettingsCommand(),
new SendSmileCommand(),
new SendFrownCommand(),
new OpenDocumentationCommand(RGuidList.RCmdSetGuid, RPackageCommandId.icmdRtvsDocumentation, DocumentationUrls.RtvsDocumentation),
new OpenDocumentationCommand(RGuidList.RCmdSetGuid, RPackageCommandId.icmdRtvsSamples, DocumentationUrls.RtvsSamples),
new OpenDocumentationCommand(RGuidList.RCmdSetGuid, RPackageCommandId.icmdRDocsIntroToR, DocumentationUrls.CranIntro),
new OpenDocumentationCommand(RGuidList.RCmdSetGuid, RPackageCommandId.icmdRDocsTaskViews, DocumentationUrls.CranViews),
new OpenDocumentationCommand(RGuidList.RCmdSetGuid, RPackageCommandId.icmdRDocsDataImportExport, DocumentationUrls.CranData),
new OpenDocumentationCommand(RGuidList.RCmdSetGuid, RPackageCommandId.icmdRDocsWritingRExtensions, DocumentationUrls.CranExtensions),
new OpenDocumentationCommand(RGuidList.RCmdSetGuid, RPackageCommandId.icmdCheckForUpdates, DocumentationUrls.CheckForRtvsUpdates),
new OpenDocumentationCommand(RGuidList.RCmdSetGuid, RPackageCommandId.icmdMicrosoftRProducts, DocumentationUrls.MicrosoftRProducts),
new LoadWorkspaceCommand(interactiveWorkflow, projectServiceAccessor),
new SaveWorkspaceCommand(interactiveWorkflow, projectServiceAccessor),
new AttachDebuggerCommand(interactiveWorkflow),
new AttachToRInteractiveCommand(interactiveWorkflow),
new StopDebuggingCommand(interactiveWorkflow),
new ContinueDebuggingCommand(interactiveWorkflow),
new StepOverCommand(interactiveWorkflow),
new StepOutCommand(interactiveWorkflow),
new StepIntoCommand(interactiveWorkflow),
new SourceRScriptCommand(interactiveWorkflow, textViewTracker),
new InterruptRCommand(interactiveWorkflow, debuggerModeTracker),
new ResetReplCommand(interactiveWorkflow),
new ImportDataSetTextFileCommand(),
new ImportDataSetUrlCommand(),
new InstallPackagesCommand(),
new CheckForPackageUpdatesCommand(),
// Window commands
new ShowPlotWindowsCommand(),
new ShowRInteractiveWindowsCommand(interactiveWorkflowProvider, interactiveWorkflowComponentContainerFactory),
new ShowVariableWindowCommand(),
new ShowHelpWindowCommand(),
new ShowHelpOnCurrentCommand(interactiveWorkflow, textViewTracker),
new ShowHistoryWindowCommand(),
// Plot commands
new ExportPlotAsImageCommand(plotHistory),
new ExportPlotAsPdfCommand(plotHistory),
new CopyPlotAsBitmapCommand(plotHistory),
new CopyPlotAsMetafileCommand(plotHistory),
new HistoryNextPlotCommand(plotHistory),
new HistoryPreviousPlotCommand(plotHistory),
new ClearPlotsCommand(plotHistory),
new RemovePlotCommand(plotHistory),
};
}
示例5: RInteractiveWorkflowOperationsTest
public RInteractiveWorkflowOperationsTest(RComponentsMefCatalogFixture catalog) {
_exportProvider = catalog.CreateExportProvider();
_workflow = _exportProvider.GetExportedValue<IRInteractiveWorkflowProvider>().GetOrCreate();
}
示例6: GetCommands
public static IEnumerable<MenuCommand> GetCommands(ExportProvider exportProvider) {
var appShell = VsAppShell.Current;
var interactiveWorkflowProvider = exportProvider.GetExportedValue<IRInteractiveWorkflowProvider>();
var interactiveWorkflow = interactiveWorkflowProvider.GetOrCreate();
var projectServiceAccessor = exportProvider.GetExportedValue<IProjectServiceAccessor>();
var textViewTracker = exportProvider.GetExportedValue<IActiveWpfTextViewTracker>();
var replTracker = exportProvider.GetExportedValue<IActiveRInteractiveWindowTracker>();
var debuggerModeTracker = exportProvider.GetExportedValue<IDebuggerModeTracker>();
var contentTypeRegistryService = exportProvider.GetExportedValue<IContentTypeRegistryService>();
var pss = exportProvider.GetExportedValue<IProjectSystemServices>();
var wbs = exportProvider.GetExportedValue<IWebBrowserServices>();
var pcsp = exportProvider.GetExportedValue<IProjectConfigurationSettingsProvider>();
var dbcs = exportProvider.GetExportedValue<IDbConnectionService>();
var settings = exportProvider.GetExportedValue<IRToolsSettings>();
var logPerms = appShell.Services.LoggingServices.Permissions;
var console = new InteractiveWindowConsole(interactiveWorkflow);
return new List<MenuCommand> {
new GoToOptionsCommand(),
new GoToEditorOptionsCommand(),
new ImportRSettingsCommand(),
new InstallRClientCommand(appShell),
new SwitchToRClientCommand(interactiveWorkflow.Connections, appShell, settings),
new SurveyNewsCommand(appShell),
new SetupRemoteCommand(),
new ReportIssueCommand(appShell.Services),
new SendSmileCommand(appShell.Services),
new SendFrownCommand(appShell.Services),
CreateRCmdSetCommand(RPackageCommandId.icmdRDocsIntroToR, new OpenDocumentationCommand(interactiveWorkflow, OnlineDocumentationUrls.CranIntro, LocalDocumentationPaths.CranIntro)),
CreateRCmdSetCommand(RPackageCommandId.icmdRDocsDataImportExport, new OpenDocumentationCommand(interactiveWorkflow, OnlineDocumentationUrls.CranData, LocalDocumentationPaths.CranData)),
CreateRCmdSetCommand(RPackageCommandId.icmdRDocsWritingRExtensions, new OpenDocumentationCommand(interactiveWorkflow, OnlineDocumentationUrls.CranExtensions, LocalDocumentationPaths.CranExtensions)),
CreateRCmdSetCommand(RPackageCommandId.icmdRDocsTaskViews, new OpenDocumentationCommand(interactiveWorkflow, OnlineDocumentationUrls.CranViews)),
CreateRCmdSetCommand(RPackageCommandId.icmdRtvsDocumentation, new OpenDocumentationCommand(interactiveWorkflow, OnlineDocumentationUrls.RtvsDocumentation)),
CreateRCmdSetCommand(RPackageCommandId.icmdRtvsSamples, new OpenDocumentationCommand(interactiveWorkflow, OnlineDocumentationUrls.RtvsSamples)),
CreateRCmdSetCommand(RPackageCommandId.icmdCheckForUpdates, new OpenDocumentationCommand(interactiveWorkflow, OnlineDocumentationUrls.CheckForRtvsUpdates)),
CreateRCmdSetCommand(RPackageCommandId.icmdMicrosoftRProducts, new OpenDocumentationCommand(interactiveWorkflow, OnlineDocumentationUrls.MicrosoftRProducts)),
new LoadWorkspaceCommand(appShell, interactiveWorkflow, projectServiceAccessor),
new SaveWorkspaceCommand(appShell, interactiveWorkflow, projectServiceAccessor),
new AttachDebuggerCommand(interactiveWorkflow),
new AttachToRInteractiveCommand(interactiveWorkflow),
new StopDebuggingCommand(interactiveWorkflow),
new ContinueDebuggingCommand(interactiveWorkflow),
new StepOverCommand(interactiveWorkflow),
new StepOutCommand(interactiveWorkflow),
new StepIntoCommand(interactiveWorkflow),
CreateRCmdSetCommand(RPackageCommandId.icmdSourceRScript, new SourceRScriptCommand(interactiveWorkflow, textViewTracker, false)),
CreateRCmdSetCommand(RPackageCommandId.icmdSourceRScriptWithEcho, new SourceRScriptCommand(interactiveWorkflow, textViewTracker, true)),
new RunShinyAppCommand(interactiveWorkflow),
new StopShinyAppCommand(interactiveWorkflow),
CreateRCmdSetCommand(RPackageCommandId.icmdInterruptR, new InterruptRCommand(interactiveWorkflow, debuggerModeTracker)),
CreateRCmdSetCommand(RPackageCommandId.icmdTerminateR, new TerminateRCommand(interactiveWorkflow, appShell)),
CreateRCmdSetCommand(RPackageCommandId.icmdSessionInformation, new SessionInformationCommand(interactiveWorkflow, console)),
CreateRCmdSetCommand(RPackageCommandId.icmdDeleteProfile, new DeleteProfileCommand(interactiveWorkflow)),
new ResetReplCommand(interactiveWorkflow),
// Directory management
new SetDirectoryToSourceCommand(interactiveWorkflow, textViewTracker),
new SetDirectoryToProjectCommand(interactiveWorkflow, pss),
new SelectWorkingDirectoryCommand(interactiveWorkflow),
new ImportDataSetTextFileCommand(appShell, interactiveWorkflow.RSession),
new ImportDataSetUrlCommand(interactiveWorkflow.RSession),
new DeleteAllVariablesCommand(interactiveWorkflow.RSession),
new AddDbConnectionCommand(dbcs, pss, pcsp, interactiveWorkflow),
new AddDsnCommand(appShell, interactiveWorkflow),
new ManageDsnCommand(appShell, interactiveWorkflow),
// Window commands
new ShowRInteractiveWindowsCommand(interactiveWorkflowProvider),
new ShowVariableWindowCommand(),
new ShowToolWindowCommand<HelpWindowPane>(RPackageCommandId.icmdShowHelpWindow),
new ShowToolWindowCommand<HistoryWindowPane>(RPackageCommandId.icmdShowHistoryWindow),
new ShowToolWindowCommand<ConnectionManagerWindowPane>(RPackageCommandId.icmdShowConnectionsWindow),
new ShowToolWindowCommand<PackageManagerWindowPane>(RPackageCommandId.icmdShowPackagesWindow),
new ShowToolWindowCommand<PlotHistoryWindowPane>(RPackageCommandId.icmdPlotHistoryWindow),
new ShowHelpOnCurrentCommand(interactiveWorkflow, textViewTracker, replTracker),
new SearchWebForCurrentCommand(interactiveWorkflow, textViewTracker, replTracker, wbs),
new GotoEditorWindowCommand(textViewTracker, contentTypeRegistryService),
new GotoSolutionExplorerCommand(),
// Plot commands
CreateRCmdSetCommand(RPackageCommandId.icmdNewPlotWindow, new PlotDeviceNewCommand(interactiveWorkflow)),
CreateRCmdSetCommand(RPackageCommandId.icmdShowPlotWindow, new ShowMainPlotWindowCommand(interactiveWorkflow)),
CreateRCmdSetCommand(RPackageCommandId.icmdPlotWindowsDynamicStart, new ShowPlotWindowCommand(appShell, interactiveWorkflow)),
new HideAllPlotWindowsCommand(appShell),
// Connection manager commands
CreateRCmdSetCommand(RPackageCommandId.icmdReconnect, new ReconnectCommand(interactiveWorkflow)),
CreateRCmdSetCommand(RPackageCommandId.icmdMruConnectionsDynamicStart, new SwitchToConnectionCommand(interactiveWorkflow))
};
//.........这里部分代码省略.........
示例7: RHistoryTests
public RHistoryTests(RComponentsMefCatalogFixture mefCatalog) {
_exportProvider = mefCatalog.CreateExportProvider();
_interactiveWorkflow = InteractiveWorkflowStubFactory.CreateDefault();
_textBuffer = _exportProvider.GetExportedValue<ITextBufferFactoryService>().CreateTextBuffer();
}