Ejemplo n.º 1
0
        public static MenuItem GetAddStyleWizardMenuItem(ShapeFileFeatureLayer shapeFileFeatureLayer)
        {
            var command = new ObservedCommand(() =>
            {
                if (GisEditorWpfMapExtension.AddStyleToLayerWithStyleWizard(new Layer[] { shapeFileFeatureLayer }))
                {
                    LayerListHelper.RefreshCache();
                    GisEditor.UIManager.BeginRefreshPlugins(new RefreshArgs(shapeFileFeatureLayer, RefreshArgsDescription.GetAddStyleWizardMenuItemDescription));
                }
            }, () => true);

            return(GetMenuItem("Style Wizard", "/GisEditorPluginCore;component/Images/addstyle.png", command));
        }
Ejemplo n.º 2
0
        private void SetTextForLine(Feature feature)
        {
            double length    = 0;
            string textValue = string.Empty;

            try
            {
                if (measuringMode == MeasuringInMode.DecimalDegree)
                {
                    Feature tempFeature = GetProjectedFeature(feature);
                    length = ((LineBaseShape)tempFeature.GetShape()).GetLength(GeographyUnit.DecimalDegree, DistanceUnit);
                }
                else
                {
                    length = ((LineBaseShape)feature.GetShape()).GetLength(MapArguments.MapUnit, DistanceUnit);
                }
                textValue = string.Format(CultureInfo.InvariantCulture, "{0:N3} {1}", length, GisEditorWpfMapExtension.GetAbbreviateDistanceUnit(DistanceUnit));
            }
            catch (Exception ex)
            {
                GisEditor.LoggerManager.Log(LoggerLevel.Debug, ex.Message, new ExceptionInfo(ex));
                textValue = "Error";
            }
            finally
            {
                feature.ColumnValues[DistanceColumnName]      = length.ToString(CultureInfo.InvariantCulture);
                feature.ColumnValues[UnitColumnName]          = DistanceUnit.ToString();
                feature.ColumnValues[measureResultColumnName] = textValue;
            }
        }