當前位置: 首頁>>代碼示例>>C#>>正文


C# BlockSpan類代碼示例

本文整理匯總了C#中BlockSpan的典型用法代碼示例。如果您正苦於以下問題:C# BlockSpan類的具體用法?C# BlockSpan怎麽用?C# BlockSpan使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


BlockSpan類屬於命名空間,在下文中一共展示了BlockSpan類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: CreateForSelectionPoints_Block_ForwardsMultipleLines

 public void CreateForSelectionPoints_Block_ForwardsMultipleLines()
 {
     Create("big cat", "big dog");
     var visualSpan = VisualSpan.CreateForSelectionPoints(VisualKind.Block, _textBuffer.GetPoint(1), _textBuffer.GetPointInLine(1, 3));
     var blockSpan = new BlockSpan(_textBuffer.GetPoint(1), 2, 2);
     Assert.Equal(blockSpan, visualSpan.AsBlock().Item);
 }
開發者ID:fpicalausa,項目名稱:VsVim,代碼行數:7,代碼來源:VisualSpanTest.cs

示例2: CreateForSelection_Block_Empty

 public void CreateForSelection_Block_Empty()
 {
     Create("hello world");
     var visualSpan = VisualSpan.CreateForSelection(_textView, VisualKind.Block);
     var blockSpan = new BlockSpan(_textBuffer.GetPoint(0), 0, 1);
     Assert.AreEqual(blockSpan, visualSpan.AsBlock().Item);
 }
開發者ID:rschatz,項目名稱:VsVim,代碼行數:7,代碼來源:VisualSpanTest.cs

示例3: CreateForSelectionPoints_Block_Backwards

 public void CreateForSelectionPoints_Block_Backwards()
 {
     Create("big cat", "big dog");
     var visualSpan = VisualSpan.CreateForSelectionPoints(VisualKind.Block, _textBuffer.GetPoint(2), _textBuffer.GetPoint(0));
     var blockSpan = new BlockSpan(_textBuffer.GetPoint(0), 2, 1);
     Assert.Equal(blockSpan, visualSpan.AsBlock().Item);
 }
開發者ID:niklasi,項目名稱:VsVim,代碼行數:7,代碼來源:VisualSpanTest.cs

示例4: CreateForSelectionPoints_Block_Empty

 public void CreateForSelectionPoints_Block_Empty()
 {
     Create("dog cat");
     var point = _textBuffer.GetPoint(2);
     var visualSpan = VisualSpan.CreateForSelectionPoints(VisualKind.Block, point, point);
     var blockSpan = new BlockSpan(point, 0, 1);
     Assert.Equal(blockSpan, visualSpan.AsBlock().Item);
 }
開發者ID:fpicalausa,項目名稱:VsVim,代碼行數:8,代碼來源:VisualSpanTest.cs

示例5: EnterBlock

 protected void EnterBlock(BlockSpan blockSpan)
 {
     var visualSpan = VisualSpan.NewBlock(blockSpan);
     var visualSelection = VisualSelection.CreateForward(visualSpan);
     visualSelection.SelectAndMoveCaret(_textView);
     Assert.False(_context.IsEmpty);
     _context.RunAll();
     Assert.True(_context.IsEmpty);
     _vimBuffer.SwitchMode(ModeKind.VisualBlock, ModeArgument.None);
 }
開發者ID:ramboma,項目名稱:VsVim,代碼行數:10,代碼來源:VisualModeIntegrationTest.cs

示例6: SimpleCaretPastTab

                public void SimpleCaretPastTab()
                {
                    Create("trucker", "\tcat");
                    var blockSpan = new BlockSpan(_textBuffer.GetPoint(1), tabStop: 2, spaces: 2, height: 2);
                    var visualSpan = VisualSpan.NewBlock(blockSpan);
                    visualSpan.Select(_textView, Path.Forward);

                    // It may seem odd for the second span to start on column 1 since the tab is partially
                    // included in the line.  However Visual Studio has this behavior.  It won't select a 
                    // character at the start / end of a selection unless it's completely included 
                    Assert.Equal(
                        new[]
                        {
                            _textBuffer.GetLineSpan(0, 1, 2),
                            _textBuffer.GetLineSpan(1, 1, 1)
                        },
                        _textView.Selection.SelectedSpans);
                }
開發者ID:Kazark,項目名稱:VsVim,代碼行數:18,代碼來源:VisualSpanTest.cs

示例7: InitialNonStartPoint

 public void InitialNonStartPoint()
 {
     Create("big cats", "big dogs", "big trees");
     var point = _textBuffer.GetPointInLine(1, 3);
     _textView.MoveCaretTo(point);
     _vimBuffer.ProcessNotation("<C-Q>");
     Assert.Equal(ModeKind.VisualBlock, _vimBuffer.ModeKind);
     var blockSpan = new BlockSpan(point, tabStop: _tabStop, spaces: 1, height: 1);
     Assert.Equal(blockSpan, _vimBuffer.GetSelectionBlockSpan());
 }
開發者ID:ramboma,項目名稱:VsVim,代碼行數:10,代碼來源:VisualModeIntegrationTest.cs

