using System; using System.Collections.Generic; using System.ComponentModel; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; using Tango.BL; using Tango.Integration.Operation; using Tango.Logging; using Tango.MachineStudio.Common.Web; using Tango.PMR.Printing; using Tango.Settings; using Tango.Transport.Adapters; using Tango.Web; namespace Tango.MachineStudio.Common { public class MachineStudioSettings : SettingsBase { public class StudioModuleBounds { public String Name { get; set; } public Rect Bounds { get; set; } public WindowState State { get; set; } } public enum WorkingEnvironment { Remote, Local } /// /// Gets or sets the last login email. /// public String LastLoginEmail { get; set; } /// /// Gets or sets the last login password. /// public String LastLoginPassword { get; set; } /// /// Gets or sets the last login method. /// public LoginMethod LastLoginMethod { get; set; } /// /// Gets or sets a value indicating whether to save the user credentials. /// public bool RememberMe { get; set; } /// /// Gets or sets the last virtual machine serial number. /// public String LastVirtualMachineSerialNumber { get; set; } /// /// Gets or sets the last bounds. /// public Rect LastBounds { get; set; } /// /// Gets or sets the default issue report assign to. /// public String DefaultIssueReportAssignTo { get; set; } /// /// Gets or sets the default issue report area. /// public String DefaultIssueReportArea { get; set; } /// /// Gets or sets the default issue report tags. /// public List DefaultIssueReportTags { get; set; } /// /// Gets or sets a value indicating whether add external bridge client emulator when scanning for connected machines. /// public bool UseExternalBridgeEmulator { get; set; } /// /// Gets or sets the last bounds of modules open windows. /// public List StudioModulesBounds { get; set; } /// /// Gets or sets the last module that was opened in the main window. /// public String LastMainModuleName { get; set; } /// /// Gets or sets the working environment. /// public WorkingEnvironment Environment { get; set; } /// /// Gets or sets the deployment slot. /// public DeploymentSlot DeploymentSlot { get; set; } /// /// Gets or sets the job upload strategy. /// public JobUploadStrategy JobUploadStrategy { get; set; } /// /// Gets or sets the job number of units method. /// public JobUnitsMethods JobUnitsMethod { get; set; } /// /// Gets or sets a value indicating whether to by pass environment version check. /// public bool ByPassEnvironmentVersionCheck { get; set; } /// /// Gets or sets a value indicating whether to force the application version update. /// public bool ForceVersionUpdate { get; set; } /// /// Gets or sets a value indicating whether to enable database entity caching. /// public ObservablesContextInMemoryCachingMode CachingMode { get; set; } /// /// Gets or sets the maximum cache time for a single entity (when CachingMode is set Absolute or Relative). /// public TimeSpan MaximumCacheTime { get; set; } /// /// Gets or sets the external bridge request timeout. /// public TimeSpan ExternalBridgeRequestTimeout { get; set; } /// /// Gets or sets the external bridge continuous request timeout. /// public TimeSpan ExternalBridgeContinuousRequestTimeout { get; set; } /// /// Gets or sets the external bridge SignalR hub. /// public String ExternalBridgeSignalRHub { get; set; } /// /// Gets or sets a value indicating whether to enable external bridge scanning via SignalR. /// public bool EnableExternalBridgeSignalR { get; set; } /// /// Gets or sets the TCP transport adapter write mode. /// public TcpTransportAdapterWriteMode TcpTransportAdapterWriteMode { get; set; } /// /// Gets the machine service address. /// public String MachineServiceAddress { get { return GetMachineServiceAddress(); } } /// /// Gets the machine service address. /// /// public String GetMachineServiceAddress() { return DeploymentSlot.ToAddress(); } /// /// Gets or sets the working theme. /// public MachineStudioTheme Theme { get; set; } /// /// Initializes a new instance of the class. /// public MachineStudioSettings() { LastBounds = new Rect(); DefaultIssueReportTags = new List(); StudioModulesBounds = new List(); Environment = WorkingEnvironment.Remote; DeploymentSlot = DeploymentSlot.DEV; JobUploadStrategy = JobUploadStrategy.JobDescriptionFile; MaximumCacheTime = TimeSpan.FromMinutes(5); CachingMode = ObservablesContextInMemoryCachingMode.None; Theme = MachineStudioTheme.Light; JobUnitsMethod = JobUnitsMethods.Operator; ExternalBridgeRequestTimeout = TimeSpan.FromSeconds(5); ExternalBridgeContinuousRequestTimeout = TimeSpan.FromSeconds(5); ExternalBridgeSignalRHub = "ExternalBridgeHub"; EnableExternalBridgeSignalR = true; TcpTransportAdapterWriteMode = TcpTransportAdapterWriteMode.Interval; } } }