当前位置: 首页>>代码示例>>C#>>正文


C# FastColoredTextBox.EndAutoUndo方法代码示例

本文整理汇总了C#中FastColoredTextBox.EndAutoUndo方法的典型用法代码示例。如果您正苦于以下问题:C# FastColoredTextBox.EndAutoUndo方法的具体用法?C# FastColoredTextBox.EndAutoUndo怎么用?C# FastColoredTextBox.EndAutoUndo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在FastColoredTextBox的用法示例。


在下文中一共展示了FastColoredTextBox.EndAutoUndo方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: DropFromTheInside


//.........这里部分代码省略.........
                        {
                            textbox.Selection = textbox.draggedRange;
                            textbox.ClearSelected();
                        }
                    }
                }

                // Selection start and end position
                Place startPosition = place;
                Place endPosition = textbox.Selection.Start;

                // Correct selection
                Range dR = (textbox.draggedRange.End > textbox.draggedRange.Start)  // dragged selection
                    ? RangeUtil.GetRange(textbox, textbox.draggedRange.Start, textbox.draggedRange.End)
                    : RangeUtil.GetRange(textbox, textbox.draggedRange.End, textbox.draggedRange.Start);
                Place tP = place; // targetPlace
                int tS_S_Line;  // targetSelection.Start.iLine
                int tS_S_Char;  // targetSelection.Start.iChar
                int tS_E_Line;  // targetSelection.End.iLine
                int tS_E_Char;  // targetSelection.End.iChar
                if ((place > textbox.draggedRange.Start) && (copyMode == false))
                {
                    if (textbox.draggedRange.ColumnSelectionMode == false)
                    {
                        // Normal selection mode:

                        // Determine character/column position of target selection
                        if (dR.Start.iLine != dR.End.iLine) // If more then one line was selected/dragged ...
                        {
                            tS_S_Char = (dR.End.iLine != tP.iLine)
                                ? tP.iChar
                                : dR.Start.iChar + (tP.iChar - dR.End.iChar);
                            tS_E_Char = dR.End.iChar;
                        }
                        else // only one line was selected/dragged
                        {
                            if (dR.End.iLine == tP.iLine)
                            {
                                tS_S_Char = tP.iChar - dR.Text.Length;
                                tS_E_Char = tP.iChar;
                            }
                            else
                            {
                                tS_S_Char = tP.iChar;
                                tS_E_Char = tP.iChar + dR.Text.Length;
                            }
                        }

                        // Determine line/row of target selection
                        if (dR.End.iLine != tP.iLine)
                        {
                            tS_S_Line = tP.iLine - (dR.End.iLine - dR.Start.iLine);
                            tS_E_Line = tP.iLine;
                        }
                        else
                        {
                            tS_S_Line = dR.Start.iLine;
                            tS_E_Line = dR.End.iLine;
                        }

                        startPosition = new Place(tS_S_Char, tS_S_Line);
                        endPosition = new Place(tS_E_Char, tS_E_Line);
                    }
                }

                // Select inserted text
                if (!textbox.draggedRange.ColumnSelectionMode)
                {
                    textbox.Selection = new Range(textbox, startPosition, endPosition);
                }
                else
                {
                    if ((copyMode == false) &&
                        (place.iLine >= dR.Start.iLine) && (place.iLine <= dR.End.iLine) &&
                        (place.iChar >= dR.End.iChar))
                    {
                        tS_S_Char = tP.iChar - (dR.End.iChar - dR.Start.iChar);
                        tS_E_Char = tP.iChar;
                    }
                    else
                    {
                        tS_S_Char = tP.iChar;
                        tS_E_Char = tP.iChar + (dR.End.iChar - dR.Start.iChar);
                    }
                    tS_S_Line = tP.iLine;
                    tS_E_Line = tP.iLine + (dR.End.iLine - dR.Start.iLine);

                    startPosition = new Place(tS_S_Char, tS_S_Line);
                    endPosition = new Place(tS_E_Char, tS_E_Line);
                    textbox.Selection = new Range(textbox, startPosition, endPosition)
                        {
                            ColumnSelectionMode = true
                        };
                }

                textbox.Range.EndUpdate();
                textbox.EndAutoUndo();
            }
            textbox.Selection.Inverse();
        }
开发者ID:rickaas,项目名称:FastColoredTextBox,代码行数:101,代码来源:DoDragDropHelper.cs


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