示例#1
0
        public double GetMaxValue()
        {
            double num = 0.0;

            try
            {
                IRendererFields fields = this.ichartRenderer_0 as IRendererFields;
                for (int i = 0; i < fields.FieldCount; i++)
                {
                    if (i == 0)
                    {
                        num = this.method_6(fields.get_Field(i));
                    }
                    else
                    {
                        double num3 = this.method_6(fields.get_Field(i));
                        num = (num < num3) ? num3 : num;
                    }
                }
            }
            catch (Exception exception)
            {
                MessageBox.Show(exception.ToString());
            }
            return(num);
        }
示例#2
0
        public void InitRendererObject(List <FieldInfo> pFields, IFeatureRenderer pRenderer, esriSymbologyStyleClass _SymbologyStyleClass)
        {
            listAddField.Items.Clear();
            flag = true;
            m_SymbologyStyleClass = _SymbologyStyleClass;

            if (!(pRenderer is IChartRenderer))//ÅжÏÊÇ·ñÊÇͼ±íäÖȾ
            {
                return;
            }
            IChartRenderer pChartRenderer = pRenderer as IChartRenderer;

            if (pChartRenderer.ColorScheme != "")//ÑÕÉ«·½°¸
            {
                cmbColorRamp.Text = pChartRenderer.ColorScheme;
            }

            if (pChartRenderer.BaseSymbol != null)//±³¾°
            {
                labelPreviewBack.Tag = pChartRenderer.BaseSymbol;
            }
            else
            {
                labelPreviewBack.Tag = ModuleCommon.CreateSymbol(m_SymbologyStyleClass);
            }
            labelPreviewBack.Image = ModuleCommon.Symbol2Picture(labelPreviewBack.Tag as ISymbol, ModuleCommon.ImageWidth, ModuleCommon.ImageHeight);
            if (pChartRenderer.UseOverposter)//·ÀÖ¹¸²¸Ç
            {
                chkIsUnOverlap.Checked = true;
            }
            else
            {
                chkIsUnOverlap.Checked = false;
            }
            //IChartSymbol pCS = pChartRenderer.ChartSymbol;
            //sizeInput.Value = pCS.MaxValue;//´óС
            IMarkerSymbol pMS = pChartRenderer.ChartSymbol as IMarkerSymbol;

            sizeInput.Value = pMS.Size;                                        //´óС
            IRendererFields pRenderFields = pChartRenderer as IRendererFields; //×Ö¶Î
            ISymbolArray    pSymbolArray  = pChartRenderer.ChartSymbol as ISymbolArray;

            listAddField.SmallImageList.Images.Clear();
            List <string> fdLst = new List <string>();//¼Ç¼äÖȾ¶ÔÏóÒÑÓÃ×Ö¶Î

            for (int i = 0; i < pRenderFields.FieldCount; i++)
            {
                listAddField.SmallImageList.Images.Add("Symbol" + i.ToString(), ModuleCommon.Symbol2Picture(pSymbolArray.get_Symbol(i), ModuleCommon.ImageWidth, ModuleCommon.ImageHeight));
                System.Windows.Forms.ListViewItem item = new System.Windows.Forms.ListViewItem();
                item.Name     = "Item" + i;
                item.Text     = "";
                item.ImageKey = "Symbol" + i.ToString();
                item.Tag      = pSymbolArray.get_Symbol(i);
                System.Windows.Forms.ListViewItem.ListViewSubItem subItem = new System.Windows.Forms.ListViewItem.ListViewSubItem();
                subItem.Text = pRenderFields.get_Field(i);
                item.SubItems.Add(subItem);
                listAddField.Items.Add(item);
                fdLst.Add(pRenderFields.get_Field(i));
            }
            if (listAddField.SmallImageList.Images.Count >= 0)
            {
                selnum   = pFields.Count;
                pSymbols = CreateSymbols(selnum);
                int ii = 0;
                foreach (FieldInfo fi in pFields)
                {
                    listAddField.SmallImageList.Images.Add("Symbol" + ii.ToString(), ModuleCommon.Symbol2Picture(pSymbols[ii], ModuleCommon.ImageWidth, ModuleCommon.ImageHeight));
                    ii++;
                }
            }
            foreach (FieldInfo fi in pFields)
            {
                if (fi.FieldName != "<NONE>" && !fdLst.Contains(fi.FieldName))
                {
                    listAllField.Items.Add(fi.FieldName);
                }
            }
            flag = false;
        }
