internal void Delete(Models.Settings.Device.Subscription theUpdatedSubscriptions) { bool SubChangesMade = false; var DeviceSearch = Core.Instance.Devices.FirstOrDefault(d => d.Guid == theUpdatedSubscriptions.DeviceId); if (DeviceSearch != null) { BBOutput OutputSearch = DeviceSearch.Outputs.FirstOrDefault(o => o.Name == theUpdatedSubscriptions.OutputId); if (OutputSearch != null) { BBSubscription Subscription = OutputSearch.Subscriptions.FirstOrDefault(s => s.Guid == theUpdatedSubscriptions.SubscriptionGuid); if (OutputSearch.Remove(Subscription)) { SubChangesMade = true; } } } if (SubChangesMade) { ConstructSubscriptions(); } }
internal void Update(Models.Settings.Device.Subscription theUpdatedSubscriptions) { var DeviceSearch = Core.Instance.Devices.FirstOrDefault(d => d.Guid == theUpdatedSubscriptions.DeviceId); if (DeviceSearch != null) { DeviceSearch.UpdateSubscriptions(theUpdatedSubscriptions); } }