예제 #1
0
        private void method_3()
        {
            string name = "";
            esriDataNormalization esriNormalizeByNothing = esriDataNormalization.esriNormalizeByNothing;

            if (this.cboNormFields.SelectedIndex == 0)
            {
                esriNormalizeByNothing = esriDataNormalization.esriNormalizeByNothing;
            }
            else if (this.cboNormFields.SelectedIndex == 1)
            {
                esriNormalizeByNothing = esriDataNormalization.esriNormalizeByLog;
            }
            else if (this.cboNormFields.SelectedIndex == 2)
            {
                esriNormalizeByNothing = esriDataNormalization.esriNormalizeByPercentOfTotal;
            }
            else if (this.cboNormFields.SelectedIndex > 2)
            {
                name = (this.cboNormFields.SelectedItem as FieldWrap).Name;
                esriNormalizeByNothing = esriDataNormalization.esriNormalizeByField;
            }
            this.method_5(this.icolorRamp_0, this.iclassBreaksRenderer_0, this.cboClassifyNum.SelectedIndex + 1,
                          this.method_4(), (this.cboValueFields.SelectedItem as FieldWrap).Name, name, esriNormalizeByNothing);
            this.listView1.Items.Clear();
            string[] strArray = new string[3];
            int      index    = 0;

            while (true)
            {
                if (index >= this.iclassBreaksRenderer_0.BreakCount)
                {
                    break;
                }
                strArray[0] = "";
                strArray[1] = (this.iclassBreaksRenderer_0 as IClassBreaksUIProperties).get_LowBreak(index).ToString() +
                              " - " + this.iclassBreaksRenderer_0.get_Break(index).ToString();
                strArray[2] = this.iclassBreaksRenderer_0.get_Label(index);
                ListViewItemEx ex = new ListViewItemEx(strArray);
                try
                {
                    ex.Style = this.iclassBreaksRenderer_0.get_Symbol(index);
                }
                catch (Exception exception)
                {
                    Logger.Current.Error("", exception, "");
                }
                this.listView1.Add(ex);
                index++;
            }
            this.cboClassifyNum.SelectedIndex = this.iclassBreaksRenderer_0.BreakCount - 1;
        }
예제 #2
0
        private void method_5(IColorRamp icolorRamp_1, IClassBreaksRenderer iclassBreaksRenderer_1, int int_0,
                              ITable itable_0, string string_0, string string_1, esriDataNormalization esriDataNormalization_0)
        {
            try
            {
                esriGeometryType esriGeometryAny = esriGeometryType.esriGeometryAny;
                if (this.igeoFeatureLayer_0.FeatureClass != null)
                {
                    esriGeometryAny = this.igeoFeatureLayer_0.FeatureClass.ShapeType;
                }
                IClassify classify =
                    this.method_2((iclassBreaksRenderer_1 as IClassBreaksUIProperties).Method) as IClassify;
                if (classify != null)
                {
                    object          obj2;
                    object          obj3;
                    bool            flag;
                    ITableHistogram histogram = new BasicTableHistogramClass
                    {
                        Field     = string_0,
                        Table     = itable_0,
                        NormField = string_1
                    };
                    (histogram as IDataNormalization).NormalizationType = esriDataNormalization_0;
                    (histogram as IBasicHistogram).GetHistogram(out obj2, out obj3);
                    if (classify is IClassifyMinMax2)
                    {
                        double minimum = (histogram as IStatisticsResults).Minimum;
                        double maximum = (histogram as IStatisticsResults).Maximum;
                        (classify as IClassifyMinMax2).ClassifyMinMax(minimum, maximum, ref int_0);
                    }
                    else if (classify is IDeviationInterval)
                    {
                        (classify as IDeviationInterval).Mean        = (histogram as IStatisticsResults).Mean;
                        (classify as IDeviationInterval).StandardDev =
                            (histogram as IStatisticsResults).StandardDeviation;
                        (classify as IDeviationInterval).DeviationInterval = 0.5;
                        classify.Classify(ref int_0);
                    }
                    else
                    {
                        (classify as IClassifyGEN).Classify(obj2, obj3, ref int_0);
                    }
                    iclassBreaksRenderer_1.BreakCount = int_0;
                    this.bool_0 = false;
                    this.cboClassifyNum.SelectedIndex = int_0 - 1;
                    this.bool_0 = true;
                    double[] classBreaks = (double[])classify.ClassBreaks;
                    if (classBreaks.Length == 0)
                    {
                        icolorRamp_1.Size = 5;
                    }
                    else
                    {
                        icolorRamp_1.Size = classBreaks.Length;
                    }
                    icolorRamp_1.CreateRamp(out flag);
                    IEnumColors colors = icolorRamp_1.Colors;
                    ISymbol     sym    = null;
                    for (int i = 0; i < (classBreaks.Length - 1); i++)
                    {
                        IColor color = colors.Next();
                        switch (esriGeometryAny)
                        {
                        case esriGeometryType.esriGeometryLine:
                        case esriGeometryType.esriGeometryPolyline:
                        {
                            ILineSymbol symbol2 = new SimpleLineSymbolClass
                            {
                                Color = color
                            };
                            sym = symbol2 as ISymbol;
                            break;
                        }

                        case esriGeometryType.esriGeometryPolygon:
                        {
                            ISimpleFillSymbol symbol3 = new SimpleFillSymbolClass
                            {
                                Color = color,
                                Style = esriSimpleFillStyle.esriSFSSolid
                            };
                            sym = symbol3 as ISymbol;
                            break;
                        }

                        case esriGeometryType.esriGeometryPoint:
                        case esriGeometryType.esriGeometryMultipoint:
                        {
                            IMarkerSymbol symbol4 = new SimpleMarkerSymbolClass
                            {
                                Color = color
                            };
                            sym = symbol4 as ISymbol;
                            break;
                        }
                        }
                        iclassBreaksRenderer_1.set_Symbol(i, sym);
                        (iclassBreaksRenderer_1 as IClassBreaksUIProperties).set_LowBreak(i, classBreaks[i]);
                        iclassBreaksRenderer_1.set_Break(i, classBreaks[i + 1]);
                        string label = classBreaks[i].ToString() + " - " + classBreaks[i + 1].ToString();
                        iclassBreaksRenderer_1.set_Label(i, label);
                    }
                }
            }
            catch (Exception exception)
            {
                Logger.Current.Error("", exception, "");
            }
        }