本文整理汇总了C#中ITextDocumentFactoryService类的典型用法代码示例。如果您正苦于以下问题:C# ITextDocumentFactoryService类的具体用法?C# ITextDocumentFactoryService怎么用?C# ITextDocumentFactoryService使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ITextDocumentFactoryService类属于命名空间,在下文中一共展示了ITextDocumentFactoryService类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BottomMargin
public BottomMargin(IWpfTextView textView, IClassifierAggregatorService classifier, ITextDocumentFactoryService documentService)
{
_textView = textView;
_classifier = classifier.GetClassifier(textView.TextBuffer);
_foregroundBrush = new SolidColorBrush((Color)FindResource(VsColors.CaptionTextKey));
_backgroundBrush = new SolidColorBrush((Color)FindResource(VsColors.ScrollBarBackgroundKey));
this.Background = _backgroundBrush;
this.ClipToBounds = true;
_lblEncoding = new TextControl("Encoding");
this.Children.Add(_lblEncoding);
_lblContentType = new TextControl("Content type");
this.Children.Add(_lblContentType);
_lblClassification = new TextControl("Classification");
this.Children.Add(_lblClassification);
_lblSelection = new TextControl("Selection");
this.Children.Add(_lblSelection);
UpdateClassificationLabel();
UpdateContentTypeLabel();
UpdateContentSelectionLabel();
if (documentService.TryGetTextDocument(textView.TextDataModel.DocumentBuffer, out _doc))
{
_doc.FileActionOccurred += FileChangedOnDisk;
UpdateEncodingLabel(_doc);
}
textView.Caret.PositionChanged += CaretPositionChanged;
}
示例2: BottomMargin
public BottomMargin(IWpfTextView textView, IClassifierAggregatorService classifier, ITextDocumentFactoryService documentService)
{
_textView = textView;
_classifier = classifier.GetClassifier(textView.TextBuffer);
SetResourceReference(BackgroundProperty, EnvironmentColors.ScrollBarBackgroundBrushKey);
ClipToBounds = true;
_lblEncoding = new TextControl("Encoding");
Children.Add(_lblEncoding);
_lblContentType = new TextControl("Content type");
Children.Add(_lblContentType);
_lblClassification = new TextControl("Classification");
Children.Add(_lblClassification);
_lblSelection = new TextControl("Selection");
Children.Add(_lblSelection);
UpdateClassificationLabel();
UpdateContentTypeLabel();
UpdateContentSelectionLabel();
if (documentService.TryGetTextDocument(textView.TextDataModel.DocumentBuffer, out _doc))
{
_doc.FileActionOccurred += FileChangedOnDisk;
UpdateEncodingLabel(_doc);
}
textView.Caret.PositionChanged += CaretPositionChanged;
}
示例3: DiffUpdateBackgroundParser
internal DiffUpdateBackgroundParser(ITextBuffer textBuffer, ITextBuffer documentBuffer, TaskScheduler taskScheduler, ITextDocumentFactoryService textDocumentFactoryService, IGitCommands commands)
: base(textBuffer, taskScheduler, textDocumentFactoryService)
{
_documentBuffer = documentBuffer;
_commands = commands;
ReparseDelay = TimeSpan.FromMilliseconds(500);
if (TextDocumentFactoryService.TryGetTextDocument(_documentBuffer, out _textDocument))
{
if (_commands.IsGitRepository(_textDocument.FilePath))
{
_textDocument.FileActionOccurred += OnFileActionOccurred;
var repositoryDirectory = _commands.GetGitRepository(_textDocument.FilePath);
if (repositoryDirectory != null)
{
_watcher = new FileSystemWatcher(repositoryDirectory);
_watcher.Changed += HandleFileSystemChanged;
_watcher.Created += HandleFileSystemChanged;
_watcher.Deleted += HandleFileSystemChanged;
_watcher.Renamed += HandleFileSystemChanged;
_watcher.EnableRaisingEvents = true;
}
}
}
}
示例4: InstantVisualStudio
public InstantVisualStudio (IWpfTextView view, ITextDocumentFactoryService textDocumentFactoryService)
{
this.view = view;
this.layer = view.GetAdornmentLayer("Instant.VisualStudio");
//Listen to any event that changes the layout (text changes, scrolling, etc)
this.view.LayoutChanged += OnLayoutChanged;
this.dispatcher = Dispatcher.CurrentDispatcher;
this.evaluator.EvaluationCompleted += OnEvaluationCompleted;
this.evaluator.Start();
this.dte.Events.BuildEvents.OnBuildProjConfigDone += OnBuildProjeConfigDone;
this.dte.Events.BuildEvents.OnBuildDone += OnBuildDone;
this.dte.Events.BuildEvents.OnBuildBegin += OnBuildBegin;
this.statusbar = (IVsStatusbar)this.serviceProvider.GetService (typeof (IVsStatusbar));
ITextDocument textDocument;
if (!textDocumentFactoryService.TryGetTextDocument (view.TextBuffer, out textDocument))
throw new InvalidOperationException();
this.document = this.dte.Documents.OfType<EnvDTE.Document>().FirstOrDefault (d => d.FullName == textDocument.FilePath);
InstantTagToggleAction.Toggled += OnInstantToggled;
}
示例5: AntlrBackgroundParser
public AntlrBackgroundParser(ITextBuffer textBuffer, TaskScheduler taskScheduler, ITextDocumentFactoryService textDocumentFactoryService, IOutputWindowService outputWindowService)
: base(textBuffer, taskScheduler, textDocumentFactoryService, outputWindowService)
{
Contract.Requires(textBuffer != null);
Contract.Requires(taskScheduler != null);
Contract.Requires(textDocumentFactoryService != null);
Contract.Requires(outputWindowService != null);
if (!_initialized)
{
try
{
// have to create an instance of the tool to make sure the error manager gets initialized
new AntlrTool();
}
catch (Exception e)
{
if (ErrorHandler.IsCriticalException(e))
throw;
}
_initialized = true;
}
}
示例6: DiffUpdateBackgroundParser
public DiffUpdateBackgroundParser(ITextBuffer textBuffer, ITextBuffer documentBuffer, TaskScheduler taskScheduler, ITextDocumentFactoryService textDocumentFactoryService, IGitCommands commands)
: base(textBuffer, taskScheduler, textDocumentFactoryService)
{
_documentBuffer = documentBuffer;
_commands = commands;
ReparseDelay = TimeSpan.FromMilliseconds(500);
if (TextDocumentFactoryService.TryGetTextDocument(_documentBuffer, out _textDocument))
{
if (_commands.IsGitRepository(_textDocument.FilePath))
{
_textDocument.FileActionOccurred += OnFileActionOccurred;
var solutionDirectory = _commands.GetGitRepository(_textDocument.FilePath);
if (!string.IsNullOrWhiteSpace(solutionDirectory))
{
var gitDirectory = Path.Combine(solutionDirectory, ".git");
_watcher = new FileSystemWatcher(gitDirectory);
_watcher.Changed += HandleFileSystemChanged;
_watcher.Created += HandleFileSystemChanged;
_watcher.Deleted += HandleFileSystemChanged;
_watcher.Renamed += HandleFileSystemChanged;
_watcher.EnableRaisingEvents = true;
}
}
}
}
示例7: BackgroundParser
public BackgroundParser(ITextBuffer textBuffer, ITextDocumentFactoryService textDocumentFactoryService, IOutputWindowService outputWindowService)
: this(textBuffer, TaskScheduler.Default, textDocumentFactoryService, outputWindowService, PredefinedOutputWindowPanes.TvlDiagnostics)
{
Contract.Requires(textBuffer != null);
Contract.Requires(textDocumentFactoryService != null);
Contract.Requires(outputWindowService != null);
}
示例8: VimHost
protected VimHost(
ITextDocumentFactoryService textDocumentFactoryService,
IEditorOperationsFactoryService editorOperationsFactoryService)
{
_textDocumentFactoryService = textDocumentFactoryService;
_editorOperationsFactoryService = editorOperationsFactoryService;
}
示例9: VsVimHost
internal VsVimHost(
IVsAdapter adapter,
ITextBufferFactoryService textBufferFactoryService,
ITextEditorFactoryService textEditorFactoryService,
ITextDocumentFactoryService textDocumentFactoryService,
ITextBufferUndoManagerProvider undoManagerProvider,
IVsEditorAdaptersFactoryService editorAdaptersFactoryService,
IEditorOperationsFactoryService editorOperationsFactoryService,
IWordUtilFactory wordUtilFactory,
ITextManager textManager,
ISharedServiceFactory sharedServiceFactory,
SVsServiceProvider serviceProvider)
: base(textBufferFactoryService, textEditorFactoryService, textDocumentFactoryService, editorOperationsFactoryService)
{
_vsAdapter = adapter;
_editorAdaptersFactoryService = editorAdaptersFactoryService;
_wordUtilFactory = wordUtilFactory;
_dte = (_DTE)serviceProvider.GetService(typeof(_DTE));
_vsExtensibility = (IVsExtensibility)serviceProvider.GetService(typeof(IVsExtensibility));
_textManager = textManager;
_sharedService = sharedServiceFactory.Create();
_vsMonitorSelection = serviceProvider.GetService<SVsShellMonitorSelection, IVsMonitorSelection>();
uint cookie;
_vsMonitorSelection.AdviseSelectionEvents(this, out cookie);
}
示例10: DiffMarginViewModel
public DiffMarginViewModel(DiffMargin margin, IWpfTextView textView, ITextDocumentFactoryService textDocumentFactoryService, IGitCommands gitCommands)
{
if (margin == null)
throw new ArgumentNullException("margin");
if (textView == null)
throw new ArgumentNullException("textView");
if (textDocumentFactoryService == null)
throw new ArgumentNullException("textDocumentFactoryService");
if (gitCommands == null)
throw new ArgumentNullException("gitCommands");
_margin = margin;
_textView = textView;
_gitCommands = gitCommands;
_diffViewModels = new ObservableCollection<DiffViewModel>();
_previousChangeCommand = new RelayCommand<DiffViewModel>(PreviousChange, PreviousChangeCanExecute);
_nextChangeCommand = new RelayCommand<DiffViewModel>(NextChange, NextChangeCanExecute);
_textView.LayoutChanged += OnLayoutChanged;
_textView.ViewportHeightChanged += OnViewportHeightChanged;
_parser = new DiffUpdateBackgroundParser(textView.TextBuffer, TaskScheduler.Default, textDocumentFactoryService, gitCommands);
_parser.ParseComplete += HandleParseComplete;
_parser.RequestParse(false);
}
示例11: VsVimHost
internal VsVimHost(
IVsAdapter adapter,
ITextBufferFactoryService textBufferFactoryService,
ITextEditorFactoryService textEditorFactoryService,
ITextDocumentFactoryService textDocumentFactoryService,
ITextBufferUndoManagerProvider undoManagerProvider,
IVsEditorAdaptersFactoryService editorAdaptersFactoryService,
IEditorOperationsFactoryService editorOperationsFactoryService,
ISmartIndentationService smartIndentationService,
ITextManager textManager,
ISharedServiceFactory sharedServiceFactory,
IVimApplicationSettings vimApplicationSettings,
SVsServiceProvider serviceProvider)
: base(textBufferFactoryService, textEditorFactoryService, textDocumentFactoryService, editorOperationsFactoryService)
{
_vsAdapter = adapter;
_editorAdaptersFactoryService = editorAdaptersFactoryService;
_dte = (_DTE)serviceProvider.GetService(typeof(_DTE));
_vsExtensibility = (IVsExtensibility)serviceProvider.GetService(typeof(IVsExtensibility));
_textManager = textManager;
_sharedService = sharedServiceFactory.Create();
_vsMonitorSelection = serviceProvider.GetService<SVsShellMonitorSelection, IVsMonitorSelection>();
_fontProperties = new TextEditorFontProperties(serviceProvider);
_vimApplicationSettings = vimApplicationSettings;
_smartIndentationService = smartIndentationService;
uint cookie;
_vsMonitorSelection.AdviseSelectionEvents(this, out cookie);
}
示例12: GoToDefinitionFilterProvider
public GoToDefinitionFilterProvider(
[Import(typeof(SVsServiceProvider))] System.IServiceProvider serviceProvider,
IVsEditorAdaptersFactoryService editorFactory,
IEditorOptionsFactoryService editorOptionsFactory,
ITextDocumentFactoryService textDocumentFactoryService,
[Import(typeof(DotNetReferenceSourceProvider))] ReferenceSourceProvider referenceSourceProvider,
VSLanguageService fsharpVsLanguageService,
ProjectFactory projectFactory)
{
_serviceProvider = serviceProvider;
_editorFactory = editorFactory;
_editorOptionsFactory = editorOptionsFactory;
_textDocumentFactoryService = textDocumentFactoryService;
_referenceSourceProvider = referenceSourceProvider;
_fsharpVsLanguageService = fsharpVsLanguageService;
_projectFactory = projectFactory;
var dte = serviceProvider.GetService(typeof(SDTE)) as DTE;
var events = dte.Events as Events2;
if (events != null)
{
_solutionEvents = events.SolutionEvents;
_solutionEvents.AfterClosing += Cleanup;
}
}
示例13: CompletionSource
public CompletionSource(CompletionSourceProvider provider, ITextBuffer buffer, ITextDocumentFactoryService textDocumentFactory, DartAnalysisServiceFactory analysisServiceFactory)
{
this.provider = provider;
this.buffer = buffer;
this.textDocumentFactory = textDocumentFactory;
this.analysisServiceFactory = analysisServiceFactory;
}
示例14: VimHostImpl
internal VimHostImpl(
ITextBufferFactoryService textBufferFactoryService,
ITextEditorFactoryService textEditorFactoryService,
ITextDocumentFactoryService textDocumentFactoryService,
IEditorOperationsFactoryService editorOperationsFactoryService) :
base(textBufferFactoryService, textEditorFactoryService, textDocumentFactoryService, editorOperationsFactoryService)
{
}
示例15: TextManager
internal TextManager(
IVsAdapter adapter,
ITextDocumentFactoryService textDocumentFactoryService,
ITextBufferFactoryService textBufferFactoryService,
ISharedServiceFactory sharedServiceFactory,
SVsServiceProvider serviceProvider) : this(adapter, textDocumentFactoryService, textBufferFactoryService, sharedServiceFactory.Create(), serviceProvider)
{
}