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

C# ITextUndoHistoryRegistry类代码示例

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

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



ITextUndoHistoryRegistry类属于命名空间,在下文中一共展示了ITextUndoHistoryRegistry类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: SmartTokenFormatterCommandHandler

 public SmartTokenFormatterCommandHandler(
     ITextUndoHistoryRegistry undoHistoryRegistry,
     IEditorOperationsFactoryService editorOperationsFactoryService) :
     base(undoHistoryRegistry,
          editorOperationsFactoryService)
 {
 }
开发者ID:Rickinio,项目名称:roslyn,代码行数:7,代码来源:SmartTokenFormatterCommandHandler.cs


示例2: CSharpRenameTrackingCodeFixProvider

 public CSharpRenameTrackingCodeFixProvider(
     IWaitIndicator waitIndicator,
     ITextUndoHistoryRegistry undoHistoryRegistry,
     [ImportMany] IEnumerable<IRefactorNotifyService> refactorNotifyServices)
     : base(waitIndicator, undoHistoryRegistry, refactorNotifyServices)
 {
 }
开发者ID:XieShuquan,项目名称:roslyn,代码行数:7,代码来源:CSharpRenameTrackingCodeFixProvider.cs


示例3: DocumentProvider

        public DocumentProvider(
            IVisualStudioHostProjectContainer projectContainer,
            IServiceProvider serviceProvider,
            bool signUpForFileChangeNotification)
        {
            var componentModel = (IComponentModel)serviceProvider.GetService(typeof(SComponentModel));

            _projectContainer = projectContainer;
            this.RunningDocumentTable = (IVsRunningDocumentTable4)serviceProvider.GetService(typeof(SVsRunningDocumentTable));
            this.EditorAdaptersFactoryService = componentModel.GetService<IVsEditorAdaptersFactoryService>();
            this.ContentTypeRegistryService = componentModel.GetService<IContentTypeRegistryService>();
            _textUndoHistoryRegistry = componentModel.GetService<ITextUndoHistoryRegistry>();
            _textManager = (IVsTextManager)serviceProvider.GetService(typeof(SVsTextManager));

            // In the CodeSense scenario we will receive file change notifications from the native
            // Language Services, so we don't want to sign up for them ourselves.
            if (signUpForFileChangeNotification)
            {
                _fileChangeService = (IVsFileChangeEx)serviceProvider.GetService(typeof(SVsFileChangeEx));
            }

            var shell = (IVsShell)serviceProvider.GetService(typeof(SVsShell));
            if (shell == null)
            {
                // This can happen only in tests, bail out.
                return;
            }

            int installed;
            Marshal.ThrowExceptionForHR(shell.IsPackageInstalled(Guids.RoslynPackageId, out installed));
            IsRoslynPackageInstalled = installed != 0;

            var runningDocumentTableForEvents = (IVsRunningDocumentTable)RunningDocumentTable;
            Marshal.ThrowExceptionForHR(runningDocumentTableForEvents.AdviseRunningDocTableEvents(new RunningDocTableEventsSink(this), out _runningDocumentTableEventCookie));
        }
开发者ID:Rickinio,项目名称:roslyn,代码行数:35,代码来源:DocumentProvider.cs


示例4: DocumentProvider

        /// <summary>
        /// Creates a document provider.
        /// </summary>
        /// <param name="projectContainer">Project container for the documents.</param>
        /// <param name="serviceProvider">Service provider</param>
        /// <param name="documentTrackingService">An optional <see cref="VisualStudioDocumentTrackingService"/> to track active and visible documents.</param>
        public DocumentProvider(
            IVisualStudioHostProjectContainer projectContainer,
            IServiceProvider serviceProvider,
            VisualStudioDocumentTrackingService documentTrackingService)
        {
            var componentModel = (IComponentModel)serviceProvider.GetService(typeof(SComponentModel));

            _projectContainer = projectContainer;
            this._documentTrackingServiceOpt = documentTrackingService;
            this._runningDocumentTable = (IVsRunningDocumentTable4)serviceProvider.GetService(typeof(SVsRunningDocumentTable));
            this._editorAdaptersFactoryService = componentModel.GetService<IVsEditorAdaptersFactoryService>();
            this._contentTypeRegistryService = componentModel.GetService<IContentTypeRegistryService>();
            _textUndoHistoryRegistry = componentModel.GetService<ITextUndoHistoryRegistry>();
            _textManager = (IVsTextManager)serviceProvider.GetService(typeof(SVsTextManager));

            _fileChangeService = (IVsFileChangeEx)serviceProvider.GetService(typeof(SVsFileChangeEx));

            var shell = (IVsShell)serviceProvider.GetService(typeof(SVsShell));
            if (shell == null)
            {
                // This can happen only in tests, bail out.
                return;
            }

            var runningDocumentTableForEvents = (IVsRunningDocumentTable)_runningDocumentTable;
            Marshal.ThrowExceptionForHR(runningDocumentTableForEvents.AdviseRunningDocTableEvents(new RunningDocTableEventsSink(this), out _runningDocumentTableEventCookie));
        }
