Exemplo n.º 1
0
        /// <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));
                }
            }
        }
Exemplo n.º 2
0
        /// <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));
            }
        }
Exemplo n.º 3
0
        /// <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));
            }
        }
Exemplo n.º 4
0
 /// <summary>
 /// Raises the BeforePluginsStopped event.
 /// </summary>
 /// <param name="e"></param>
 internal void OnBeforePluginsStopped(PluginContextEventArgs e)
 {
     EventHandlerHelper.Raise(BeforePluginsStopped, this, e);
 }
Exemplo n.º 5
0
 /// <summary>
 /// Raises the AfterPluginsStarted event.
 /// </summary>
 /// <param name="e"></param>
 internal void OnAfterPluginsStarted(PluginContextEventArgs e)
 {
     EventHandlerHelper.Raise(AfterPluginsStarted, this, e);
 }
Exemplo n.º 6
0
 /// <summary>
 /// Raises the PluginStopped event.
 /// </summary>
 /// <param name="e"></param>
 internal void OnPluginStopped(PluginDescriptorEventArgs e)
 {
     EventHandlerHelper.Raise(PluginStopped, this, e);
 }