Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions AsyncFileAppender.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public int WaitTime
public AsyncFileAppender()
: base()
{
if (running == false) { processQueue(); }
if (running == false) { ProcessQueue(); }

afAppenders.Add(this);
}
Expand All @@ -72,7 +72,7 @@ protected override void Append(log4net.Core.LoggingEvent loggingEvent)
}
}

static void processQueue()
static void ProcessQueue()
{
if (running) { return; } running = true; // prevent double

Expand All @@ -84,7 +84,7 @@ static void processQueue()
System.Threading.Thread.Sleep(300); // wait for first run delay
while (running)
{
writeLogs();
WriteLogs();
mAutoResetEvent.WaitOne(waitTime);
}
}
Expand All @@ -97,7 +97,7 @@ static void processQueue()
}).Start();

}
static void writeLogs()
static void WriteLogs()
{
foreach (var appKV in afAppenders)
{
Expand Down
324 changes: 324 additions & 0 deletions GeoCoder.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,324 @@
/* Google Maps Geo Decoder JSON Class
* {
"results" : [
{
"address_components" : [
{
"long_name" : "Strada Ghidighici",
"short_name" : "Strada Ghidighici",
"types" : [ "route" ]
},
{
"long_name" : "Buiucani",
"short_name" : "Buiucani",
"types" : [ "sublocality_level_1", "sublocality", "political" ]
},
{
"long_name" : "Chişinău",
"short_name" : "Chişinău",
"types" : [ "locality", "political" ]
},
{
"long_name" : "Chișinău",
"short_name" : "Chișinău",
"types" : [ "administrative_area_level_1", "political" ]
},
{
"long_name" : "Moldova",
"short_name" : "MD",
"types" : [ "country", "political" ]
}
],
"formatted_address" : "Strada Ghidighici, Chişinău, Moldova",
"geometry" : {
"bounds" : {
"northeast" : {
"lat" : 47.0521352,
"lng" : 28.7837334
},
"southwest" : {
"lat" : 47.0506237,
"lng" : 28.7837291
}
},
"location" : {
"lat" : 47.0513795,
"lng" : 28.7837313
},
"location_type" : "GEOMETRIC_CENTER",
"viewport" : {
"northeast" : {
"lat" : 47.05272843029149,
"lng" : 28.7850802302915
},
"southwest" : {
"lat" : 47.0500304697085,
"lng" : 28.7823822697085
}
}
},
"place_id" : "ChIJDUmMoyfWy0ARV55ANxIA8F8",
"types" : [ "route" ]
},
{
"address_components" : [
{
"long_name" : "Sectorul Buiucani",
"short_name" : "Sectorul Buiucani",
"types" : [ "sublocality_level_1", "sublocality", "political" ]
},
{
"long_name" : "Chisinau",
"short_name" : "Chisinau",
"types" : [ "locality", "political" ]
},
{
"long_name" : "Chisinau",
"short_name" : "Chisinau",
"types" : [ "administrative_area_level_1", "political" ]
},
{
"long_name" : "Moldova",
"short_name" : "MD",
"types" : [ "country", "political" ]
}
],
"formatted_address" : "Sectorul Buiucani, Chisinau, Moldova",
"geometry" : {
"bounds" : {
"northeast" : {
"lat" : 47.0735926,
"lng" : 28.8370138
},
"southwest" : {
"lat" : 47.0034657,
"lng" : 28.7446761
}
},
"location" : {
"lat" : 47.0347985,
"lng" : 28.7943996
},
"location_type" : "APPROXIMATE",
"viewport" : {
"northeast" : {
"lat" : 47.0735926,
"lng" : 28.8370138
},
"southwest" : {
"lat" : 47.0034657,
"lng" : 28.7446761
}
}
},
"place_id" : "ChIJYRIneO19yUARTEj7IYo-RKs",
"types" : [ "sublocality_level_1", "sublocality", "political" ]
},
{
"address_components" : [
{
"long_name" : "Chisinau",
"short_name" : "Chisinau",
"types" : [ "locality", "political" ]
},
{
"long_name" : "Chisinau",
"short_name" : "Chisinau",
"types" : [ "administrative_area_level_1", "political" ]
},
{
"long_name" : "Moldova",
"short_name" : "MD",
"types" : [ "country", "political" ]
}
],
"formatted_address" : "Chisinau, Moldova",
"geometry" : {
"bounds" : {
"northeast" : {
"lat" : 47.079175,
"lng" : 28.9716983
},
"southwest" : {
"lat" : 46.9205631,
"lng" : 28.7446548
}
},
"location" : {
"lat" : 47.0104529,
"lng" : 28.8638103
},
"location_type" : "APPROXIMATE",
"viewport" : {
"northeast" : {
"lat" : 47.079175,
"lng" : 28.9716983
},
"southwest" : {
"lat" : 46.9205631,
"lng" : 28.7446548
}
}
},
"place_id" : "ChIJoWm3KDZ8yUARPN1JVzDW0Tc",
"types" : [ "locality", "political" ]
},
{
"address_components" : [
{
"long_name" : "Chisinau",
"short_name" : "Chisinau",
"types" : [ "administrative_area_level_1", "political" ]
},
{
"long_name" : "Moldova",
"short_name" : "MD",
"types" : [ "country", "political" ]
}
],
"formatted_address" : "Chisinau, Moldova",
"geometry" : {
"bounds" : {
"northeast" : {
"lat" : 47.1622709,
"lng" : 29.1219709
},
"southwest" : {
"lat" : 46.867643,
"lng" : 28.6291789
}
},
"location" : {
"lat" : 47.0458889,
"lng" : 28.85041249999999
},
"location_type" : "APPROXIMATE",
"viewport" : {
"northeast" : {
"lat" : 47.1622709,
"lng" : 29.1219709
},
"southwest" : {
"lat" : 46.867643,
"lng" : 28.6291789
}
}
},
"place_id" : "ChIJPSOipW58yUAR97pzmHD6zkk",
"types" : [ "administrative_area_level_1", "political" ]
},
{
"address_components" : [
{
"long_name" : "Moldova",
"short_name" : "MD",
"types" : [ "country", "political" ]
}
],
"formatted_address" : "Moldova",
"geometry" : {
"bounds" : {
"northeast" : {
"lat" : 48.491944,
"lng" : 30.162538
},
"southwest" : {
"lat" : 45.466904,
"lng" : 26.6168559
}
},
"location" : {
"lat" : 47.411631,
"lng" : 28.369885
},
"location_type" : "APPROXIMATE",
"viewport" : {
"northeast" : {
"lat" : 48.491944,
"lng" : 30.162538
},
"southwest" : {
"lat" : 45.466904,
"lng" : 26.6168559
}
}
},
"place_id" : "ChIJoWm3KDZ8yUARy6xT36wZgSU",
"types" : [ "country", "political" ]
}
],
"status" : "OK"
}
*/

public class GeoDecoder
{
public Result[] results { get; set; }
public string status { get; set; }
}

public class Result
{
public Address_Components[] address_components { get; set; }
public string formatted_address { get; set; }
public Geometry geometry { get; set; }
public string place_id { get; set; }
public string[] types { get; set; }
}

public class Geometry
{
public Bounds bounds { get; set; }
public Location location { get; set; }
public string location_type { get; set; }
public Viewport viewport { get; set; }
}

public class Bounds
{
public Northeast northeast { get; set; }
public Southwest southwest { get; set; }
}

public class Northeast
{
public float lat { get; set; }
public float lng { get; set; }
}

public class Southwest
{
public float lat { get; set; }
public float lng { get; set; }
}

public class Location
{
public float lat { get; set; }
public float lng { get; set; }
}

public class Viewport
{
public Northeast1 northeast { get; set; }
public Southwest1 southwest { get; set; }
}

public class Northeast1
{
public float lat { get; set; }
public float lng { get; set; }
}

public class Southwest1
{
public float lat { get; set; }
public float lng { get; set; }
}

public class Address_Components
{
public string long_name { get; set; }
public string short_name { get; set; }
public string[] types { get; set; }
}