• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# ITextDocumentFactoryService类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中ITextDocumentFactoryService的典型用法代码示例。如果您正苦于以下问题:C# ITextDocumentFactoryService类的具体用法?C# ITextDocumentFactoryService怎么用?C# ITextDocumentFactoryService使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ITextDocumentFactoryService类属于命名空间,在下文中一共展示了ITextDocumentFactoryService类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
        }
开发者ID:modulexcite,项目名称:ExtensibilityTools,代码行数:34,代码来源:BottomMargin.cs


示例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;
        }
开发者ID:japj,项目名称:ExtensibilityTools,代码行数:33,代码来源:BottomMargin.cs


示例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;
                    }
                }
            }
        }
开发者ID:haiiev,项目名称:GitDiffMargin,代码行数:26,代码来源:DiffUpdateBackgroundParser.cs


示例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;
		}
开发者ID:ermau,项目名称:Instant,代码行数:27,代码来源:InstantVisualStudio.cs


示例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;
            }
        }
开发者ID:sebandraos,项目名称:LangSvcV2,代码行数:25,代码来源:AntlrBackgroundParser.cs


示例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;
                    }
                }
            }
        }
开发者ID:275208498,项目名称:GitDiffMargin,代码行数:28,代码来源:DiffUpdateBackgroundParser.cs


示例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);
 }
开发者ID:chandramouleswaran,项目名称:LangSvcV2,代码行数:7,代码来源:BackgroundParser.cs


示例8: VimHost

 protected VimHost(
     ITextDocumentFactoryService textDocumentFactoryService,
     IEditorOperationsFactoryService editorOperationsFactoryService)
 {
     _textDocumentFactoryService = textDocumentFactoryService;
     _editorOperationsFactoryService = editorOperationsFactoryService;
 }
开发者ID:bentayloruk,项目名称:VsVim,代码行数:7,代码来源:VimHost.cs


示例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);
        }
开发者ID:0-F,项目名称:VsVim,代码行数:26,代码来源:VsVimHost.cs


示例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);
        }
开发者ID:b4shailen,项目名称:Git-Source-Control-Provider,代码行数:25,代码来源:DiffMarginViewModel.cs


示例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);
        }
开发者ID:honeyhoneywell,项目名称:VsVim,代码行数:29,代码来源:VsVimHost.cs


示例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;
            }
        }
开发者ID:bryanhunter,项目名称:VisualFSharpPowerTools,代码行数:25,代码来源:GotoDefinitionFilterProvider.cs


示例13: CompletionSource

 public CompletionSource(CompletionSourceProvider provider, ITextBuffer buffer, ITextDocumentFactoryService textDocumentFactory, DartAnalysisServiceFactory analysisServiceFactory)
 {
     this.provider = provider;
     this.buffer = buffer;
     this.textDocumentFactory = textDocumentFactory;
     this.analysisServiceFactory = analysisServiceFactory;
 }
开发者ID:modulexcite,项目名称:DartVS,代码行数:7,代码来源:CompletionSourceProvider.cs


示例14: VimHostImpl

 internal VimHostImpl(
     ITextBufferFactoryService textBufferFactoryService,
     ITextEditorFactoryService textEditorFactoryService,
     ITextDocumentFactoryService textDocumentFactoryService,
     IEditorOperationsFactoryService editorOperationsFactoryService) :
     base(textBufferFactoryService, textEditorFactoryService, textDocumentFactoryService, editorOperationsFactoryService)
 {
 }
开发者ID:Yzzl,项目名称:VsVim,代码行数:8,代码来源:VimHostTests.cs


示例15: TextManager

 internal TextManager(
     IVsAdapter adapter,
     ITextDocumentFactoryService textDocumentFactoryService,
     ITextBufferFactoryService textBufferFactoryService,
     ISharedServiceFactory sharedServiceFactory,
     SVsServiceProvider serviceProvider) : this(adapter, textDocumentFactoryService, textBufferFactoryService, sharedServiceFactory.Create(), serviceProvider)
 {
 }
