${iServer2_Theme_ThemeParameters_Title}

${iServer2_Theme_ThemeParameters_Description}

Inheritance: ParametersBase
        //制作等级符号专题图
        private void commit_Click(object sender, RoutedEventArgs e)
        {
            ThemeGraduatedSymbol theme = new ThemeGraduatedSymbol()
            {
                Expression = "Pop_1994",
                BaseValue = 112813968.00000,
                PositiveStyle = new ServerStyle()
                {
                    MarkerSize = 5,
                    FillSymbolID = 1,
                    LineColor = new ServerColor
                    {
                        Red = 0,
                        Green = 255,
                        Blue = 0
                    }
                }
            };
            ThemeParameters parameters = new ThemeParameters
            {
                MapName = "World",
                LayerName = "World@world",
                Theme = theme
            };

            //与服务器交互
            ThemeService themeService = new ThemeService("http://localhost:7080/demo");
            themeService.ProcessAsync(parameters);
            themeService.Failed += new EventHandler<ServiceFailedEventArgs>(themeService_Failed);
            themeService.ProcessCompleted += new EventHandler<ThemeEventArgs>(themeService_ProcessCompleted);
        }
        //制作范围分段专题图
        private void commit_Click(object sender, RoutedEventArgs e)
        {
            ThemeRange themerange = new ThemeRange
            {
                RangeExpression = "Pop_1994",
                MakeDefaultParam = new ThemeRangeParam
                {
                    LayerName = "World@world",
                    ColorGradientType = ColorGradientType.RainBow,
                    RangeMode = RangeMode.Equalinterval,
                    RangeParameter = 5
                },
            };

            ThemeParameters parameters = new ThemeParameters
            {
                MapName = "World",
                LayerName = "World@world" ,
                Theme = themerange
            };

            //与服务器交互
            ThemeService themeService = new ThemeService("http://localhost:7080/demo");
            themeService.ProcessAsync(parameters);
            themeService.Failed += new EventHandler<ServiceFailedEventArgs>(themeService_Failed);
            themeService.ProcessCompleted += new EventHandler<ThemeEventArgs>(themeService_ProcessCompleted);
        }
        //制作标签专题图
        private void commit_Click(object sender, RoutedEventArgs e)
        {
            Themelabel theme = new Themelabel()
            {
                LabelExpression = "Country",
                UniformStyle = new ServerTextStyle()
                {
                    Color = new ServerColor(228, 111, 12)
                },
                LabelBackShape = LabelBackShape.Roundrect,
                BackStyle = new ServerStyle
                {
                    FillForeColor = new ServerColor { Red = 167, Green = 226, Blue = 197 },
                },
            };

            ThemeParameters parameters = new ThemeParameters
            {
                MapName = "World",
                LayerName = "World@world" ,
                Theme = theme,
            };

            ThemeService themeService = new ThemeService("http://localhost:7080/demo");
            themeService.ProcessAsync(parameters);
            themeService.Failed += new EventHandler<ServiceFailedEventArgs>(themeService_Failed);
            themeService.ProcessCompleted += new EventHandler<ThemeEventArgs>(themeService_ProcessCompleted);
        }
        //制作点密度专题图
        private void commit_Click(object sender, RoutedEventArgs e)
        {
            //如果字段表达式为空则用下拉列表中选择字段来制作单值专题图
            ThemeDotDensity theme = new ThemeDotDensity()
            {
                DotExpression = "Pop_1994",
                Value = 11281396.89000,
                Style = new ServerStyle()
                {
                    MarkerSize = 3,
                    LineColor = new ServerColor { Blue = 0, Green = 255, Red = 0 }
                }
            };

            ThemeParameters parameters = new ThemeParameters
            {
                MapName = "World",
                LayerName = "World@world" ,
                Theme = theme,
            };

            //与服务器交互
            ThemeService themeService = new ThemeService("http://localhost:7080/demo");
            themeService.ProcessAsync(parameters);
            themeService.Failed += new EventHandler<ServiceFailedEventArgs>(themeService_Failed);
            themeService.ProcessCompleted += new EventHandler<ThemeEventArgs>(themeService_ProcessCompleted);
        }
        //制作统计专题图
        private void commit_Click(object sender, RoutedEventArgs e)
        {
            //设置了二个子项
            ThemeGraphItem item1 = new ThemeGraphItem()
            {
                Caption = "面积",
                GraphExpression = "SmArea",
                UniformStyle = new ServerStyle() { FillForeColor = new ServerColor(255, 209, 173) },
            };

            ThemeGraphItem item2 = new ThemeGraphItem()
            {
                Caption = "人口",
                GraphExpression = "Pop_1994",
                UniformStyle = new ServerStyle() { FillForeColor = new ServerColor(233, 150, 127) },
            };

            SuperMap.Web.iServerJava2.ThemeGraph themeGraph = new SuperMap.Web.iServerJava2.ThemeGraph()
            {
                Items = new List<ThemeGraphItem>() { item1, item2 },
                AxesColor = new ServerColor(255, 0, 0),
                GraduatedMode = GraduatedMode.Constant,
                GraphTextFormat = GraphTextFormat.Caption,
                GraphType = GraphType.Bar3D,
                IsGraphTextDisplayed = true,
                IsFlowEnabled = false,
                IsLeaderLineDisplayed = true,
                LeaderLineStyle = new ServerStyle
                {
                    LineColor = new ServerColor { Red = 0, Green = 255, Blue = 0 }
                },
            };

            ThemeParameters parameters = new ThemeParameters()
             {
                 LayerName = "World@world",
                 MapName = "World",
                 Theme = themeGraph,
             };

            //与服务器交互
            ThemeService themeService = new ThemeService(url) { DisableClientCaching = true };
            themeService.ProcessAsync(parameters);
            themeService.ProcessCompleted += new EventHandler<ThemeEventArgs>(themeService_ProcessCompleted);
            themeService.Failed += new EventHandler<ServiceFailedEventArgs>(themeService_Failed);
        }
        /// <summary>${iServer2_Theme_ThemeService_method_ProcessAsync_D}</summary>
        /// <param name="parameters">${iServer2_Theme_ThemeService_method_ProcessAsync_param_parameters}</param>
        /// <param name="state">${iServer2_Theme_ThemeService_method_ProcessAsync_param_state}</param>
        public void ProcessAsync(ThemeParameters parameters, object state)
        {
            if (parameters == null)
            {
                //TODO:资源
                //throw new ArgumentNullException("ThemeParameters is Null");
                throw new ArgumentNullException(SuperMap.Web.iServerJava2.Resources.ExceptionStrings.ArgumentIsNull);
            }
            if (string.IsNullOrEmpty(base.Url))
            {
                //TODO:资源
                //throw new InvalidOperationException("Url is not set");
                throw new InvalidOperationException(SuperMap.Web.iServerJava2.Resources.ExceptionStrings.InvalidUrl);
            }
            if (!base.Url.EndsWith("/"))
            {
                base.Url += '/';
            }

            base.SubmitRequest(base.Url + "commonhandler?", GetParameters(parameters),
                new EventHandler<RequestEventArgs>(request_Completed), state, false);
        }
        //制作单值专题图
        private void commit_Click(object sender, RoutedEventArgs e)
        {
            ThemeParameters themeparameters = new ThemeParameters
            {
                MapName = "World",
                LayerName = "World@world",
                Theme = new SuperMap.Web.iServerJava2.ThemeUnique
                {
                    UniqueExpression = "SmID",
                    MakeDefaultParam = new ThemeUniqueParam
                    {
                        LayerName = "World@world",
                        ColorGradientType = ColorGradientType.RainBow
                    },

                }
            };

            //与服务器交互
            ThemeService themeService = new ThemeService("http://localhost:7080/demo");
            themeService.ProcessAsync(themeparameters);
            themeService.Failed += new EventHandler<ServiceFailedEventArgs>(themeService_Failed);
            themeService.ProcessCompleted += new EventHandler<ThemeEventArgs>(themeService_ProcessCompleted);
        }
 /// <overloads>${iServer2_Theme_ThemeService_method_ProcessAsync_overloads_D}</overloads>
 /// <summary>${iServer2_Theme_ThemeService_method_ProcessAsync_D}</summary>
 /// <param name="parameters">${iServer2_Theme_ThemeService_method_ProcessAsync_param_parameters}</param>
 public void ProcessAsync(ThemeParameters parameters)
 {
     ProcessAsync(parameters, null);
 }
        private Dictionary<string, string> GetParameters(ThemeParameters parameters)
        {
            Dictionary<string, string> dictionary = new Dictionary<string, string>();

            string method = "addTheme";

            if (parameters.JoinItems != null && parameters.JoinItems.Count > 0)
            {
                method = "addthemebyjoinitem";
            }

            dictionary.Add("method", method);
            dictionary.Add("mapName", parameters.MapName);

            Dictionary<string, string> dict = new Dictionary<string, string>();
            dict.Add("mapName", parameters.MapName);
            dict.Add("layerName", parameters.LayerName);

            if (parameters.Theme is ThemeUnique)
            {
                dict.Add("theme", ThemeUnique.ToJson(((ThemeUnique)parameters.Theme)));
                dict.Add("themeType", "1");
            }
            else if (parameters.Theme is ThemeRange)
            {
                dict.Add("theme", ThemeRange.ToJson(((ThemeRange)parameters.Theme)));
                dict.Add("themeType", "2");
            }
            else if (parameters.Theme is ThemeGraph)
            {
                dict.Add("theme", ThemeGraph.ToJson(((ThemeGraph)parameters.Theme)));
                dict.Add("themeType", "3");
            }
            else if (parameters.Theme is ThemeGraduatedSymbol)
            {
                dict.Add("theme", ThemeGraduatedSymbol.ToJson((ThemeGraduatedSymbol)parameters.Theme));
                dict.Add("themeType", "4");
            }
            else if (parameters.Theme is ThemeDotDensity)
            {
                dict.Add("theme", ThemeDotDensity.ToJson((ThemeDotDensity)parameters.Theme));
                dict.Add("themeType", "5");
            }
            else if (parameters.Theme is Themelabel)
            {
                dict.Add("theme", Themelabel.ToJson((Themelabel)parameters.Theme));
                dict.Add("themeType", "7");
            }
            //else if (parameters.Theme is ThemeGridRange)
            //{
            //    dict.Add("theme", ThemeGridRange.ToJson(((ThemeGridRange)parameters.Theme)));
            //    dict.Add("themeType", "12");
            //}
            if (parameters.JoinItems != null && parameters.JoinItems.Count > 0)
            {
                List<string> temp = new List<string>();
                for (int i = 0; i < parameters.JoinItems.Count; i++)
                {
                    temp.Add(string.Format("{0}", JoinItem.ToJson(parameters.JoinItems[i])));
                }
                dict.Add("joinItems", string.Join(",", temp.ToArray()));
            }
            else
            {
                dict.Add("joinItems", "null");
            }

            dictionary.Add("params", Bridge.CreateParams(method, dict));

            return dictionary;
        }