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

C# IVimData类代码示例

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

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



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

示例1: CreateCommonOperations

 internal static ICommonOperations CreateCommonOperations(
     ITextView textView,
     IVimLocalSettings localSettings,
     IOutliningManager outlining = null,
     IStatusUtil statusUtil = null,
     ISearchService searchService = null,
     IUndoRedoOperations undoRedoOperations = null,
     IVimData vimData = null,
     IVimHost vimHost = null,
     ITextStructureNavigator navigator = null,
     IClipboardDevice clipboardDevice = null,
     IFoldManager foldManager = null)
 {
     var editorOperations = EditorUtil.GetOperations(textView);
     var editorOptions = EditorUtil.FactoryService.EditorOptionsFactory.GetOptions(textView);
     var jumpList = new JumpList(new TrackingLineColumnService());
     var keyMap = new KeyMap();
     foldManager = foldManager ?? new FoldManager(textView.TextBuffer);
     statusUtil = statusUtil ?? new StatusUtil();
     searchService = searchService ?? CreateSearchService(localSettings.GlobalSettings);
     undoRedoOperations = undoRedoOperations ??
                          new UndoRedoOperations(statusUtil, FSharpOption<ITextUndoHistory>.None);
     vimData = vimData ?? new VimData();
     vimHost = vimHost ?? new MockVimHost();
     navigator = navigator ?? CreateTextStructureNavigator(textView.TextBuffer);
     clipboardDevice = clipboardDevice ?? new MockClipboardDevice();
     var operationsData = new OperationsData(
         editorOperations,
         editorOptions,
         foldManager,
         jumpList,
         keyMap,
         localSettings,
         outlining != null ? FSharpOption.Create(outlining) : FSharpOption<IOutliningManager>.None,
         CreateRegisterMap(clipboardDevice),
         searchService,
         EditorUtil.FactoryService.SmartIndentationService,
         statusUtil,
         textView,
         undoRedoOperations,
         vimData,
         vimHost,
         navigator);
     return new CommonOperations(operationsData);
 }
开发者ID:rride,项目名称:VsVim,代码行数:45,代码来源:VimUtil.cs


示例2: CreateVim

 public static Mock<IVim> CreateVim(
     IRegisterMap registerMap = null,
     IMarkMap map = null,
     IVimGlobalSettings settings = null,
     IVimHost host = null,
     IKeyMap keyMap = null,
     IKeyboardDevice keyboardDevice = null,
     IMouseDevice mouseDevice = null,
     IVimData vimData = null,
     IMacroRecorder macroRecorder = null,
     ISearchService searchService = null,
     Dictionary<string, VariableValue> variableMap = null,
     MockRepository factory = null)
 {
     factory = factory ?? new MockRepository(MockBehavior.Strict);
     registerMap = registerMap ?? CreateRegisterMap().Object;
     map = map ?? new MarkMap(new BufferTrackingService());
     settings = settings ?? new GlobalSettings();
     host = host ?? new MockVimHost();
     keyMap = keyMap ?? (new KeyMap(settings, new Dictionary<string, VariableValue>()));
     macroRecorder = macroRecorder ?? CreateMacroRecorder(factory: factory).Object;
     searchService = searchService ?? factory.Create<ISearchService>().Object;
     keyboardDevice = keyboardDevice ?? (factory.Create<IKeyboardDevice>(MockBehavior.Loose)).Object;
     mouseDevice = mouseDevice ?? (factory.Create<IMouseDevice>(MockBehavior.Loose)).Object;
     vimData = vimData ?? VimUtil.CreateVimData();
     variableMap = variableMap ?? new Dictionary<string, VariableValue>();
     var mock = factory.Create<IVim>(MockBehavior.Strict);
     mock.SetupGet(x => x.RegisterMap).Returns(registerMap);
     mock.SetupGet(x => x.MarkMap).Returns(map);
     mock.SetupGet(x => x.GlobalSettings).Returns(settings);
     mock.SetupGet(x => x.VimHost).Returns(host);
     mock.SetupGet(x => x.KeyMap).Returns(keyMap);
     mock.SetupGet(x => x.VimData).Returns(vimData);
     mock.SetupGet(x => x.MacroRecorder).Returns(macroRecorder);
     mock.SetupGet(x => x.SearchService).Returns(searchService);
     mock.SetupGet(x => x.VariableMap).Returns(variableMap);
     return mock;
 }
