private void btnMoveDown_Click(object sender, EventArgs e)
        {
            int            index = this.SelectFieldslistView.SelectedIndices[0];
            ListViewItemEx ex    = this.SelectFieldslistView.Items[index] as ListViewItemEx;

            this.SelectFieldslistView.Items.RemoveAt(index);
            if ((index + 1) == this.SelectFieldslistView.Items.Count)
            {
                this.SelectFieldslistView.Items.Add(ex);
            }
            else
            {
                this.SelectFieldslistView.Items.Insert(index + 1, ex);
            }
            ISymbolArray dotDensitySymbol = this.idotDensityRenderer_0.DotDensitySymbol as ISymbolArray;

            dotDensitySymbol.MoveSymbol(dotDensitySymbol.get_Symbol(index), index + 1);
            IRendererFields fields = this.idotDensityRenderer_0 as IRendererFields;

            fields.ClearFields();
            for (int i = 0; i < this.SelectFieldslistView.Items.Count; i++)
            {
                ex = this.SelectFieldslistView.Items[i] as ListViewItemEx;
                FieldWrap tag = ex.Tag as FieldWrap;
                fields.AddField(tag.Name, tag.ToString());
            }
        }
        private void btnUnSelect_Click(object sender, EventArgs e)
        {
            int          index = this.SelectFieldslistView.SelectedIndices[0];
            ListViewItem item  = this.SelectFieldslistView.SelectedItems[0];

            this.FieldsListBoxCtrl.Items.Add(item.Tag);
            ISymbolArray dotDensitySymbol = this.idotDensityRenderer_0.DotDensitySymbol as ISymbolArray;

            dotDensitySymbol.DeleteSymbol(dotDensitySymbol.get_Symbol(index));
            (this.idotDensityRenderer_0 as IRendererFields).DeleteField(item.Text);
            this.SelectFieldslistView.Items.RemoveAt(index);
            if (this.SelectFieldslistView.Items.Count == 0)
            {
                this.btnUnSelectAll.Enabled = false;
            }
        }
Beispiel #3
0
 private void colorRampComboBox1_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (this.bool_0)
     {
         IFields fields = this.igeoFeatureLayer_0.FeatureClass.Fields;
         this.ienumColors_0 = this.method_1(this.colorRampComboBox1.GetSelectColorRamp(), fields.FieldCount);
         this.ienumColors_0.Reset();
         this.ichartRenderer_0.ColorScheme = this.colorRampComboBox1.Text;
         ISymbolArray chartSymbol = this.ichartRenderer_0.ChartSymbol as ISymbolArray;
         for (int i = 0; i < chartSymbol.SymbolCount; i++)
         {
             IFillSymbol symbol = chartSymbol.get_Symbol(i) as IFillSymbol;
             symbol.Color = this.ienumColors_0.Next();
         }
         this.SelectFieldslistView.Invalidate();
     }
 }
Beispiel #4
0
        private void btnMoveUp_Click(object sender, EventArgs e)
        {
            int            index = this.SelectFieldslistView.SelectedIndices[0];
            ListViewItemEx item  = this.SelectFieldslistView.Items[index] as ListViewItemEx;

            this.SelectFieldslistView.Items.RemoveAt(index);
            this.SelectFieldslistView.Items.Insert(index - 1, item);
            ISymbolArray chartSymbol = this.ichartRenderer_0.ChartSymbol as ISymbolArray;

            chartSymbol.MoveSymbol(chartSymbol.get_Symbol(index), index - 1);
            IRendererFields fields = this.ichartRenderer_0 as IRendererFields;

            fields.ClearFields();
            for (int i = 0; i < this.SelectFieldslistView.Items.Count; i++)
            {
                item = this.SelectFieldslistView.Items[i] as ListViewItemEx;
                FieldWrap tag = item.Tag as FieldWrap;
                fields.AddField(tag.Name, tag.ToString());
            }
        }
