Пример #1
0
 public IRenderer newRenderer(RendererDef rendererDef)
 {
     Type rendererType = rendererDef.GetType();
     if (rendererType == typeof(SimpleRendererDef))
     {
         SimpleRendererDef rDef = (SimpleRendererDef)rendererDef;
         IS3SimpleRenderer renderer = new IS3SimpleRenderer();
         renderer.Symbol = newSymbol(rDef.SymbolDef);
         return renderer;
     }
     else if (rendererType == typeof(UniqueValueRendererDef))
     {
         UniqueValueRendererDef rDef = (UniqueValueRendererDef)rendererDef;
         IS3UniqueValueRenderer renderer = new IS3UniqueValueRenderer();
         renderer.DefaultSymbol = newSymbol(rDef.DefaultSymbolDef);
         renderer.Fields = rDef.Fields;
         renderer.Infos = new ObservableCollection<IUniqueValueInfo>(
             rDef.InfosDef.Select(x => new IS3UniqueValueInfo 
             { 
                 Symbol = newSymbol(x.SymbolDef),
                 Values = x.Values
             })
             );
         return renderer;
     }
     else if (rendererType == typeof(ClassBreaksRendererDef))
     {
         ClassBreaksRendererDef rDef = (ClassBreaksRendererDef)rendererDef;
         IS3ClassBreaksRenderer renderer = new IS3ClassBreaksRenderer();
         renderer.DefaultSymbol = newSymbol(rDef.DefaultSymbolDef);
         renderer.Field = rDef.Field;
         renderer.Infos = new ObservableCollection<IClassBreakInfo>(
             rDef.InfosDef.Select(x => new IS3ClassBreakInfo 
             { 
                 Maximum = x.Maximum,
                 Minimum = x.Maximum,
                 Symbol = newSymbol(x.SymbolDef)
             })
             );
         return renderer;
     }
     return null;
 }
Пример #2
0
 public IClassBreaksRenderer newClassBreaksRenderer(
     ISymbol defaultSymbol,
     string field,
     ObservableCollection<IClassBreakInfo> infos)
 {
     IS3ClassBreaksRenderer renderer = new IS3ClassBreaksRenderer();
     renderer.DefaultSymbol = defaultSymbol;
     renderer.Field = field;
     renderer.Infos = infos;
     return renderer;
 }