Permalink
Browse files

Initial Commit

  • Loading branch information...
0 parents commit 6aaf0b710e430e8c784f33f60f734fa9c322248a @geobabbler committed Jun 11, 2012
Showing with 2,557 additions and 0 deletions.
  1. +49 −0 .gitattributes
  2. +165 −0 .gitignore
  3. +141 −0 Data/EndpointDefinition.cs
  4. +187 −0 Data/MapsApiData.cs
  5. +206 −0 Data/OverlayInfo.cs
  6. +663 −0 Finder.cs
  7. +683 −0 GeoCommonsWebClient.cs
  8. +97 −0 GeoIQ.Net.csproj
  9. +80 −0 GeoIQ.Net4.csproj
  10. +228 −0 Maps.cs
  11. +58 −0 Properties/AssemblyInfo.cs
@@ -0,0 +1,49 @@
+*.doc diff=astextplain
+*.DOC diff=astextplain
+*.docx diff=astextplain
+*.DOCX diff=astextplain
+*.dot diff=astextplain
+*.DOT diff=astextplain
+*.pdf diff=astextplain
+*.PDF diff=astextplain
+*.rtf diff=astextplain
+*.RTF diff=astextplain
+
+*.jpg binary
+*.png binary
+*.gif binary
+
+*.cs text=auto diff=csharp
+*.vb text=auto
+*.c text=auto
+*.cpp text=auto
+*.cxx text=auto
+*.h text=auto
+*.hxx text=auto
+*.py text=auto
+*.rb text=auto
+*.java text=auto
+*.html text=auto
+*.htm text=auto
+*.css text=auto
+*.scss text=auto
+*.sass text=auto
+*.less text=auto
+*.js text=auto
+*.lisp text=auto
+*.clj text=auto
+*.sql text=auto
+*.php text=auto
+*.lua text=auto
+*.m text=auto
+*.asm text=auto
+*.erl text=auto
+*.fs text=auto
+*.fsx text=auto
+*.hs text=auto
+
+*.csproj text=auto merge=union
+*.vbproj text=auto merge=union
+*.fsproj text=auto merge=union
+*.dbproj text=auto merge=union
+*.sln text=auto eol=crlf merge=union
@@ -0,0 +1,165 @@
+
+#################
+## Eclipse
+#################
+
+*.pydevproject
+.project
+.metadata
+bin/**
+tmp/**
+tmp/**/*
+*.tmp
+*.bak
+*.swp
+*~.nib
+local.properties
+.classpath
+.settings/
+.loadpath
+
+# External tool builders
+.externalToolBuilders/
+
+# Locally stored "Eclipse launch configurations"
+*.launch
+
+# CDT-specific
+.cproject
+
+# PDT-specific
+.buildpath
+
+
+#################
+## Visual Studio
+#################
+
+## Ignore Visual Studio temporary files, build results, and
+## files generated by popular Visual Studio add-ons.
+
+# User-specific files
+*.suo
+*.user
+*.sln.docstates
+
+# Build results
+**/[Dd]ebug/
+**/[Rr]elease/
+*_i.c
+*_p.c
+*.ilk
+*.meta
+*.obj
+*.pch
+*.pdb
+*.pgc
+*.pgd
+*.rsp
+*.sbr
+*.tlb
+*.tli
+*.tlh
+*.tmp
+*.vspscc
+.builds
+**/*.dotCover
+
+## TODO: If you have NuGet Package Restore enabled, uncomment this
+#**/packages/
+
+# Visual C++ cache files
+ipch/
+*.aps
+*.ncb
+*.opensdf
+*.sdf
+
+# Visual Studio profiler
+*.psess
+*.vsp
+
+# ReSharper is a .NET coding add-in
+_ReSharper*
+
+# Installshield output folder
+[Ee]xpress
+
+# DocProject is a documentation generator add-in
+DocProject/buildhelp/
+DocProject/Help/*.HxT
+DocProject/Help/*.HxC
+DocProject/Help/*.hhc
+DocProject/Help/*.hhk
+DocProject/Help/*.hhp
+DocProject/Help/Html2
+DocProject/Help/html
+
+# Click-Once directory
+publish
+
+# Others
+[Bb]in
+[Oo]bj
+sql
+TestResults
+*.Cache
+ClientBin
+stylecop.*
+~$*
+*.dbmdl
+Generated_Code #added for RIA/Silverlight projects
+
+# Backup & report files from converting an old project file to a newer
+# Visual Studio version. Backup files are not needed, because we have git ;-)
+_UpgradeReport_Files/
+Backup*/
+UpgradeLog*.XML
+
+
+
+############
+## Windows
+############
+
+# Windows image file caches
+Thumbs.db
+
+# Folder config file
+Desktop.ini
+
+
+#############
+## Python
+#############
+
+*.py[co]
+
+# Packages
+*.egg
+*.egg-info
+dist
+build
+eggs
+parts
+bin
+var
+sdist
+develop-eggs
+.installed.cfg
+
+# Installer logs
+pip-log.txt
+
+# Unit test / coverage reports
+.coverage
+.tox
+
+#Translations
+*.mo
+
+#Mr Developer
+.mr.developer.cfg
+
+# Mac crap
+.DS_Store
@@ -0,0 +1,141 @@
+//The MIT License
+
+//Copyright (c) 2012 Zekiah Technologies, Inc.
+
+//Permission is hereby granted, free of charge, to any person obtaining a copy
+//of this software and associated documentation files (the "Software"), to deal
+//in the Software without restriction, including without limitation the rights
+//to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+//copies of the Software, and to permit persons to whom the Software is
+//furnished to do so, subject to the following conditions:
+
+//The above copyright notice and this permission notice shall be included in
+//all copies or substantial portions of the Software.
+
+//THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+//IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+//FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+//AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+//LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+//OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+//THE SOFTWARE.
+
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Linq;
+using System.Text;
+using System.IO;
+using System.Runtime.Serialization;
+using System.Runtime.Serialization.Json;
+
+namespace GeoIQ.Net.Data
+{
+ [Serializable]
+ [DataContract()]
+ public class EndpointDefinition
+ {
+ [DataMember(Name = "endpoint")]
+ public string EndpointURL { get; set; }
+ [DataMember(Name = "name")]
+ public string Name { get; set; }
+
+ //non-serialized members
+ public string UserID { get; set; }
+ public string Password { get; set; }
+ }
+
+ [Serializable]
+ [DataContract()]
+ public class EndpointDefinitions
+ {
+
+ public EndpointDefinitions()
+ {
+ this.Items = new ObservableCollection<EndpointDefinition>();
+ }
+
+ [DataMember(Name = "items")]
+
+ public ObservableCollection<EndpointDefinition> Items { get; set; }
+ }
+
+ public class EndpointManager
+ {
+ private EndpointDefinitions _endpoints = null;
+ private string _saveFolder = "";
+
+ public EndpointManager()
+ {
+ _saveFolder = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + "\\GeoIQ";
+ }
+
+ public EndpointDefinitions Endpoints
+ {
+ get { return _endpoints; }
+ }
+
+ public string SaveFolder
+ {
+ get { return _saveFolder; }
+ set
+ {
+ _saveFolder = value;
+ _endpoints = null;
+ Load();
+ }
+ }
+
+ public void Load()
+ {
+ if (!System.IO.Directory.Exists(_saveFolder))
+ {
+ System.IO.Directory.CreateDirectory(_saveFolder);
+ }
+ if (System.IO.File.Exists(_saveFolder + "\\endpoints.json"))
+ {
+ DataContractJsonSerializer serializer = new DataContractJsonSerializer(typeof(EndpointDefinitions));
+ System.IO.FileStream fs = new System.IO.FileStream(_saveFolder + "\\endpoints.json", System.IO.FileMode.Open);
+ //System.IO.TextReader reader = new System.IO.StreamReader(_saveFolder + "\\endpoints.json");
+ _endpoints = (EndpointDefinitions)serializer.ReadObject(fs);
+ fs.Close();
+ }
+ else
+ {
+ _endpoints = new EndpointDefinitions();
+ _endpoints.Items.Add(new EndpointDefinition { Name = "GeoCommons", EndpointURL = "http://finder.geocommons.com" });
+ Save();
+ //System.IO.MemoryStream ms = new System.IO.MemoryStream();
+ //serializer.WriteObject(ms, Extension.Endpoints);
+ //byte[] data = ms.ToArray();
+ //System.IO.FileStream fs = new System.IO.FileStream(_saveFolder + "\\endpoints.json", System.IO.FileMode.Create, System.IO.FileAccess.Write);
+ //fs.Write(data, 0, data.Length);
+ //fs.Close();
+ //ms.Close();
+ //serializer.WriteObject(
+ }
+ _endpoints.Items.CollectionChanged += new System.Collections.Specialized.NotifyCollectionChangedEventHandler(Items_CollectionChanged);
+ }
+
+ void Items_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
+ {
+ Save();
+ }
+
+ public void Save()
+ {
+ if (_endpoints.Items.Count == 0)
+ {
+ _endpoints.Items.Add(new EndpointDefinition { Name = "GeoCommons", EndpointURL = "http://finder.geocommons.com" });
+ }
+ DataContractJsonSerializer serializer = new DataContractJsonSerializer(typeof(EndpointDefinitions));
+ System.IO.MemoryStream ms = new System.IO.MemoryStream();
+ serializer.WriteObject(ms, _endpoints);
+ byte[] data = ms.ToArray();
+ System.IO.FileStream fs = new System.IO.FileStream(_saveFolder + "\\endpoints.json", System.IO.FileMode.Create, System.IO.FileAccess.Write);
+ fs.Write(data, 0, data.Length);
+ fs.Close();
+ ms.Close();
+ }
+ }
+}
Oops, something went wrong.

0 comments on commit 6aaf0b7

Please sign in to comment.