void BrowseForDbLib() { var dblib = AltiumFile.BrowseForDbLib(); if (dblib.Success) { PathToDbLib = dblib.Path; Properties.Settings.Default.AltiumDbPath = dblib.Path; Properties.Settings.Default.Save(); PathToUdl = dblib.ConnectionStringPath; } }
void BrowseForAltiumDirectory() { var dbLib = AltiumFile.BrowseForDbLib(); if (!dbLib.Success) { ShowAltiumPathError = true; AltiumPathError = "DbLib could not be found/opened. Please login with username and password."; return; } if (String.IsNullOrEmpty(dbLib.ConnectionStringPath)) { ShowAltiumPathError = true; AltiumPathError = "DbLib has not been configured correctly. Please login with username and password."; return; } var conn = AltiumFile.ReadUdlFile(dbLib.ConnectionStringPath); if (!String.IsNullOrEmpty(conn.Error)) { ShowAltiumPathError = true; AltiumPathError = String.Format("{0} Please login with username and password.", conn.Error); return; } if (conn.Server != "csql.database.windows.net") { ShowAltiumPathError = true; AltiumPathError = "DbLib configured for a local server. Please login with username and password."; return; } Username = conn.Username; Password = conn.Password; AltiumPath = dbLib.Path; }