开发者ID:XieShuquan,项目名称:roslyn,代码行数:33,代码来源:DocumentProvider.cs


示例5: RenameTrackingCodeAction

 public RenameTrackingCodeAction(Document document, string title, IEnumerable<IRefactorNotifyService> refactorNotifyServices, ITextUndoHistoryRegistry undoHistoryRegistry)
 {
     _document = document;
     _title = title;
     _refactorNotifyServices = refactorNotifyServices;
     _undoHistoryRegistry = undoHistoryRegistry;
 }
开发者ID:CAPCHIK,项目名称:roslyn,代码行数:7,代码来源:RenameTrackingTaggerProvider.RenameTrackingCodeAction.cs


示例6: AutomaticLineEnderCommandHandler

 public AutomaticLineEnderCommandHandler(
     IWaitIndicator waitIndicator,
     ITextUndoHistoryRegistry undoRegistry,
     IEditorOperationsFactoryService editorOperations)
     : base(waitIndicator, undoRegistry, editorOperations)
 {
 }
开发者ID:SoumikMukherjeeDOTNET,项目名称:roslyn,代码行数:7,代码来源:AutomaticLineEnderCommandHandler.cs


示例7: GlobalUndoServiceFactory

 public GlobalUndoServiceFactory(
     ITextUndoHistoryRegistry undoHistoryRegistry,
     SVsServiceProvider serviceProvider,
     Lazy<VisualStudioWorkspace> workspace)
 {
     _singleton = new GlobalUndoService(undoHistoryRegistry, serviceProvider, workspace);
 }
开发者ID:CAPCHIK,项目名称:roslyn,代码行数:7,代码来源:GlobalUndoServiceFactory.cs


示例8: CreateEditTransaction

 /// <summary>
 /// create caret preserving edit transaction with automatic code change undo merging policy
 /// </summary>
 public static CaretPreservingEditTransaction CreateEditTransaction(
     this ITextView view, string description, ITextUndoHistoryRegistry registry, IEditorOperationsFactoryService service)
 {
     return new CaretPreservingEditTransaction(description, view, registry, service)
     {
         MergePolicy = AutomaticCodeChangeMergePolicy.Instance
     };
 }
开发者ID:XieShuquan,项目名称:roslyn,代码行数:11,代码来源:Extensions.cs


示例9: AbstractRenameTrackingCodeFixProvider

 protected AbstractRenameTrackingCodeFixProvider(
     IWaitIndicator waitIndicator,
     ITextUndoHistoryRegistry undoHistoryRegistry,
     IEnumerable<IRefactorNotifyService> refactorNotifyServices)
 {
     _waitIndicator = waitIndicator;
     _undoHistoryRegistry = undoHistoryRegistry;
     _refactorNotifyServices = refactorNotifyServices;
 }
开发者ID:CAPCHIK,项目名称:roslyn,代码行数:9,代码来源:AbstractRenameTrackingCodeFixProvider.cs


