Esempio n. 1
0
        //private List<TableData> getFileData(string[] fullpaths)
        //{
        //    List<TableData> files = new List<TableData>();

        //    Action<string> func = x =>
        //    {
        //        String name = Path.GetFileName(x);
        //        String ext = Path.GetExtension(x);

        //        //FileInfo fileinfo = new FileInfo(x);
        //        //fileinfo.CreationTime;
        //        string guid = Win32.getObjectID(x).ToString();
        //        TableData filedata = tagdb.selectFileData(guid);
        //        if (filedata == null)
        //        {
        //            filedata = new TableData(guid, name, new List<string>(), "");
        //        }
        //        files.Add(filedata);
        //    };

        //    foreach (string fullpath in fullpaths)
        //    {
        //        if (File.GetAttributes(fullpath) == FileAttributes.Directory)
        //        {
        //            DoIt(fullpath, func);
        //        }
        //        else
        //        {
        //            String filename = Path.GetFileName(fullpath);
        //            string guid = Win32.getObjectID(fullpath).ToString();
        //            files.Add(new TableData(guid, filename, new List<string>(), ""));
        //        }

        //    }
        //    return files;
        //}

        private void RegisterTagsComent(List <TableData> files)
        {
            RegisterForm reg = new RegisterForm();

            reg.FileDatas = files;
            reg.Tags      = tagdb.getAllTags();
            reg.SetFileData();
            DialogResult res = reg.ShowDialog(this);

            if (res == DialogResult.OK)
            {
                tagdb.insertFileData(reg.FileDatas, reg.Tags.ToList <string>());
            }
        }
Esempio n. 2
0
 //private List<TableData> getFileData(string[] fullpaths)
 //{
 //    List<TableData> files = new List<TableData>();
 //    Action<string> func = x =>
 //    {
 //        String name = Path.GetFileName(x);
 //        String ext = Path.GetExtension(x);
 //        //FileInfo fileinfo = new FileInfo(x);
 //        //fileinfo.CreationTime;
 //        string guid = Win32.getObjectID(x).ToString();
 //        TableData filedata = tagdb.selectFileData(guid);
 //        if (filedata == null)
 //        {
 //            filedata = new TableData(guid, name, new List<string>(), "");
 //        }
 //        files.Add(filedata);
 //    };
 //    foreach (string fullpath in fullpaths)
 //    {
 //        if (File.GetAttributes(fullpath) == FileAttributes.Directory)
 //        {
 //            DoIt(fullpath, func);
 //        }
 //        else
 //        {
 //            String filename = Path.GetFileName(fullpath);
 //            string guid = Win32.getObjectID(fullpath).ToString();
 //            files.Add(new TableData(guid, filename, new List<string>(), ""));
 //        }
 //    }
 //    return files;
 //}
 private void RegisterTagsComent(List<TableData> files)
 {
     RegisterForm reg = new RegisterForm();
     reg.FileDatas = files;
     reg.Tags = tagdb.getAllTags();
     reg.SetFileData();
     DialogResult res = reg.ShowDialog(this);
     if (res == DialogResult.OK)
     {
         tagdb.insertFileData(reg.FileDatas, reg.Tags.ToList<string>());
     }
 }