Example #1
0
 private void OnCommandAddItem(Microsoft.Matrix.Core.Projects.ProjectItem item)
 {
     if ((item == this._rootItem) || (item is DirectoryProjectItem))
     {
         AddFileDialog form = new AddFileDialog(this, item.Path, true);
         IUIService service = (IUIService) base.GetService(typeof(IUIService));
         if (service.ShowDialog(form) == DialogResult.OK)
         {
             DocumentProjectItem newProjectItem = form.NewProjectItem;
             this.OpenProjectItem(newProjectItem, false, DocumentViewType.Default);
         }
     }
 }
Example #2
0
 DocumentProjectItem IDocumentManager.CreateDocument(Project project, FolderProjectItem parentItem, bool fixedParentItem)
 {
     if (project == null)
     {
         throw new ArgumentNullException("project");
     }
     if (fixedParentItem && (parentItem == null))
     {
         throw new ArgumentNullException("parentItem");
     }
     IMxUIService service = (IMxUIService) this._serviceProvider.GetService(typeof(IMxUIService));
     string location = null;
     if (parentItem != null)
     {
         location = parentItem.Path;
     }
     AddFileDialog dialog = new AddFileDialog(project, location, fixedParentItem);
     if (service.ShowDialog(dialog) == DialogResult.OK)
     {
         return dialog.NewProjectItem;
     }
     return null;
 }