本文整理汇总了C#中IContentType类的典型用法代码示例。如果您正苦于以下问题:C# IContentType类的具体用法?C# IContentType怎么用?C# IContentType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IContentType类属于命名空间,在下文中一共展示了IContentType类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: CreateReplWindow
public IReplWindow CreateReplWindow(IContentType contentType, string/*!*/ title, Guid languageServiceGuid, string replId)
{
int curId = 0;
ReplWindow window;
do {
curId++;
window = FindReplWindowInternal(curId);
} while (window != null);
foreach (var provider in _evaluators) {
var evaluator = provider.GetEvaluator(replId);
if (evaluator != null) {
string[] roles = provider.GetType().GetCustomAttributes(typeof(ReplRoleAttribute), true).Select(r => ((ReplRoleAttribute)r).Name).ToArray();
window = CreateReplWindowInternal(evaluator, contentType, roles, curId, title, languageServiceGuid, replId);
if ((null == window) || (null == window.Frame)) {
throw new NotSupportedException(Resources.CanNotCreateWindow);
}
return window;
}
}
throw new InvalidOperationException(String.Format("ReplId {0} was not provided by an IReplWindowProvider", replId));
}
开发者ID:borota,项目名称:JTVS,代码行数:25,代码来源:ReplWindowProvider.cs
示例2: CreateVsTextBufferAdapter
public IVsTextBuffer CreateVsTextBufferAdapter(OLE.Interop.IServiceProvider serviceProvider, IContentType contentType)
{
VsTextBufferMock tb = new VsTextBufferMock(contentType);
_textBufferAdapters[tb.TextBuffer] = tb;
_vsTextBufferAdapters[tb] = tb.TextBuffer;
return tb;
}
开发者ID:AlexanderSher,项目名称:RTVS-Old,代码行数:7,代码来源:VsEditorAdaptersFactoryServiceMock.cs
示例3: JadeClassifierProvider
public JadeClassifierProvider(IClassificationTypeRegistryService registryService,
ITextBufferFactoryService bufferFact,
IContentTypeRegistryService contentTypeService,
[ImportMany(typeof(ITaggerProvider))]Lazy<ITaggerProvider, TaggerProviderMetadata>[] taggerProviders,
[ImportMany(typeof(IClassifierProvider))]Lazy<IClassifierProvider, IClassifierProviderMetadata>[] classifierProviders) {
ClassificationRegistryService = registryService;
BufferFactoryService = bufferFact;
JsContentType = contentTypeService.GetContentType(NodejsConstants.JavaScript);
CssContentType = contentTypeService.GetContentType(NodejsConstants.CSS);
var jsTagger = taggerProviders.Where(
provider =>
provider.Metadata.ContentTypes.Contains(NodejsConstants.JavaScript) &&
provider.Metadata.TagTypes.Any(tagType => tagType.IsSubclassOf(typeof(ClassificationTag)))
).FirstOrDefault();
if (JsTaggerProvider != null) {
JsTaggerProvider = jsTagger.Value;
}
var cssTagger = classifierProviders.Where(
provider => provider.Metadata.ContentTypes.Any(x => x.Equals("css", StringComparison.OrdinalIgnoreCase))
).FirstOrDefault();
if (cssTagger != null) {
CssClassifierProvider = cssTagger.Value;
}
}
开发者ID:lioaphy,项目名称:nodejstools,代码行数:26,代码来源:JadeClassifierProvider.cs
示例4: ExecuteAppCommand
private int ExecuteAppCommand(ref Guid pguidCmdGroup, uint commandId, uint executeInformation, IntPtr pvaIn, IntPtr pvaOut, ITextBuffer subjectBuffer, IContentType contentType)
{
int result = VSConstants.S_OK;
var guidCmdGroup = pguidCmdGroup;
Action executeNextCommandTarget = () =>
{
result = NextCommandTarget.Exec(ref guidCmdGroup, commandId, executeInformation, pvaIn, pvaOut);
};
switch ((VSConstants.AppCommandCmdID)commandId)
{
case VSConstants.AppCommandCmdID.BrowserBackward:
ExecuteBrowserBackward(subjectBuffer, contentType, executeNextCommandTarget);
break;
case VSConstants.AppCommandCmdID.BrowserForward:
ExecuteBrowserForward(subjectBuffer, contentType, executeNextCommandTarget);
break;
default:
return NextCommandTarget.Exec(ref pguidCmdGroup, commandId, executeInformation, pvaIn, pvaOut);
}
return result;
}
开发者ID:AnthonyDGreen,项目名称:roslyn,代码行数:25,代码来源:AbstractOleCommandTarget.Execute.cs
示例5: InteractiveEvaluator
internal InteractiveEvaluator(
IContentType contentType,
HostServices hostServices,
IViewClassifierAggregatorService classifierAggregator,
IInteractiveWindowCommandsFactory commandsFactory,
ImmutableArray<IInteractiveWindowCommand> commands,
string responseFilePath,
string initialWorkingDirectory,
string interactiveHostPath,
Type replType)
{
Debug.Assert(responseFilePath == null || PathUtilities.IsAbsolute(responseFilePath));
_contentType = contentType;
_responseFilePath = responseFilePath;
_workspace = new InteractiveWorkspace(this, hostServices);
_contentTypeChangedHandler = new EventHandler<ContentTypeChangedEventArgs>(LanguageBufferContentTypeChanged);
_classifierAggregator = classifierAggregator;
_initialWorkingDirectory = initialWorkingDirectory;
_commandsFactory = commandsFactory;
_commands = commands;
var hostPath = interactiveHostPath;
_interactiveHost = new InteractiveHost(replType, hostPath, initialWorkingDirectory);
_interactiveHost.ProcessStarting += ProcessStarting;
}
开发者ID:nevinclement,项目名称:roslyn,代码行数:26,代码来源:InteractiveEvaluator.cs
示例6: GetContentType
public static IContentType GetContentType(this IContentTypeRegistryService contentTypeRegistryService, IContentType contentType, string contentTypeString) {
if (contentType != null)
return contentType;
if (contentTypeString != null)
return contentTypeRegistryService.GetContentType(contentTypeString);
return null;
}
开发者ID:manojdjoshi,项目名称:dnSpy,代码行数:7,代码来源:ContentTypeRegistryServiceExtensions.cs
示例7: SetLanguage
public static void SetLanguage(this IInteractiveWindow window, Guid languageServiceGuid, IContentType contentType)
{
VsInteractiveWindowEditorFactoryService.GetDispatcher(window).CheckAccess();
var commandFilter = VsInteractiveWindowEditorFactoryService.GetCommandFilter(window);
window.Properties[typeof(IContentType)] = contentType;
commandFilter.firstLanguageServiceCommandFilter = null;
var provider = commandFilter._oleCommandTargetProviders.OfContentType(contentType, commandFilter._contentTypeRegistry);
if (provider != null)
{
var targetFilter = commandFilter.firstLanguageServiceCommandFilter ?? commandFilter.EditorServicesCommandFilter;
var target = provider.GetCommandTarget(window.TextView, targetFilter);
if (target != null)
{
commandFilter.firstLanguageServiceCommandFilter = target;
}
}
if (window.CurrentLanguageBuffer != null)
{
window.CurrentLanguageBuffer.ChangeContentType(contentType, null);
}
VsInteractiveWindowEditorFactoryService.SetEditorOptions(window.TextView.Options, languageServiceGuid);
}
开发者ID:Rickinio,项目名称:roslyn,代码行数:25,代码来源:VsInteractiveWindowExtensions.cs
示例8: Initialize
private void Initialize(string targetFileContents, string mapFileContents, string directory, IContentType contentType)
{
_contentType = contentType;
_parser = CssParserLocator.FindComponent(_contentType).CreateParser();
_directory = directory;
PopulateMap(targetFileContents, mapFileContents); // Begin two-steps initialization.
}
开发者ID:jmorenor,项目名称:WebEssentials2013,代码行数:7,代码来源:CssSourceMap.cs
示例9: InteractiveEvaluator
internal InteractiveEvaluator(
IContentType contentType,
HostServices hostServices,
IViewClassifierAggregatorService classifierAggregator,
IInteractiveWindowCommandsFactory commandsFactory,
ImmutableArray<IInteractiveWindowCommand> commands,
string responseFilePath,
string initialWorkingDirectory,
string interactiveHostPath,
Type replType)
{
Debug.Assert(responseFilePath == null || PathUtilities.IsAbsolute(responseFilePath));
_contentType = contentType;
_responseFilePath = responseFilePath;
_workspace = new InteractiveWorkspace(this, hostServices);
_contentTypeChangedHandler = new EventHandler<ContentTypeChangedEventArgs>(LanguageBufferContentTypeChanged);
_classifierAggregator = classifierAggregator;
_initialWorkingDirectory = initialWorkingDirectory;
_commandsFactory = commandsFactory;
_commands = commands;
// The following settings will apply when the REPL starts without .rsp file.
// They are discarded once the REPL is reset.
ReferenceSearchPaths = ImmutableArray<string>.Empty;
SourceSearchPaths = ImmutableArray<string>.Empty;
WorkingDirectory = initialWorkingDirectory;
var metadataService = _workspace.CurrentSolution.Services.MetadataService;
_metadataReferenceResolver = CreateMetadataReferenceResolver(metadataService, ReferenceSearchPaths, _initialWorkingDirectory);
_sourceReferenceResolver = CreateSourceReferenceResolver(SourceSearchPaths, _initialWorkingDirectory);
_interactiveHost = new InteractiveHost(replType, interactiveHostPath, initialWorkingDirectory);
_interactiveHost.ProcessStarting += ProcessStarting;
}
开发者ID:CAPCHIK,项目名称:roslyn,代码行数:34,代码来源:InteractiveEvaluator.cs
示例10: MapComposition
private static void MapComposition(IContentType umbracoContentType, ContentType type)
{
type.Composition = umbracoContentType.ContentTypeComposition
.Where(cmp => cmp.Id != umbracoContentType.ParentId)
.Select(MapContentTypeBase)
.ToList();
}
开发者ID:scy0846,项目名称:Umbraco.CodeGen,代码行数:7,代码来源:ContentTypeMapping.cs
示例11: Content
/// <summary>
/// Constructor for creating a Content object
/// </summary>
/// <param name="name">Name of the content</param>
/// <param name="parentId">Id of the Parent content</param>
/// <param name="contentType">ContentType for the current Content object</param>
/// <param name="properties">Collection of properties</param>
public Content(string name, int parentId, IContentType contentType, PropertyCollection properties)
: base(name, parentId, contentType, properties)
{
Mandate.ParameterNotNull(contentType, "contentType");
_contentType = contentType;
}
开发者ID:phaniarveti,项目名称:Experiments,代码行数:14,代码来源:Content.cs
示例12: CreateInteractiveWindow
public IVsInteractiveWindow CreateInteractiveWindow(
IContentType contentType,
string/*!*/ title,
Guid languageServiceGuid,
string replId
) {
int curId = 0;
InteractiveWindowInfo window;
do {
curId++;
window = FindReplWindowInternal(curId);
} while (window != null);
foreach (var provider in _evaluators) {
var evaluator = provider.GetEvaluator(replId);
if (evaluator != null) {
string[] roles = evaluator.GetType().GetCustomAttributes(typeof(InteractiveWindowRoleAttribute), true)
.OfType<InteractiveWindowRoleAttribute>()
.Select(r => r.Name)
.ToArray();
window = CreateInteractiveWindowInternal(evaluator, contentType, roles, curId, title, languageServiceGuid, replId);
return window.Window;
}
}
throw new InvalidOperationException(String.Format("ReplId {0} was not provided by an IInteractiveWindowProvider", replId));
}
开发者ID:omnimark,项目名称:PTVS,代码行数:29,代码来源:InteractiveWindowProvider.cs
示例13: CreateAllTypesContent
public static Content CreateAllTypesContent(IContentType contentType, string name, int parentId)
{
var content = new Content("Random Content Name", parentId, contentType) { Language = "en-US", Level = 1, SortOrder = 1, CreatorId = 0, WriterId = 0 };
content.SetValue("isTrue", true);
content.SetValue("number", 42);
content.SetValue("bodyText", "Lorem Ipsum Body Text Test");
content.SetValue("singleLineText", "Single Line Text Test");
content.SetValue("multilineText", "Multiple lines \n in one box");
content.SetValue("upload", "/media/1234/koala.jpg");
content.SetValue("label", "Non-editable label");
content.SetValue("dateTime", DateTime.Now.AddDays(-20));
content.SetValue("colorPicker", "black");
content.SetValue("folderBrowser", "");
content.SetValue("ddlMultiple", "1234,1235");
content.SetValue("rbList", "random");
content.SetValue("date", DateTime.Now.AddDays(-10));
content.SetValue("ddl", "1234");
content.SetValue("chklist", "randomc");
content.SetValue("contentPicker", 1090);
content.SetValue("mediaPicker", 1091);
content.SetValue("memberPicker", 1092);
content.SetValue("simpleEditor", "This is simply edited");
content.SetValue("ultimatePicker", "1234,1235");
content.SetValue("relatedLinks", "<links><link title=\"google\" link=\"http://google.com\" type=\"external\" newwindow=\"0\" /></links>");
content.SetValue("tags", "this,is,tags");
content.SetValue("macroContainer", "");
content.SetValue("imgCropper", "");
return content;
}
开发者ID:ChrisNikkel,项目名称:Umbraco-CMS,代码行数:31,代码来源:MockedContent.cs
示例14: CompareAllowedTemplates
private static bool CompareAllowedTemplates(IContentType contentType, DocumentTypeAttribute docTypeAttr, Type typeDocType)
{
List<ITemplate> allowedTemplates = DocumentTypeManager.GetAllowedTemplates(docTypeAttr, typeDocType);
IEnumerable<ITemplate> existingTemplates = contentType.AllowedTemplates;
if (allowedTemplates.Count != existingTemplates.Count())
{
return false;
}
foreach (Template template in allowedTemplates)
{
if (!existingTemplates.Any(t => t.Alias == template.Alias))
{
return false;
}
}
ITemplate defaultTemplate = DocumentTypeManager.GetDefaultTemplate(docTypeAttr, typeDocType, allowedTemplates);
if (defaultTemplate != null)
{
return (contentType.DefaultTemplate.Id == defaultTemplate.Id);
}
if (allowedTemplates.Count == 1)
{
return (contentType.DefaultTemplate.Id == allowedTemplates.First().Id);
}
return true;
}
开发者ID:grom8255,项目名称:uSiteBuilder,代码行数:33,代码来源:DocumentTypeComparer.cs
示例15: EditorTextFactoryService
public EditorTextFactoryService(
ITextBufferFactoryService textBufferFactoryService,
IContentTypeRegistryService contentTypeRegistryService)
{
_textBufferFactory = textBufferFactoryService;
_unknownContentType = contentTypeRegistryService.UnknownContentType;
}
开发者ID:Rickinio,项目名称:roslyn,代码行数:7,代码来源:EditorTextFactoryService.cs
示例16: Initialize
private void Initialize(string targetFileName, string mapFileName, IContentType contentType)
{
_contentType = contentType;
_parser = CssParserLocator.FindComponent(_contentType).CreateParser();
_directory = Path.GetDirectoryName(mapFileName);
PopulateMap(targetFileName, mapFileName); // Begin two-steps initialization.
}
开发者ID:Jetro223,项目名称:WebEssentials2013,代码行数:7,代码来源:CssSourceMap.cs
示例17: Create
internal static InteractiveSmartIndenter Create(
IEnumerable<Lazy<ISmartIndentProvider, ContentTypeMetadata>> smartIndenterProviders,
IContentType contentType,
ITextView view)
{
var provider = GetProvider(smartIndenterProviders, contentType);
return (provider == null) ? null : new InteractiveSmartIndenter(contentType, view, provider.Item2.Value);
}
开发者ID:elemk0vv,项目名称:roslyn-1,代码行数:8,代码来源:InteractiveSmartIndenter.cs
示例18: MinifyFile
private async static Task MinifyFile(IContentType contentType, string sourcePath, string minPath, IMinifierSettings settings)
{
IFileMinifier minifier = Mef.GetImport<IFileMinifier>(contentType);
bool changed = await minifier.MinifyFile(sourcePath, minPath);
if (settings.GzipMinifiedFiles && (changed || !File.Exists(minPath + ".gzip")))
FileHelpers.GzipFile(minPath);
}
开发者ID:hanskishore,项目名称:WebEssentials2013,代码行数:8,代码来源:MinificationSaveListener.cs
示例19: MockTextBuffer
public MockTextBuffer(string content, IContentType contentType, string filename = null) {
_snapshot = new MockTextSnapshot(this, content);
_contentType = contentType;
if (filename == null) {
filename = Path.Combine(TestData.GetTempPath(), Path.GetRandomFileName(), "file.py");
}
Properties[typeof(ITextDocument)] = new MockTextDocument(this, filename);
}
开发者ID:omnimark,项目名称:PTVS,代码行数:8,代码来源:MockTextBuffer.cs
示例20: GetParsers
public IEnumerable<ParserConfiguration> GetParsers(IContentType contentType)
{
foreach (var entry in Configuration) {
if (entry.ContentType.Equals(contentType.TypeName, StringComparison.OrdinalIgnoreCase)) {
yield return entry.Configuration;
}
}
}
开发者ID:nbalakin,项目名称:VSOutputEnhancer,代码行数:8,代码来源:ParsersConfigurationService.cs
注:本文中的IContentType类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论