Пример #1
0
        internal void AddEntityFromFolders()
        {
            if (RestrictManualAdd() == false)
            {
                FolderBrowserDialog dialog = new FolderBrowserDialog();
                dialog.SelectedPath = Properties.Settings.Default.LastSelectedFolder;
                if (dialog.ShowDialog() == DialogResult.OK)
                {
                    Properties.Settings.Default.LastSelectedFolder = dialog.SelectedPath;
                    Properties.Settings.Default.Save();
                    List <string> Dirs = Directory.GetDirectories(dialog.SelectedPath, "*", SearchOption.AllDirectories).ToList();
                    Dirs.Add(dialog.SelectedPath);

                    foreach (string s in Dirs)
                    {
                        Node nodetoadd = new Node(ActiveFolder, "Node" + GlobalClass.GetRandomString(), OpenedNode.Name, new DirectoryInfo(s).Name);
                        AddTask(new TaskInfo(OpenedNode, nodetoadd, ActiveFolder));
                        List <FileInfo> files = new DirectoryInfo(s).GetFiles("*.jpg").ToList();
                        files.AddRange(new DirectoryInfo(s).GetFiles("*.png"));
                        foreach (FileInfo f in files)
                        {
                            AddTask(new TaskInfo(nodetoadd, f.FullName, ActiveFolder));
                        }
                    }
                }

                tasks.Execute();
            }
        }
Пример #2
0
 internal void AddNewNode()
 {
     if (RestrictManualAdd() == false)
     {
         Node n = new Node(ActiveFolder, "Node" + GlobalClass.GetRandomString(), OpenedNode.Name, "New Node");
         n.Save();
         OpenedNode.Add(n);
         OpenedNode.Save();
         OpenedNode.Refresh(true);
     }
 }
Пример #3
0
        public Entity(Image image, string ActiveFolderPath)
        {
            string Random = GlobalClass.GetRandomString();

            this.ImageFileName     = "Image" + Random;
            this.ThumbnailFileName = "Thumbnail" + ImageFileName;
            picture = new Picture(ImageFileName, ThumbnailFileName);
            SetPicture(image, ActiveFolderPath);
            Tags          = "";
            OldParentName = null;
            IsShortCut    = false;
            IsDeleted     = false;
            IsFavorite    = false;
        }