//配置相关显示参数 private void SetScintillaToCurrentOptions(DocumentForm doc) { //// Turn on line numbers? //if (lineNumbersToolStripMenuItem.Checked) doc.Scintilla.Margins.Margin0.Width = LINE_NUMBERS_MARGIN_WIDTH; //else // doc.Scintilla.Margins.Margin0.Width = 0; //// Turn on white space? //if (whitespaceToolStripMenuItem.Checked) // doc.Scintilla.Whitespace.Mode = WhitespaceMode.VisibleAlways; //else // doc.Scintilla.Whitespace.Mode = WhitespaceMode.Invisible; //// Turn on word wrap? //if (wordWrapToolStripMenuItem.Checked) // doc.Scintilla.LineWrapping.Mode = LineWrappingMode.Word; //else // doc.Scintilla.LineWrapping.Mode = LineWrappingMode.None; //// Show EOL? //doc.Scintilla.EndOfLine.IsVisible = endOfLineToolStripMenuItem.Checked; // Set the zoom doc.Scintilla.ZoomFactor = _zoomLevel; }
private DocumentForm OpenFile(string nodeId) { //获取文章信息 string SQL = "select Title,Content from TContent inner join TTree on TContent.NodeId=Ttree.NodeId where TContent.NodeId=" + nodeId; DataTable temp = AccessAdo.ExecuteDataSet(SQL, null).Tables[0]; if (temp.Rows.Count == 0) { return(null); } string Title = temp.Rows[0]["Title"].ToString(); string Content = temp.Rows[0]["Content"].ToString(); DocumentForm doc = new DocumentForm(); SetScintillaToCurrentOptions(doc); doc.Scintilla.Text = Content; doc.Scintilla.UndoRedo.EmptyUndoBuffer(); doc.Scintilla.Modified = false; doc.Text = Title; doc.NodeId = nodeId; doc.Show(dockPanel1); return(doc); }
private DocumentForm OpenFile(string nodeId) { //获取文章信息 string SQL = "select Title,Content from TContent inner join TTree on TContent.NodeId=Ttree.NodeId where TContent.NodeId=" + nodeId; DataTable temp = AccessAdo.ExecuteDataSet(SQL, null).Tables[0]; if (temp.Rows.Count == 0) return null; string Title = temp.Rows[0]["Title"].ToString(); string Content = temp.Rows[0]["Content"].ToString(); DocumentForm doc = new DocumentForm(); SetScintillaToCurrentOptions(doc); doc.Scintilla.Text = Content; doc.Scintilla.UndoRedo.EmptyUndoBuffer(); doc.Scintilla.Modified = false; doc.Text = Title; doc.NodeId = nodeId; doc.Show(dockPanel1); return doc; }