예제 #1
0
        /// <summary>
        /// Removes the given channel instance from the collection of channel instances.
        /// </summary>
        /// <param name="channelInstance">The channel instance to be removed.</param>
        public void Remove(ChannelInstance channelInstance)
        {
            CollectionElement?channelInstancesElement = PhysicalRecord.Body.Collection.GetCollectionByTag(ChannelInstancesTag);

            if (channelInstancesElement == null)
            {
                return;
            }

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

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

                if (Equals(channelInstance, instance))
                {
                    channelInstancesElement.RemoveElement(channelSettingElement);
                }
            }
        }
예제 #2
0
 /// <summary>
 /// Creates a new instance of the <see cref="SeriesInstance"/> class.
 /// </summary>
 /// <param name="physicalStructure">The physical structure of the series instance.</param>
 /// <param name="channel">The channel instance that this series instance resides in.</param>
 /// <param name="definition">The series definition that defines this series instance.</param>
 public SeriesInstance(CollectionElement physicalStructure, ChannelInstance channel, SeriesDefinition definition)
 {
     PhysicalStructure = physicalStructure;
     Channel           = channel;
     Definition        = definition;
 }