ArcGISPortalViewer.ViewModel.MapViewModel.CreateSelectionGraphic C# (CSharp) Method

CreateSelectionGraphic() private method

private CreateSelectionGraphic ( Feature feature ) : Graphic
feature Feature
return Graphic
        private Graphic CreateSelectionGraphic(Feature feature)
        {
            if (feature == null)
                return null;

            var selectionGraphic  = feature is GeodatabaseFeature ? ((GeodatabaseFeature)feature).AsGraphic() : new Graphic { Geometry = feature.Geometry };
            switch (selectionGraphic.Geometry.GeometryType)
            {
                case GeometryType.Multipoint:
                case GeometryType.Point:
                    selectionGraphic.Symbol = _pointSelectionSymbol;
                    break;
                case GeometryType.Polygon:
                case GeometryType.Envelope:
                    selectionGraphic.Symbol = _polygonSelectionSymbol;
                    break;
                case GeometryType.Polyline:
                    selectionGraphic.Symbol = _polylineSelectionSymbol;
                    break;
            }            
            return selectionGraphic;
        }
    }