本文整理汇总了C#中IVsTextLines类的典型用法代码示例。如果您正苦于以下问题:C# IVsTextLines类的具体用法?C# IVsTextLines怎么用?C# IVsTextLines使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IVsTextLines类属于命名空间,在下文中一共展示了IVsTextLines类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetColorizer
public virtual int GetColorizer(IVsTextLines buffer, out IVsColorizer colorizer)
{
Contract.Requires<ArgumentNullException>(buffer != null, "buffer");
colorizer = null;
return VSConstants.E_FAIL;
}
示例2: XmlViewModel
/// <summary>
/// Default ctor
/// </summary>
protected XmlViewModel(IXmlStore xmlStore, IXmlModel xmlModel, IServiceProvider provider, IVsTextLines buffer)
{
if (xmlModel == null)
throw new ArgumentNullException("xmlModel");
if (xmlStore == null)
throw new ArgumentNullException("xmlStore");
if (provider == null)
throw new ArgumentNullException("provider");
if (buffer == null)
throw new ArgumentNullException("buffer");
BufferDirty = false;
DesignerDirty = false;
serviceProvider = provider;
this.buffer = buffer;
textBufferSerializer = new TextBufferSerializer(buffer);
this.xmlStore = xmlStore;
// OnUnderlyingEditCompleted
editingScopeCompletedHandler = OnUnderlyingEditCompleted;
this.xmlStore.EditingScopeCompleted += editingScopeCompletedHandler;
// OnUndoRedoCompleted
undoRedoCompletedHandler = OnUndoRedoCompleted;
this.xmlStore.UndoRedoCompleted += undoRedoCompletedHandler;
this.xmlModel = xmlModel;
// BufferReloaded
bufferReloadedHandler += BufferReloaded;
this.xmlModel.BufferReloaded += bufferReloadedHandler;
}
示例3: MySqlColorizer
// private IScanner scanner;
// private IVsTextLines buffer;
// private List<TokenInfo>[] tokenList;
// private string savedSqlText;
public MySqlColorizer(LanguageService service, IVsTextLines buffer, IScanner scanner)
: base(service, buffer, scanner)
{
(scanner as MySqlScanner).Colorizer = this;
// this.scanner = scanner;
// this.buffer = buffer;
}
示例4: GetSource
public ISource GetSource(IVsTextLines textBuffer)
{
var src = languageService.GetSource(textBuffer);
if (src == null)
return null;
return new Source(src);
}
示例5: AvaloniaDesignerPane
public AvaloniaDesignerPane(IVsCodeWindow vsCodeWindow, IVsTextLines textBuffer, string fileName, IAvaloniaDesignerSettings designerSettings)
{
_vsCodeWindow = vsCodeWindow;
_textBuffer = textBuffer.GetTextBuffer();
_fileName = fileName;
_designerSettings = designerSettings;
}
示例6: GetScanner
public override IScanner GetScanner(IVsTextLines buffer)
{
if (scanner == null)
this.scanner = new LineScanner();
return this.scanner;
}
示例7: InitializeLanguageService
protected override void InitializeLanguageService(IVsTextLines textLines)
{
var userData = textLines as IVsUserData;
if (userData == null) return;
var langSid = typeof(PowerShellLanguageInfo).GUID;
if (langSid == Guid.Empty) return;
var vsCoreSid = new Guid("{8239bec4-ee87-11d0-8c98-00c04fc2ab22}");
Guid currentSid;
ErrorHandler.ThrowOnFailure(textLines.GetLanguageServiceID(out currentSid));
// If the language service is set to the default SID, then
// set it to our language
if (currentSid == vsCoreSid)
{
ErrorHandler.ThrowOnFailure(textLines.SetLanguageServiceID(ref langSid));
}
else if (currentSid != langSid)
{
// Some other language service has it, so return VS_E_INCOMPATIBLEDOCDATA
throw new COMException("Incompatible doc data", VSConstants.VS_E_INCOMPATIBLEDOCDATA);
}
var bufferDetectLang = VSConstants.VsTextBufferUserDataGuid.VsBufferDetectLangSID_guid;
ErrorHandler.ThrowOnFailure(userData.SetData(ref bufferDetectLang, false));
}
示例8: GetScanner
/// <summary>
/// Create and return instantiation of a parser represented by RegularExpressionScanner object.
/// </summary>
/// <param name="buffer">An <see cref="IVsTextLines"/> represents lines of source to parse.</param>
/// <returns>Returns a RegularExpressionScanner object</returns>
public override IScanner GetScanner(IVsTextLines buffer)
{
SpecFlowProject specFlowProject = DteProjectReader.LoadSpecFlowProjectFromDteProject(CurrentProject);
scanner = new RegularExpressionScanner(specFlowProject.Configuration.GeneratorConfiguration.FeatureLanguage);
return scanner;
}
示例9: XSharpSource
public XSharpSource( XSharpLanguageService service,
IVsTextLines textLines,
Colorizer colorizer)
: base(service, textLines, colorizer)
{
}
示例10: CodeDomFileCodeModel
public CodeDomFileCodeModel(DTE dte, IVsTextLines buffer, CodeDomProvider provider, string moniker)
: base(dte, moniker)
{
this.textBuffer = buffer;
this.provider = provider as IMergableProvider;
if (provider == null) throw new ArgumentException("provider must implement IMergeableProvider interface");
}
示例11: GetScanner
public override IScanner GetScanner(IVsTextLines buffer)
{
if (this.scanner == null)
this.scanner = new LightScanner(grammar);
return this.scanner;
}
示例12: IsCSharpOrCppOrC
private static bool IsCSharpOrCppOrC(IVsTextLines textLines)
{
Guid languageServiceId;
textLines.GetLanguageServiceID(out languageServiceId);
//return GuidList.CSHARP_LANGUAGE_GUID.Equals(languageServiceId);
return true;
}
示例13: TextBufferMerger
internal TextBufferMerger(IVsTextLines buffer)
{
if (null == buffer) {
throw new ArgumentNullException("buffer");
}
this.textBuffer = buffer;
}
示例14: EditorPane
/// <summary>
/// Constructor that calls the Microsoft.VisualStudio.Shell.WindowPane constructor then
/// our initialization functions.
/// </summary>
/// <param name="package">Our Package instance.</param>
public EditorPane(ServiceDesignerPackage package, string fileName, IVsTextLines textBuffer)
: base(null)
{
_thisPackage = package;
_fileName = fileName;
_textBuffer = textBuffer;
}
示例15: CreateSource
public override Source CreateSource(IVsTextLines buffer)
{
var filePath = FilePathUtilities.GetFilePath(buffer);
if (GlobalServices.GetProjectManagerForFile(filePath) == null)
return base.CreateSource(buffer);
return new BooSource(this, filePath, buffer, GetColorizer(buffer)) {LastParseTime = 0};
}