diff --git a/Xamarin.Neo4j/Xamarin.Neo4j/Xamarin.Neo4j.iOS/Info.plist b/Xamarin.Neo4j/Xamarin.Neo4j/Xamarin.Neo4j.iOS/Info.plist index 31c765e..472017e 100644 --- a/Xamarin.Neo4j/Xamarin.Neo4j/Xamarin.Neo4j.iOS/Info.plist +++ b/Xamarin.Neo4j/Xamarin.Neo4j/Xamarin.Neo4j.iOS/Info.plist @@ -27,7 +27,7 @@ CFBundleIdentifier nl.resoftware.pocketgraph CFBundleVersion - 1.0.2 + 1.0.3 UILaunchStoryboardName LaunchScreen CFBundleName diff --git a/Xamarin.Neo4j/Xamarin.Neo4j/Xamarin.Neo4j/Managers/ConnectionStringManager.cs b/Xamarin.Neo4j/Xamarin.Neo4j/Xamarin.Neo4j/Managers/ConnectionStringManager.cs index 8e4939a..1c3ddf2 100644 --- a/Xamarin.Neo4j/Xamarin.Neo4j/Xamarin.Neo4j/Managers/ConnectionStringManager.cs +++ b/Xamarin.Neo4j/Xamarin.Neo4j/Xamarin.Neo4j/Managers/ConnectionStringManager.cs @@ -59,5 +59,22 @@ namespace Xamarin.Neo4j.Managers await SaveConnectionStrings(connectionStrings); } + + public static async Task UpdateConnectionString(Guid id, Neo4jConnectionString connectionString) + { + var connectionStrings = await GetConnectionStrings(); + + var connectionStringToUpdate = connectionStrings.FirstOrDefault(cs => cs.Id == id); + + if (connectionStringToUpdate == null) + return; + + connectionStringToUpdate.Scheme = connectionString.Scheme; + connectionStringToUpdate.Host = connectionString.Host; + connectionStringToUpdate.Username = connectionString.Username; + connectionStringToUpdate.Password = connectionString.Password; + + await SaveConnectionStrings(connectionStrings); + } } } diff --git a/Xamarin.Neo4j/Xamarin.Neo4j/Xamarin.Neo4j/Models/Neo4jConnectionString.cs b/Xamarin.Neo4j/Xamarin.Neo4j/Xamarin.Neo4j/Models/Neo4jConnectionString.cs index 3c79839..76fb48d 100644 --- a/Xamarin.Neo4j/Xamarin.Neo4j/Xamarin.Neo4j/Models/Neo4jConnectionString.cs +++ b/Xamarin.Neo4j/Xamarin.Neo4j/Xamarin.Neo4j/Models/Neo4jConnectionString.cs @@ -21,23 +21,27 @@ namespace Xamarin.Neo4j.Models public string Host { get; set; } + public string Scheme { get; set; } + public string Username { get; set; } public string Password { get; set; } public Tuple ParseHost() { - if (Host.StartsWith("neo4j://")) - return new Tuple(Host, false, false); + var fullHost = Scheme + Host; + + if (fullHost.StartsWith("neo4j://")) + return new Tuple(fullHost, false, false); - if (Host.StartsWith("bolt://")) - return new Tuple(Host.Replace("bolt://", "neo4j://"), false, false); + if (fullHost.StartsWith("bolt://")) + return new Tuple(fullHost.Replace("bolt://", "neo4j://"), false, false); - if (Host.StartsWith("neo4j+s://")) - return new Tuple(Host.Replace("neo4j+s://", "neo4j://"), true, false); + if (fullHost.StartsWith("neo4j+s://")) + return new Tuple(fullHost.Replace("neo4j+s://", "neo4j://"), true, false); - if (Host.StartsWith("neo4j+ssc://")) - return new Tuple(Host.Replace("neo4j+ssc://", "neo4j://"), true, true); + if (fullHost.StartsWith("neo4j+ssc://")) + return new Tuple(fullHost.Replace("neo4j+ssc://", "neo4j://"), true, true); throw new NotSupportedException("Unknown protocol."); } diff --git a/Xamarin.Neo4j/Xamarin.Neo4j/Xamarin.Neo4j/Pages/AddConnectionPage.xaml b/Xamarin.Neo4j/Xamarin.Neo4j/Xamarin.Neo4j/Pages/AddConnectionPage.xaml index 563b8e7..0a2e7c1 100644 --- a/Xamarin.Neo4j/Xamarin.Neo4j/Xamarin.Neo4j/Pages/AddConnectionPage.xaml +++ b/Xamarin.Neo4j/Xamarin.Neo4j/Xamarin.Neo4j/Pages/AddConnectionPage.xaml @@ -7,6 +7,22 @@ + + +