Example #1
0
        public void Unregister(ICFU cfu)
        {
            var toRemove = ChildCollection.Where(x => x.Value.Equals(cfu)).Select(x => x.Key).ToList(); //ToList required, as we remove from the source

            foreach (var key in toRemove)
            {
                ChildCollection.Remove(key);
            }

            machine.UnregisterAsAChildOf(this, cfu);
        }
Example #2
0
        /// <summary>
        /// Release the child form index when it is unloaded
        /// </summary>
        /// <param name="e">OnClosed event args</param>
        protected override void OnClosed(EventArgs e)
        {
            base.OnClosed(e);

            // Remove from the collection only if the calling form is a MDI child form
            if (this.IsMdiContainer == false && this.MdiParent != null)
            {
                ChildCollection.Remove(this.Name.ToString());
                childNames.Remove(this.CurrentFormName);
                this.IntimateParent(false);
            }
        }
Example #3
0
        public virtual void Unregister(T peripheral)
        {
            var toRemove = ChildCollection.Where(x => x.Value.Equals(peripheral)).Select(x => x.Key).ToList();

            if (toRemove.Count == 0)
            {
                throw new RegistrationException("The specified peripheral was never registered.");
            }
            foreach (var key in toRemove)
            {
                ChildCollection.Remove(key);
            }
        }