本文整理汇总了C#中ScintillaNet.Scintilla类的典型用法代码示例。如果您正苦于以下问题:C# Scintilla类的具体用法?C# Scintilla怎么用?C# Scintilla使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Scintilla类属于ScintillaNet命名空间,在下文中一共展示了Scintilla类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Folding
internal Folding(Scintilla scintilla)
: base(scintilla)
{
IsEnabled = true;
UseCompactFolding = false;
MarkerScheme = FoldMarkerScheme.BoxPlusMinus;
}
示例2: InstantiateScintilla
private Scintilla InstantiateScintilla()
{
// TODO: Read preferences from disk, via Controller and Preferences instances.
Scintilla scintilla = new Scintilla();
scintilla.AcceptsReturn = true;
scintilla.AcceptsTab = true;
scintilla.AllowDrop = true;
scintilla.Dock = DockStyle.Fill;
scintilla.ConfigurationManager.CustomLocation = "ScintillaNET.xml";
scintilla.ConfigurationManager.Language = "xml";
scintilla.Enabled = true;
// TODO: Investigate indentation, do it.
//scintilla.Indentation = SmartIndent.Simple;
// TODO: Investigate what is required to claim accessibility, then do it.
scintilla.IsAccessible = false;
scintilla.IsReadOnly = false;
scintilla.Location = new Point(0);
scintilla.MatchBraces = true;
scintilla.Margin = scintilla.Padding = new Padding(0);
// TODO: Calculate the width of the line number margin dynamically.
scintilla.Margins[0].Width = 40;
scintilla.OverType = false;
scintilla.Styles.LineNumber.BackColor = Color.Blue;
scintilla.Styles.LineNumber.ForeColor = Color.Cyan;
scintilla.TabIndex = 0;
scintilla.TabStop = false;
scintilla.Visible = true;
return scintilla;
}
示例3: KeywordCollection
internal KeywordCollection(Scintilla scintilla)
: base(scintilla)
{
// Auugh, this plagued me for a while. Each of the lexers cna define their own "Name"
// and also asign themsleves to a Scintilla Lexer Constant. Most of the time these
// match the defined constant, but sometimes they don't. We'll always use the constant
// name since it's easier to use, consistent and will always have valid characters.
// However its still valid to access the lexers by this name (as SetLexerLanguage
// uses this value) so we'll create a lookup.
_lexerAliasMap = new Dictionary<string, Lexer>(StringComparer.OrdinalIgnoreCase);
// I have no idea how Progress fits into this. It's defined with the PS lexer const
// and a name of "progress"
_lexerAliasMap.Add("PL/M", Lexer.Plm);
_lexerAliasMap.Add("props", Lexer.Properties);
_lexerAliasMap.Add("inno", Lexer.InnoSetup);
_lexerAliasMap.Add("clarion", Lexer.Clw);
_lexerAliasMap.Add("clarionnocase", Lexer.ClwNoCase );
//_lexerKeywordListMap = new Dictionary<string,string[]>(StringComparer.OrdinalIgnoreCase);
//_lexerKeywordListMap.Add("xml", new string[] { "HTML elements and attributes", "JavaScript keywords", "VBScript keywords", "Python keywords", "PHP keywords", "SGML and DTD keywords" });
//_lexerKeywordListMap.Add("yaml", new string[] { "Keywords" });
// baan, kix, ave, scriptol, diff, props, makefile, errorlist, latex, null, lot, haskell
// lexers don't have keyword list names
}
示例4: BaseScincillaWraper
public BaseScincillaWraper()
{
InitializeComponent();
var ui = TaskScheduler.FromCurrentSynchronizationContext();
if (Process.GetCurrentProcess().ProcessName != "devenv")
{
_sca = new Scintilla();
Initialize(_sca);
_sca.CharAdded += new EventHandler<CharAddedEventArgs>(CharAdded);
splitContainer1.Panel1.Controls.Add(_sca);
var deafultColor = _sca.BackColor;
_sca.BackColor = Color.Gray;
_sca.Enabled = false;
Task.Factory
.StartNew(EvaluationHelper.InitEvaluator)
.ContinueWith(_ =>
{
_sca.Enabled = true;
_sca.BackColor = deafultColor;
}, ui);
}
else
{
BackColor = Color.White;
}
}
示例5: IndicatorCollection
internal IndicatorCollection(Scintilla scintilla) : base(scintilla){}
示例6: closeAllToolStripMenuItem_Click
private void closeAllToolStripMenuItem_Click(object sender, EventArgs e)
{
tabControl1.TabPages.Clear();
string title = "New" + (tabControl1.TabCount + 1).ToString();
TabPage myTabPage = new TabPage(title);
ScintillaNet.Scintilla newtext = new ScintillaNet.Scintilla();
myTabPage.Controls.Add(newtext);
newtext.AllowDrop = true;
newtext.AutoComplete.DropRestOfWord = true;
newtext.AutoComplete.ListString = "";
newtext.Dock = System.Windows.Forms.DockStyle.Fill;
newtext.Folding.UseCompactFolding = true;
newtext.Location = new System.Drawing.Point(3, 3);
newtext.Margins.Margin0.Width = 20;
newtext.Margins.Margin1.IsClickable = true;
newtext.Margins.Margin1.IsFoldMargin = true;
newtext.Margins.Margin1.Width = 3;
newtext.Margins.Margin2.IsMarkerMargin = true;
newtext.Margins.Margin2.Width = 16;
newtext.Name = title;
newtext.Size = new System.Drawing.Size(783, 353);
newtext.Styles.BraceBad.FontName = "Verdana";
newtext.Styles.BraceLight.FontName = "Verdana";
newtext.Styles.ControlChar.FontName = "Verdana";
newtext.Styles.Default.FontName = "Verdana";
newtext.Styles.IndentGuide.FontName = "Verdana";
newtext.Styles.LastPredefined.FontName = "Verdana";
newtext.Styles.LineNumber.FontName = "Verdana";
newtext.Styles.Max.FontName = "Verdana";
newtext.TabIndex = 0;
tabControl1.TabPages.Add(myTabPage);
tabControl1.SelectedTab = myTabPage;
}
示例7: LexerInitializer
private LexerInitializer(Scintilla scintilla, int startPos, int length)
{
this.scintilla = scintilla;
this.startPos = startPos;
// One line of text
this.text = scintilla.GetRange(startPos, startPos + length).Text;
}
示例8: SnippetManager
public SnippetManager(Scintilla scintilla)
: base(scintilla)
{
_list = new SnippetList(this);
_snippetLinkTimer.Interval = 1;
_snippetLinkTimer.Tick += new EventHandler(_snippetLinkTimer_Tick);
IsEnabled = _isEnabled;
}
示例9: Range
public Range(int start, int end, Scintilla scintilla) : base(scintilla)
{
if(start < end)
{
_start = start;
_end = end;
}
else
{
_start = end;
_end = start;
}
}
示例10: StyleCollection
internal StyleCollection(Scintilla scintilla) : base(scintilla)
{
Bits = 7;
// Defaulting CallTip Settings to Platform defaults
Style s = CallTip;
s.ForeColor = SystemColors.InfoText;
s.BackColor = SystemColors.Info;
s.Font = SystemFonts.StatusFont;
// Making Line Number's BackColor have a named system color
// instead of just the value
LineNumber.BackColor = SystemColors.Control;
}
示例11: WindowLoaded
private void WindowLoaded(object sender, System.Windows.RoutedEventArgs e)
{
// Create the interop host control.
var host = new WindowsFormsHost();
this.codeEditorControl = new Scintilla { MatchBraces = true };
this.codeEditorControl.DocumentChange += this.CodeEditorControlTextChanged;
// Assign the MaskedTextBox control as the host control's child.
host.Child = this.codeEditorControl;
// Add the interop host control to the Grid
// control's collection of child controls.
this.CodeEditorGrid.Children.Add(host);
}
示例12: Lexing
internal Lexing(Scintilla scintilla)
: base(scintilla)
{
WhitespaceChars = DEFAULT_WHITECHARS;
WordChars = DEFAULT_WORDCHARS;
_keywords = new KeywordCollection(scintilla);
// Language names are a superset lexer names. For instance the c and cs (c#)
// langauges both use the cpp lexer (by default). Languages are kind of a
// SCite concept, while Scintilla only cares about Lexers. However we don't
// need to explicetly map a language to a lexer if they are the same name
// like cpp.
_lexerLanguageMap.Add("cs", "cpp");
_lexerLanguageMap.Add("html", "hypertext");
_lexerLanguageMap.Add("xml", "hypertext");
}
示例13: FindReplace
internal FindReplace(Scintilla scintilla) : base(scintilla)
{
_marker = scintilla.Markers[10];
_marker.SetSymbolInternal(MarkerSymbol.Arrows);
_indicator = scintilla.Indicators[16];
_indicator.Color = Color.Purple;
_indicator.Style = IndicatorStyle.RoundBox;
_window = new FindReplaceDialog();
_window.Scintilla = scintilla;
_incrementalSearcher = new IncrementalSearcher();
_incrementalSearcher.Scintilla = scintilla;
_incrementalSearcher.Visible = false;
scintilla.Controls.Add(_incrementalSearcher);
}
示例14: Init
public static void Init(Scintilla scintilla)
{
// Reset any current language and enable the StyleNeeded
// event by setting the lexer to container.
scintilla.Indentation.SmartIndentType = SmartIndent.None;
scintilla.ConfigurationManager.Language = String.Empty;
scintilla.Lexing.LexerName = "container";
scintilla.Lexing.Lexer = Lexer.Container;
// Add our custom styles to the collection
scintilla.Styles[QUOTED_STYLE].ForeColor = Color.FromArgb(153, 51, 51);
scintilla.Styles[KEY_STYLE].ForeColor = Color.FromArgb(0, 0, 153);
scintilla.Styles[ASSIGNMENT_STYLE].ForeColor = Color.OrangeRed;
scintilla.Styles[VALUE_STYLE].ForeColor = Color.FromArgb(102, 0, 102);
scintilla.Styles[COMMENT_STYLE].ForeColor = Color.FromArgb(102, 102, 102);
scintilla.Styles[SECTION_STYLE].ForeColor = Color.FromArgb(0, 0, 102);
scintilla.Styles[SECTION_STYLE].Bold = true;
}
示例15: ApplyUserStyle
//apply custom style
public static void ApplyUserStyle(Scintilla scintilla,CodeEditorConfig codeeditorcong )
{
Font userFont = new Font(codeeditorcong.Font, codeeditorcong.FontSize, codeeditorcong.FontStyle, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
//config-style line marging
scintilla.Styles[STYLE_LINENUMBER].BackColor = Color.White;
scintilla.Styles[STYLE_LINENUMBER].ForeColor = Color.DarkTurquoise;
scintilla.Styles[STYLE_LINENUMBER].Bold = true;
//apply user configuration
scintilla.UseFont = true;
scintilla.Font = userFont;
scintilla.Styles[STYLE_LINENUMBER].Size =(float)codeeditorcong.FontSize;
int Ratio = (int)codeeditorcong.FontSize;
scintilla.Margins[LINENUMBER_MARGIN].Width = Ratio * scintilla.Lines.Count.ToString().Length + 4;
scintilla.Folding.MarkerScheme = codeeditorcong.FoldingMarker;
scintilla.Caret.HighlightCurrentLine = codeeditorcong.IsLineHilighting;
}