示例#1
0
文件: MainForm.cs 项目: jzChia/demo
        private void toolStripMenuItem4_Click(object sender, EventArgs e)
        {
            TreeNode tn = treeView1.SelectedNode;

            if (tn == null)
            {
                return;
            }

            string layerID = Convert.ToString(tn.Tag);

            if (tn.Parent.Tag != null && tn.Parent.Tag.ToString() == "RASTER_LAYERS")
            {
                Demo.Entities.RasterLayer rl = Demo.Entities.RasterLayer.GetRasterIndexById(layerID);
                if (rl == null)
                {
                    return;
                }
                FormMetaData fmd = new FormMetaData(rl);
                fmd.ShowDialog();
            }
            else if (tn.Parent.Tag != null && tn.Parent.Tag.ToString() == "VECTOR_LAYERS")
            {
                VectorLayer vl = VectorLayer.GetVectorIndexById(layerID);
                if (vl == null)
                {
                    return;
                }
                FormMetaData fmd = new FormMetaData(vl);
                fmd.ShowDialog();
            }
        }
示例#2
0
        private void button2_Click(object sender, EventArgs e)
        {
            VectorLayer vl = VectorLayer.GetVectorIndexById("");

            if (vl != null)
            {
                FormMetaData fmd = new FormMetaData(vl);
                fmd.ShowDialog();
            }
        }
示例#3
0
文件: MainForm.cs 项目: jzChia/demo
        /// <summary>
        /// 导出到本地
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void toolStripMenuItem2_Click(object sender, EventArgs e)
        {
            if (treeView1.SelectedNode.Parent.Tag.ToString().Equals("RASTER_LAYERS"))
            {
                FolderBrowserDialog fbd = new FolderBrowserDialog();
                if (fbd.ShowDialog() == DialogResult.OK)
                {
                    Demo.Entities.RasterLayer rstLyr = Demo.Entities.RasterLayer.GetRasterIndexById(treeView1.SelectedNode.Tag.ToString());
                    URI    uri              = new URI();
                    string sourceFileName   = uri.GetServerTruePath(rstLyr.URI);
                    string destFileNickName = fbd.SelectedPath + "\\" + System.IO.Path.GetFileName(sourceFileName);
                    Transfer.RasterReadHelper destRstInfo = new Transfer.RasterReadHelper(destFileNickName);
                    string destFileName = fbd.SelectedPath + "\\" + destRstInfo.NameWithoutExtension + destRstInfo.Extension;

                    Guid         taskID       = Guid.NewGuid();
                    TransferTask transferTask = new TransferTask(taskID, sourceFileName, destFileName, TaskType.Download, RenameMode.Accumulate, TaskCategory.Raster, (int)rstLyr.LAYERSIZE);
                    transferTaskListControl1.AddTask(transferTask);
                }
            }
            else if (treeView1.SelectedNode.Parent.Tag.ToString().Equals("VECTOR_LAYERS"))
            {
                FolderBrowserDialog fbd = new FolderBrowserDialog();
                if (fbd.ShowDialog() == DialogResult.OK)
                {
                    VectorLayer vctLyr                      = VectorLayer.GetVectorIndexById(treeView1.SelectedNode.Tag.ToString());
                    URI         uri                         = new URI();
                    string      sourceFileName              = uri.GetServerTruePath(vctLyr.URI);
                    string      destFileNickName            = fbd.SelectedPath + "\\" + System.IO.Path.GetFileName(sourceFileName);
                    Transfer.FeatureReadHelper destFeatInfo = new Transfer.FeatureReadHelper(destFileNickName);
                    string destFileName                     = fbd.SelectedPath + "\\" + destFeatInfo.NameWithoutExtension;

                    Guid         taskID       = Guid.NewGuid();
                    TransferTask transferTask = new TransferTask(taskID, sourceFileName, destFileName, TaskType.Download, RenameMode.Accumulate, TaskCategory.Features, (int)vctLyr.LAYERSIZE);
                    transferTaskListControl1.AddTask(transferTask);
                }
            }
        }