开发者ID:Kazark,项目名称:VsVim,代码行数:38,代码来源:MockObjectFactory.cs


示例3: RunCommand

 /// <summary>
 /// Run the specified command, capture it's output and return it to the caller
 /// </summary>
 public virtual string RunCommand(string command, string arguments, IVimData vimdata)
 {
     var startInfo = new ProcessStartInfo
                         {
                             FileName = command,
                             Arguments = arguments,
                             RedirectStandardOutput = true,
                             UseShellExecute = false,
                             WorkingDirectory = vimdata.CurrentDirectory
                         };
     try
     {
         var process = Process.Start(startInfo);
         process.WaitForExit();
         return process.StandardOutput.ReadToEnd();
     }
     catch (Exception ex)
     {
         return ex.Message;
     }
 }
开发者ID:nligerakis,项目名称:VsVim,代码行数:24,代码来源:VimHost.cs


示例4: RunCommandFunc

 string IVimHost.RunCommand(string command, string arguments, IVimData vimData)
 {
     return RunCommandFunc(command, arguments, vimData);
 }
开发者ID:niklasi,项目名称:VsVim,代码行数:4,代码来源:MockVimHost.cs


示例5: VimDataCreated

 public virtual void VimDataCreated(IVimData vimData)
 {
 }
开发者ID:Yzzl,项目名称:VsVim,代码行数:3,代码来源:VimHost.cs


示例6: Create

 public void Create(params string[] lines)
 {
     _textView = CreateTextView(lines);
     _textView.Caret.MoveTo(new SnapshotPoint(_textView.TextSnapshot, 0));
     _textBuffer = _textView.TextBuffer;
     _factory = new MockRepository(MockBehavior.Strict);
     _editOpts = _factory.Create<IEditorOperations>();
     _vimHost = _factory.Create<IVimHost>();
     _vimHost.Setup(x => x.IsDirty(It.IsAny<ITextBuffer>())).Returns(false);
     _operations = _factory.Create<ICommonOperations>();
     _operations.SetupGet(x => x.EditorOperations).Returns(_editOpts.Object);
     _statusUtil = _factory.Create<IStatusUtil>();
     _fileSystem = _factory.Create<IFileSystem>(MockBehavior.Strict);
     _foldManager = _factory.Create<IFoldManager>(MockBehavior.Strict);
     _vimData = new VimData();
     _vim = MockObjectFactory.CreateVim(RegisterMap, host: _vimHost.Object, vimData: _vimData, factory: _factory);
     var localSettings = new LocalSettings(Vim.GlobalSettings);
     var vimTextBuffer = MockObjectFactory.CreateVimTextBuffer(
         _textBuffer,
         vim: _vim.Object,
         localSettings: localSettings,
         factory: _factory);
     var vimBufferData = CreateVimBufferData(
         vimTextBuffer.Object,
         _textView,
         statusUtil: _statusUtil.Object);
     var vimBuffer = CreateVimBuffer(vimBufferData);
     _interpreter = new Interpreter.VimInterpreter(
         vimBuffer,
         _operations.Object,
         _foldManager.Object,
         _fileSystem.Object,
         _factory.Create<IBufferTrackingService>().Object);
 }
开发者ID:wmchristie,项目名称:VsVim,代码行数:34,代码来源:CommandProcessorLegacyTest.cs


