public void RevokeInformer(WmiReadynessInformer obj, bool force = false) { if (!ContainsInformer(obj)) { throw new ArgumentException("Informer with specified ApplicationName has not been published through this provider."); } try { if (obj.GetType().GetCustomAttributes(typeof(ManagementEntityAttribute), false).Any()) { InstrumentationManager.Revoke(obj); } else { Instrumentation.Revoke(obj); } } catch (Exception ex) { if (!force) { throw ex; } } _pub.Remove(obj.ApplicationName); }
public void PublishInformer(WmiReadynessInformer obj) { if (ContainsInformer(obj)) { throw new ArgumentException("This informer has already been already published.", "obj.ApplicationName = " + obj.ApplicationName); } if (obj.GetType().GetCustomAttributes(typeof(ManagementEntityAttribute), false).Any()) { InstrumentationManager.Publish(obj); } else { Instrumentation.Publish(obj); } _inform.Add(obj.ApplicationName, obj); }
public bool ContainsInformer(WmiReadynessInformer informer) { return(_inform.ContainsKey(informer.ApplicationName)); }