Example #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);
 }
Example #2
0
 public Map()
 {
     _version              = new MapVersion();
     _author               = new MapAuthor();
     _arguments            = new MapArguments();
     _conflictDefForSymbol = new ConflictDefinition();
     _conflictDefForLabel  = new ConflictDefinition(new Size(60, 16), true);
 }
Example #3
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);
 }
Example #4
0
        private static MapVersion GetMapVersion(XDocument doc)
        {
            var result = doc.Element("Map").Element("Version");

            if (result == null)
            {
                return(null);
            }
            return(MapVersion.FromXElement(result as XElement));
        }
Example #5
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);
 }
Example #6
0
        public static MapVersion FromXElement(XElement xelement)
        {
            if (xelement == null)
            {
                return(null);
            }
            MapVersion version = new MapVersion();

            version.AuthorYear     = int.Parse(xelement.Attribute("year").Value);
            version.Description    = xelement.Attribute("description").Value;
            version.Publisher      = xelement.Attribute("publisher").Value;
            version.ScaleOfMapping = int.Parse(xelement.Attribute("scaleofmapping").Value);
            if (xelement.Attribute("source") != null)
            {
                version.Source = xelement.Attribute("source").Value;
            }
            return(version);
        }
Example #7
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();
     }
 }