示例7: Create

 private void Create(ITextView textView, IEditorOptions editorOptions = null)
 {
     _textView = textView;
     _textBuffer = textView.TextBuffer;
     _snapshot = _textBuffer.CurrentSnapshot;
     _textBuffer.Changed += delegate { _snapshot = _textBuffer.CurrentSnapshot; };
     _globalSettings = new Vim.GlobalSettings();
     _localSettings = new LocalSettings(_globalSettings, FSharpOption.CreateForReference(editorOptions), FSharpOption.CreateForReference(textView));
     _markMap = new MarkMap(new TrackingLineColumnService());
     _vimData = new VimData();
     _search = VimUtil.CreateSearchService(_globalSettings);
     _jumpList = VimUtil.CreateJumpList();
     _statusUtil = new Mock<IStatusUtil>(MockBehavior.Strict);
     _navigator = VimUtil.CreateTextStructureNavigator(_textView, WordKind.NormalWord);
     _motionUtil = new MotionUtil(
         _textView,
         _markMap,
         _localSettings,
         _search,
         _navigator,
         _jumpList,
         _statusUtil.Object,
         VimUtil.GetWordUtil(textView),
         _vimData);
 }
开发者ID:franch,项目名称:VsVim,代码行数:25,代码来源:MotionUtilTest.cs


示例8: Create

 private void Create(ITextView textView)
 {
     _textView = textView;
     _textBuffer = textView.TextBuffer;
     _buffer = _textView.TextBuffer;
     _snapshot = _buffer.CurrentSnapshot;
     _buffer.Changed += delegate { _snapshot = _buffer.CurrentSnapshot; };
     _globalSettings = new Vim.GlobalSettings();
     _localSettings = new LocalSettings(_globalSettings, _textView);
     _markMap = new MarkMap(new TrackingLineColumnService());
     _vimData = new VimData();
     _search = VimUtil.CreateSearchService(_globalSettings);
     _jumpList = VimUtil.CreateJumpList();
     _statusUtil = new Mock<IStatusUtil>(MockBehavior.Strict);
     _navigator = VimUtil.CreateTextStructureNavigator(_textView.TextBuffer);
     _motionUtil = new MotionUtil(
         _textView,
         _markMap,
         _localSettings,
         _search,
         _navigator,
         _jumpList,
         _statusUtil.Object,
         _vimData);
 }
开发者ID:bentayloruk,项目名称:VsVim,代码行数:25,代码来源:MotionUtilTest.cs


