using System; using System.Collections.Generic; using System.IO; using InABox.Clients; using InABox.Configuration; using InABox.Core; namespace Comal.Classes { public enum AutoUpdateChannel { Stable, PreRelease, Unstable } public enum DatabaseType { Standalone, Networked, Local } public class DatabaseSettings : ConnectionSettings { public DatabaseSettings() { IsActive = true; DatabaseType = DatabaseType.Standalone; FileName = Path.Combine(CoreUtils.GetPath(), "prs.dbs"); LocalServerName = ""; URL = "http://127.0.0.1"; Port = 8000; Protocol = SerializerProtocol.Rest; Provider = DatabaseProvider.SQLite; StartPanel = ""; //UpdateType = AutoUpdateType.Url; //UpdateLocation = "https://prsdigital.com.au/updates/prs"; //UpdateAdmin = false; //UpdateChannel = AutoUpdateChannel.Stable; Autologin = false; LoginType = LoginType.UserID; Logo = null; LibraryLocation = ""; GoogleAPIKey = ""; JobPrefix = ""; PurchaseOrderPrefix = ""; SecondaryWindows = new Dictionary>(); ColorScheme = DefaultColorScheme; // CornflowerBlue } public bool RestartRequired(DatabaseSettings original) { bool result = (original.DatabaseType != DatabaseType) || (!String.Equals(FileName, original.FileName)) || (!String.Equals(LocalServerName, original.LocalServerName)) || (!String.Equals(URL, original.URL)); return result; } public bool IsActive { get; set; } [Obsolete("Use DatabaseType instead")] public bool IsNetwork { get => DatabaseType == DatabaseType.Networked; set { if (value) { DatabaseType = DatabaseType.Networked; } else if(DatabaseType == DatabaseType.Networked) { DatabaseType = DatabaseType.Standalone; } } } public DatabaseType DatabaseType { get; set; } public string FileName { get; set; } public string LocalServerName { get; set; } public LoginType LoginType { get; set; } public bool Autologin { get; set; } public string StartPanel { get; set; } public DatabaseProvider Provider { get; set; } public string LibraryLocation { get; set; } //public AutoUpdateType UpdateType { get; set; } //public String UpdateLocation { get; set; } public byte[]? Logo { get; set; } public const string DefaultColorScheme = "#FF6495ED"; public string ColorScheme { get; set; } //public bool UpdateAdmin { get; set; } //public AutoUpdateChannel UpdateChannel { get; set; } public string GoogleAPIKey { get; set; } // Geocoding API vandenbos.frank@gmail.com: "AIzaSyB9ZnKdEpKsbN9cm3K7rNfqeN5fIe_xlJ0"; public string JobPrefix { get; set; } public string PurchaseOrderPrefix { get; set; } // Panel Class, Button Name (? this should be panel name, but grrr), left, top, width, height public Dictionary> SecondaryWindows { get; set; } } public enum AutoUpdateType { NotSet, Url, File } }