public void AddUrlMonitoringInstance(UrlAddressMonitoringInstance instance) { if (instance == null) { throw new ArgumentNullException(nameof(instance)); } //Check for duplicate class key if (_urlAddresses.FirstOrDefault(x => x.Address == instance.Address) != null) { throw new Exception("Unable to add new instance, Existing instance found with same key property"); } _urlInstanceEditor.ExecuteDiscovery(ScomDiscoveryType.Insert, new UrlAddressMonitoringInstance[] { instance }); _urlAddresses.Add(instance); InstanceAdded?.Invoke(this, new UrlAddressInstanceEventArgs(instance)); }
internal static void InvokeInstanceAdded(Instance instance) { InstanceAdded?.Invoke(instance); }