示例#3
0
        private void method_0()
        {
            IFields fields2;
            int     num;

            this.FieldsListBoxCtrl.Items.Clear();
            this.SelectFieldslistView.Items.Clear();
            IRendererFields fields = this.idotDensityRenderer_0 as IRendererFields;

            if (this.igeoFeatureLayer_0 is IDisplayTable)
            {
                fields2 = (this.igeoFeatureLayer_0 as IDisplayTable).DisplayTable.Fields;
            }
            else
            {
                fields2 = this.igeoFeatureLayer_0.FeatureClass.Fields;
            }
            this.colorRampComboBox1.Text = this.idotDensityRenderer_0.ColorScheme;
            if (this.colorRampComboBox1.Items.Count == 0)
            {
                this.ienumColors_0 = this.method_1(null, fields2.FieldCount);
            }
            else
            {
                this.ienumColors_0 = this.method_1(this.colorRampComboBox1.GetSelectColorRamp(), fields2.FieldCount);
            }
            bool flag = false;

            for (num = 0; num < fields2.FieldCount; num++)
            {
                IField        field = fields2.get_Field(num);
                esriFieldType type  = field.Type;
                if ((((type != esriFieldType.esriFieldTypeDouble) && (type != esriFieldType.esriFieldTypeInteger)) &&
                     (type != esriFieldType.esriFieldTypeSingle)) && (type != esriFieldType.esriFieldTypeSmallInteger))
                {
                    continue;
                }
                flag = true;
                string str = field.Name.ToUpper();
                for (int i = 0; i < fields.FieldCount; i++)
                {
                    if (str == fields.get_Field(i).ToUpper())
                    {
                        goto Label_0145;
                    }
                }
                goto Label_0147;
Label_0145:
                flag = false;
Label_0147:
                if (flag)
                {
                    this.FieldsListBoxCtrl.Items.Add(new FieldWrap(field));
                }
            }
            double[]     numArray         = new double[fields.FieldCount];
            double[]     numArray2        = new double[fields.FieldCount];
            double[]     numArray3        = new double[fields.FieldCount];
            string[]     strArray         = new string[2];
            ISymbolArray dotDensitySymbol = this.idotDensityRenderer_0.DotDensitySymbol as ISymbolArray;

            for (num = 0; num < fields.FieldCount; num++)
            {
                double num3;
                double num4;
                double num5;
                strArray[0] = "";
                strArray[1] = fields.get_FieldAlias(num);
                ListViewItemEx ex = new ListViewItemEx(strArray)
                {
                    Style = dotDensitySymbol.get_Symbol(num),
                    Tag   = new FieldWrap(fields2.get_Field(fields2.FindField(fields.get_Field(num))))
                };
                this.SelectFieldslistView.Add(ex);
                this.GetStaticsValue(fields.get_Field(num), out num3, out num4, out num5);
                numArray[num]  = num3;
                numArray3[num] = num4;
                numArray2[num] = num5;
            }
            if (fields.FieldCount > 0)
            {
                this.btnUnSelectAll.Enabled = true;
            }
            this.txtSize.Text       = this.idotDensityRenderer_0.DotDensitySymbol.DotSize.ToString();
            this.txtPointValue.Text = this.idotDensityRenderer_0.DotValue.ToString();
            double num7 = double.Parse(this.txtPointValue.Text);
            IDotDensityFillSymbol symbol =
                (this.idotDensityRenderer_0.DotDensitySymbol as IClone).Clone() as IDotDensityFillSymbol;
            IDotDensityFillSymbol symbol2 =
                (this.idotDensityRenderer_0.DotDensitySymbol as IClone).Clone() as IDotDensityFillSymbol;
            IDotDensityFillSymbol symbol3 =
                (this.idotDensityRenderer_0.DotDensitySymbol as IClone).Clone() as IDotDensityFillSymbol;

            this.MinsymbolItem.Symbol  = symbol;
            this.MeansymbolItem.Symbol = symbol2;
            this.MaxsymbolItem.Symbol  = symbol3;
            for (num = 0; num < (symbol as ISymbolArray).SymbolCount; num++)
            {
                symbol.set_DotCount(num, (int)(numArray[num] / num7));
                symbol2.set_DotCount(num, (int)(numArray3[num] / num7));
                symbol3.set_DotCount(num, (int)(numArray2[num] / num7));
            }
            this.MinsymbolItem.Invalidate();
            this.MeansymbolItem.Invalidate();
            this.MaxsymbolItem.Invalidate();
        }
