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

C# BlockSpan类代码示例

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

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



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


示例16: ForwardSimple

 public void ForwardSimple()
 {
     Create("cats", "dogs");
     var visualSelection = VisualSelection.CreateForPoints(
         VisualKind.Block,
         _textBuffer.GetPointInLine(0, 1),
         _textBuffer.GetPointInLine(1, 3),
         tabStop: 4);
     var blockSpan = new BlockSpan(_textBuffer.GetPointInLine(0, 1), tabStop: 4, spaces: 3, height: 2);
     Assert.Equal(blockSpan, visualSelection.AsBlock().Item1);
 }
开发者ID:aesire,项目名称:VsVim,代码行数:11,代码来源:VisualSelectionTest.cs


示例17: BackwardsMultipleLines

 public void BackwardsMultipleLines()
 {
     Create("big cat", "big dog");
     var visualSpan = VisualSpan.CreateForSelectionPoints(VisualKind.Block, _textBuffer.GetPoint(2), _textBuffer.GetPointInLine(1, 1), _vimBuffer.LocalSettings.TabStop);
     var blockSpan = new BlockSpan(_textBuffer.GetPoint(1), _vimBuffer.LocalSettings.TabStop, 1, 2);
     Assert.Equal(blockSpan, visualSpan.AsBlock().Item);
 }
开发者ID:Kazark,项目名称:VsVim,代码行数:7,代码来源:VisualSpanTest.cs


示例18: Empty

 public void Empty()
 {
     Create("dog cat");
     var point = _textBuffer.GetPoint(2);
     var visualSpan = VisualSpan.CreateForSelectionPoints(VisualKind.Block, point, point, _vimBuffer.LocalSettings.TabStop);
     var blockSpan = new BlockSpan(point, _vimBuffer.LocalSettings.TabStop, spaces: 1, height: 1);
     Assert.Equal(blockSpan, visualSpan.AsBlock().Item);
 }
开发者ID:Kazark,项目名称:VsVim,代码行数:8,代码来源:VisualSpanTest.cs


示例19: EndPartiallyThroughTab

 public void EndPartiallyThroughTab()
 {
     Create("cat", "\tdog");
     var blockSpan = new BlockSpan(_textBuffer.GetPoint(0), tabStop: 4, spaces: 1, height: 2);
     Assert.Equal(_textBuffer.GetPointInLine(1, 1), blockSpan.End);
 }
开发者ID:Kazark,项目名称:VsVim,代码行数:6,代码来源:BlockSpanTest.cs


示例20: TabStart

 public void TabStart()
 {
     Create("\tcat dog");
     var blockSpan = new BlockSpan(_textBuffer.GetPoint(1), tabStop: 4, spaces: 1, height: 1);
     Assert.Equal(4, blockSpan.ColumnSpaces);
 }
开发者ID:Kazark,项目名称:VsVim,代码行数:6,代码来源:BlockSpanTest.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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