/// <summary> /// Removes a Type from the collection /// </summary> /// <param name="type">The Type to remove</param> public void Remove(Type type) { if (Contains(type)) { lock (SyncRoot) { InnerList.Remove(type); EventHandlerHelper.Raise(Changed, this, new TypeCollectionEventArgs(type, ObjectActions.Changed)); } } }
/// <summary> /// Adds a Type to the collection /// </summary> /// <param name="type">The Type to add</param> public void Add(Type type) { if (!AllowDuplicates) { if (Contains(type)) { throw new TypeAlreadyExistsException(type); } } lock (SyncRoot) { InnerList.Add(type); EventHandlerHelper.Raise(Changed, this, new TypeCollectionEventArgs(type, ObjectActions.Added)); } }
/// <summary> /// Inserts a Type into the collection at the specified index. /// </summary> /// <param name="index"></param> /// <param name="type"></param> public void Insert(int index, Type type) { if (type == null) { throw new ArgumentNullException("type"); } if (Contains(type)) { throw new TypeAlreadyExistsException(type); } lock (SyncRoot) { InnerList.Insert(index, type); EventHandlerHelper.Raise(Changed, this, new TypeCollectionEventArgs(type, ObjectActions.Added)); } }
/// <summary> /// Raises the BeforePluginsStopped event. /// </summary> /// <param name="e"></param> internal void OnBeforePluginsStopped(PluginContextEventArgs e) { EventHandlerHelper.Raise(BeforePluginsStopped, this, e); }
/// <summary> /// Raises the AfterPluginsStarted event. /// </summary> /// <param name="e"></param> internal void OnAfterPluginsStarted(PluginContextEventArgs e) { EventHandlerHelper.Raise(AfterPluginsStarted, this, e); }
/// <summary> /// Raises the PluginStopped event. /// </summary> /// <param name="e"></param> internal void OnPluginStopped(PluginDescriptorEventArgs e) { EventHandlerHelper.Raise(PluginStopped, this, e); }