示例9: Create

        public void Create(params string[] lines)
        {
            _textView = EditorUtil.CreateTextView(lines);
            _vimData = new VimData();
            _editorOptions = EditorUtil.FactoryService.EditorOptionsFactory.GetOptions(_textView);
            _textView.Caret.MoveTo(new SnapshotPoint(_textView.TextSnapshot, 0));
            _textBuffer = _textView.TextBuffer;
            _factory = new MockRepository(MockBehavior.Strict);
            _registerMap = VimUtil.CreateRegisterMap(MockObjectFactory.CreateClipboardDevice(_factory).Object);
            _host = _factory.Create<IVimHost>();
            _jumpList = _factory.Create<IJumpList>();
            _editorOperations = _factory.Create<IEditorOperations>();
            _editorOperations.Setup(x => x.AddAfterTextBufferChangePrimitive());
            _editorOperations.Setup(x => x.AddBeforeTextBufferChangePrimitive());
            _globalSettings = _factory.Create<IVimGlobalSettings>();
            _globalSettings.SetupGet(x => x.Magic).Returns(true);
            _globalSettings.SetupGet(x => x.SmartCase).Returns(false);
            _globalSettings.SetupGet(x => x.IgnoreCase).Returns(true);
            _globalSettings.SetupGet(x => x.IsVirtualEditOneMore).Returns(false);
            _globalSettings.SetupGet(x => x.UseEditorIndent).Returns(false);
            _globalSettings.SetupGet(x => x.UseEditorSettings).Returns(false);
            _globalSettings.SetupGet(x => x.VirtualEdit).Returns(String.Empty);
            _globalSettings.SetupGet(x => x.WrapScan).Returns(true);
            _settings = MockObjectFactory.CreateLocalSettings(_globalSettings.Object, _factory);
            _settings.SetupGet(x => x.AutoIndent).Returns(false);
            _settings.SetupGet(x => x.GlobalSettings).Returns(_globalSettings.Object);
            _settings.SetupGet(x => x.ExpandTab).Returns(true);
            _settings.SetupGet(x => x.TabStop).Returns(4);
            _outlining = _factory.Create<IOutliningManager>();
            _outlining
                .Setup(x => x.ExpandAll(It.IsAny<SnapshotSpan>(), It.IsAny<Predicate<ICollapsed>>()))
                .Returns<IEnumerable<ICollapsible>>(null);
            _globalSettings.SetupGet(x => x.ShiftWidth).Returns(2);
            _statusUtil = _factory.Create<IStatusUtil>();
            _searchService = VimUtil.CreateSearchService(_globalSettings.Object);
            _undoRedoOperations = VimUtil.CreateUndoRedoOperations(_statusUtil.Object);

            var data = new OperationsData(
                vimData: _vimData,
                vimHost: _host.Object,
                editorOperations: _editorOperations.Object,
                textView: _textView,
                outliningManager: FSharpOption.Create(_outlining.Object),
                jumpList: _jumpList.Object,
                localSettings: _settings.Object,
                undoRedoOperations: _undoRedoOperations,
                registerMap: _registerMap,
                editorOptions: _editorOptions,
                keyMap: null,
                statusUtil: _statusUtil.Object,
                foldManager: null,
                searchService: _searchService,
                wordUtil: VimUtil.GetWordUtil(_textView));

            _operationsRaw = new CommonOperations(data);
            _operations = _operationsRaw;
        }
开发者ID:franch,项目名称:VsVim,代码行数:57,代码来源:CommonOperationsTest.cs


示例10: Create

 protected void Create(params string[] lines)
 {
     _textView = CreateTextView(lines);
     _textBuffer = _textView.TextBuffer;
     _globalSettings = Vim.GlobalSettings;
     _globalSettings.IgnoreCase = true;
     _globalSettings.HighlightSearch = true;
     _vimData = Vim.VimData;
     _asyncTaggerSourceRaw = new HighlightSearchTaggerSource(
         _textView,
         _globalSettings,
         _vimData,
         Vim.VimHost);
     _asyncTaggerSource = _asyncTaggerSourceRaw;
 }
开发者ID:Deleriumdoll,项目名称:VsVim,代码行数:15,代码来源:HighlightSearchTaggerSourceTest.cs


示例11: Create

        protected void Create(ITextView textView)
        {
            _textView = textView;
            _textBuffer = textView.TextBuffer;
            _snapshot = _textBuffer.CurrentSnapshot;
            _textBuffer.Changed += delegate { _snapshot = _textBuffer.CurrentSnapshot; };

            _vimTextBuffer = Vim.CreateVimTextBuffer(_textBuffer);
            _statusUtil = new Mock<IStatusUtil>(MockBehavior.Strict);
            var vimBufferData = CreateVimBufferData(_vimTextBuffer, _textView, statusUtil: _statusUtil.Object);
            _globalSettings = vimBufferData.LocalSettings.GlobalSettings;
            _localSettings = vimBufferData.LocalSettings;
            _markMap = vimBufferData.Vim.MarkMap;
            _vimData = vimBufferData.Vim.VimData;
            _search = vimBufferData.Vim.SearchService;
            var wordNavigator = CreateTextStructureNavigator(_textView.TextBuffer, WordKind.NormalWord);
            _motionUtil = new MotionUtil(vimBufferData);
        }
