public ISimpleFillSymbol newSimpleFillSymbol(Color color,
                                                     IS3.Core.Graphics.SimpleFillStyle style,
                                                     ISimpleLineSymbol outline)
        {
            IS3SimpleFillSymbol symbol = new IS3SimpleFillSymbol();

            symbol.Color   = color;
            symbol.Outline = outline as IS3SimpleLineSymbol;
            symbol.Style   = style;

            return(symbol);
        }
        public ISymbol newSymbol(SymbolDef symbolDef)
        {
            if (symbolDef == null)
            {
                return(null);
            }

            Type symbolType = symbolDef.GetType();

            if (symbolType == typeof(SimpleLineSymbolDef))
            {
                SimpleLineSymbolDef sDef   = (SimpleLineSymbolDef)symbolDef;
                IS3SimpleLineSymbol symbol = new IS3SimpleLineSymbol();
                symbol.Color = sDef.Color;
                symbol.Style = sDef.Style;
                symbol.Width = sDef.Width;
                return(symbol);
            }
            else if (symbolType == typeof(SimpleFillSymbolDef))
            {
                SimpleFillSymbolDef sDef   = (SimpleFillSymbolDef)symbolDef;
                IS3SimpleFillSymbol symbol = new IS3SimpleFillSymbol();
                symbol.Color   = sDef.Color;
                symbol.Style   = sDef.Style;
                symbol.Outline = (ISimpleLineSymbol)newSymbol(sDef.OutlineDef);
                return(symbol);
            }
            else if (symbolType == typeof(SimpleMarkerSymbolDef))
            {
                SimpleMarkerSymbolDef sDef   = (SimpleMarkerSymbolDef)symbolDef;
                IS3SimpleMarkerSymbol symbol = new IS3SimpleMarkerSymbol();
                symbol.Angle          = sDef.Angle;
                symbol.AngleAlignment = sDef.AngleAlignment;
                symbol.Color          = sDef.Color;
                symbol.Outline        = (ISimpleLineSymbol)newSymbol(sDef.OutlineDef);
                symbol.Size           = sDef.Size;
                symbol.Style          = sDef.Style;
                symbol.XOffset        = sDef.XOffset;
                symbol.YOffset        = sDef.YOffset;
                return(symbol);
            }
            else if (symbolType == typeof(TextSymbolDef))
            {
                TextSymbolDef sDef   = (TextSymbolDef)symbolDef;
                IS3TextSymbol symbol = new IS3TextSymbol();
                symbol.Angle                   = sDef.Angle;
                symbol.AngleAlignment          = sDef.AngleAlignment;
                symbol.BackgroundColor         = sDef.BackgroundColor;
                symbol.BorderLineColor         = sDef.BorderLineColor;
                symbol.BorderLineSize          = sDef.BorderLineSize;
                symbol.Color                   = sDef.Color;
                symbol.Text                    = sDef.Text;
                symbol.HorizontalTextAlignment = sDef.HorizontalTextAlignment;
                symbol.VerticalTextAlignment   = sDef.VerticalTextAlignment;
                symbol.Font                    = newSymbolFont(sDef.FontDef);
                symbol.XOffset                 = sDef.XOffset;
                symbol.YOffset                 = sDef.YOffset;
                return(symbol);
            }

            return(null);
        }
Beispiel #3
0
        public ISymbol newSymbol(SymbolDef symbolDef)
        {
            if (symbolDef == null)
                return null;

            Type symbolType = symbolDef.GetType();
            if (symbolType == typeof(SimpleLineSymbolDef))
            {
                SimpleLineSymbolDef sDef = (SimpleLineSymbolDef)symbolDef;
                IS3SimpleLineSymbol symbol = new IS3SimpleLineSymbol();
                symbol.Color = sDef.Color;
                symbol.Style = sDef.Style;
                symbol.Width = sDef.Width;
                return symbol;
            }
            else if (symbolType == typeof(SimpleFillSymbolDef))
            {
                SimpleFillSymbolDef sDef = (SimpleFillSymbolDef)symbolDef;
                IS3SimpleFillSymbol symbol = new IS3SimpleFillSymbol();
                symbol.Color = sDef.Color;
                symbol.Style = sDef.Style;
                symbol.Outline = (ISimpleLineSymbol) newSymbol(sDef.OutlineDef);
                return symbol;
            }
            else if (symbolType == typeof(SimpleMarkerSymbolDef))
            {
                SimpleMarkerSymbolDef sDef = (SimpleMarkerSymbolDef)symbolDef;
                IS3SimpleMarkerSymbol symbol = new IS3SimpleMarkerSymbol();
                symbol.Angle = sDef.Angle;
                symbol.AngleAlignment = sDef.AngleAlignment;
                symbol.Color = sDef.Color;
                symbol.Outline = (ISimpleLineSymbol)newSymbol(sDef.OutlineDef);
                symbol.Size = sDef.Size;
                symbol.Style = sDef.Style;
                symbol.XOffset = sDef.XOffset;
                symbol.YOffset = sDef.YOffset;
                return symbol;
            }
            else if (symbolType == typeof(TextSymbolDef))
            {
                TextSymbolDef sDef = (TextSymbolDef)symbolDef;
                IS3TextSymbol symbol = new IS3TextSymbol();
                symbol.Angle = sDef.Angle;
                symbol.AngleAlignment = sDef.AngleAlignment;
                symbol.BackgroundColor = sDef.BackgroundColor;
                symbol.BorderLineColor = sDef.BorderLineColor;
                symbol.BorderLineSize = sDef.BorderLineSize;
                symbol.Color = sDef.Color;
                symbol.Text = sDef.Text;
                symbol.HorizontalTextAlignment = sDef.HorizontalTextAlignment;
                symbol.VerticalTextAlignment = sDef.VerticalTextAlignment;
                symbol.Font = newSymbolFont(sDef.FontDef);
                symbol.XOffset = sDef.XOffset;
                symbol.YOffset = sDef.YOffset;
                return symbol;
            }

            return null;
        }
Beispiel #4
0
        public ISimpleFillSymbol newSimpleFillSymbol(Color color,
            IS3.Core.Graphics.SimpleFillStyle style,
            ISimpleLineSymbol outline)
        {
            IS3SimpleFillSymbol symbol = new IS3SimpleFillSymbol();
            symbol.Color = color;
            symbol.Outline = outline as IS3SimpleLineSymbol;
            symbol.Style = style;

            return symbol;
        }