本文整理汇总了C#中IServiceProvider.GetPythonContentType方法的典型用法代码示例。如果您正苦于以下问题:C# IServiceProvider.GetPythonContentType方法的具体用法?C# IServiceProvider.GetPythonContentType怎么用?C# IServiceProvider.GetPythonContentType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IServiceProvider
的用法示例。
在下文中一共展示了IServiceProvider.GetPythonContentType方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: EnsureReplWindow
internal static IVsInteractiveWindow/*!*/ EnsureReplWindow(IServiceProvider serviceProvider, IPythonInterpreterFactory factory, PythonProjectNode project) {
var compModel = serviceProvider.GetComponentModel();
var provider = compModel.GetService<InteractiveWindowProvider>();
string replId = PythonReplEvaluatorProvider.GetReplId(factory, project);
var window = provider.FindReplWindow(replId);
if (window == null) {
window = provider.CreateInteractiveWindow(
serviceProvider.GetPythonContentType(),
factory.Description + " Interactive",
typeof(PythonLanguageInfo).GUID,
replId
);
var toolWindow = window as ToolWindowPane;
if (toolWindow != null) {
toolWindow.BitmapImageMoniker = KnownMonikers.PYInteractiveWindow;
}
var pyService = serviceProvider.GetPythonToolsService();
window.InteractiveWindow.SetSmartUpDown(pyService.GetInteractiveOptions(factory).ReplSmartHistory);
}
if (project != null && project.Interpreters.IsProjectSpecific(factory)) {
project.AddActionOnClose(window, BasePythonReplEvaluator.CloseReplWindow);
}
return window;
}
示例2: EnsureReplWindow
internal static IVsInteractiveWindow/*!*/ EnsureReplWindow(IServiceProvider serviceProvider) {
var compModel = serviceProvider.GetComponentModel();
var provider = compModel.GetService<InteractiveWindowProvider>();
string replId = PythonDebugReplEvaluatorProvider.GetDebugReplId();
var window = provider.FindReplWindow(replId);
if (window == null) {
window = provider.CreateInteractiveWindow(serviceProvider.GetPythonContentType(), "Python Debug Interactive", typeof(PythonLanguageInfo).GUID, replId);
var pyService = serviceProvider.GetPythonToolsService();
window.InteractiveWindow.SetSmartUpDown(pyService.DebugInteractiveOptions.ReplSmartHistory);
}
return window;
}