コード例 #1
0
 public static GeoJsonFeatureCollection FromCombinedRecords(IDeltaActions <CombinedRecord> actions)
 {
     return(new GeoJsonFeatureCollection
     {
         Featrues = actions.RecordsToCreate.Select(
             r => GeoJsonFeature.FromCombinedRecord(r, "#3cc62a", "New")
             ).Union(actions.RecordsToRemove.Select(
                         r => GeoJsonFeature.FromCombinedRecord(r, "#c62a2a", "Retired"))
                     ).Union(actions.RecordsToReplace.Select(
                                 r => GeoJsonFeature.FromCombinedRecord(r, "#2a75c6", "Updated"))
                             ).ToList()
     });
 }
コード例 #2
0
 public static string GenerateGeoJson(IDeltaActions <CombinedRecord> deltaActions)
 {
     return(JsonConvert.SerializeObject(GeoJsonFeatureCollection.FromCombinedRecords(deltaActions)));
 }
コード例 #3
0
        public static string GenerateHtmlReport <T>(IDeltaActions <T> deltaActions) where T : IDeltaRecord <T>
        {
            const string css = "<style>table {  font-family: arial, sans-serif;  border-collapse: collapse;  width: 100%;}td, th {  border: 1px solid #dddddd;  text-align: left;  padding: 8px;}tr:nth-child(even) {  background-color: #dddddd;}</style>";

            return($"<html>{css}<body><table><tr><th>Action</th><th>Count</th></tr><tr><td>New Addresses</td><th>{deltaActions.RecordsToCreate.Count()}</td></tr><tr><td>Retired Addresses</td><th>{deltaActions.RecordsToRemove.Count()}</td></tr><tr><td>Updated Addresses</td><th>{deltaActions.RecordsToReplace.Count()}</td></tr></table></body></html>");
        }