Esempio n. 1
0
        //
        // - Methods -
        //

        /// <summary>
        /// Creates a deep copy of this instance.
        /// </summary>
        /// <returns>A deep copy of this instance.</returns>
        public CommandSet Clone()
        {
            // Create an empty Command Set.
            CommandSet cloneCommandSet = new CommandSet(this.DvtkDataCommandSet.CommandField);

            // Copy all attributes.
            for (int index = 0; index < this.Count; index++)
            {
                // The Add method will take care of the deep copy.
                cloneCommandSet.Add(this[index]);
            }

            // Return the deep copy.
            return(cloneCommandSet);
        }
Esempio n. 2
0
        /// <summary>
        /// Makes this instance a deep copy of <paramref name="commandSet"/>.
        /// </summary>
        /// <param name="commandSet">The Command Set to copy from.</param>
        public void CloneFrom(CommandSet commandSet)
        {
            Clear();

            for (int index = 0; index < commandSet.Count; index++)
            {
                // The Add method will take care of the deep copy.
                Add(commandSet[index]);
            }
        }
Esempio n. 3
0
        //
        // - Methods -
        //        
        /// <summary>
        /// Creates a deep copy of this instance.
        /// </summary>
        /// <returns>A deep copy of this instance.</returns>
        public CommandSet Clone()
        {
            // Create an empty Command Set.
            CommandSet cloneCommandSet = new CommandSet(this.DvtkDataCommandSet.CommandField);

            // Copy all attributes.
            for (int index = 0; index < this.Count; index++)
            {
                // The Add method will take care of the deep copy.
                cloneCommandSet.Add(this[index]);
            }

            // Return the deep copy.
            return(cloneCommandSet);
        }
Esempio n. 4
0
 internal DicomMessage(CommandSet commandSet, DataSet dataSet)
 {
     this.commandSet = commandSet;
     this.dataSet = dataSet;
 }
Esempio n. 5
0
 /// <summary>
 /// Constructor.
 /// 
 /// Use this constructor to create a DicomMessage with an empty command set
 /// and the given Dataset.
 /// </summary>
 /// <param name="dimseCommand">The Dimse command.</param>
 /// <param name="dataSet">The Dataset.</param>
 public DicomMessage(DvtkData.Dimse.DimseCommand dimseCommand, DataSet dataSet)
 {
     this.commandSet = new CommandSet(dimseCommand);
     this.dataSet = dataSet;
 }
Esempio n. 6
0
        /// <summary>
        /// Constructor.
        /// 
        /// Use this constructor to construct the command set and data set based on the 
        /// command set and data set contained in the encapsulated DvtkData DicomMessage.
        /// </summary>
        /// <param name="dvtkDataDicomMessage">The encapsulated DvtkData DicomMessage.</param>
        internal DicomMessage(DvtkData.Dimse.DicomMessage dvtkDataDicomMessage)
        {
            // Sanity check.
            if (dvtkDataDicomMessage == null)
            {
                throw new HliException("Parameter may not be null.");
            }

            // Create the CommandSet object.
            this.commandSet = new CommandSet(dvtkDataDicomMessage.CommandSet);

            // Create the DataSet object.
            if (dvtkDataDicomMessage.DataSet == null)
            {
                this.dataSet = new DataSet();
            }
            else
            {
                this.dataSet = new DataSet(dvtkDataDicomMessage.DataSet);
            }

            this.encodedPCID = dvtkDataDicomMessage.EncodedPresentationContextID;
        }