开发者ID:kcprogrammer,项目名称:VsVim,代码行数:18,代码来源:MotionUtilTest.cs


示例12: Create

        protected virtual void Create(params string[] lines)
        {
            _textView = CreateTextView(lines);
            _textBuffer = _textView.TextBuffer;
            _vimBuffer = Vim.CreateVimBuffer(_textView);
            _vimBuffer.ErrorMessage +=
                (_, message) =>
                {
                    if (_assertOnErrorMessage)
                    {
                        throw new Exception("Error Message: " + message.Message);
                    }
                };
            _vimBuffer.WarningMessage +=
                (_, message) =>
                {
                    if (_assertOnWarningMessage)
                    {
                        throw new Exception("Warning Message: " + message.Message);
                    }
                };
            _vimBufferData = _vimBuffer.VimBufferData;
            _vimTextBuffer = _vimBuffer.VimTextBuffer;
            _normalMode = _vimBuffer.NormalMode;
            _keyMap = _vimBuffer.Vim.KeyMap;
            _localSettings = _vimBuffer.LocalSettings;
            _globalSettings = _localSettings.GlobalSettings;
            _windowSettings = _vimBuffer.WindowSettings;
            _jumpList = _vimBuffer.JumpList;
            _vimHost = (MockVimHost)_vimBuffer.Vim.VimHost;
            _vimHost.BeepCount = 0;
            _vimData = Vim.VimData;
            _foldManager = FoldManagerFactory.GetFoldManager(_textView);
            _clipboardDevice = (TestableClipboardDevice)CompositionContainer.GetExportedValue<IClipboardDevice>();

            // Many of the operations operate on both the visual and edit / text snapshot
            // simultaneously.  Ensure that our setup code is producing a proper IElisionSnapshot
            // for the Visual portion so we can root out any bad mixing of instances between
            // the two
            Assert.True(_textView.VisualSnapshot is IElisionSnapshot);
            Assert.True(_textView.VisualSnapshot != _textView.TextSnapshot);
        }
开发者ID:Deleriumdoll,项目名称:VsVim,代码行数:42,代码来源:NormalModeIntegrationTest.cs


示例13: Create

        protected void Create(params string[] lines)
        {
            _vimHost = (MockVimHost)Vim.VimHost;
            _textView = CreateTextView(lines);
            _textBuffer = _textView.TextBuffer;
            _vimTextBuffer = CreateVimTextBufferCore(_textBuffer);
            _localSettings = _vimTextBuffer.LocalSettings;

            var foldManager = CreateFoldManager(_textView);

            _factory = new MockRepository(MockBehavior.Loose);
            _statusUtil = _factory.Create<IStatusUtil>();
            _bulkOperations = new TestableBulkOperations();

            var vimBufferData = CreateVimBufferData(
                _vimTextBuffer,
                _textView,
                statusUtil: _statusUtil.Object);
            _jumpList = vimBufferData.JumpList;
            _windowSettings = vimBufferData.WindowSettings;

            _vimData = Vim.VimData;
            _macroRecorder = Vim.MacroRecorder;
            _globalSettings = Vim.GlobalSettings;

            var operations = CreateCommonOperations(vimBufferData);
            var lineChangeTracker = new LineChangeTracker(vimBufferData);
            _motionUtil = new MotionUtil(vimBufferData, operations);
            _commandUtil = new CommandUtil(
                vimBufferData,
                _motionUtil,
                operations,
                foldManager,
                new InsertUtil(vimBufferData, _motionUtil, operations),
                _bulkOperations,
                MouseDevice,
                lineChangeTracker);

            var outliningManagerService = CompositionContainer.GetExportedValue<IOutliningManagerService>();
            _outliningManager = outliningManagerService.GetOutliningManager(_textView);
        }
开发者ID:Yzzl,项目名称:VsVim,代码行数:41,代码来源:CommandUtilTest.cs


