GSF.PQDIF.Logical.ObservationRecord.Remove C# (CSharp) 메소드

Remove() 공개 메소드

Removes the given channel instance from the collection of channel instances.
public Remove ( ChannelInstance channelInstance ) : void
channelInstance ChannelInstance The channel instance to be removed.
리턴 void
        public void Remove(ChannelInstance channelInstance)
        {
            CollectionElement channelInstancesElement = m_physicalRecord.Body.Collection.GetCollectionByTag(ChannelInstancesTag);
            List<CollectionElement> channelInstanceElements;
            ChannelInstance instance;

            if ((object)channelInstancesElement == null)
                return;

            channelInstanceElements = channelInstancesElement.GetElementsByTag(OneChannelInstanceTag).Cast<CollectionElement>().ToList();

            foreach (CollectionElement channelSettingElement in channelInstanceElements)
            {
                instance = new ChannelInstance(channelSettingElement, this);

                if (Equals(channelInstance, instance))
                    channelInstancesElement.RemoveElement(channelSettingElement);
            }
        }