private void UsersColorChangedEventHandler(UsersColorModel payload) { if (!string.IsNullOrEmpty(payload.Subject)) { this._captionTextBox.Text = string.Format(UiResources.ColoredBy_1, payload.Subject); } else { this._captionTextBox.Text = string.Empty; } var userDic = payload.UsersColorDic; foreach (var item in this._layer.Items) { var shape = item as MapShape; if (shape != null) { var user = shape.Tag as CP.NLayer.Models.Entities.User; if (user != null) { if (userDic.Any(x => x.Key.Id == user.Id)) { var color = userDic.First(x => x.Key.Id == user.Id).Value; MapUtilities.ColorShape(shape, color); } } } } }
public View() { InitializeComponent(); if (WpfHelper.GetIsInDesignMode()) { return; } this._shapeDataList = MapUtilities.LoadUserShapeData(); SwitchToDisplayButton_Click(null, null); }
private void AddShapes() { if (this.ShapeDataList == null || this.ShapeDataList.Count == 0) { return; } foreach (var item in this.ShapeDataList) { var shape = MapUtilities.CreateUserShape(item); this._layer.Items.Add(shape); } }
private void SaveButton_Click(object sender, RoutedEventArgs e) { var layout = this._mapContainer.Content as LayoutView; if (layout != null) { layout.SaveShapeDataList(); //save to DB MapUtilities.SaveUserShapeData(layout.ShapeDataList); this._shapeDataList = MapUtilities.LoadUserShapeData(); layout.ShapeDataList = this._shapeDataList; layout.LoadMap(); } }
private void ColorShapes() { foreach (var item in this._layer.Items) { var shape = item as MapShape; if (shape != null) { if (this._selectedShapes.Contains(shape)) { MapUtilities.SelectShape(shape); } else { MapUtilities.UnSelectShape(shape); } } } }
private void ColorShapes() { foreach (var item in this._layer.Items) { var shape = item as MapShape; if (shape != null) { if (this._selectedShapes.Contains(shape)) { MapUtilities.SelectShape(shape); } else { MapUtilities.UnSelectShape(shape); } MapUtilities.ColorShape(shape, _defaultColor); } if (this._selectedShapes.Count > 0) { MapUtilities.ColorShape(this._selectedShapes.First(), _ownedColor); } } }