示例10: StandardTextDocument

            public StandardTextDocument(
                DocumentProvider documentProvider,
                IVisualStudioHostProject project,
                DocumentKey documentKey,
                IReadOnlyList<string> folderNames,
                SourceCodeKind sourceCodeKind,
                ITextUndoHistoryRegistry textUndoHistoryRegistry,
                IVsFileChangeEx fileChangeService,
                ITextBuffer openTextBuffer,
                DocumentId id,
                EventHandler updatedOnDiskHandler,
                EventHandler<bool> openedHandler,
                EventHandler<bool> closingHandler)
            {
                Contract.ThrowIfNull(documentProvider);

                this.Project = project;
                this.Id = id ?? DocumentId.CreateNewId(project.Id, documentKey.Moniker);
                this.Folders = folderNames;

                _documentProvider = documentProvider;

                this.Key = documentKey;
                this.SourceCodeKind = sourceCodeKind;
                _itemMoniker = documentKey.Moniker;
                _textUndoHistoryRegistry = textUndoHistoryRegistry;
                _fileChangeTracker = new FileChangeTracker(fileChangeService, this.FilePath);
                _fileChangeTracker.UpdatedOnDisk += OnUpdatedOnDisk;

                _openTextBuffer = openTextBuffer;
                _snapshotTracker = new ReiteratedVersionSnapshotTracker(openTextBuffer);

                // The project system does not tell us the CodePage specified in the proj file, so
                // we use null to auto-detect.
                _doNotAccessDirectlyLoader = new FileTextLoader(documentKey.Moniker, defaultEncoding: null);

                // If we aren't already open in the editor, then we should create a file change notification
                if (openTextBuffer == null)
                {
                    _fileChangeTracker.StartFileChangeListeningAsync();
                }

                if (updatedOnDiskHandler != null)
                {
                    UpdatedOnDisk += updatedOnDiskHandler;
                }

                if (openedHandler != null)
                {
                    Opened += openedHandler;
                }

                if (closingHandler != null)
                {
                    Closing += closingHandler;
                }
            }
开发者ID:natidea,项目名称:roslyn,代码行数:57,代码来源:DocumentProvider.StandardTextDocument.cs


示例11: CommandHandlerDispatcher

		public CommandHandlerDispatcher(IVsTextView textViewAdapter, ITextView textView, ITextUndoHistoryRegistry textUndoHistoryRegistry, params ICommandHandler[] commandHandlers)
		{
			_textViewAdapter = textViewAdapter;
			_textView = textView;
			_textUndoHistoryRegistry = textUndoHistoryRegistry;
			_commandHandlers = commandHandlers.ToDictionary(h => h.CommandId);

			_textViewAdapter.AddCommandFilter(this, out _nextTarget);
		}
开发者ID:modulexcite,项目名称:YamlDotNet.Editor,代码行数:9,代码来源:CommandHandlerDispatcher.cs


示例12: RenameTrackingTestState

        public RenameTrackingTestState(
            string markup,
            string languageName,
            bool onBeforeGlobalSymbolRenamedReturnValue = true,
            bool onAfterGlobalSymbolRenamedReturnValue = true)
        {
            this.Workspace = CreateTestWorkspace(markup, languageName, TestExportProvider.CreateExportProviderWithCSharpAndVisualBasic());

            _hostDocument = Workspace.Documents.First();
            _view = _hostDocument.GetTextView();
            _view.Caret.MoveTo(new SnapshotPoint(_view.TextSnapshot, _hostDocument.CursorPosition.Value));
            _editorOperations = Workspace.GetService<IEditorOperationsFactoryService>().GetEditorOperations(_view);
            _historyRegistry = Workspace.ExportProvider.GetExport<ITextUndoHistoryRegistry>().Value;
            _mockRefactorNotifyService = new MockRefactorNotifyService
            {
                OnBeforeSymbolRenamedReturnValue = onBeforeGlobalSymbolRenamedReturnValue,
                OnAfterSymbolRenamedReturnValue = onAfterGlobalSymbolRenamedReturnValue
            };

            var optionService = this.Workspace.Services.GetService<IOptionService>();

            // Mock the action taken by the workspace INotificationService
            var notificationService = Workspace.Services.GetService<INotificationService>() as INotificationServiceCallback;
            var callback = new Action<string, string, NotificationSeverity>((message, title, severity) => _notificationMessage = message);
            notificationService.NotificationCallback = callback;

            var tracker = new RenameTrackingTaggerProvider(
                _historyRegistry,
                Workspace.ExportProvider.GetExport<Host.IWaitIndicator>().Value,
                Workspace.ExportProvider.GetExport<IInlineRenameService>().Value,
                Workspace.ExportProvider.GetExport<IDiagnosticAnalyzerService>().Value,
                SpecializedCollections.SingletonEnumerable(_mockRefactorNotifyService),
                Workspace.ExportProvider.GetExports<IAsynchronousOperationListener, FeatureMetadata>());

            _tagger = tracker.CreateTagger<RenameTrackingTag>(_hostDocument.GetTextBuffer());

            if (languageName == LanguageNames.CSharp)
            {
                _codeFixProvider = new CSharpRenameTrackingCodeFixProvider(
                    Workspace.ExportProvider.GetExport<Host.IWaitIndicator>().Value,
                    _historyRegistry,
                    SpecializedCollections.SingletonEnumerable(_mockRefactorNotifyService));
            }
            else if (languageName == LanguageNames.VisualBasic)
            {
                _codeFixProvider = new VisualBasicRenameTrackingCodeFixProvider(
                    Workspace.ExportProvider.GetExport<Host.IWaitIndicator>().Value,
                    _historyRegistry,
                    SpecializedCollections.SingletonEnumerable(_mockRefactorNotifyService));
            }
            else
            {
                throw new ArgumentException("Invalid langauge name: " + languageName, "languageName");
            }
        }
