当前位置: 首页>>代码示例>>C#>>正文


C# Layer.SetValue方法代码示例

本文整理汇总了C#中Layer.SetValue方法的典型用法代码示例。如果您正苦于以下问题:C# Layer.SetValue方法的具体用法?C# Layer.SetValue怎么用?C# Layer.SetValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Layer的用法示例。


在下文中一共展示了Layer.SetValue方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SetErrorMessage

 public static void SetErrorMessage(Layer layer, string value)
 {
     if (layer == null)
     {
         throw new ArgumentNullException("layer");
     }
     layer.SetValue(ESRI.ArcGIS.Client.Extensibility.LayerExtensions.ErrorMessageProperty, value);
 }
开发者ID:Esri,项目名称:arcgis-viewer-silverlight,代码行数:8,代码来源:LayerExtensions.cs

示例2: SetIsSelected

 public static void SetIsSelected(Layer layer, bool value)
 {
     if (layer == null)
     {
         throw new ArgumentNullException("layer");
     }
     layer.SetValue(IsSelectedProperty, value);
 }
开发者ID:Esri,项目名称:arcgis-viewer-silverlight,代码行数:8,代码来源:LayerExtensions.cs

示例3: SetIsVisibleInMapContents

 /// <summary>
 /// Sets whether the layer is visible in the application's list of map contents
 /// </summary>
 /// <param name="layer">The layer to set visibility for</param>
 /// <param name="value">Whether or not the layer should be visible.  True if so, false if not.</param>
 public static void SetIsVisibleInMapContents(Layer layer, bool value)
 {
     if (layer == null)
     {
         throw new ArgumentNullException("layer");
     }
     layer.SetValue(IsVisibleInMapContentsProperty, value);
 }
开发者ID:konglingjie,项目名称:arcgis-viewer-silverlight,代码行数:13,代码来源:LayerProperties.cs

示例4: SetIsEditable

 /// <summary>
 /// Sets whether editing has been enabled on a layer at the application level
 /// </summary>
 /// <param name="layer">The layer to enable or disable editing for</param>
 /// <param name="value">Whether or not editing should be enabled</param>
 internal static void SetIsEditable(Layer layer, bool value)
 {
     if (layer == null)
     {
         throw new ArgumentNullException("layer");
     }
     layer.SetValue(IsEditableProperty, value);
 }
开发者ID:konglingjie,项目名称:arcgis-viewer-silverlight,代码行数:13,代码来源:LayerProperties.cs

示例5: SetDisplayUrl

 public static void SetDisplayUrl(Layer layer, string value)
 {
     if (layer == null)
     {
         throw new ArgumentNullException("layer");
     }
     layer.SetValue(DisplayUrlProperty, value);
 }
开发者ID:konglingjie,项目名称:arcgis-viewer-silverlight,代码行数:8,代码来源:LayerExtensions.cs

示例6: SetInitialUpdateFailed

 public static void SetInitialUpdateFailed(Layer layer, bool value)
 {
     if (layer == null)
     {
         throw new ArgumentNullException("layer");
     }
     layer.SetValue(ESRI.ArcGIS.Client.Extensibility.LayerExtensions.InitialUpdateFailedProperty, value);
 }
开发者ID:Esri,项目名称:arcgis-viewer-silverlight,代码行数:8,代码来源:LayerExtensions.cs

示例7: SetSelectedLayer

 private void SetSelectedLayer(Layer selected)
 {
     if (Map != null)
     {
         foreach (Layer layer in Map.Layers)
         {
             layer.SetValue(CoreExtensions.IsSelectedProperty, false);
         }
         if (selected != null)
             selected.SetValue(CoreExtensions.IsSelectedProperty, true);
     }
 }
开发者ID:Esri,项目名称:arcgis-viewer-silverlight,代码行数:12,代码来源:MapContents.cs

示例8: SetLayerInfos

 public static void SetLayerInfos(Layer layer, Collection<LayerInformation> value)
 {
     layer.SetValue(LayerInfosProperty, value);
 }
开发者ID:konglingjie,项目名称:arcgis-viewer-silverlight,代码行数:4,代码来源:LayerExtensions.cs

示例9: SetSerializedWebMapPopupDataTemplates

 /// <summary>
 /// Layer popup template
 /// </summary>
 /// <param name="obj">Layer</param>
 /// <param name="value">DataTemplate</param>
 public static void SetSerializedWebMapPopupDataTemplates(Layer obj, string value)
 {
     if (obj == null)
         return;
     obj.SetValue(SerializedWebMapPopupDataTemplatesProperty, value);
 }
