public Message SetupExecution()
        {
            base.ThrowIfProcessingStarted();
            base.SetProcessingStarted();
            bool signBody = false;

            if (this.elementContainer.SourceSigningToken != null)
            {
                if (this.signatureParts == null)
                {
                    throw TraceUtility.ThrowHelperError(new ArgumentNullException("SignatureParts"), base.Message);
                }
                signBody = this.signatureParts.IsBodyIncluded;
            }
            bool encryptBody = false;

            if (this.elementContainer.SourceEncryptionToken != null)
            {
                if (this.encryptionParts == null)
                {
                    throw TraceUtility.ThrowHelperError(new ArgumentNullException("EncryptionParts"), base.Message);
                }
                encryptBody = this.encryptionParts.IsBodyIncluded;
            }
            System.ServiceModel.Security.SecurityAppliedMessage message = new System.ServiceModel.Security.SecurityAppliedMessage(base.Message, this, signBody, encryptBody);
            base.Message = message;
            return(message);
        }
 public Message SetupExecution()
 {
     base.ThrowIfProcessingStarted();
     base.SetProcessingStarted();
     bool signBody = false;
     if (this.elementContainer.SourceSigningToken != null)
     {
         if (this.signatureParts == null)
         {
             throw TraceUtility.ThrowHelperError(new ArgumentNullException("SignatureParts"), base.Message);
         }
         signBody = this.signatureParts.IsBodyIncluded;
     }
     bool encryptBody = false;
     if (this.elementContainer.SourceEncryptionToken != null)
     {
         if (this.encryptionParts == null)
         {
             throw TraceUtility.ThrowHelperError(new ArgumentNullException("EncryptionParts"), base.Message);
         }
         encryptBody = this.encryptionParts.IsBodyIncluded;
     }
     System.ServiceModel.Security.SecurityAppliedMessage message = new System.ServiceModel.Security.SecurityAppliedMessage(base.Message, this, signBody, encryptBody);
     base.Message = message;
     return message;
 }