示例8: InitialState

 public void InitialState()
 {
     Create("hello world");
     _vimBuffer.ProcessNotation("<C-Q>");
     Assert.Equal(ModeKind.VisualBlock, _vimBuffer.ModeKind);
     var blockSpan = new BlockSpan(_textBuffer.GetPoint(0), tabStop: _tabStop, spaces: 1, height: 1);
     Assert.Equal(blockSpan, _vimBuffer.GetSelectionBlockSpan());
 }
開發者ID:ramboma,項目名稱:VsVim,代碼行數:8,代碼來源:VisualModeIntegrationTest.cs

示例9: EnterBlock

 private void EnterBlock(BlockSpan blockSpan)
 {
     var visualSpan = VisualSpan.NewBlock(blockSpan);
     var visualSelection = VisualSelection.CreateForVisualSpan(visualSpan);
     CommonUtil.SelectAndUpdateCaret(_textView, visualSelection);
     Assert.IsFalse(_context.IsEmpty);
     _context.RunAll();
     Assert.IsTrue(_context.IsEmpty);
     _buffer.SwitchMode(ModeKind.VisualBlock, ModeArgument.None);
 }
開發者ID:sehe,項目名稱:VsVim,代碼行數:10,代碼來源:VisualModeIntegrationTest.cs

示例10: Backwards

 public void Backwards()
 {
     Create("big cats", "big dogs");
     _textView.MoveCaretTo(2);
     _vimBuffer.ProcessNotation("<C-Q>jh");
     Assert.Equal(ModeKind.VisualBlock, _vimBuffer.ModeKind);
     var blockSpan = new BlockSpan(_textView.GetPoint(1), tabStop: _tabStop, spaces: 2, height: 2);
     Assert.Equal(blockSpan, _vimBuffer.GetSelectionBlockSpan());
 }
開發者ID:ramboma,項目名稱:VsVim,代碼行數:9,代碼來源:VisualModeIntegrationTest.cs

示例11: Switch_CharacterToBlock

        public void Switch_CharacterToBlock()
        {
            Create("big dog", "big cat", "big tree", "big fish");
            _textView.MoveCaretTo(1);
            _vimBuffer.Process("vjl");
            Assert.AreEqual(ModeKind.VisualCharacter, _vimBuffer.ModeKind);
            _vimBuffer.Process(KeyInputUtil.CharWithControlToKeyInput('q'));
            Assert.AreEqual(ModeKind.VisualBlock, _vimBuffer.ModeKind);

            var tuple = _vimBuffer.VisualBlockMode.VisualSelection.AsBlock();
            var blockSpan = new BlockSpan(
                _textBuffer.GetPoint(1),
                2,
                2);
            Assert.AreEqual(blockSpan, tuple.Item1);
            Assert.AreEqual(BlockCaretLocation.BottomRight, tuple.Item2);
        }
開發者ID:purplecow,項目名稱:VsVim,代碼行數:17,代碼來源:VisualModeIntegrationTest.cs

示例12: Select_Block_InitialState

 public void Select_Block_InitialState()
 {
     Create("hello world");
     _vimBuffer.ProcessNotation("<C-Q>");
     Assert.AreEqual(ModeKind.VisualBlock, _vimBuffer.ModeKind);
     var blockSpan = new BlockSpan(_textBuffer.GetPoint(0), 1, 1);
     Assert.AreEqual(blockSpan, _textView.GetSelectionBlockSpan());
 }
開發者ID:purplecow,項目名稱:VsVim,代碼行數:8,代碼來源:VisualModeIntegrationTest.cs

示例13: EndPoint_MultiLine

 public void EndPoint_MultiLine()
 {
     Create("cat", "dog", "fish");
     var blockSpan = new BlockSpan(_textBuffer.GetPoint(0), 2, 2);
     Assert.AreEqual(_textBuffer.GetLine(1).Start.Add(2), blockSpan.End);
 }
開發者ID:rschatz,項目名稱:VsVim,代碼行數:6,代碼來源:BlockSpanTest.cs

示例14: Select_Block_Backwards

 public void Select_Block_Backwards()
 {
     Create("big cats", "big dogs");
     _textView.MoveCaretTo(2);
     _vimBuffer.ProcessNotation("<C-Q>jh");
     Assert.AreEqual(ModeKind.VisualBlock, _vimBuffer.ModeKind);
     var blockSpan = new BlockSpan(_textView.GetPoint(1), 2, 2);
     Assert.AreEqual(blockSpan, _textView.GetSelectionBlockSpan());
 }
開發者ID:bajtos,項目名稱:VsVim,代碼行數:9,代碼來源:VisualModeIntegrationTest.cs

示例15: BackwardsCaretOnColumnZero

 public void BackwardsCaretOnColumnZero()
 {
     Create("cat", "dog");
     var visualSelection = VisualSelection.CreateForPoints(
         VisualKind.Block,
         _textBuffer.GetPointInLine(0, 1),
         _textBuffer.GetPointInLine(1, 0),
         tabStop: 4);
     var blockSpan = new BlockSpan(_textBuffer.GetPoint(0), tabStop: 4, spaces: 2, height: 2);
     Assert.Equal(blockSpan, visualSelection.AsBlock().Item1);
 }
開發者ID:aesire,項目名稱:VsVim,代碼行數:11,代碼來源:VisualSelectionTest.cs


注:本文中的BlockSpan類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。