开发者ID:GloryChou,项目名称:roslyn,代码行数:55,代码来源:RenameTrackingTestState.cs


示例13: AutoCommentService

 public AutoCommentService(
     [Import] IVsEditorAdaptersFactoryService editorAdaptersFactoryService,
     [Import] IEditorOperationsFactoryService editorOperationsFactoryService,
     [Import] ITextUndoHistoryRegistry textUndoHistoryRegistry,
     [ImportMany] IEnumerable<Lazy<ICommenterProvider, IContentTypeMetadata>> commenterProviders)
 {
     _editorAdaptersFactoryService = editorAdaptersFactoryService;
     _editorOperationsFactoryService = editorOperationsFactoryService;
     _textUndoHistoryRegistry = textUndoHistoryRegistry;
     _commenterProviders = commenterProviders.ToList();
 }
开发者ID:modulexcite,项目名称:vsbase,代码行数:11,代码来源:AutoCommentService.cs


示例14: TextBufferUndoManager

		public TextBufferUndoManager(ITextBuffer textBuffer, ITextUndoHistoryRegistry textUndoHistoryRegistry) {
			if (textBuffer == null)
				throw new ArgumentNullException(nameof(textBuffer));
			if (textUndoHistoryRegistry == null)
				throw new ArgumentNullException(nameof(textUndoHistoryRegistry));
			changes = new List<ChangeInfo>();
			TextBuffer = textBuffer;
			this.textUndoHistoryRegistry = textUndoHistoryRegistry;
			textBufferUndoHistory = textUndoHistoryRegistry.RegisterHistory(TextBuffer);
			TextBuffer.Changed += TextBuffer_Changed;
			TextBuffer.PostChanged += TextBuffer_PostChanged;
		}
开发者ID:manojdjoshi,项目名称:dnSpy,代码行数:12,代码来源:TextBufferUndoManager.cs


示例15: TryCreate

        public static CaretPreservingEditTransaction TryCreate(string description, 
            ITextView textView,
            ITextUndoHistoryRegistry undoHistoryRegistry,
            IEditorOperationsFactoryService editorOperationsFactoryService)
        {
            if (undoHistoryRegistry.TryGetHistory(textView.TextBuffer, out var unused))
            {
                return new CaretPreservingEditTransaction(description, textView, undoHistoryRegistry, editorOperationsFactoryService);
            }

            return null;
        }
开发者ID:GuilhermeSa,项目名称:roslyn,代码行数:12,代码来源:CaretPreservingEditTransaction.cs


示例16: Commenter

        public Commenter(ITextView textView, ITextUndoHistoryRegistry textUndoHistoryRegistry, IEnumerable<CommentFormat> commentFormats)
        {
            Contract.Requires<ArgumentNullException>(textView != null, "textView");
            Contract.Requires<ArgumentNullException>(textUndoHistoryRegistry != null, "textUndoHistoryRegistry");
            Contract.Requires<ArgumentNullException>(commentFormats != null, "commentFormats");

            this._textView = textView;
            this._textUndoHistoryRegistry = textUndoHistoryRegistry;
            this._commentFormats = commentFormats.ToList().AsReadOnly();
            this._blockFormats = _commentFormats.OfType<BlockCommentFormat>().ToList().AsReadOnly();
            this._lineFormats = _commentFormats.OfType<LineCommentFormat>().ToList().AsReadOnly();
            this._useLineComments = this._lineFormats.Count > 0;
        }
