コード例 #1
0
ファイル: TestFrm.cs プロジェクト: bsrykt/kml-library
        private void btnTestLoadAndSave_Click(object sender, EventArgs e)
        {
            LoadSave ls = new LoadSave("kml");
            string fpath = ls.GetLoadPath();
            if (fpath != null)
            {
                KMLRoot kml = KMLRoot.Load(fpath);
                //MessageBox.Show("Loaded kml: " + fpath);
                Style s = new Style();
                s.Id = "#style1";
                LineStyle lineStyle = new LineStyle();
                lineStyle.Color = Color.White;
                PolyStyle polyStyle = new PolyStyle();
                polyStyle.Color = Color.FromArgb(1, 255, 0, 0);
                s.Add(lineStyle);
                s.Add(polyStyle);

                StyleMap smap = new StyleMap();
                smap.Id = "#sm1";
                smap.AddPairs(new Pair("normal", "#style1"), new Pair("highlight", "#style1"));

                kml.Document.Styles.Add(s);
                kml.Document.Styles.Add(smap);

                fpath = ls.GetSavePath();
                if (fpath != null)
                {
                    kml.Save(fpath);
                }
            }
        }
コード例 #2
0
ファイル: TestFrm.cs プロジェクト: deepakice/kml-library
 private void button3_Click(object sender, EventArgs e) {
     KMLRoot kml = CreateKmlFeat();
     LoadSave ls = new LoadSave("kml");
     string fpath = ls.GetSavePath();
     if (fpath != null) {
         kml.Save(fpath);
     }
 }
コード例 #3
0
ファイル: TestFrm.cs プロジェクト: parsnips/kml-library-fork
 private void button3_Click(object sender, EventArgs e)
 {
     var kml = CreateKmlFeat();
     var ls = new LoadSave("kml");
     var fpath = ls.GetSavePath();
     if (fpath != null)
     {
         kml.Save(fpath);
     }
 }
コード例 #4
0
ファイル: TestFrm.cs プロジェクト: bsrykt/kml-library
 private void button2_Click(object sender, EventArgs e)
 {
     LoadSave ls = new LoadSave("kml");
     string fpath = ls.GetLoadPath();
     if (fpath != null) {
         KMLRoot kml = KMLRoot.Load(fpath);
         if (kml.UsesDocument) {
             MessageBox.Show("Loaded kml (doc): " + kml.Document.List.Count);
         } else {
             MessageBox.Show("Loaded kml (feature): " + kml.Feature.name);
         }
     }
 }
コード例 #5
0
ファイル: LoadSave.cs プロジェクト: parsnips/kml-library-fork
        public static bool BrowseLoadForTextBox(TextBox txtBox, string ext)
        {
            var ls = new LoadSave(ext);
            if (String.IsNullOrEmpty(txtBox.Text))
            {
                ls.InitialDirectory = txtBox.Text;
            }

            var path = ls.GetLoadPath();
            if (path != null)
            {
                txtBox.Text = path;
                return true;
            }

            return false;
        }
コード例 #6
0
ファイル: LoadSave.cs プロジェクト: OOP-03376400/DF_GCS_W
        public static bool BrowseSaveForTextBox(TextBox txtBox, string ext)
        {
            LoadSave ls = new LoadSave(ext);

            if (String.IsNullOrEmpty(txtBox.Text))
            {
                ls.InitialDirectory = txtBox.Text;
            }
            string path = ls.GetSavePath();

            if (path != null)
            {
                txtBox.Text = path;
                return(true);
            }
            return(false);
        }