Пример #1
0
        /// <summary>
        /// <see cref="ISniffer.Validate"/>
        /// </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);
        }
Пример #2
0
        /// <summary>
        /// <see cref="IDulMessaging.Send"/>
        /// </summary>
        public SendReturnCode Send(DulMessage message)
        {
            if (message == null) throw new System.ArgumentNullException();

            Wrappers.SendReturnCode wrappersSendReturnCode =
                (this.m_adaptee as Wrappers.MScriptSession).Send(message);
            return _Convert(wrappersSendReturnCode);
        }
Пример #3
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);
        }
Пример #4
0
 /// <summary>
 /// <see cref="IDulMessaging.Receive(out DulMessage )"/>
 /// </summary>
 public ReceiveReturnCode Receive(out DulMessage dulMessage)
 {
     dulMessage = null;
     Wrappers.ReceiveReturnCode wrappersReceiveReturnCode =
         (this.m_adaptee as Wrappers.MScriptSession).Receive(out dulMessage);
     return _Convert(wrappersReceiveReturnCode);
 }