示例14: Create

 protected void Create(params string[] lines)
 {
     _statusUtil = new TestableStatusUtil();
     _vimData = Vim.VimData;
     _vimBufferData = CreateVimBufferData(
         CreateTextView(lines),
         statusUtil: _statusUtil);
     _vimBuffer = CreateVimBuffer(_vimBufferData);
     _vimTextBuffer = _vimBufferData.VimTextBuffer;
     _localSettings = _vimBufferData.LocalSettings;
     _globalSettings = _localSettings.GlobalSettings;
     _textBuffer = _vimBufferData.TextBuffer;
     _textView = _vimBufferData.TextView;
     _interpreter = new global::Vim.Interpreter.Interpreter(
         _vimBuffer,
         CommonOperationsFactory.GetCommonOperations(_vimBufferData),
         FoldManagerFactory.GetFoldManager(_vimBufferData.TextView),
         new FileSystem(),
         BufferTrackingService);
     _keyMap = Vim.KeyMap;
 }
开发者ID:ultonis,项目名称:VsVim,代码行数:21,代码来源:InterpreterTest.cs


示例15: Create

        private void Create(params string[] lines)
        {
            _vimHost = (MockVimHost)Vim.VimHost;
            _textView = CreateTextView(lines);
            _globalSettings = Vim.GlobalSettings;
            _globalSettings.IncrementalSearch = true;
            _globalSettings.WrapScan = true;

            var vimTextBuffer = Vim.CreateVimTextBuffer(_textView.TextBuffer);

            _factory = new MockRepository(MockBehavior.Strict);
            _statusUtil = _factory.Create<IStatusUtil>();
            _statusUtil.Setup(x => x.OnWarning(Resources.Common_SearchBackwardWrapped));
            _statusUtil.Setup(x => x.OnWarning(Resources.Common_SearchForwardWrapped));

            _vimData = Vim.VimData;
            var vimBufferData = CreateVimBufferData(vimTextBuffer, _textView);
            var operations = CommonOperationsFactory.GetCommonOperations(vimBufferData);
            _searchRaw = new IncrementalSearch(vimBufferData, operations);
            _search = _searchRaw;
        }
开发者ID:Yzzl,项目名称:VsVim,代码行数:21,代码来源:IncrementalSearchTest.cs


示例16: Create

        private void Create(params string[] lines)
        {
            _textBuffer = CreateTextBuffer(lines);
            _textView = MockObjectFactory.CreateTextView(_textBuffer);
            _textView.SetupGet(x => x.HasAggregateFocus).Returns(true);

            // Setup normal mode so that we can provide an ICommandRunner to 
            // recieve commands from
            _factory = new MockRepository(MockBehavior.Loose) {DefaultValue = DefaultValue.Mock};
            _runner = _factory.Create<ICommandRunner>(MockBehavior.Loose);
            _normalMode = _factory.Create<INormalMode>(MockBehavior.Strict);
            _normalMode.SetupGet(x => x.CommandRunner).Returns(_runner.Object);

            // Create the IVimBuffer instance
            _buffer = _factory.Create<IVimBuffer>(MockBehavior.Loose);
            _buffer.DefaultValue = DefaultValue.Mock;
            _buffer.SetupGet(x => x.NormalMode).Returns(_normalMode.Object);

            _vimData = VimUtil.CreateVimData();
            var vim = MockObjectFactory.CreateVim(vimData: _vimData);
            _tracker = new ChangeTracker(vim.Object);
            _tracker.OnVimBufferCreated(_buffer.Object);
        }
开发者ID:Kazark,项目名称:VsVim,代码行数:23,代码来源:ChangeTrackerTest.cs