开发者ID:chandramouleswaran,项目名称:LangSvcV2,代码行数:13,代码来源:Commenter.cs


示例17: AsyncCompletionService

 public AsyncCompletionService(
     IEditorOperationsFactoryService editorOperationsFactoryService,
     ITextUndoHistoryRegistry undoHistoryRegistry,
     IInlineRenameService inlineRenameService,
     [ImportMany] IEnumerable<Lazy<IAsynchronousOperationListener, FeatureMetadata>> asyncListeners,
     [ImportMany] IEnumerable<Lazy<IIntelliSensePresenter<ICompletionPresenterSession, ICompletionSession>, OrderableMetadata>> completionPresenters,
     [ImportMany] IEnumerable<Lazy<ICompletionProvider, OrderableLanguageMetadata>> allCompletionProviders,
     [ImportMany] IEnumerable<Lazy<IBraceCompletionSessionProvider, IBraceCompletionMetadata>> autoBraceCompletionChars)
     : this(editorOperationsFactoryService, undoHistoryRegistry, inlineRenameService,
           ExtensionOrderer.Order(completionPresenters).Select(lazy => lazy.Value).FirstOrDefault(),
           asyncListeners, allCompletionProviders, autoBraceCompletionChars)
 {
 }
开发者ID:GeertVL,项目名称:roslyn,代码行数:13,代码来源:AsyncCompletionService.cs


示例18: RenameTrackingCommitter

 public RenameTrackingCommitter(
     StateMachine stateMachine,
     SnapshotSpan snapshotSpan,
     IEnumerable<IRefactorNotifyService> refactorNotifyServices,
     ITextUndoHistoryRegistry undoHistoryRegistry,
     string displayText)
 {
     _stateMachine = stateMachine;
     _snapshotSpan = snapshotSpan;
     _refactorNotifyServices = refactorNotifyServices;
     _undoHistoryRegistry = undoHistoryRegistry;
     _displayText = displayText;
     _renameSymbolResultGetter = new AsyncLazy<RenameTrackingSolutionSet>(c => RenameSymbolWorkerAsync(c), cacheResult: true);
 }
开发者ID:SoumikMukherjeeDOTNET,项目名称:roslyn,代码行数:14,代码来源:RenameTrackingTaggerProvider.RenameTrackingCommitter.cs


示例19: DefaultKeyProcessor

        internal DefaultKeyProcessor(IWpfTextView textView, IEditorOperations editorOperations, ITextUndoHistoryRegistry undoHistoryRegistry) {
            if (textView == null)
                throw new ArgumentNullException("textView");

            if (editorOperations == null)
                throw new ArgumentNullException("editorOperations");

            if (undoHistoryRegistry == null)
                throw new ArgumentNullException("undoHistoryRegistry");

            _textView = textView;
            _editorOperations = editorOperations;
            _undoHistoryRegistry = undoHistoryRegistry;
        }
开发者ID:AlexanderSher,项目名称:RTVS-Old,代码行数:14,代码来源:DefaultKeyStrokeProcessor.cs


示例20: RenameTrackingCommitter

 public RenameTrackingCommitter(
     StateMachine stateMachine,
     SnapshotSpan snapshotSpan,
     IEnumerable<IRefactorNotifyService> refactorNotifyServices,
     ITextUndoHistoryRegistry undoHistoryRegistry,
     string displayText,
     bool showPreview)
 {
     _stateMachine = stateMachine;
     _snapshotSpan = snapshotSpan;
     _refactorNotifyServices = refactorNotifyServices;
     _undoHistoryRegistry = undoHistoryRegistry;
     _displayText = displayText;
     _showPreview = showPreview;
 }
开发者ID:ehsansajjad465,项目名称:roslyn,代码行数:15,代码来源:RenameTrackingTaggerProvider.RenameTrackingCommitter.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# ITextView类代码示例发布时间:2022-05-24
下一篇:
C# ITextSourceVersion类代码示例发布时间: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