using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; using System.Text; using System.Threading.Tasks; using Tango.BL.Enumerations; using Tango.Core; namespace Tango.FSE.Insights.Config { public class AnnotationsConfiguration : ExtendedObject { private bool _displayConnectionMarkers; public bool DisplayConnectionMarkers { get { return _displayConnectionMarkers; } set { _displayConnectionMarkers = value; RaisePropertyChangedAuto(); } } private bool _displayEvents; public bool DisplayEvents { get { return _displayEvents; } set { _displayEvents = value; RaisePropertyChangedAuto(); } } private bool _displayJob; public bool DisplayJobs { get { return _displayJob; } set { _displayJob = value; RaisePropertyChangedAuto(); } } private bool _displayStatuses; public bool DisplayStatuses { get { return _displayStatuses; } set { _displayStatuses = value; RaisePropertyChangedAuto(); } } private bool _displayUpdates; public bool DisplayUpdates { get { return _displayUpdates; } set { _displayUpdates = value; RaisePropertyChangedAuto(); } } private bool _displayBugReports; public bool DisplayBugReports { get { return _displayBugReports; } set { _displayBugReports = value; RaisePropertyChangedAuto(); } } private bool _displayApplicationExceptions; public bool DisplayApplicationExceptions { get { return _displayApplicationExceptions; } set { _displayApplicationExceptions = value; RaisePropertyChangedAuto(); } } private ObservableCollection _eventsCategories; [JsonProperty(ObjectCreationHandling = ObjectCreationHandling.Replace)] public ObservableCollection EventsCategories { get { return _eventsCategories; } set { _eventsCategories = value; RaisePropertyChangedAuto(); } } private ObservableCollection _eventsGroups; [JsonProperty(ObjectCreationHandling = ObjectCreationHandling.Replace)] public ObservableCollection EventsGroups { get { return _eventsGroups; } set { _eventsGroups = value; RaisePropertyChangedAuto(); } } public static AnnotationsConfiguration CreateDefault() { AnnotationsConfiguration config = new AnnotationsConfiguration(); config.EventsCategories.Add(EventTypeCategories.Critical); config.EventsCategories.Add(EventTypeCategories.Error); config.EventsCategories.Add(EventTypeCategories.Info); //config.EventsGroups.Add(EventTypeGroups.Jobs); //Job are artificially from a check box. config.EventsGroups.Add(EventTypeGroups.Application); config.EventsGroups.Add(EventTypeGroups.Dispensers); config.EventsGroups.Add(EventTypeGroups.Dryer); config.EventsGroups.Add(EventTypeGroups.DyeingHead); config.EventsGroups.Add(EventTypeGroups.ElectricalCabinet); config.EventsGroups.Add(EventTypeGroups.GeneralHardware); config.EventsGroups.Add(EventTypeGroups.InkDeliverySystem); config.EventsGroups.Add(EventTypeGroups.InkFillingSystem); config.EventsGroups.Add(EventTypeGroups.Mixer); config.EventsGroups.Add(EventTypeGroups.ThreadFeedingSystem); config.EventsGroups.Add(EventTypeGroups.WasteHandlingSystem); return config; } public AnnotationsConfiguration() { DisplayConnectionMarkers = true; DisplayEvents = true; DisplayJobs = true; DisplayStatuses = true; DisplayUpdates = true; DisplayBugReports = true; DisplayApplicationExceptions = true; EventsCategories = new ObservableCollection(); EventsGroups = new ObservableCollection(); } } }