public object PropertyPage(object initObject)
        {
            if (initObject is IFeatureLayer)
            {
                IFeatureLayer layer = (IFeatureLayer)initObject;
                if (layer.FeatureClass == null)
                {
                    return(null);
                }

                if (_symbolTable.Count == 0)
                {
                    this[null] = RendererFunctions.CreateStandardSymbol(layer.LayerGeometryType /*layer.FeatureClass.GeometryType*/);
                }

                string   appPath    = System.IO.Path.GetDirectoryName(Assembly.GetEntryAssembly().Location);
                Assembly uiAssembly = Assembly.LoadFrom(appPath + @"\gView.Carto.Rendering.UI.dll");

                IPropertyPanel p = uiAssembly.CreateInstance("gView.Framework.Carto.Rendering.UI.PropertyPage_ValueMapRenderer") as IPropertyPanel;
                if (p != null)
                {
                    return(p.PropertyPanel(this, (IFeatureLayer)initObject));
                }
            }

            return(null);
        }
Beispiel #2
0
        public object PropertyPage(object initObject)
        {
            if (initObject is IFeatureLayer)
            {
                if (((IFeatureLayer)initObject).FeatureClass == null)
                {
                    return(null);
                }

                if (_symbol == null)
                {
                    _symbol = RendererFunctions.CreateStandardSymbol(((IFeatureLayer)initObject).LayerGeometryType /*((IFeatureLayer)initObject).FeatureClass.GeometryType*/);
                }
                string   appPath    = System.IO.Path.GetDirectoryName(Assembly.GetEntryAssembly().Location);
                Assembly uiAssembly = Assembly.LoadFrom(appPath + @"/gView.Win.Carto.Rendering.UI.dll");

                IPropertyPanel p = uiAssembly.CreateInstance("gView.Framework.Carto.Rendering.UI.PropertyForm_SimpleRenderer") as IPropertyPanel;
                if (p != null)
                {
                    return(p.PropertyPanel(this, (IFeatureLayer)initObject));
                }
            }

            return(null);
        }
Beispiel #3
0
        public ISymbol this[string key]
        {
            get
            {
                if (key == null)
                {
                    key = "__gview_all_other_values__";
                }

                if (!_symbolTable.ContainsKey(key))
                {
                    return(null);
                }

                return(_symbolTable[key]);
            }
            set
            {
                if (key == null)
                {
                    key = "__gview_all_other_values__";
                }

                ISymbol symbol;
                if (value == null)
                {
                    symbol = RendererFunctions.CreateStandardSymbol(_geometryType);
                }
                else
                {
                    if (!(value is ISymbol))
                    {
                        return;
                    }

                    symbol = value;
                }

                if (!_symbolTable.ContainsKey(key))
                {
                    _symbolTable.Add(key, symbol);
                }
                else
                {
                    _symbolTable[key].Release();
                    _symbolTable[key] = symbol;
                }
                if (symbol is ILegendItem)
                {
                    if (String.IsNullOrEmpty(symbol.LegendLabel))
                    {
                        symbol.LegendLabel =
                            (key == "__gview_all_other_values__") ? "all other values" : key;
                    }
                }
            }
        }
Beispiel #4
0
        public UniversalGeometrySymbol(SymbolType type)
        {
            switch (type)
            {
            case SymbolType.normal:
                _pointSymbol   = RendererFunctions.CreateStandardSymbol(geometryType.Point);
                _lineSymbol    = RendererFunctions.CreateStandardSymbol(geometryType.Polyline);
                _polygonSymbol = RendererFunctions.CreateStandardSymbol(geometryType.Polygon);
                break;

            case SymbolType.selection:
                _pointSymbol   = RendererFunctions.CreateStandardSelectionSymbol(geometryType.Point);
                _lineSymbol    = RendererFunctions.CreateStandardSelectionSymbol(geometryType.Polyline);
                _polygonSymbol = RendererFunctions.CreateStandardSelectionSymbol(geometryType.Polygon);
                break;

            case SymbolType.highlight:
                _pointSymbol   = RendererFunctions.CreateStandardHighlightSymbol(geometryType.Point);
                _lineSymbol    = RendererFunctions.CreateStandardHighlightSymbol(geometryType.Polyline);
                _polygonSymbol = RendererFunctions.CreateStandardHighlightSymbol(geometryType.Polygon);
                break;
            }
        }
Beispiel #5
0
 public ISymbol CreateStandardHighlightSymbol(geometryType type)
 {
     return(RendererFunctions.CreateStandardHighlightSymbol(type));
 }