开发者ID:konglingjie,项目名称:arcgis-viewer-silverlight,代码行数:11,代码来源:LayerExtensions.cs

示例10: SetPopupTitleExpressions

		/// <summary>
        /// Sets the title expressions used to display the titles on a layer's popups.
        /// </summary>
        /// <param name="obj">The layer to get title expressions for</param>
        /// <param name="value">Dictionary with integer keys and string values.  Integer keys are layer ids: -1 for a GraphicLayer, otherwise Layer ID.
        /// String values are format strings like this: "{NAME}: {POPULATION}"</param>
        public static void SetPopupTitleExpressions(Layer obj, IDictionary<int, string> value)
		{
			if (obj != null)
				obj.SetValue(PopupTitleExpressionsProperty, value);
		}
开发者ID:konglingjie,项目名称:arcgis-viewer-silverlight,代码行数:11,代码来源:LayerProperties.cs

示例11: SetIdentifyLayerIds

 public static void SetIdentifyLayerIds(Layer layer, Collection<int> value)
 {
     layer.SetValue(IdentifyLayerIdsProperty, value);
 }
开发者ID:konglingjie,项目名称:arcgis-viewer-silverlight,代码行数:4,代码来源:LayerExtensions.cs

示例12: SetLayerName

 /// <summary>
 /// Sets the display name of the given layer
 /// </summary>
 /// <param name="layer">The layer to set the name of</param>
 /// <param name="value">The layer name</param>
 public static void SetLayerName(Layer layer, string value)
 {
     if (layer == null)
     {
         throw new ArgumentNullException("layer");
     }
     layer.SetValue(MapApplication.LayerNameProperty, value);
     if (string.IsNullOrWhiteSpace(layer.ID))
         layer.ID = value;
 }
开发者ID:Esri,项目名称:arcgis-viewer-silverlight,代码行数:15,代码来源:MapApplication.cs

示例13: SetPopupDataTemplates

        /// <summary>
        /// Sets the XAML data templates used to display the contents of a layer's popups.
        /// </summary>
        /// <param name="obj">The layer to specify templates for</param>
        /// <param name="value">Dictionary with integer keys and string values.  Integer keys are layer ids: -1 for a GraphicLayer, otherwise Layer ID.
        /// String values are XAML data template strings on which XamlReader.Load can be called to create a DataTemplate.</param>
        public static void SetPopupDataTemplates(Layer obj, IDictionary<int, string> value)
		{
			if (obj != null)
				obj.SetValue(PopupDataTemplatesProperty, value);
		}
开发者ID:konglingjie,项目名称:arcgis-viewer-silverlight,代码行数:11,代码来源:LayerProperties.cs

