外部组件发生异常

0 投票
使用产品:iobject.NET 10i 操作系统:win10 x64  

   在themeRange.AddToTail(themeRangeItem2);语句总出现外部组件发生异常,但是注释了该语句后就可以正常运行,代码如下:

ThemeRange themeRange = new ThemeRange();
            themeRange.RangeExpression = "总磷";
            GeoStyle geostyle1 = new GeoStyle
            {
                LineWidth = 0.5,
                LineColor = Color.FromArgb(0, 160, 233)
            };
            ThemeRangeItem themeRangeItem1 = new ThemeRangeItem
            {
                Caption = "1",
                Start = 0,
                End = 0.01,
                Style = geostyle1,
                IsVisible = true
            };
            GeoStyle geostyle2 = new GeoStyle
            {
                LineWidth = 0.5,
                LineColor = Color.FromArgb(46, 215, 100)
            };
            ThemeRangeItem themeRangeItem2 = new ThemeRangeItem
            {
                Caption = "2",
                Start = 0.01,
                End = 0.025,
                Style = geostyle2,
                IsVisible = true
            };
            GeoStyle geostyle3 = new GeoStyle
            {
                LineWidth = 0.5,
                LineColor = Color.FromArgb(230, 222, 15)
            };
            ThemeRangeItem themeRangeItem3 = new ThemeRangeItem
            {
                Caption = "3",
                Start = 0.025,
                End = 0.05,
                Style = geostyle3,
                IsVisible = true
            };
            GeoStyle geostyle4 = new GeoStyle
            {
                LineWidth = 0.5,
                LineColor = Color.Red
            };
            ThemeRangeItem themeRangeItem4 = new ThemeRangeItem
            {
                Caption = "4",
                Start = 0.05,
                End = 1.0,
                Style = geostyle4,
                IsVisible = true
            };
            themeRange.AddToHead(themeRangeItem1);
            themeRange.AddToTail(themeRangeItem2);
            themeRange.AddToTail(themeRangeItem3);
            themeRange.AddToTail(themeRangeItem4);
            mapControl1.Map.Layers.Add(m_netLine, themeRange, true);
            mapControl1.Map.Layers[0].IsSelectable = false;
            mapControl1.Map.Layers[0].IsSnapable = false;
            mapControl1.Map.Refresh();
8月 24, 2020 分类:  227次浏览 | 用户: yeeela (4 分)

1个回答

0 投票
用ThemeLabelRangeItems.AddToTail()替代, themeRange.AddToTail已经过时废弃了
8月 24, 2020 用户: 程逸诗 名扬四海 (4,360 分)
可是我这是分段专题图,不是分段标签专题图啊
...