示例17: Create

 public void Create(params string[] lines)
 {
     _textView = CreateTextView(lines);
     _textView.Caret.MoveTo(new SnapshotPoint(_textView.TextSnapshot, 0));
     _textBuffer = _textView.TextBuffer;
     _factory = new MockRepository(MockBehavior.Strict);
     _registerMap = VimUtil.CreateRegisterMap(MockObjectFactory.CreateClipboardDevice(_factory).Object);
     _editOpts = _factory.Create<IEditorOperations>();
     _vimHost = _factory.Create<IVimHost>();
     _operations = _factory.Create<ICommonOperations>();
     _operations.SetupGet(x => x.EditorOperations).Returns(_editOpts.Object);
     _commandOperations = _factory.Create<IOperations>();
     _statusUtil = _factory.Create<IStatusUtil>();
     _fileSystem = _factory.Create<IFileSystem>(MockBehavior.Strict);
     _foldManager = _factory.Create<IFoldManager>(MockBehavior.Strict);
     _vimData = new VimData();
     _vim = MockObjectFactory.CreateVim(_registerMap, host: _vimHost.Object, vimData: _vimData, factory: _factory);
     var localSettings = new LocalSettings(Vim.GlobalSettings);
     var vimTextBuffer = MockObjectFactory.CreateVimTextBuffer(
         _textBuffer,
         vim: _vim.Object,
         localSettings: localSettings,
         factory: _factory);
     var vimBufferData = CreateVimBufferData(
         vimTextBuffer.Object,
         _textView,
         statusUtil: _statusUtil.Object);
     _processorRaw = new CommandProcessor(
         vimBufferData,
         _operations.Object,
         _commandOperations.Object,
         _fileSystem.Object,
         _foldManager.Object);
     _processor = _processorRaw;
 }
开发者ID:GunioRobot,项目名称:VsVim,代码行数:35,代码来源:CommandProcessorTest.cs


示例18: Create

        public void Create(params string[] lines)
        {
            _textView = CreateTextView(lines);
            _textView.Caret.MoveTo(new SnapshotPoint(_textView.TextSnapshot, 0));
            _textBuffer = _textView.TextBuffer;
            _foldManager = FoldManagerFactory.GetFoldManager(_textView);
            _factory = new MockRepository(MockBehavior.Strict);

            // Create the Vim instance with our Mock'd services
            _vimData = new VimData();
            var registerMap = VimUtil.CreateRegisterMap(MockObjectFactory.CreateClipboardDevice(_factory).Object);
            _vimHost = _factory.Create<IVimHost>();
            _globalSettings = _factory.Create<IVimGlobalSettings>();
            _globalSettings.SetupGet(x => x.Magic).Returns(true);
            _globalSettings.SetupGet(x => x.SmartCase).Returns(false);
            _globalSettings.SetupGet(x => x.IgnoreCase).Returns(true);
            _globalSettings.SetupGet(x => x.IsVirtualEditOneMore).Returns(false);
            _globalSettings.SetupGet(x => x.SelectionKind).Returns(SelectionKind.Inclusive);
            _globalSettings.SetupGet(x => x.UseEditorIndent).Returns(false);
            _globalSettings.SetupGet(x => x.UseEditorSettings).Returns(false);
            _globalSettings.SetupGet(x => x.VirtualEdit).Returns(String.Empty);
            _globalSettings.SetupGet(x => x.WrapScan).Returns(true);
            _globalSettings.SetupGet(x => x.ShiftWidth).Returns(2);
            _searchService = new SearchService(TextSearchService, _globalSettings.Object);
            var vim = MockObjectFactory.CreateVim(
                registerMap: registerMap,
                host: _vimHost.Object,
                settings: _globalSettings.Object,
                searchService: _searchService,
                factory: _factory);

            // Create the IVimTextBuffer instance with our Mock'd services
            _localSettings = MockObjectFactory.CreateLocalSettings(_globalSettings.Object, _factory);
            _localSettings.SetupGet(x => x.AutoIndent).Returns(false);
            _localSettings.SetupGet(x => x.GlobalSettings).Returns(_globalSettings.Object);
            _localSettings.SetupGet(x => x.ExpandTab).Returns(true);
            _localSettings.SetupGet(x => x.TabStop).Returns(4);
            _vimTextBuffer = MockObjectFactory.CreateVimTextBuffer(
                _textBuffer,
                localSettings: _localSettings.Object,
                vim: vim.Object,
                factory: _factory);

            // Create the VimBufferData instance with our Mock'd services
            _jumpList = _factory.Create<IJumpList>();
            _statusUtil = _factory.Create<IStatusUtil>();
            _undoRedoOperations = VimUtil.CreateUndoRedoOperations(_statusUtil.Object);
            var vimBufferData = CreateVimBufferData(
                _vimTextBuffer.Object,
                _textView,
                statusUtil: _statusUtil.Object,
                jumpList: _jumpList.Object,
                undoRedoOperations: _undoRedoOperations);

            _smartIndentationService = _factory.Create<ISmartIndentationService>();
            _outlining = _factory.Create<IOutliningManager>();
            _outlining
                .Setup(x => x.ExpandAll(It.IsAny<SnapshotSpan>(), It.IsAny<Predicate<ICollapsed>>()))
                .Returns<IEnumerable<ICollapsible>>(null);

            _operationsRaw = new CommonOperations(
                vimBufferData,
                EditorOperationsFactoryService.GetEditorOperations(_textView),
                FSharpOption.Create(_outlining.Object),
                _smartIndentationService.Object);
            _operations = _operationsRaw;
        }
