123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143 |
- using System;
- using System.Collections.Generic;
- using System.IO;
- using System.Net;
- using InABox.Clients;
- using InABox.Configuration;
- using InABox.Core;
- namespace Comal.Classes
- {
- public enum AutoUpdateChannel
- {
- Stable,
- PreRelease,
- Unstable
- }
- public enum DatabaseType
- {
- Standalone,
- Networked,
- Local,
- RPC
- }
-
- public class DatabaseSettings : ILocalConfigurationSettings
- {
- public DatabaseSettings()
- {
- IsActive = true;
-
- DatabaseType = DatabaseType.Networked;
-
- // If DatabaseType == Standalone
- FileName = Path.Combine(CoreUtils.GetPath(), "prs.dbs");
- Provider = DatabaseProvider.SQLite;
- // If DatabaseType == Pipe
- LocalServerName = "";
-
- // If DatabaseType == Networked
- //URL = "http://127.0.0.1";
- //Port = 8000;
- Protocol = SerializerProtocol.RPC;
- URLs = new string[] { "https://demo.prsdigital.com.au:8033" };
- StartPanel = "";
- Autologin = false;
- LoginType = LoginType.UserID;
- Logo = null;
- LibraryLocation = "";
- GoogleAPIKey = "";
- JobPrefix = "";
- PurchaseOrderPrefix = "";
- SecondaryWindows = new Dictionary<Guid, Tuple<string, string, double, double, double, double>>();
- 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))
- //|| (!int.Equals(Port, original.Port))
- || (!String.Equals(String.Join(";", URLs), String.Join(";", original.URLs)));
- 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;
- }
- }
- }
-
- [Obsolete("Replaced with HostNames", true)]
- public string URL { get; set; }
- [Obsolete("Replaced with HostNames", true)]
- public int Port { get; set; }
- public SerializerProtocol Protocol { get; set; }
- public string UserID { get; set; }
- public string Password { get; set; }
-
- public DatabaseType DatabaseType { get; set; }
- public string FileName { get; set; }
- public string LocalServerName { get; set; }
-
- public string[] URLs { 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 byte[]? Logo { get; set; }
- public const string DefaultColorScheme = "#FF6495ED";
- public string ColorScheme { 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<Guid, Tuple<string, string, double, double, double, double>> SecondaryWindows { get; set; }
-
- public Dictionary<int, int> ButtonFavourites { get; set; }
- }
- public enum AutoUpdateType
- {
- NotSet,
- Url,
- File
- }
- }
|