Ejemplo n.º 1
0
 public Map(string name, string url, MapVersion version, MapAuthor author, MapArguments arg, ILayer[] layers)
     : this(name, url, version, author, arg)
 {
     _inputLayers          = layers;
     _conflictDefForSymbol = new ConflictDefinition();
     _conflictDefForLabel  = new ConflictDefinition(new Size(60, 16), true);
 }
Ejemplo n.º 2
0
 public Map(string name, string url, IFeatureLayer[] layers)
     : this(name, url)
 {
     _inputLayers          = layers;
     _conflictDefForSymbol = new ConflictDefinition();
     _conflictDefForLabel  = new ConflictDefinition(new Size(60, 16), true);
 }
Ejemplo n.º 3
0
 public void Dispose()
 {
     _host.OnCanvasSizeChanged -= _resizeHandler;
     _grids       = null;
     _conflictDef = null;
     _host        = null;
 }
Ejemplo n.º 4
0
 public Map()
 {
     _version              = new MapVersion();
     _author               = new MapAuthor();
     _arguments            = new MapArguments();
     _conflictDefForSymbol = new ConflictDefinition();
     _conflictDefForLabel  = new ConflictDefinition(new Size(60, 16), true);
 }
Ejemplo n.º 5
0
 public PixelConflictor(ConflictDefinition conflictDef, IMapRuntimeHost host)
 {
     _conflictDef               = conflictDef;
     _host                      = host;
     _resizeHandler             = new EventHandler(_control_SizeChanged);
     _host.OnCanvasSizeChanged += _resizeHandler;
     BuildGrids();
 }
Ejemplo n.º 6
0
 public Map(string name, string url)
 {
     _name                 = name;
     _url                  = url;
     _version              = new MapVersion();
     _author               = new MapAuthor();
     _arguments            = new MapArguments();
     _conflictDefForSymbol = new ConflictDefinition();
     _conflictDefForLabel  = new ConflictDefinition(new Size(60, 16), true);
 }
Ejemplo n.º 7
0
 internal void SetConflictDefinition(ConflictDefinition sym, ConflictDefinition label)
 {
     if (sym != null)
     {
         _conflictDefForSymbol = sym;
     }
     if (label != null)
     {
         _conflictDefForLabel = label;
     }
 }
Ejemplo n.º 8
0
 public Map(string name, string url, MapVersion version, MapAuthor author, MapArguments arg)
 {
     _name    = name;
     _url     = url;
     _version = version;
     _author  = author;
     if (arg == null)
     {
         arg = new MapArguments();
     }
     _arguments            = arg;
     _conflictDefForSymbol = new ConflictDefinition();
     _conflictDefForLabel  = new ConflictDefinition(new Size(60, 16), true);
 }
Ejemplo n.º 9
0
        public static ConflictDefinition FromXElement(XElement ele)
        {
            if (ele == null)
            {
                return(new ConflictDefinition());
            }
            string sizestr = ele.Attribute("gridsize").Value;

            string[]           sizestrs = sizestr.Split(',');
            ConflictDefinition def      = new ConflictDefinition();

            def.GridSize = new Size(int.Parse(sizestrs[0]), int.Parse(sizestrs[1]));
            def.Enabled  = bool.Parse(ele.Attribute("enabled").Value);
            return(def);
        }
Ejemplo n.º 10
0
        private static void GetConflictDef(XDocument doc, out ConflictDefinition sym, out ConflictDefinition label)
        {
            sym   = null;
            label = null;
            var result = doc.Element("Map").Element("ConflictDefinitionSymbol");

            if (result == null)
            {
                return;
            }
            sym    = ConflictDefinition.FromXElement(result.Element("ConflictDefinition") as XElement);
            result = doc.Element("Map").Element("ConflictDefinitionLabel");
            label  = ConflictDefinition.FromXElement(result.Element("ConflictDefinition") as XElement);
            return;
        }
Ejemplo n.º 11
0
 public void Dispose()
 {
     if (_graphics != null)
     {
         _graphics.Dispose();
         _graphics = null;
     }
     if (_bitmap != null)
     {
         _bitmap.Dispose();
         _bitmap = null;
     }
     _host.OnCanvasSizeChanged -= _resizeHandler;
     _resizeHandler             = null;
     //_control.SizeChanged -= _resizeHandler;
     _conflictDef = null;
     //_control = null;
     _host = null;
 }
Ejemplo n.º 12
0
 private static IMap ParseMapFromXml(string filename)
 {
     PersistObject.BeginParse();
     try
     {
         XDocument          doc = XDocument.Load(filename);
         MapAuthor          author = GetMapAuthor(doc);
         MapVersion         version = GetMapVersion(doc);
         MapArguments       arg = GetMapArguments(doc);
         ConflictDefinition csym = null, clabel = null;
         GetConflictDef(doc, out csym, out clabel);
         ILayer[] layers  = GetFeatureLayer(doc);
         string   mapname = doc.Element("Map").Attribute("name").Value;
         Map      map = new Map(mapname, filename, version, author, arg, layers);
         map.SetConflictDefinition(csym, clabel);
         return(map);
     }
     finally
     {
         PersistObject.EndParse();
     }
 }