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));
        }
Esempio n. 2
0
 internal static void InvokeInstanceAdded(Instance instance)
 {
     InstanceAdded?.Invoke(instance);
 }