示例#4
0
        private void method_2()
        {
            IFields fields2;
            int     num;

            this.FieldsListBoxCtrl.Items.Clear();
            this.SelectFieldslistView.Items.Clear();
            IRendererFields fields = this.ichartRenderer_0 as IRendererFields;

            if (this.igeoFeatureLayer_0 is IDisplayTable)
            {
                fields2 = (this.igeoFeatureLayer_0 as IDisplayTable).DisplayTable.Fields;
            }
            else
            {
                fields2 = this.igeoFeatureLayer_0.FeatureClass.Fields;
            }
            this.colorRampComboBox1.Text = this.ichartRenderer_0.ColorScheme;
            if (this.colorRampComboBox1.Items.Count == 0)
            {
                this.ienumColors_0 = this.method_1(null, fields2.FieldCount);
            }
            else
            {
                this.ienumColors_0 = this.method_1(this.colorRampComboBox1.GetSelectColorRamp(), fields2.FieldCount);
            }
            bool flag = false;

            for (num = 0; num < fields2.FieldCount; num++)
            {
                IField        field = fields2.get_Field(num);
                esriFieldType type  = field.Type;
                if ((((type != esriFieldType.esriFieldTypeDouble) && (type != esriFieldType.esriFieldTypeInteger)) &&
                     (type != esriFieldType.esriFieldTypeSingle)) && (type != esriFieldType.esriFieldTypeSmallInteger))
                {
                    continue;
                }
                flag = true;
                string str = field.Name.ToUpper();
                for (int i = 0; i < fields.FieldCount; i++)
                {
                    if (str == fields.get_Field(i).ToUpper())
                    {
                        goto Label_0145;
                    }
                }
                goto Label_0147;
Label_0145:
                flag = false;
Label_0147:
                if (flag)
                {
                    this.FieldsListBoxCtrl.Items.Add(new FieldWrap(field));
                }
            }
            string[]     strArray    = new string[2];
            ISymbolArray chartSymbol = this.ichartRenderer_0.ChartSymbol as ISymbolArray;

            for (num = 0; num < fields.FieldCount; num++)
            {
                strArray[0] = "";
                strArray[1] = fields.get_FieldAlias(num);
                ListViewItemEx ex = new ListViewItemEx(strArray)
                {
                    Style = chartSymbol.get_Symbol(num),
                    Tag   = new FieldWrap(fields2.get_Field(fields2.FindField(fields.get_Field(num))))
                };
                this.SelectFieldslistView.Add(ex);
            }
            if ((this.igeoFeatureLayer_0.FeatureClass.ShapeType == esriGeometryType.esriGeometryPoint) ||
                (this.igeoFeatureLayer_0.FeatureClass.ShapeType == esriGeometryType.esriGeometryMultipoint))
            {
                this.lblBackground.Visible = false;
                this.btnStyle.Visible      = false;
            }
            else
            {
                this.lblBackground.Visible = true;
                this.btnStyle.Visible      = true;
            }
            if (this.ichartRenderer_0.BaseSymbol == null)
            {
                this.ichartRenderer_0.BaseSymbol = this.method_8(this.igeoFeatureLayer_0.FeatureClass.ShapeType);
            }
            this.btnStyle.Style        = this.ichartRenderer_0.BaseSymbol;
            this.chkOverposter.Checked = this.ichartRenderer_0.UseOverposter;
        }