public override FolderTreeNode createFolderNode(FiledropsDirectory dir, FolderTreeNodeFilter filter, bool recursive = true) { if (filter == null) return new ProjectFolderNode(pi, dir, this.ShowExtBinding, this.filter); else return new ProjectFolderNode(pi, dir, this.ShowExtBinding, filter); }
public SolutionProjectRootNode(SolutionManager manager, SolutionProjectInfo pi, FiledropsDirectory di, Binding showext, FolderTreeNodeFilter filter) : base(manager, pi, di, showext) { this.filter = filter; this.pi = pi; this.manager = manager; }
public ProjectFolderNode(ProjectInfo pi, FiledropsDirectory di, Binding showext, FolderTreeNodeFilter filter = null) : base(di, showext, filter) { this.pi = pi; //this.ContextMenuOpening //pi.Manager }
public ProjectRootNode(ProjectManager manager, ProjectInfo pi, FiledropsDirectory di, Binding showext) : base(di, showext) { this.pi = pi; this.manager = manager; Tag = "Project"; }
public SolutionRootNode(SolutionManager manager, SolutionInfo si, FiledropsDirectory di, Binding showext, FolderTreeNodeFilter filter = null) : base(di, showext, filter) { this.Solution = si; this.manager = manager; this.Tag = "Solution"; }
public override FolderTreeNode createFolderNode(FiledropsDirectory dir, FolderTreeNodeFilter filter, bool recursive = true) { if (filter == null) return new SolutionProjectRootNode(manager, this.Solution.GetSolutionProjectWithDirectory(dir), dir, this.ShowExtBinding, this.filter); else return new SolutionProjectRootNode(manager, this.Solution.GetSolutionProjectWithDirectory(dir), dir, this.ShowExtBinding, filter); }
public SolutionProjectInfo GetSolutionProjectWithDirectory(FiledropsDirectory dir) { SolutionProjectInfo spi = projects[dir.Name]; if (spi != null && spi.ProjectFile.Parent.FullName.Equals(dir.FullName)) { return spi; } return null; }
/// <summary> /// This creates a new instance of the Selector. /// To display it, you still need to call "showDialog()". /// </summary> /// <param name="f">The project file (fdproj). This file will determine the root directory of this component.</param> /// <param name="ext">The extension to display. (Extensions should be named with a dot at the start)</param> public Selector(FiledropsDirectory dir, string ext, string folder) { InitializeComponent(); this._ext = ext; view.ShowFiles = true; view.ShowRoot = false; view.Filters = new string[] { ext.Substring(1) }; view.AcceptedDirs = new string[] { folder }; FillTree(dir); }
public ExplorerDialog(bool foldersonly, FiledropsDirectory root, string title, string filter = null) { InitializeComponent(); this.foldersonly = foldersonly; if (foldersonly) { ExplorerControl.ShowFoldersList = true; ExplorerControl.ShowFiles = false; } else { ExplorerControl.ShowFoldersList = true; ExplorerControl.ShowFilesTree = false; ExplorerControl.ShowFilesList = true; ExplorerControl.ExtensionFilter = filter; ExplorerControl.ListDisplay.MouseDoubleClick += Check_File; } this.Title = title; this.ExplorerControl.AddRoot(root); this.ExplorerControl.Confirm.Click += Confirm_Click; this.ExplorerControl.FileSelectBox.KeyDown += CheckName; this.fs = root.FileSystem; }
public NewFilePanel(FiledropsDirectory folder, FiledropsDirectory schemadir, string ext, GetIcon iconFunction) { InitializeComponent(); this.IconFunction = iconFunction; this._ext = ext; this._folderpath = folder.FullName; _lv = new FiledropsFileList(schemadir, false, false, ".xsd"); _lv.ShowFiles = true; Button b = new Button(); b.Content = "Create file"; b.Click += CreateFileClick; b.Margin = new System.Windows.Thickness(10); _lv.MouseDoubleClick += CreateFileClick; Grid.SetRow(_lv, 0); Grid.SetRow(b, 1); grid.Children.Add(_lv); grid.Children.Add(b); }
private void FillTree(FiledropsDirectory dir) { this.view.addRoot(dir); }
public BitmapImage GetClosedDirIcon(FiledropsDirectory d, int size) { BitmapImage img = null; string folder = GetFolderKey(d); if (folder != null) { int valueindex = Array.IndexOf(ProjectManager.ACCEPTED, folder); if (valueindex >= 0) { ProjectManager.CLOSEDFOLDER_ICONS.TryGetValue(ProjectManager.ACCEPTEDXTS[valueindex], out img); } } else { if (ProjectManager.projFolderIcon != null) { img = ProjectManager.projFolderIcon; } } return img; }
public FolderTreeNode addRoot(FiledropsDirectory dir, SolutionInfo si) { FolderTreeNode node = new SolutionRootNode(Manager, si, dir, showExtBinding); this.RootDirectories.Add(node.Entry); this.buildFolderRoot(node); if (ShowRoot) { this.Items.Add(node); } return node; }
public void addRootAndRename(FiledropsDirectory dir, SolutionInfo si) { FolderTreeNode node = new SolutionRootNode(Manager, si, dir, showExtBinding); this.RootDirectories.Add(node.Entry); this.buildFolderRoot(node); this.Items.Add(node); node.RenameNode(); }
protected void initTopDirs(FiledropsDirectory dir) { foreach (String s in ACCEPTED) { try { FiledropsDirectory newdir = this.FileSystem.ConstructDirectory(dir.FullName + @"\" + s); newdir.Create(); } catch { } } }
/// <summary> /// /// </summary> /// <param name="ext"></param> /// <returns></returns> public FiledropsFile NewFile(string ext, FiledropsDirectory dir) { FiledropsDirectory schemadir = dir.FileSystem .ConstructDirectory(Environment.CurrentDirectory + @"\Resources\DocUI\" + ACCEPTED[Array.IndexOf(ACCEPTEDXTS, ext)]); if (schemadir.Exists()) { if (schemadir.GetFiles("xsd").Count > 1) { FiledropsFileSystem fs = this.FileSystem.Clone<FiledropsFileSystem>(); fs.WorkingDirectory = schemadir; schemadir.FileSystem = fs; fs.GetFileIcon = GetSchemaImage; NewFilePanel dialog = new NewFilePanel(dir, schemadir, ext, GetIcon); bool? result = dialog.ShowDialog(); if (result == true) { FiledropsFile file = dir.FileSystem.ConstructFileRecursive(dir.FullName + @"\", dir.Name, ext); XmlSchemaUtilities.generateCleanXml(file.FullName, dialog.NewType.FullName, ACCEPTED[Array.IndexOf(ACCEPTEDXTS, ext)]); return dir.FileSystem.ConstructFile(file.FullName); } else { return null; } } else if (schemadir.GetFiles("xsd").Count == 1) { FiledropsFile xsd = schemadir.GetFiles("xsd")[0]; FiledropsFile file = dir.FileSystem.ConstructFileRecursive(dir.FullName + @"\", dir.Name, ext); XmlSchemaUtilities.generateCleanXml(file.FullName, xsd.FullName, ACCEPTED[Array.IndexOf(ACCEPTEDXTS, ext)]); return file; } else { return null; } } else if (NoSchema.Contains<string>(ext)) { FiledropsFile file = dir.FileSystem.ConstructFileRecursive(dir.FullName + @"\", dir.Name, ext); return file; } return null; }
private string GetFolderKey(FiledropsDirectory d) { if (d.FullName.StartsWith(this.Root.FullName) && d.FullName != this.Root.FullName) { string topfolder = d.FullName.Substring(this.Root.FullName.Length + 1); int index = topfolder.IndexOf('\\'); if (index < 0) { index = topfolder.IndexOf('/'); } if (index >= 0) { topfolder = topfolder.Substring(0, index); } return topfolder; } return null; }
public void AddRootAndRename(FiledropsDirectory dir, ProjectInfo pi) { FolderTreeNode node = new ProjectRootNode(Manager, pi, dir, showExtBinding); this.RootDirectories.Add(node.Entry); this.buildFolderRoot(node); this.Items.Add(node); node.RenameNode(); }
public FolderTreeNode AddRoot(FiledropsDirectory dir, ProjectInfo pi) { FolderTreeNode node = new ProjectRootNode(Manager, pi, dir, showExtBinding); this.RootDirectories.Add(node.Entry); this.buildFolderRoot(node); if (ShowRoot) { this.Items.Add(node); } return node; }