开发者ID:oraclechang,项目名称:VsVim,代码行数:67,代码来源:CommonOperationsTest.cs


示例19: Create

 private void Create(params string[] lines)
 {
     _textView = CreateTextView(lines);
     _textBuffer = _textView.TextBuffer;
     _globalSettings = new GlobalSettings();
     _globalSettings.IgnoreCase = true;
     _globalSettings.HighlightSearch = true;
     _searchService = Vim.SearchService;
     _vimData = Vim.VimData;
     _asyncTaggerSourceRaw = new HighlightSearchTaggerSource(
         _textView,
         _globalSettings,
         CreateTextStructureNavigator(_textBuffer, WordKind.NormalWord),
         _searchService,
         _vimData,
         Vim.VimHost);
     _asyncTaggerSource = _asyncTaggerSourceRaw;
 }
开发者ID:aming,项目名称:VsVim,代码行数:18,代码来源:HighlightSearchTaggerSourceTest.cs


示例20: Create

 public void Create(params string[] lines)
 {
     _textView = EditorUtil.CreateView(lines);
     _textView.Caret.MoveTo(new SnapshotPoint(_textView.TextSnapshot, 0));
     _textBuffer = _textView.TextBuffer;
     _factory = new MockRepository(MockBehavior.Strict);
     _map = VimUtil.CreateRegisterMap(MockObjectFactory.CreateClipboardDevice(_factory).Object);
     _editOpts = _factory.Create<IEditorOperations>();
     _host = _factory.Create<IVimHost>();
     _operations = _factory.Create<IOperations>();
     _operations.SetupGet(x => x.EditorOperations).Returns(_editOpts.Object);
     _statusUtil = _factory.Create<IStatusUtil>();
     _fileSystem = _factory.Create<IFileSystem>(MockBehavior.Strict);
     _vimData = new VimData();
     _bufferData = MockObjectFactory.CreateVimBuffer(
         _textView,
         "test",
         MockObjectFactory.CreateVim(_map, host: _host.Object, vimData: _vimData).Object);
     _processorRaw = new Vim.Modes.Command.CommandProcessor(_bufferData.Object, _operations.Object, _statusUtil.Object, _fileSystem.Object);
     _processor = _processorRaw;
 }
开发者ID:bentayloruk,项目名称:VsVim,代码行数:21,代码来源:CommandProcessorTest.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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