示例14: PerformPostLayerInitializationActions

        private void PerformPostLayerInitializationActions(Layer layer, bool initializationSuccess)
        {
            GraphicsLayer gLayer = layer as GraphicsLayer;
            if (gLayer != null)
            {
                GeometryType geometryType = Core.LayerExtensions.GetGeometryType(gLayer);
                Collection<FieldInfo> layerFields = Core.LayerExtensions.GetFields(gLayer);
                FeatureLayer featureLayer = layer as FeatureLayer;
                if (layerFields.Count == 0 &&
                    featureLayer != null && featureLayer.LayerInfo != null && featureLayer.LayerInfo.Fields != null)
                {
                    foreach (ESRI.ArcGIS.Client.Field field in featureLayer.LayerInfo.Fields)
                    {
                        if (FieldHelper.IsFieldFilteredOut(field.Type))
                            continue;
                        ESRI.ArcGIS.Mapping.Core.FieldInfo fieldInfo = ESRI.ArcGIS.Mapping.Core.FieldInfo.FieldInfoFromField(featureLayer, field);
                        layerFields.Add(fieldInfo);
                    }
                }
                if (gLayer.Graphics != null)
                {
                    #region Get geometry type, start getting symbology
                    if (geometryType == GeometryType.Unknown && gLayer.Graphics.Count > 0)
                    {
                        geometryType = LayerUtils.GetGeometryTypeFromGraphic(gLayer.Graphics.ElementAtOrDefault(0));
                        Core.LayerExtensions.SetGeometryType(gLayer, geometryType);

                        if ((gLayer.Renderer == null || gLayer.Renderer is HiddenRenderer) && !Symbology.DefaultSymbols.ContainsKey(geometryType))
                        {
                            if (geometryType == GeometryType.Unknown)
                            {
                                gLayer.SetValue(ESRI.ArcGIS.Client.Extensibility.LayerExtensions.ErrorMessageProperty, "Layer has unspecified geometry type.");
                            }
                            else
                            {
                                Core.LayerExtensions.SetRunLayerPostInitializationActions(gLayer, true);
                                SymbolConfigProvider.GetDefaultLinearGradientBrush(gLayer, ColorRampType.ClassBreaks);
                            }
                            return;
                        }
                    }
                    #endregion

                    #region Project graphics if necessary
                    if (graphicsRequireReprojection(gLayer.Graphics))
                    {
                        GeometryServiceOperationHelper helper = new GeometryServiceOperationHelper(
                             new ConfigurationStoreHelper().GetGeometryServiceUrl(ConfigurationStore)
                            );
                        helper.ProjectGraphicsCompleted += (sender, args) =>
                        {
                            GraphicsLayer targetLayer = args.UserState as GraphicsLayer;
                            if (targetLayer != null)
                            {
                                targetLayer.Graphics.Clear();
                                foreach (Graphic graphic in args.Graphics)
                                    targetLayer.Graphics.Add(graphic);
                            }
                        };
                        helper.ProjectGraphics(gLayer.Graphics, Map.SpatialReference, gLayer);
                    }
                    #endregion

                    #region Get field information
                    if (layerFields.Count == 0) // fields not determined yet
                    {
                        determineFieldsFromGraphic(layerFields, gLayer.Graphics.ElementAtOrDefault(0));
                    }
                    #endregion
                }

                #region Get renderer from feature layer's layer info, if necessary
                if (gLayer.Renderer == null || gLayer.Renderer is HiddenRenderer)
                {
                    FeatureLayer lay = gLayer as FeatureLayer;
                    if (lay != null && lay.LayerInfo != null && lay.LayerInfo.Renderer != null)
                    {
                        lay.Renderer = lay.LayerInfo.Renderer;
                    }
                }
                #endregion

                #region Change PictureMarkerSymbol to ImageFillSymbol
                if (gLayer.Renderer != null && (geometryType == GeometryType.Point || geometryType == GeometryType.MultiPoint))
                {
                    SimpleRenderer sr = gLayer.Renderer as SimpleRenderer;
                    ESRI.ArcGIS.Client.FeatureService.Symbols.PictureMarkerSymbol pms = null;
                    if (sr != null)
                    {
                        pms = sr.Symbol as ESRI.ArcGIS.Client.FeatureService.Symbols.PictureMarkerSymbol;
                        if (pms != null)
                            sr.Symbol = SymbolJsonHelper.ToImageFillSymbol(pms);
                    }
                    else
                    {
                        ClassBreaksRenderer cbr = gLayer.Renderer as ClassBreaksRenderer;
                        if (cbr != null)
                        {
                            foreach (ClassBreakInfo info in cbr.Classes)
                            {
//.........这里部分代码省略.........
开发者ID:yulifengwx,项目名称:arcgis-viewer-silverlight,代码行数:101,代码来源:View_SymbologyLogic.cs

示例15: setLayerProps

        private static void setLayerProps(ParameterConfig config, Layer layer)
        {
            string layerTitle = null;

            FeatureLayerParameterConfig flConfig = config as FeatureLayerParameterConfig;
            if (flConfig != null)
            {
                layerTitle = flConfig.LayerName;
                layer.Opacity = flConfig.Opacity;
            }

            MapServiceLayerParameterConfig mapServiceLayerConfig = config as MapServiceLayerParameterConfig;
            if (mapServiceLayerConfig != null)
            {
                layerTitle = mapServiceLayerConfig.LayerName;
                layer.Opacity = mapServiceLayerConfig.Opacity;
                if (mapServiceLayerConfig.LayerInfos != null)
                    ESRI.ArcGIS.Mapping.Core.LayerExtensions.SetGPResultMapServerLayerInfos(layer, mapServiceLayerConfig.LayerInfos);
            }

            if (string.IsNullOrEmpty(layerTitle))
                layerTitle = string.IsNullOrEmpty(config.Label) ? config.Name : config.Label;

            layer.ID = Guid.NewGuid().ToString("N");
            layer.SetValue(MapApplication.LayerNameProperty, layerTitle);
        }
开发者ID:konglingjie,项目名称:arcgis-viewer-silverlight,代码行数:26,代码来源:GPResultWidget.cs


注:本文中的Layer.SetValue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。