示例#1
0
 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;
 }
示例#3
0
 public ProjectFolderNode(ProjectInfo pi, FiledropsDirectory di, Binding showext, FolderTreeNodeFilter filter = null)
     : base(di, showext, filter)
 {
     this.pi = pi;
     //this.ContextMenuOpening
     //pi.Manager
 }
示例#4
0
 public ProjectRootNode(ProjectManager manager, ProjectInfo pi, FiledropsDirectory di, Binding showext)
     : base(di, showext)
 {
     this.pi = pi;
     this.manager = manager;
     Tag = "Project";
 }
示例#5
0
 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";
 }
示例#6
0
 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);
 }
示例#7
0
 public SolutionProjectInfo GetSolutionProjectWithDirectory(FiledropsDirectory dir)
 {
     SolutionProjectInfo spi = projects[dir.Name];
     if (spi != null && spi.ProjectFile.Parent.FullName.Equals(dir.FullName))
     {
         return spi;
     }
     return null;
 }
示例#8
0
        /// <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);
        }
示例#9
0
 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;
 }
示例#10
0
		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);
		}
示例#11
0
 private void FillTree(FiledropsDirectory dir)
 {
     this.view.addRoot(dir);
 }
示例#12
0
 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;
 }
示例#13
0
 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;
 }
示例#14
0
 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();
 }
示例#15
0
 protected void initTopDirs(FiledropsDirectory dir)
 {
     foreach (String s in ACCEPTED)
     {
         try
         {
             FiledropsDirectory newdir = this.FileSystem.ConstructDirectory(dir.FullName + @"\" + s);
             newdir.Create();
         }
         catch { }
     }
 }
示例#16
0
        /// <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;
        }
示例#17
0
 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;
 }
示例#18
0
 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();
 }
示例#19
0
 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;
 }