/// <summary> /// Added Osm primitive /// </summary> /// <param name="osmPrimitive">Node, Way or Relation</param> /// <param name="changesType">Created, Updated or Deleted</param> public void AddOsmPrimitive(OsmPrimitive osmPrimitive, ChangesType changesType) { Type type = osmPrimitive.GetType(); if (osmPrimitive is Node) { switch (changesType) { case ChangesType.Created: NodesCreated.Add((Node)osmPrimitive); return; break; case ChangesType.Updated: NodesUpdated.Add((Node)osmPrimitive); return; break; case ChangesType.Deleted: NodesDeleted.Add((Node)osmPrimitive); return; break; } } if (osmPrimitive is Way) { switch (changesType) { case ChangesType.Created: WaysCreated.Add((Way)osmPrimitive); return; break; case ChangesType.Updated: WaysUpdated.Add((Way)osmPrimitive); return; break; case ChangesType.Deleted: WaysDeleted.Add((Way)osmPrimitive); return; break; } } }
private string IncrementVersionNumber(decimal currentVersion, ChangesType reportChangesType) { var version = currentVersion; switch (reportChangesType) { case ChangesType.Minor: var minorVersion = currentVersion % 1 * (decimal)Math.Pow(10, CountDecimalDigits(currentVersion)); version = minorVersion < 99 ? currentVersion + 0.01m : (minorVersion == 99 ? Math.Floor(currentVersion) + 0.100m : currentVersion + 0.001m); break; case ChangesType.Major: version = Math.Floor(currentVersion) + 1.00m; break; } return(version.ToString(CultureInfo.InvariantCulture)); }
/// <summary> /// Added Osm primitive /// </summary> /// <param name="osmPrimitive">Node, Way or Relation</param> /// <param name="changesType">Created, Updated or Deleted</param> public void AddOsmPrimitive(OsmPrimitive osmPrimitive, ChangesType changesType) { Type type = osmPrimitive.GetType(); if (osmPrimitive is Node) { switch (changesType) { case ChangesType.Created: NodesCreated.Add((Node)osmPrimitive); return; break; case ChangesType.Updated: NodesUpdated.Add((Node)osmPrimitive); return; break; case ChangesType.Deleted: NodesDeleted.Add((Node)osmPrimitive); return; break; } } if (osmPrimitive is Way) { switch (changesType) { case ChangesType.Created: WaysCreated.Add((Way)osmPrimitive); return; break; case ChangesType.Updated: WaysUpdated.Add((Way)osmPrimitive); return; break; case ChangesType.Deleted: WaysDeleted.Add((Way)osmPrimitive); return; break; } } }
private void ReadOsmPrimitive(XmlTextReader readerBlockModify, ChangesType changesType) { while (readerBlockModify.NodeType != XmlNodeType.EndElement) { readerBlockModify.Read(); if (readerBlockModify.NodeType != XmlNodeType.Whitespace) { switch (readerBlockModify.Name) { case "node": this.ReadNode(readerBlockModify); break; case "way": this.ReadWay(readerBlockModify); break; case "relation": this.ReadRelation(readerBlockModify); break; } } } }
private void ReadOsmPrimitive(XmlTextReader readerBlockModify, ChangesType changesType) { while (readerBlockModify.NodeType != XmlNodeType.EndElement) { readerBlockModify.Read(); if (readerBlockModify.NodeType != XmlNodeType.Whitespace) { switch (readerBlockModify.Name) { case "node": this.ReadNode(readerBlockModify); break; case "way": this.ReadWay(readerBlockModify); break; case "relation": this.ReadRelation(readerBlockModify); break; } } } }