Ejemplo n.º 1
0
        /// <summary>
        /// <see cref="ISniffer.Validate(DulMessage , ValidationControlFlags )"/>
        /// </summary>
        public bool Validate(
            DulMessage message,
            ValidationControlFlags validationControlFlags)
        {
            if (message == null)
            {
                throw new System.ArgumentNullException();
            }

            //Set the validation options
            Wrappers.ValidationControlFlags
                wrappersValidationControlFlags = Wrappers.ValidationControlFlags.None;
            if ((validationControlFlags & ValidationControlFlags.UseDefinitions) != 0)
            {
                wrappersValidationControlFlags |= Wrappers.ValidationControlFlags.UseDefinitions;
            }
            if ((validationControlFlags & ValidationControlFlags.UseValueRepresentations) != 0)
            {
                wrappersValidationControlFlags |= Wrappers.ValidationControlFlags.UseValueRepresentations;
            }

            return((this.m_adaptee as Wrappers.MSnifferSession).Validate(
                       message,
                       wrappersValidationControlFlags));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// <see cref="IDimseValidation.Validate"/>
        /// </summary>
        public bool Validate(
            DicomMessage message,
            DicomMessage referenceMessage,
            ValidationControlFlags validationControlFlags)
        {
            if (message == null)
            {
                throw new System.ArgumentNullException();
            }
            // referenceMessage may be null
            //
            // Convert flags
            //
            Wrappers.ValidationControlFlags
                wrappersValidationControlFlags = Wrappers.ValidationControlFlags.None;
            if ((validationControlFlags & ValidationControlFlags.UseDefinitions) != 0)
            {
                wrappersValidationControlFlags |= Wrappers.ValidationControlFlags.UseDefinitions;
            }
            if ((validationControlFlags & ValidationControlFlags.UseReferences) != 0)
            {
                wrappersValidationControlFlags |= Wrappers.ValidationControlFlags.UseReferences;
            }
            if ((validationControlFlags & ValidationControlFlags.UseValueRepresentations) != 0)
            {
                wrappersValidationControlFlags |= Wrappers.ValidationControlFlags.UseValueRepresentations;
            }

            return((this.m_adaptee as Wrappers.MScriptSession).Validate(
                       message,
                       referenceMessage,
                       wrappersValidationControlFlags));
        }
Ejemplo n.º 3
0
        /// <summary>
        /// <see cref="IMediaValidation.Validate"/>
        /// </summary>
        public bool Validate(DicomFile file, ValidationControlFlags validationControlFlags)
        {
            if (file == null)
            {
                throw new System.ArgumentNullException("file");
            }
            if ((validationControlFlags & ValidationControlFlags.UseReferences) != 0)
            {
                throw new System.ArgumentException();
            }
            //
            // Convert flags
            //
            Wrappers.ValidationControlFlags
                wrappersValidationControlFlags = Wrappers.ValidationControlFlags.None;
            if ((validationControlFlags & ValidationControlFlags.UseDefinitions) != 0)
            {
                wrappersValidationControlFlags |= Wrappers.ValidationControlFlags.UseDefinitions;
            }
            if ((validationControlFlags & ValidationControlFlags.UseReferences) != 0)
            {
                wrappersValidationControlFlags |= Wrappers.ValidationControlFlags.UseReferences;
            }
            if ((validationControlFlags & ValidationControlFlags.UseValueRepresentations) != 0)
            {
                wrappersValidationControlFlags |= Wrappers.ValidationControlFlags.UseValueRepresentations;
            }

            return(this.m_adaptee.Validate(file, wrappersValidationControlFlags));
        }
Ejemplo n.º 4
0
        /// <summary>
        /// <see cref="IDulValidation.Validate"/>
        /// </summary>
        public bool Validate(
            DulMessage message,
            DulMessage referenceMessage,
            ValidationControlFlags validationControlFlags)
        {
            if (message == null)
            {
                throw new System.ArgumentNullException();
            }
            //
            // referenceMessage may be null
            //
            if (referenceMessage != null)
            {
                //
                // Check runtime instance type equality of message and referenceMessage
                //
                if (referenceMessage.GetType() != message.GetType())
                {
                    throw new System.ArgumentException(
                              string.Concat(
                                  "message and referenceMessage should have the same type.\n",
                                  string.Format(
                                      "message type = {0}\n",
                                      message.GetType().ToString()
                                      ),
                                  string.Format(
                                      "referenceMessage type = {0}\n",
                                      referenceMessage.GetType().ToString()
                                      )
                                  ),
                              "referenceMessage");
                }
            }
            //
            // Remove obsolete flag ValidationControlFlags.UseValueRepresentations
            //
            Wrappers.ValidationControlFlags
                wrappersValidationControlFlags = Wrappers.ValidationControlFlags.None;
            if ((validationControlFlags & ValidationControlFlags.UseDefinitions) != 0)
            {
                wrappersValidationControlFlags |= Wrappers.ValidationControlFlags.UseDefinitions;
            }
            if ((validationControlFlags & ValidationControlFlags.UseReferences) != 0)
            {
                wrappersValidationControlFlags |= Wrappers.ValidationControlFlags.UseReferences;
            }
//            if ((validationControlFlags & ValidationControlFlags.UseValueRepresentations) != 0)
//                wrappersValidationControlFlags |= Wrappers.ValidationControlFlags.UseValueRepresentations;

            return((this.m_adaptee as Wrappers.MScriptSession).Validate(
                       message,
                       referenceMessage,
                       wrappersValidationControlFlags));
        }