Beispiel #5
0
 private void btnUnSelect_Click(object sender, EventArgs e)
 {
     try
     {
         int          index = this.SelectFieldslistView.SelectedIndices[0];
         ListViewItem item  = this.SelectFieldslistView.SelectedItems[0];
         this.FieldsListBoxCtrl.Items.Add(item.Tag);
         (this.ichartRenderer_0 as IRendererFields).DeleteField(item.SubItems[1].Text);
         ISymbolArray chartSymbol = this.ichartRenderer_0.ChartSymbol as ISymbolArray;
         chartSymbol.DeleteSymbol(chartSymbol.get_Symbol(index));
         this.SelectFieldslistView.Items.RemoveAt(index);
         if (this.SelectFieldslistView.Items.Count == 0)
         {
             this.btnUnSelectAll.Enabled = false;
         }
     }
     catch (Exception exception)
     {
         MessageBox.Show(exception.ToString());
     }
 }
        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;
        }
        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();
        }
Beispiel #8
0
        private static void AddSymbolNode(TreeNodeComLayer tnComLayer, object renderer)
        {
            int             index;
            LogicBaseTree   logicBT    = new LogicBaseTree();
            ImageCollection treeImages = logicBT.TreeList.StateImageList as ImageCollection;

            if (renderer is SimpleRenderer)
            {
                ISimpleRenderer simpleRenderer = (ISimpleRenderer)renderer;
                ISymbol         symbol         = simpleRenderer.Symbol;
                Image           img            = ConvertSymbolToImage.Convert(symbol, 16, 16);
                index = treeImages.Images.Add(img);
                //img.Save("d:\\" + index + ".JPG");

                string         label    = simpleRenderer.Label;
                TreeNodeSymbol tnSymbol = new TreeNodeSymbol()
                {
                    Name = label, CustomValue = symbol
                };
                tnSymbol.ImageIndex = index;
                tnComLayer.Add(tnSymbol);
            }
            else if (renderer is UniqueValueRenderer)
            {
                string renderLabel = "";
                IUniqueValueRenderer uniqueValueRenderer = renderer as IUniqueValueRenderer;
                for (int i = 0; i < uniqueValueRenderer.FieldCount - 1; i++)
                {
                    renderLabel += uniqueValueRenderer.get_Field(i) + " /";
                }
                renderLabel += uniqueValueRenderer.get_Field(uniqueValueRenderer.FieldCount - 1);//FieldCount为地物分类数
                //getImage(esriGeometryType.esriGeometryPolygon, Color.White).Save("D:\\111.jpg");
                index = treeImages.Images.Add(getImage(esriGeometryType.esriGeometryPolygon, Color.White));

                TreeNodeSymbol tnChartNode = new TreeNodeSymbol()
                {
                    Name = renderLabel, CustomValue = uniqueValueRenderer
                };
                tnChartNode.ImageIndex = index;
                tnComLayer.Add(tnChartNode);

                for (int i = 0; i < uniqueValueRenderer.ValueCount; i++)//ValueCount为地物分类下的设施种类数
                {
                    ISymbol symbol = uniqueValueRenderer.get_Symbol(uniqueValueRenderer.get_Value(i));

                    Image img = ConvertSymbolToImage.Convert(symbol, 16, 16);
                    //img.Save("D:\\121121.jpg");


                    index = treeImages.Images.Add(img);

                    TreeNodeSymbol tnSymbol = new TreeNodeSymbol()
                    {
                        Name = uniqueValueRenderer.get_Label(uniqueValueRenderer.get_Value(i)), CustomValue = symbol
                    };
                    tnSymbol.ImageIndex = index;
                    tnComLayer.Add(tnSymbol);
                }
                if (uniqueValueRenderer.UseDefaultSymbol)
                {
                    ISymbol symbol = uniqueValueRenderer.DefaultSymbol;
                    Image   img    = ConvertSymbolToImage.Convert(symbol, 16, 16);
                    index = treeImages.Images.Add(img);

                    TreeNodeSymbol tnSymbol = new TreeNodeSymbol()
                    {
                        Name = uniqueValueRenderer.DefaultLabel, CustomValue = symbol
                    };
                    tnSymbol.ImageIndex = index;
                    tnComLayer.Add(tnSymbol);
                }
            }
            else if (renderer is IChartRenderer)
            {
                IChartRenderer  chartRenderer = renderer as IChartRenderer;
                IRendererFields pFields       = chartRenderer as IRendererFields;
                string          renderLabel   = "";
                for (int i = 0; i < pFields.FieldCount - 1; i++)
                {
                    renderLabel += pFields.get_FieldAlias(i) + " /";
                }
                renderLabel += pFields.get_FieldAlias(pFields.FieldCount - 1);

                index = treeImages.Images.Add(getImage(esriGeometryType.esriGeometryPolygon, Color.White));

                TreeNodeSymbol tnChartNode = new TreeNodeSymbol()
                {
                    Name = renderLabel, CustomValue = chartRenderer
                };
                tnChartNode.ImageIndex = index;
                tnComLayer.Add(tnChartNode);


                ISymbolArray symArray = chartRenderer.ChartSymbol as ISymbolArray;
                for (int i = 0; i < symArray.SymbolCount; i++)
                {
                    ISymbol symbol = symArray.get_Symbol(i);

                    Image img = ConvertSymbolToImage.Convert(symbol, 16, 16);
                    index = treeImages.Images.Add(img);

                    TreeNodeSymbol tnSymbol = new TreeNodeSymbol()
                    {
                        Name = pFields.get_FieldAlias(i), CustomValue = symbol
                    };
                    tnSymbol.ImageIndex = index;
                    tnComLayer.Add(tnSymbol);
                }
            }
            else if (renderer is IClassBreaksRenderer)
            {
                IClassBreaksRenderer classRenderer = renderer as IClassBreaksRenderer;
                index = treeImages.Images.Add(getImage(esriGeometryType.esriGeometryPolygon, Color.White));

                TreeNodeSymbol tnChartNode = new TreeNodeSymbol()
                {
                    Name = classRenderer.Field, CustomValue = classRenderer
                };
                tnChartNode.ImageIndex = index;
                tnComLayer.Add(tnChartNode);


                for (int i = 0; i < classRenderer.BreakCount; i++)
                {
                    ISymbol symbol = classRenderer.get_Symbol(i);

                    Image img = ConvertSymbolToImage.Convert(symbol, 16, 16);
                    index = treeImages.Images.Add(img);

                    TreeNodeSymbol tnSymbol = new TreeNodeSymbol()
                    {
                        Name = classRenderer.get_Label(i), CustomValue = symbol
                    };
                    tnSymbol.ImageIndex = index;
                    tnComLayer.Add(tnSymbol);
                }
            }
            else if (renderer is IRasterRenderer)
            {
                if (renderer is IRasterClassifyColorRampRenderer)
                {
                    //MessageBox.Show("IRasterClassifyColorRampRenderer");
                }
                else if (renderer is IRasterUniqueValueRenderer)
                {
                    //MessageBox.Show("IRasterUniqueValueRenderer");
                }
                else if (renderer is IRasterStretchColorRampRenderer)
                {
                    ////MessageBox.Show("IRasterStretchColorRampRenderer");
                    IRasterStretchColorRampRenderer pRSCRR = renderer as IRasterStretchColorRampRenderer;

                    index = treeImages.Images.Add(getImage(esriGeometryType.esriGeometryPolygon, Color.White));
                    TreeNodeSymbol tnChartNode = new TreeNodeSymbol()
                    {
                        Name = "<Value>", CustomValue = pRSCRR
                    };
                    tnChartNode.ImageIndex = index;
                    tnComLayer.Add(tnChartNode);

                    if (pRSCRR.ColorRamp.Size >= 3)
                    {
                        IEnumColors colors = pRSCRR.ColorRamp.Colors;
                        colors.Reset();
                        IColor  c      = colors.Next();
                        Color[] cArray = new Color[3];
                        int     count  = 0;
                        while (c != null)
                        {
                            count++;
                            if (count == 1)
                            {
                                cArray[0] = Color.FromArgb(c.RGB);
                            }
                            else if (count == pRSCRR.ColorRamp.Size / 2)
                            {
                                cArray[1] = Color.FromArgb(c.RGB);
                            }
                            else if (count == pRSCRR.ColorRamp.Size)
                            {
                                cArray[2] = Color.FromArgb(c.RGB);
                            }
                            c = colors.Next();
                        }
                        for (int i = 0; i < 3; i++)
                        {
                            Image img = getImage(esriGeometryType.esriGeometryPolygon, cArray[i]);
                            index = treeImages.Images.Add(img);

                            string label = "";
                            if (i == 0)
                            {
                                label = pRSCRR.LabelLow;
                            }
                            else if (i == 1)
                            {
                                label = pRSCRR.LabelMedium;
                            }
                            else if (i == 2)
                            {
                                label = pRSCRR.LabelHigh;
                            }

                            TreeNodeSymbol tnSymbol = new TreeNodeSymbol()
                            {
                                Name = label, CustomValue = cArray[i]
                            };
                            tnSymbol.ImageIndex = index;
                            tnComLayer.Add(tnSymbol);
                        }
                    }
                }

                else if (renderer is IRasterRGBRenderer)
                {
                    //MessageBox.Show("IRasterRGBRenderer");
                }
                else if (renderer is IRasterColormap)
                {
                    //MessageBox.Show("IRasterColormap");
                }
                else
                {
                    //MessageBox.Show("未处理的IRasterRenderer类型:  " + renderer.GetType().FullName);
                }
            }
            else if (renderer is ITinRenderer)
            {
                if (renderer is ITinColorRampRenderer)
                {
                    ////MessageBox.Show("ITinColorRampRenderer");
                    ITinColorRampRenderer pTCRR = renderer as ITinColorRampRenderer;

                    index = treeImages.Images.Add(getImage(esriGeometryType.esriGeometryPolygon, Color.White));
                    TreeNodeSymbol tnChartNode = new TreeNodeSymbol()
                    {
                        Name = "Elevation", CustomValue = pTCRR
                    };
                    tnChartNode.ImageIndex = index;
                    tnComLayer.Add(tnChartNode);



                    for (int i = 0; i < pTCRR.BreakCount; i++)
                    {
                        ISymbol symbol = pTCRR.get_Symbol(i);
                        Image   img    = ConvertSymbolToImage.Convert(symbol, 16, 16);
                        index = treeImages.Images.Add(img);
                        TreeNodeSymbol tnSymbol = new TreeNodeSymbol()
                        {
                            Name = pTCRR.get_Label(i), CustomValue = symbol
                        };
                        tnSymbol.ImageIndex = index;
                        tnComLayer.Add(tnSymbol);
                    }
                }
                else if (renderer is ITinUniqueValueRenderer)
                {
                    ////MessageBox.Show("ITinUniqueValueRenderer");
                    ITinUniqueValueRenderer pTUVR = renderer as ITinUniqueValueRenderer;

                    index = treeImages.Images.Add(getImage(esriGeometryType.esriGeometryPolygon, Color.White));

                    TreeNodeSymbol tnChartNode = new TreeNodeSymbol()
                    {
                        Name = "Elevation", CustomValue = pTUVR
                    };
                    tnChartNode.ImageIndex = index;
                    tnComLayer.Add(tnChartNode);


                    for (int i = 0; i < pTUVR.ValueCount; i++)
                    {
                        string  val    = pTUVR.get_Value(i);
                        ISymbol symbol = pTUVR.get_Symbol(val);
                        Image   img    = ConvertSymbolToImage.Convert(symbol, 16, 16);
                        index = treeImages.Images.Add(img);

                        TreeNodeSymbol tnSymbol = new TreeNodeSymbol()
                        {
                            Name = pTUVR.get_Label(val), CustomValue = symbol
                        };
                        tnSymbol.ImageIndex = index;
                        tnComLayer.Add(tnSymbol);
                    }
                    if (pTUVR.UseDefaultSymbol)
                    {
                        ISymbol symbol = pTUVR.DefaultSymbol;
                        Image   img    = ConvertSymbolToImage.Convert(symbol, 16, 16);
                        index = treeImages.Images.Add(img);

                        TreeNodeSymbol tnSymbol = new TreeNodeSymbol()
                        {
                            Name = pTUVR.DefaultLabel, CustomValue = symbol
                        };
                        tnSymbol.ImageIndex = index;
                        tnComLayer.Add(tnSymbol);
                    }
                }
                else if (renderer is ITinSingleSymbolRenderer)
                {
                    ////MessageBox.Show("ITinSingleSymbolRenderer");
                    ITinSingleSymbolRenderer pTSSR = renderer as ITinSingleSymbolRenderer;
                    ISymbol symbol = pTSSR.Symbol;
                    Image   img    = ConvertSymbolToImage.Convert(symbol, 16, 16);
                    index = treeImages.Images.Add(img);

                    TreeNodeSymbol tnSymbol = new TreeNodeSymbol()
                    {
                        Name = pTSSR.Label, CustomValue = symbol
                    };
                    tnSymbol.ImageIndex = index;
                    tnComLayer.Add(tnSymbol);
                }
                else
                {
                    //MessageBox.Show("未处理的ITinRenderer类型:  " + renderer.GetType().FullName);
                }
            }
            else
            {
                //MessageBox.Show("未处理的Renderer类型:  " + renderer.GetType().FullName);
            }
        }
