Example #1
0
 public void CreateFromXml(System.Xml.XmlElement element)
 {
     foreach (System.Xml.XmlElement child in element.ChildNodes)
     {
         if (child.Name.Equals("shapeFile") && BoundryFilePathExists(child.InnerText))
         {
             if (provider == null)
             {
                 provider = new DotDensityLayerProvider(myMap);
             }
             object[] shapeFileProperties = provider.LoadShapeFile(child.InnerText);
             if (shapeFileProperties != null)
             {
                 if (shapeFileProperties.Length == 2)
                 {
                     shapeFilePath = shapeFileProperties[0].ToString();
                     IDictionary <string, object> shapeAttributes = (IDictionary <string, object>)shapeFileProperties[1];
                     if (shapeAttributes != null)
                     {
                         cbxShapeKey.Items.Clear();
                         foreach (string key in shapeAttributes.Keys)
                         {
                             cbxShapeKey.Items.Add(key);
                         }
                     }
                 }
             }
         }
         if (child.Name.Equals("dataKey"))
         {
             cbxDataKey.SelectedItem = child.InnerText;
         }
         if (child.Name.Equals("shapeKey"))
         {
             cbxShapeKey.SelectedItem = child.InnerText;
         }
         if (child.Name.Equals("dotValue"))
         {
             txtDotValue.Text = child.InnerText;
         }
         if (child.Name.Equals("value"))
         {
             cbxValue.SelectedItem = child.InnerText;
         }
         if (child.Name.Equals("dotColor"))
         {
             rctDotColor.Fill = new SolidColorBrush((Color)ColorConverter.ConvertFromString(child.InnerText));
         }
     }
     RenderMap();
 }
        public DotDensityLayerProperties(ESRI.ArcGIS.Client.Map myMap, DashboardHelper dashboardHelper, IMapControl mapControl)
        {
            InitializeComponent();
            this.myMap = myMap;
            this.dashboardHelper = dashboardHelper;
            this.mapControl = mapControl;

            provider = new DotDensityLayerProvider(myMap);

            FillComboBoxes();
            mapControl.MapDataChanged += new EventHandler(mapControl_MapDataChanged);
            btnShapeFile.Click += new RoutedEventHandler(btnShapeFile_Click);
            cbxDataKey.SelectionChanged += new SelectionChangedEventHandler(keys_SelectionChanged);
            cbxShapeKey.SelectionChanged += new SelectionChangedEventHandler(keys_SelectionChanged);
            cbxValue.SelectionChanged += new SelectionChangedEventHandler(keys_SelectionChanged);
            rctDotColor.MouseUp += new MouseButtonEventHandler(rctDotColor_MouseUp);
            rctFilter.MouseUp += new MouseButtonEventHandler(rctFilter_MouseUp);
        }