Esempio n. 1
0
        public void OpenShader(String filePath)
        {
            DocumentForm doc = new DocumentForm();
            doc.Scintilla.Margins.Margin0.Width = 35;
            doc.Scintilla.Whitespace.Mode = WhitespaceMode.Invisible;
            doc.Scintilla.Text = File.ReadAllText(filePath);
            doc.Scintilla.UndoRedo.EmptyUndoBuffer();
            doc.Scintilla.Modified = false;
            doc.Text = Path.GetFileName(filePath);
            doc.FilePath = filePath;
            doc.Show(dockPanel1);

            // Use a built-in lexer and configuration
            doc.IniLexer = false;
            doc.Scintilla.ConfigurationManager.Language = "cs";
            doc.Scintilla.Indentation.SmartIndentType = SmartIndent.CPP;
        }
Esempio n. 2
0
        private void toolStripButton1_Click(object sender, EventArgs e)
        {
            DocumentForm doc = new DocumentForm();

            doc.Text = String.Format(CultureInfo.CurrentCulture, "{0}{1}", "Untitled", ++_newDocumentCount);
            doc.Show(dockPanel1);
            //toolIncremental.Searcher.Scintilla = doc.Scintilla;
        }