private void radMenuItem13_Click(object sender, EventArgs e) { var np = new NewItemDialog(); if (np.ShowDialog() == System.Windows.Forms.DialogResult.OK) { var f = new File(); f.Name = np.Filename; f.Src = np.Filename; f.ID = np.Type; Workspace.SelectedProject.Files.Add(f); radTreeView1.Nodes.Clear(); radTreeView1.Nodes.Add(SolutionExplorer.Build(Workspace.Solution)); Workspace.Solution.Save(Workspace.SolutionPath); var p = np.Template; var editor = EditorBuilder.Build(p.Extension, null, null, null); var doc = new DocumentWindow(f.Name); doc.Controls.Add(editor); radDock1.AddDocument(doc); } }
private void radMenuItem13_Click(object sender, EventArgs e) { var np = new NewItemDialog(); if (np.ShowDialog() == System.Windows.Forms.DialogResult.OK) { var f = new Core.ProjectSystem.File(); f.Name = np.Filename; f.Src = np.Filename; f.ID = np.Type; Workspace.SelectedProject.Files.Add(f); explorerTreeView.Nodes.Clear(); explorerTreeView.Nodes.Add(SolutionExplorer.Build(Workspace.Solution, radContextMenu1)); Workspace.Solution.Save(Workspace.SolutionPath); var fi = new FileInfo(Workspace.SolutionPath).Directory.FullName + "\\" + f.Name; System.IO.File.WriteAllBytes(fi, np.Template.Raw); np.Plugin.Events.Fire("OnCreateItem", f, np.Template.Raw); var doc = new DocumentWindow(f.Name); doc.Controls.Add(ViewSelector.Select(np.Template, System.IO.File.ReadAllBytes(fi)).GetView()); dock.AddDocument(doc); } }