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); } } } } }
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); } } }