${iServer6_SetLayerStatusParameter_Title}

${iServer6_SetLayerStatusParameter_Description}

        private void isVisible_Click(object sender , RoutedEventArgs e)
        {
            SetLayerStatusParameters parameters = new SetLayerStatusParameters
            {
                HoldTime = 30 ,
                LayerStatusList = layersStatus ,
                ResourceID = tempLayerID
            };

            SetLayerStatusService setLayersStatus = new SetLayerStatusService(url);
            setLayersStatus.ProcessAsync(parameters);
            setLayersStatus.ProcessCompleted += new EventHandler<SetLayerEventArgs>(setLayersStatus_ProcessCompleted);
            setLayersStatus.Failed += new EventHandler<SuperMap.Web.Service.ServiceFailedEventArgs>(setLayersStatus_Failed);
        }
        internal static string ToJson(SetLayerStatusParameters parameters)
        {
            string json = "{";
            var list = new List<string>();
            foreach (var item in parameters.LayerStatusList)
            {
                list.Add(LayerStatus.ToJson(item));
            }

            json += string.Format("\"layers\":[{0}]", string.Join(",", list.ToArray()));
            json += "}";

            return json;
        }
        /// <summary>${iServer6_SetLayerStatusService_method_processAsync_D}</summary>
        /// <param name="parameters">${iServer6_SetLayerStatusService_method_processAsync_param_parameters}</param>
        /// <param name="state">${iServer6_SetLayerStatusService_method_processAsync_param_state}</param>
        public void ProcessAsync(SetLayerStatusParameters parameters, object state)
        {
            mapUrl = base.Url;

            requestParameters = parameters;
            ValidationUrlAndParametres();
            resourceID = requestParameters.ResourceID;
            GetMapName();

            if (!string.IsNullOrEmpty(resourceID))//直接put
            {
                base.SubmitRequest(GetPutRequestUrl(), GetDictionaryParameters(), new EventHandler<RequestEventArgs>(SetLayerStatusRequest_Complated), state, true, false, true);
            }
            else   //先post再put
            {
                string getTempLayerSetUrl = Url;
                getTempLayerSetUrl += "/tempLayersSet.json";
                WebClient temp = new WebClient();
                temp.Encoding = Encoding.UTF8;
                temp.Headers["Content-Type"] = "application/x-www-form-urlencoded;charset=UTF-8";
                temp.UploadStringCompleted += new UploadStringCompletedEventHandler(PostRequest_Complated);
                temp.UploadStringAsync(new Uri(getTempLayerSetUrl), "POST", "", state);
            }
        }
 /// <summary>${iServer6_SetLayerStatusService_method_processAsync_D}</summary>
 /// <overloads>${iServer6_SetLayerStatusService_method_processAsync_overloads}</overloads>
 public void ProcessAsync(SetLayerStatusParameters parameters)
 {
     ProcessAsync(parameters, null);
 }
        private void SetLayerStatus_Click(object sender, RoutedEventArgs e)
        {
            SetLayerStatusService layerStatusService = new SetLayerStatusService(url);

            SetLayerStatusParameters parameters = new SetLayerStatusParameters
            {
                LayerStatusList = new List<LayerStatus>
                 {
                      new LayerStatus{
                           IsVisible=false,
                            LayerName="ContinentLabel@World"
                      },
                      new LayerStatus{
                           IsVisible=false,
                            LayerName="OceanLabel@World"
                      },
                      new LayerStatus
                      {
                          IsVisible=false,
                          LayerName="标签专题图#2"
                      },
                      new LayerStatus
                      {
                          IsVisible=false,
                          LayerName="Ocean@World"
                      },
                      new LayerStatus
                      {
                          IsVisible=false,
                          LayerName="Capitals@World"
                      },
                      new LayerStatus
                      {
                          IsVisible=false,
                          LayerName="Grids@World"
                      },
                      new LayerStatus
                      {
                          IsVisible=false,
                          LayerName="单值专题图"
                      },
                 },
                ResourceID = "3"
            };

            layerStatusService.ProcessAsync(parameters);
            layerStatusService.ProcessCompleted += new EventHandler<SetLayerEventArgs>(layerStatusService_ProcessCompleted);
            layerStatusService.Failed += new EventHandler<ServiceFailedEventArgs>(layerStatusService_Failed);
        }