开发者ID:Yzzl,项目名称:VsVim,代码行数:8,代码来源:TextManager.cs


示例16: PhpOutliningBackgroundParser

 private PhpOutliningBackgroundParser(ITextBuffer textBuffer, TaskScheduler taskScheduler, IOutputWindowService outputWindowService, ITextDocumentFactoryService textDocumentFactoryService)
     : base(textBuffer, taskScheduler, textDocumentFactoryService, outputWindowService)
 {
     Contract.Requires(textBuffer != null);
     Contract.Requires(taskScheduler != null);
     Contract.Requires(outputWindowService != null);
     Contract.Requires(textDocumentFactoryService != null);
 }
开发者ID:chandramouleswaran,项目名称:LangSvcV2,代码行数:8,代码来源:PhpOutliningBackgroundParser.cs


示例17: MarkdownBackgroundParser

        public MarkdownBackgroundParser(ITextBuffer textBuffer, TaskScheduler taskScheduler, ITextDocumentFactoryService textDocumentFactoryService)
            : base(textBuffer, taskScheduler, textDocumentFactoryService)
        {
            ReparseDelay = TimeSpan.FromMilliseconds(300);

            ITextDocument document;
            if (textDocumentFactoryService.TryGetTextDocument(textBuffer, out document))
                this.LoadRuleset(document);
        }
开发者ID:JunyiYi,项目名称:MarkdownMode,代码行数:9,代码来源:MarkdownBackgroundParser.cs


示例18: CreateParser

        internal static PhpOutliningBackgroundParser CreateParser(ITextBuffer textBuffer, TaskScheduler taskScheduler, IOutputWindowService outputWindowService, ITextDocumentFactoryService textDocumentFactoryService)
        {
            Contract.Requires<ArgumentNullException>(textBuffer != null, "textBuffer");
            Contract.Requires<ArgumentNullException>(taskScheduler != null, "taskScheduler");
            Contract.Requires<ArgumentNullException>(outputWindowService != null, "outputWindowService");
            Contract.Requires<ArgumentNullException>(textDocumentFactoryService != null, "textDocumentFactoryService");

            return new PhpOutliningBackgroundParser(textBuffer, taskScheduler, outputWindowService, textDocumentFactoryService);
        }
开发者ID:chandramouleswaran,项目名称:LangSvcV2,代码行数:9,代码来源:PhpOutliningBackgroundParser.cs


示例19: VimHostTest

 protected VimHostTest()
 {
     _textDocumentFactoryService = CompositionContainer.GetExportedValue<ITextDocumentFactoryService>();
     _vimHost = new VimHostImpl(
         TextBufferFactoryService,
         TextEditorFactoryService,
         _textDocumentFactoryService,
         EditorOperationsFactoryService);
 }
开发者ID:jaredswarts55,项目名称:VsVim,代码行数:9,代码来源:VimHostTests.cs


示例20: PackageInitializerViewHandler

 public PackageInitializerViewHandler(
   [Import(typeof(SVsServiceProvider))]IServiceProvider serviceProvider,
   IVsEditorAdaptersFactoryService adaptersFactoryService,
   IFileRegistrationRequestService fileRegistrationRequestService,
   ITextDocumentFactoryService textDocumentFactoryService) {
   _serviceProvider = serviceProvider;
   _adaptersFactoryService = adaptersFactoryService;
   _fileRegistrationRequestService = fileRegistrationRequestService;
   _textDocumentFactoryService = textDocumentFactoryService;
 }
开发者ID:mbbill,项目名称:vs-chromium,代码行数:10,代码来源:PackageInitializerViewHandler.cs



注:本文中的ITextDocumentFactoryService类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# ITextEditor类代码示例发布时间:2022-05-24
下一篇:
C# ITextDocument类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap