示例#1
0
 public void InsertFile(IMainForm mainForm, Project project, string path, GenericNode node)
 {
     if (!mainForm.CurrentDocument.IsEditable) return;
     string nodeType = (node != null) ? node.GetType().ToString() : null;
     string export = (node != null && node is ExportNode) ? (node as ExportNode).Export : null;
     string textToInsert = project.GetInsertFileText(mainForm.CurrentDocument.FileName, path, export, nodeType);
     if (textToInsert == null) return;
     if (mainForm.CurrentDocument.IsEditable)
     {
         mainForm.CurrentDocument.SciControl.AddText(textToInsert.Length, textToInsert);
         mainForm.CurrentDocument.Activate();
     }
     else
     {
         string msg = TextHelper.GetString("Info.EmbedNeedsOpenDocument");
         ErrorManager.ShowInfo(msg);
     }
 }