本文整理汇总了C#中ExportProvider类的典型用法代码示例。如果您正苦于以下问题:C# ExportProvider类的具体用法?C# ExportProvider怎么用?C# ExportProvider使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ExportProvider类属于命名空间,在下文中一共展示了ExportProvider类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateView
public static IWpfTextView CreateView(
string contentType,
ExportProvider exportProvider,
params string[] lines)
{
var buffer = CreateBuffer(contentType, exportProvider, lines);
return exportProvider.GetExportedValue<ITextEditorFactoryService>().CreateTextView(buffer);
}
示例2: CreateWorkspaceFromFilesAsync
public static Task<TestWorkspace> CreateWorkspaceFromFilesAsync(
string[] files,
CSharpParseOptions[] parseOptions = null,
CSharpCompilationOptions compilationOptions = null,
ExportProvider exportProvider = null)
{
return CreateWorkspaceFromFilesAsync(LanguageNames.CSharp, compilationOptions, parseOptions, files, exportProvider);
}
示例3: VisualStudioTestExportProvider
static VisualStudioTestExportProvider()
{
PartCatalog =
TestExportProvider.EntireAssemblyCatalogWithCSharpAndVisualBasic.WithParts(
MinimalTestExportProvider.CreateAssemblyCatalog(typeof(CSharpCodeModelService).Assembly));
ExportProvider = MinimalTestExportProvider.CreateExportProvider(PartCatalog);
}
示例4: CreateWorkspaceFromLinesAsync
public static Task<TestWorkspace> CreateWorkspaceFromLinesAsync(
string[] lines,
ExportProvider exportProvider,
string[] metadataReferences = null)
{
var file = lines.Join(Environment.NewLine);
return CreateWorkspaceFromFileAsync(file, exportProvider: exportProvider, metadataReferences: metadataReferences);
}
示例5: CreateWorkspaceFromFilesAsync
/// <param name="files">Can pass in multiple file contents with individual source kind: files will be named test1.vb, test2.vbx, etc.</param>
public static Task<TestWorkspace> CreateWorkspaceFromFilesAsync(
string[] files,
ParseOptions[] parseOptions = null,
CompilationOptions compilationOptions = null,
ExportProvider exportProvider = null)
{
return TestWorkspaceFactory.CreateWorkspaceFromFilesAsync(LanguageNames.VisualBasic, compilationOptions, parseOptions, files, exportProvider);
}
示例6: CreateWorkspaceFromLinesAsync
public static Task<TestWorkspace> CreateWorkspaceFromLinesAsync(
string[] lines,
CSharpParseOptions parseOptions = null,
CSharpCompilationOptions compilationOptions = null,
ExportProvider exportProvider = null)
{
var file = lines.Join(Environment.NewLine);
return CreateWorkspaceFromFileAsync(file, parseOptions, compilationOptions, exportProvider);
}
示例7: CreateWorkspaceFromFiles
/// <param name="files">Can pass in multiple file contents: files will be named test1.vb, test2.vb, etc. and additional metadata references</param>
public static TestWorkspace CreateWorkspaceFromFiles(
string[] files,
ParseOptions parseOptions = null,
CompilationOptions compilationOptions = null,
ExportProvider exportProvider = null,
string[] metadataReferences = null)
{
return TestWorkspaceFactory.CreateWorkspaceFromFiles(LanguageNames.VisualBasic, compilationOptions, parseOptions, files, exportProvider, metadataReferences);
}
示例8: CreateWorkspaceFromFile
/// <param name="content">Can pass in multiple file contents: files will be named test1.cs, test2.cs, etc.</param>
/// <param name="parseOptions">Parse the source code in interactive mode</param>
public static TestWorkspace CreateWorkspaceFromFile(
string file,
CSharpParseOptions parseOptions = null,
CSharpCompilationOptions compilationOptions = null,
ExportProvider exportProvider = null,
string[] metadataReferences = null)
{
return CreateWorkspaceFromFiles(new[] { file }, parseOptions, compilationOptions, exportProvider, metadataReferences);
}
示例9: CreateWorkspaceFromFiles
/// <param name="files">Can pass in multiple file contents: files will be named test1.cs, test2.cs, etc.</param>
public static TestWorkspace CreateWorkspaceFromFiles(
string[] files,
CSharpParseOptions parseOptions = null,
CSharpCompilationOptions compilationOptions = null,
ExportProvider exportProvider = null,
string[] metadataReferences = null)
{
return CreateWorkspaceFromFiles(LanguageNames.CSharp, compilationOptions, parseOptions, files, exportProvider, metadataReferences);
}
示例10: CreateWorkspace
public static TestWorkspace CreateWorkspace(
XElement workspaceElement,
bool completed = true,
bool openDocuments = true,
ExportProvider exportProvider = null,
string workspaceKind = null)
{
return CreateWorkspaceAsync(workspaceElement, completed, openDocuments, exportProvider, workspaceKind).WaitAndGetResult(CancellationToken.None);
}
示例11: CreateWorkspaceFromFileAsync
public static Task<TestWorkspace> CreateWorkspaceFromFileAsync(
string file,
ParseOptions parseOptions = null,
CompilationOptions compilationOptions = null,
ExportProvider exportProvider = null,
string[] metadataReferences = null)
{
return CreateWorkspaceFromFilesAsync(new[] { file }, parseOptions, compilationOptions, exportProvider, metadataReferences);
}
示例12: Add
/// <summary>
/// The add.
/// </summary>
/// <param name="provider">
/// The provider.
/// </param>
public void Add(ExportProvider provider)
{
Contract.Requires<ArgumentNullException>(provider != null, "provider");
lock (_providers)
{
_providers.Add(provider);
provider.ExportsChanged += OnExportsChanged;
}
}
示例13: CreateBuffer
public static ITextBuffer CreateBuffer(
string contentType,
ExportProvider exportProvider,
params string[] lines)
{
var text = LinesToFullText(lines);
var intContentType = exportProvider.GetExportedValue<IContentTypeRegistryService>().GetContentType(contentType);
var buffer = exportProvider.GetExportedValue<ITextBufferFactoryService>().CreateTextBuffer(intContentType);
buffer.Replace(new Span(0, 0), text);
return buffer;
}
示例14: CreateView
public static IWpfTextView CreateView(
string contentType,
ExportProvider exportProvider,
params string[] lines)
{
TestWorkspace.ResetThreadAffinity();
WpfTestCase.RequireWpfFact($"Creates an IWpfTextView through {nameof(EditorFactory)}.{nameof(CreateView)}");
var buffer = CreateBuffer(contentType, exportProvider, lines);
return exportProvider.GetExportedValue<ITextEditorFactoryService>().CreateTextView(buffer);
}
示例15: CreateVisualBasicAsync
public static Task<TestWorkspace> CreateVisualBasicAsync(
string[] files,
ParseOptions parseOptions = null,
CompilationOptions compilationOptions = null,
ExportProvider exportProvider = null,
string[] metadataReferences = null)
{
return CreateAsync(LanguageNames.VisualBasic, compilationOptions, parseOptions, files, exportProvider, metadataReferences);
}