Beispiel #9
0
 private void method_4()
 {
     if (this.igeoFeatureLayer_0 == null)
     {
         this.ichartRenderer_0 = null;
     }
     else
     {
         IChartRenderer pInObject = this.igeoFeatureLayer_0.Renderer as IChartRenderer;
         if (pInObject == null)
         {
             if (this.ichartRenderer_0 == null)
             {
                 this.ichartRenderer_0 = new ChartRendererClass();
                 if (this.int_0 == 0)
                 {
                     this.ichartRenderer_0.ChartSymbol = new PieChartSymbolClass();
                 }
                 else if (this.int_0 == 1)
                 {
                     this.ichartRenderer_0.ChartSymbol = new BarChartSymbolClass();
                 }
                 else
                 {
                     this.ichartRenderer_0.ChartSymbol = new StackedChartSymbolClass();
                 }
                 (this.ichartRenderer_0.ChartSymbol as IMarkerSymbol).Size = 32.0;
             }
         }
         else
         {
             IObjectCopy copy = new ObjectCopyClass();
             this.ichartRenderer_0 = copy.Copy(pInObject) as IChartRenderer;
             IChartSymbol chartSymbol = this.ichartRenderer_0.ChartSymbol;
             IChartSymbol symbol2     = null;
             if (this.int_0 == 0)
             {
                 if (!(chartSymbol is IPieChartSymbol))
                 {
                     symbol2 = new PieChartSymbolClass();
                 }
             }
             else if (this.int_0 == 1)
             {
                 if (!(chartSymbol is IBarChartSymbol))
                 {
                     symbol2 = new BarChartSymbolClass();
                 }
             }
             else if ((this.int_0 == 2) && !(chartSymbol is IStackedChartSymbol))
             {
                 symbol2 = new StackedChartSymbolClass();
             }
             if (symbol2 != null)
             {
                 ISymbolArray array = chartSymbol as ISymbolArray;
                 for (int i = 0; i < array.SymbolCount; i++)
                 {
                     (symbol2 as ISymbolArray).AddSymbol(array.get_Symbol(i));
                 }
                 this.ichartRenderer_0.ChartSymbol = symbol2;
             }
         }
     }
 }
Beispiel #10
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;
        }