public void Import(ICatalogItem fetClassItem, ICatalogItem locationItem, IProgressTracker tracker, string name, string displayName, string description)
        {
            CatalogFile  cfile  = fetClassItem as CatalogFile;
            CatalogLocal cloc   = locationItem as CatalogLocal;
            string       file   = cfile.Tag.ToString();
            string       dstdir = cloc.Tag.ToString();

            CopyFile(file, name, displayName, dstdir, tracker);
        }
Exemple #2
0
 private void AddLocaDataSource()
 {
     using (FolderBrowserDialog dlg = new FolderBrowserDialog())
     {
         if (dlg.ShowDialog() == DialogResult.OK)
         {
             string       dir = dlg.SelectedPath;
             CatalogLocal loc = new CatalogLocal(dir, dir, dir);
             AddChild(loc);
             Refresh();
         }
     }
 }
Exemple #3
0
 internal override void LoadChildren()
 {
     if (!_isLoaded)
     {
         string[] dirs = null;
         try
         {
             dirs = Directory.GetDirectories(_tag.ToString());
         }
         catch (Exception ex)
         {
             MsgBox.ShowError(ex.Message);
             return;
         }
         //load dirs
         if (dirs != null && dirs.Length > 0)
         {
             foreach (string d in dirs)
             {
                 string[]     dparts = d.Split(Path.DirectorySeparatorChar);
                 CatalogLocal loc    = new CatalogLocal(dparts[dparts.Length - 1], d, d);
                 AddChild(loc);
             }
         }
         //load files
         foreach (string ext in _supportedFileExts)
         {
             string[] files = Directory.GetFiles(_tag.ToString(), ext);
             if (files != null && files.Length > 0)
             {
                 foreach (string f in files)
                 {
                     CatalogFile cf = null;
                     if (ext == "*.shp")
                     {
                         cf = new CatalogFile(Path.GetFileNameWithoutExtension(f), f, f);
                     }
                     else if (ext == "*.rst")
                     {
                         cf = new CatalogRasterFile(Path.GetFileNameWithoutExtension(f), f, f);
                     }
                     AddChild(cf);
                 }
             }
         }
         //
         Refresh();
         _isLoaded = true;
     }
 }