Esempio n. 1
0
 private void cmdBrowse_Click(object sender, EventArgs e) // browse restore file
 {
     if (DlgOpen.ShowDialog() == DialogResult.OK)
     {
         lbPath.Text = DlgOpen.FileName;
     }
 }
Esempio n. 2
0
 private void link选择提取模板_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
 {
     if (TViewRegion.SelectedNode != null && DlgOpen.ShowDialog() == DialogResult.OK)
     {
         PageDrillRagularRule sPageDrillRule    = PageDrillRagularRule.Open(DlgOpen.FileName);
         DrillRegularRule     sDrillRagularRule = sPageDrillRule.ToDrillRegularRule();
         TViewRegion.SelectedNode.Tag = sDrillRagularRule;
         LoadDrillRule(sDrillRagularRule);
     }
 }
Esempio n. 3
0
        private void OpenTexture()
        {
            DlgOpen.InitialDirectory = m_AssetDir;
            DlgOpen.Filter           = "텍스처 파일 (*.png)|*.png";
            DlgOpen.DefaultExt       = ".png";
            DlgOpen.FileName         = "";
            DlgOpen.Title            = "오브젝트 셋 텍스처 불러오기";

            if (DlgOpen.ShowDialog() == DialogResult.OK)
            {
                tbTextureFileName.Text = DlgOpen.SafeFileName;
            }
        }
Esempio n. 4
0
        private void CmdOpen_Click(object sender, System.EventArgs e)
        {
            if (DlgOpen.ShowDialog() != DialogResult.OK)
            {
                return;
            }

            using (var fs = new FileStream(DlgOpen.FileName, FileMode.Open))
            {
                var reader = XmlReader.Create(fs);
                CronTab.ReadXml(reader);
            }
        }
Esempio n. 5
0
        private void BtnInput_Click(object sender, EventArgs e)
        {
            string strPath = null;
            //文件名
            var _with1 = DlgOpen;

            _with1.FileName    = "";
            _with1.Filter      = "GIS(*.lyr)|*.*|GIS(*.img)|*.img|GIS(*.aux)|*.aux|GIS(*.tif)|";
            _with1.FilterIndex = 2;

            if ((DlgOpen.ShowDialog() == System.Windows.Forms.DialogResult.OK))
            {
                strPath = DlgOpen.FileName.Trim();
                //获取图层的栅格信息
                IRasterWorkspace  pRWS = default(IRasterWorkspace);
                IWorkspaceFactory pWorkspaceFactory = default(IWorkspaceFactory);
                pWorkspaceFactory = new RasterWorkspaceFactory();
                string wsp = null;
                int    r   = 0;
                int    l   = 0;
                r    = strPath.LastIndexOf("\\");
                l    = strPath.LastIndexOf(".");
                wsp  = Microsoft.VisualBasic.Strings.Left(strPath, r);
                pRWS = (IRasterWorkspace)pWorkspaceFactory.OpenFromFile(wsp, 0);

                try {
                    string sp = null;
                    sp = Microsoft.VisualBasic.Strings.Mid(strPath, r + 2, strPath.Length - r - 1);

                    pRster = pRWS.OpenRasterDataset(sp).CreateDefaultRaster();
                    //打开栅格图层
                    ComboBoxInLayer.Text = sp;
                    ILayer pLayer = default(ILayer);
                    pRasterLayr = new RasterLayer();

                    pRasterLayr.CreateFromRaster(pRster);
                    pLayer = pRasterLayr;
                    frm.mainMapControl.AddLayer(pLayer);
                }
                catch (Exception ex) {
                    MessageBox.Show(ex.ToString(), "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                }
            }
        }
Esempio n. 6
0
        private void 불러오기ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            DlgOpen.InitialDirectory = KAssetDir;
            DlgOpen.Filter           = "오브젝트 셋 파일 (*.xml)|*.xml";
            DlgOpen.DefaultExt       = ".xml";
            DlgOpen.FileName         = "";
            DlgOpen.Title            = "오브젝트 셋 불러오기";

            if (DlgOpen.ShowDialog() == DialogResult.OK)
            {
                Manager.LoadFromFile(DlgOpen.FileName);

                this.Text = "DirectX11Tutorial Object Editor: " + Manager.ObjectSet.ObjectSetName;

                SurfaceTexture.ClearTextures();
                SurfaceTexture.AddTextureFromFile(Manager.ObjectSet.TextureFileName);

                SurfaceObject.ClearTextures();
                SurfaceObject.AddTextureFromFile(Manager.ObjectSet.TextureFileName);

                SurfaceTexture.Invalidate();
                SurfaceObject.Invalidate();

                SSize texture_size = SurfaceTexture.GetTextureSize(0);

                hScrollBar1.LargeChange = KScrollDelta;
                hScrollBar1.Maximum     = texture_size.Width / hScrollBar1.LargeChange;

                vScrollBar1.LargeChange = KScrollDelta;
                vScrollBar1.Maximum     = texture_size.Height / vScrollBar1.LargeChange;

                LBObjects.Items.Clear();
                foreach (ObjectSetElementData element in Manager.ObjectSet.Elements)
                {
                    LBObjects.Items.Add(element.ElementName);
                }
            }
        }