Esempio n. 1
0
        }         // void wc_OpenReadCompleted(object sender, OpenReadCompletedEventArgs e) {

        private void fillLyrList(System.IO.Stream s)
        {
            log("fillLyrList...");
            List <VLayerDescription> lyrs = new List <VLayerDescription>();
            XDocument doc = XDocument.Load(s);
            var       res = from r in doc.Descendants("Layer")
                            where r.Attribute("id").Value != ""
                            select r;

            foreach (var r in res)
            {
                VLayerDescription ld = new VLayerDescription();
                ld.id          = r.Attribute("id").Value.Trim();
                ld.name        = r.Attribute("name").Value.Trim();
                ld.type        = r.Attribute("type").Value.Trim();
                ld.topic       = r.Attribute("topic").Value.Trim();
                ld.url         = r.Value.ToString().Trim();
                ld.proxy       = ld.getFromXml(r.Attribute("proxy"));
                ld.preview     = ld.getFromXml(r.Attribute("preview"));
                ld.imageFormat = ld.getFromXml(r.Attribute("ImageFormat"));
                log(String.Format("get LD [{0}]", ld.toString()));
                lyrs.Add(ld);
            }
            log("fillLyrList, got layers: " + String.Join("; ", lyrs));
            this.lyrsDescr = lyrs;

            this.fillListDialog();
        }         // private void fillLyrList(System.IO.Stream s)
Esempio n. 2
0
        }         // public void changeTopicSelection() {

        public void changeLayerSelection()
        {
            log("changeLayerSelection...");
            VLayerDescription ld = (VLayerDescription)this.listDialog.listBox2.SelectedItem;

            log("selected layer: " + ld.toString());
        }
Esempio n. 3
0
        private void bmpBackground_ImageFailed(object sender, ExceptionRoutedEventArgs e)
        {
            vmsApp.log("bmpBackground_ImageFailed, error: " + e.ErrorException.Message);
            var    bi = sender as ImageBrush;
            string a  = ((System.Windows.Media.Imaging.BitmapImage)(((bi)).ImageSource)).UriSource.ToString();

            vmsApp.log("bmpBackground_ImageFailed, url " + a);

            var   ld  = new VLayerDescription();
            Image img = new Image();

            img.Source     = new System.Windows.Media.Imaging.BitmapImage(new Uri(ld.preview, UriKind.RelativeOrAbsolute));
            bi.ImageSource = img.Source;
        }         // private void bmpBackground_ImageFailed(object sender, ExceptionRoutedEventArgs e)
Esempio n. 4
0
        public VLayer(VLayerDescription ld)
        {
            lyr      = null;
            lyrName  = ld.name;
            lyrUrl   = ld.url;
            lyrType  = ld.type;
            selected = false;
            proxy    = ld.proxy;
            if (ld.imageFormat == "PNG32")
            {
                imageFormat = ArcGISDynamicMapServiceLayer.RestImageFormat.PNG32;
            }

            helpCreateLayer(ld.id, true);
        }                            // public VLayer(VLayerDescription ld)
Esempio n. 5
0
        public void addSelectedLayer()
        {
            log("addSelectedLayer...");
            VLayerDescription ld = (VLayerDescription)this.listDialog.listBox2.SelectedItem;

            if (ld == null)
            {
                log("no selected layer");
                return;
            }
            log("selected layer: " + ld.toString());
            var lyr = new VLayer(ld);

            // if FeatureLayer retrieve attribs from server
            // look in VLayer.createLayer
            //lr.OutFields.Add("*");
            //lr.Initialize();
            addLayer2Q(lyr); // queue
            //addLayer(lyr);
        }                    // public void addSelectedLayer()