本文整理汇总了C#中ICSharpCode.TextEditor.TextAreaControl类的典型用法代码示例。如果您正苦于以下问题:C# TextAreaControl类的具体用法?C# TextAreaControl怎么用?C# TextAreaControl使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TextAreaControl类属于ICSharpCode.TextEditor命名空间,在下文中一共展示了TextAreaControl类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: TextEditorControl
public TextEditorControl()
{
SetStyle(ControlStyles.ContainerControl, true);
textAreaPanel.Dock = DockStyle.Fill;
Document = (new DocumentFactory()).CreateDocument();
Document.HighlightingStrategy = HighlightingStrategyFactory.CreateHighlightingStrategy();
primaryTextArea = new TextAreaControl(this);
activeTextAreaControl = primaryTextArea;
primaryTextArea.TextArea.GotFocus += delegate
{
SetActiveTextAreaControl(primaryTextArea);
};
primaryTextArea.Dock = DockStyle.Fill;
textAreaPanel.Controls.Add(primaryTextArea);
InitializeTextAreaControl(primaryTextArea);
Controls.Add(textAreaPanel);
ResizeRedraw = true;
Document.UpdateCommited += new EventHandler(CommitUpdateRequested);
OptionsChanged();
}
开发者ID:KindDragon,项目名称:ICSharpCode.TextEditor.V4,代码行数:25,代码来源:TextEditorControl.cs
示例2: SetActiveTextAreaControl
protected void SetActiveTextAreaControl(TextAreaControl value)
{
if (activeTextAreaControl != value) {
activeTextAreaControl = value;
if (ActiveTextAreaControlChanged != null) {
ActiveTextAreaControlChanged(this, EventArgs.Empty);
}
}
}
开发者ID:JoeyEremondi,项目名称:tikzedt,代码行数:10,代码来源:TextEditorControl.cs
示例3: InitializeTextAreaControl
protected override void InitializeTextAreaControl(TextAreaControl newControl) {
base.InitializeTextAreaControl(newControl);
newControl.TextArea.KeyEventHandler += new KeyEventHandler(HandleKeyPress);
newControl.SelectionManager.SelectionChanged += new EventHandler(SelectionChanged);
newControl.Document.DocumentChanged += new DocumentEventHandler(DocumentChanged);
newControl.Caret.PositionChanged += new EventHandler(CaretPositionChanged);
newControl.TextArea.ClipboardHandler.CopyText += new CopyTextEventHandler(ClipboardHandlerCopyText);
newControl.MouseWheel += new MouseEventHandler(TextAreaMouseWheel);
newControl.DoHandleMousewheel = false;
}
开发者ID:BackupTheBerlios,项目名称:ch3etah-svn,代码行数:12,代码来源:XmlEditorControl.cs
示例4: InitializeTextAreaControl
protected override void InitializeTextAreaControl(TextAreaControl newControl)
{
base.InitializeTextAreaControl(newControl);
newControl.ShowContextMenu += delegate(object sender, MouseEventArgs e) {
MenuService.ShowContextMenu(this, contextMenuPath, (Control)sender, e.X, e.Y);
};
newControl.TextArea.KeyEventHandler += new ICSharpCode.TextEditor.KeyEventHandler(HandleKeyPress);
newControl.TextArea.ClipboardHandler.CopyText += new CopyTextEventHandler(ClipboardHandlerCopyText);
// newControl.TextArea.IconBarMargin.Painted += new MarginPaintEventHandler(PaintIconBarBreakPoints);
// newControl.TextArea.IconBarMargin.MouseDown += new MarginMouseEventHandler(IconBarMouseDown);
newControl.MouseWheel += new MouseEventHandler(TextAreaMouseWheel);
newControl.DoHandleMousewheel = false;
}
开发者ID:xuchuansheng,项目名称:GenXSource,代码行数:16,代码来源:SharpDevelopTextAreaControl.cs
示例5: Dispose
protected override void Dispose(bool disposing)
{
base.Dispose(disposing);
if (disposing) {
if (!disposed) {
disposed = true;
if (caret != null) {
caret.PositionChanged -= new EventHandler(SearchMatchingBracket);
caret.Dispose();
}
if (selectionManager != null) {
selectionManager.Dispose();
}
Document.TextContentChanged -= new EventHandler(TextContentChanged);
Document.FoldingManager.FoldingsChanged -= new EventHandler(DocumentFoldingsChanged);
motherTextAreaControl = null;
motherTextEditorControl = null;
foreach (AbstractMargin margin in leftMargins) {
if (margin is IDisposable)
(margin as IDisposable).Dispose();
}
textView.Dispose();
}
}
}
开发者ID:ChrisPea,项目名称:TuningSuites,代码行数:25,代码来源:TextArea.cs
示例6: ProvidedDocumentInformation
public ProvidedDocumentInformation(IDocument document, string fileName, TextAreaControl textAreaControl)
{
this.document = document;
this.textBuffer = document.TextBufferStrategy;
this.fileName = fileName;
this.textAreaControl = textAreaControl;
this.endOffset = this.CurrentOffset;
}
开发者ID:kingjiang,项目名称:SharpDevelopLite,代码行数:8,代码来源:ProvidedDocumentInformation.cs
示例7: InitializeTextAreaControl
protected override void InitializeTextAreaControl(TextAreaControl newControl)
{
newControl.TextArea.KeyEventHandler += new ICSharpCode.TextEditor.KeyEventHandler(HandleKeyPress);
base.InitializeTextAreaControl(newControl);
}
开发者ID:mausch,项目名称:NHWorkbench,代码行数:5,代码来源:HqlEditor.cs
示例8: TextArea
public TextArea(TextEditorControl motherTextEditorControl, TextAreaControl motherTextAreaControl)
{
this.motherTextAreaControl = motherTextAreaControl;
this.motherTextEditorControl = motherTextEditorControl;
caret = new Caret(this);
selectionManager = new SelectionManager(Document);
this.textAreaClipboardHandler = new TextAreaClipboardHandler(this);
ResizeRedraw = true;
SetStyle(ControlStyles.DoubleBuffer, false);
// SetStyle(ControlStyles.AllPaintingInWmPaint, true);
// SetStyle(ControlStyles.UserPaint, true);
SetStyle(ControlStyles.Opaque, false);
SetStyle(ControlStyles.ResizeRedraw, true);
SetStyle(ControlStyles.Selectable, true);
textView = new TextView(this);
gutterMargin = new GutterMargin(this);
foldMargin = new FoldMargin(this);
iconBarMargin = new IconBarMargin(this);
leftMargins.AddRange(new AbstractMargin[] { iconBarMargin, gutterMargin, foldMargin });
OptionsChanged();
new TextAreaMouseHandler(this).Attach();
new TextAreaDragDropHandler().Attach(this);
bracketshemes.Add(new BracketHighlightingSheme('{', '}'));
bracketshemes.Add(new BracketHighlightingSheme('(', ')'));
bracketshemes.Add(new BracketHighlightingSheme('[', ']'));
caret.PositionChanged += new EventHandler(SearchMatchingBracket);
Document.TextContentChanged += new EventHandler(TextContentChanged);
Document.FoldingManager.FoldingsChanged += new EventHandler(DocumentFoldingsChanged);
}
开发者ID:BackupTheBerlios,项目名称:ch3etah-svn,代码行数:39,代码来源:TextArea.cs
示例9: ReplaceElement
/// <summary>
/// Tries to replace the element defined by element name and its Id attribute in the
/// text editor with the specified xml.
/// </summary>
/// <param name="id">The Id attribute of the element.</param>
/// <param name="elementName">The name of the element.</param>
/// <param name="textAreaControl">The text area control to update.</param>
/// <param name="xml">The replacement xml.</param>
bool ReplaceElement(string id, string elementName, TextAreaControl textAreaControl, string xml)
{
WixDocumentEditor documentEditor = new WixDocumentEditor(textAreaControl);
IDocument document = textAreaControl.Document;
DomRegion region = WixDocument.GetElementRegion(new StringReader(document.TextContent), elementName, id);
if (!region.IsEmpty) {
documentEditor.Replace(region, xml);
return true;
}
return false;
}
开发者ID:kingjiang,项目名称:SharpDevelopLite,代码行数:19,代码来源:PackageFilesView.cs
示例10: UpdateOpenFileWithRootDirectoryRefChanges
bool UpdateOpenFileWithRootDirectoryRefChanges(WixDocument wixDocument, TextAreaControl textAreaControl)
{
// Get the xml for the root directory ref.
WixDirectoryRefElement rootDirectoryRef = wixDocument.RootDirectoryRef;
string xml = GetWixXml(rootDirectoryRef);
// Find the root directory ref location.
return ReplaceElement(rootDirectoryRef.Id, WixDirectoryRefElement.DirectoryRefElementName, textAreaControl, xml);
}
开发者ID:kingjiang,项目名称:SharpDevelopLite,代码行数:9,代码来源:PackageFilesView.cs
示例11: UpdateOpenFileWithRootDirectoryChanges
bool UpdateOpenFileWithRootDirectoryChanges(WixDocument wixDocument, TextAreaControl textAreaControl)
{
// Get the xml for the root directory.
WixDirectoryElement rootDirectory = wixDocument.RootDirectory;
string xml = GetWixXml(rootDirectory);
// Find the root directory location.
bool updated = ReplaceElement(rootDirectory.Id, WixDirectoryElement.DirectoryElementName, textAreaControl, xml);
if (updated) {
return true;
}
// Find the product end element location.
IDocument document = textAreaControl.Document;
Location location = WixDocument.GetEndElementLocation(new StringReader(document.TextContent), "Product", wixDocument.Product.GetAttribute("Id"));
if (!location.IsEmpty) {
// Insert the xml with an extra new line at the end.
ITextEditorProperties properties = SharpDevelopTextEditorProperties.Instance;
WixDocumentEditor documentEditor = new WixDocumentEditor(textAreaControl);
documentEditor.Insert(location.Y, location.X, String.Concat(xml, properties.LineTerminator));
return true;
}
return false;
}
开发者ID:kingjiang,项目名称:SharpDevelopLite,代码行数:24,代码来源:PackageFilesView.cs
示例12: InitializeTextAreaControl
protected override void InitializeTextAreaControl(TextAreaControl newControl)
{
newControl.TextArea.DoProcessDialogKey += HandleDialogKey;
}
开发者ID:kingjiang,项目名称:SharpDevelopLite,代码行数:4,代码来源:CommandPromptControl.cs
示例13: HookEvents
private void HookEvents(TextAreaControl control)
{
control.Caret.CaretModeChanged += (s, e) => UpdateCaretMode();
control.Caret.PositionChanged += (s, e) => UpdateCaretPosition();
control.TextArea.KeyDown += (s, e) => _connectionPoint.ForAll<INiKeyEventNotify>(p => p.OnKeyDown(e.KeyData));
control.TextArea.KeyUp += (s, e) => _connectionPoint.ForAll<INiKeyEventNotify>(p => p.OnKeyUp(e.KeyData));
control.TextArea.KeyPress += (s, e) => _connectionPoint.ForAll<INiKeyEventNotify>(p => p.OnKeyPress(e.KeyChar));
control.TextArea.MouseDown += (s, e) => _connectionPoint.ForAll<INiMouseEventNotify>(p => p.OnMouseDown(e.Button, e.X, e.Y));
control.TextArea.MouseUp += (s, e) => _connectionPoint.ForAll<INiMouseEventNotify>(p => p.OnMouseUp(e.Button, e.X, e.Y));
control.TextArea.MouseClick += (s, e) => _connectionPoint.ForAll<INiMouseEventNotify>(p => p.OnMouseClick(e.Button, e.X, e.Y));
control.TextArea.MouseDoubleClick += (s, e) => _connectionPoint.ForAll<INiMouseEventNotify>(p => p.OnMouseDoubleClick(e.Button, e.X, e.Y));
control.TextArea.MouseWheel += (s, e) => _connectionPoint.ForAll<INiMouseEventNotify>(p => p.OnMouseWheel(e.Delta));
}
开发者ID:netide,项目名称:netide,代码行数:13,代码来源:TextEditorWindow.cs
示例14: InitializeTextAreaControl
protected virtual void InitializeTextAreaControl(TextAreaControl newControl)
{
}
开发者ID:JoeyEremondi,项目名称:tikzedt,代码行数:3,代码来源:TextEditorControl.cs
示例15: Split
public void Split()
{
if (secondaryTextArea == null) {
secondaryTextArea = new TextAreaControl(this);
secondaryTextArea.Dock = DockStyle.Bottom;
secondaryTextArea.Height = Height / 2;
secondaryTextArea.TextArea.GotFocus += delegate {
SetActiveTextAreaControl(secondaryTextArea);
};
textAreaSplitter = new Splitter();
textAreaSplitter.BorderStyle = BorderStyle.FixedSingle ;
textAreaSplitter.Height = 8;
textAreaSplitter.Dock = DockStyle.Bottom;
textAreaPanel.Controls.Add(textAreaSplitter);
textAreaPanel.Controls.Add(secondaryTextArea);
InitializeTextAreaControl(secondaryTextArea);
secondaryTextArea.OptionsChanged();
} else {
SetActiveTextAreaControl(primaryTextArea);
textAreaPanel.Controls.Remove(secondaryTextArea);
textAreaPanel.Controls.Remove(textAreaSplitter);
secondaryTextArea.Dispose();
textAreaSplitter.Dispose();
secondaryTextArea = null;
textAreaSplitter = null;
}
}
开发者ID:JoeyEremondi,项目名称:tikzedt,代码行数:31,代码来源:TextEditorControl.cs
示例16: FindTargetImpl
public FindTargetImpl(TextAreaControl textAreaControl)
{
_textAreaControl = textAreaControl;
}
开发者ID:netide,项目名称:netide,代码行数:4,代码来源:TextEditorControl.FindTarget.cs
示例17: IndentLines
private void IndentLines()
{
ICSharpCode.TextEditor.TextAreaControl ta = new TextAreaControl (textEditorControl);
switch (m_Lenguaje)
{
case TipoLenguaje.Text:
{break;}
case TipoLenguaje.CSHARP: case TipoLenguaje.C64CHARP:
{
CSharpBinding.FormattingStrategy.CSharpFormattingStrategy Formating = new CSharpBinding.FormattingStrategy.CSharpFormattingStrategy ();
Formating.IndentLines(ta.TextArea,0,textEditorControl.Document.TotalNumberOfLines-1);
break;
}
case TipoLenguaje.VBNET: case TipoLenguaje.VBSCRIPT:
{
VBBinding.FormattingStrategy.VBFormattingStrategy Formating = new VBBinding.FormattingStrategy.VBFormattingStrategy ();
Formating.IndentLines(ta.TextArea,0,textEditorControl.Document.TotalNumberOfLines-1);
break;
}
case TipoLenguaje.CPP:
{
CPPBinding.FormattingStrategy.CSharpFormattingStrategy Formating = new CPPBinding.FormattingStrategy.CSharpFormattingStrategy ();
Formating.IndentLines(ta.TextArea,0,textEditorControl.Document.TotalNumberOfLines-1);
break;
}
case TipoLenguaje.JAVA: case TipoLenguaje.JAVASCRIPT:
{
JavaBinding.FormattingStrategy.JavaFormattingStrategy Formating = new JavaBinding.FormattingStrategy.JavaFormattingStrategy ();
Formating.IndentLines(ta.TextArea,0,textEditorControl.Document.TotalNumberOfLines-1);
break;
}
}
}
开发者ID:spzenk,项目名称:sfdocsamples,代码行数:36,代码来源:TextCodeEditor.cs
示例18: WixDocumentEditor
public WixDocumentEditor(TextAreaControl textAreaControl)
{
this.textAreaControl = textAreaControl;
}
开发者ID:kingjiang,项目名称:SharpDevelopLite,代码行数:4,代码来源:WixDocumentEditor.cs
示例19: InitializeTextAreaControl
protected override void InitializeTextAreaControl(TextAreaControl newControl)
{
base.InitializeTextAreaControl(newControl);
primaryTextAreaControl = newControl;
newControl.TextArea.KeyEventHandler += new ICSharpCode.TextEditor.KeyEventHandler(HandleKeyPress);
newControl.ContextMenuStrip = contextMenuStrip;
newControl.SelectionManager.SelectionChanged += new EventHandler(SelectionChanged);
newControl.Document.DocumentChanged += new DocumentEventHandler(DocumentChanged);
newControl.TextArea.ClipboardHandler.CopyText += new CopyTextEventHandler(ClipboardHandlerCopyText);
newControl.MouseWheel += new MouseEventHandler(TextAreaMouseWheel);
newControl.DoHandleMousewheel = false;
}
开发者ID:BackupTheBerlios,项目名称:nantgui,代码行数:16,代码来源:XmlEditorControl.cs
示例20: Dispose
protected override void Dispose(bool disposing)
{
if (disposing) {
if (printDocument != null) {
printDocument.BeginPrint -= new PrintEventHandler(this.BeginPrint);
printDocument.PrintPage -= new PrintPageEventHandler(this.PrintPage);
printDocument = null;
}
Document.UndoStack.ClearAll();
//Document.UpdateCommited -= new EventHandler(CommitUpdateRequested);
if (textAreaPanel != null) {
if (secondaryTextArea != null) {
secondaryTextArea.Dispose();
textAreaSplitter.Dispose();
secondaryTextArea = null;
textAreaSplitter = null;
}
if (primaryTextArea != null) {
primaryTextArea.Dispose();
}
textAreaPanel.Dispose();
textAreaPanel = null;
}
}
base.Dispose(disposing);
}
开发者ID:JoeyEremondi,项目名称:tikzedt,代码行数:26,代码来源:TextEditorControl.cs
注:本文中的ICSharpCode.TextEditor.TextAreaControl类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论