Ejemplo n.º 1
0
 public SamlDelegatingWriter(XmlDictionaryWriter innerWriter, Stream canonicalStream, ICanonicalWriterEndRootElementCallback callback, IXmlDictionary dictionary)
 {
     if (innerWriter == null)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("innerWriter");
     }
     if (canonicalStream == null)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("canonicalStream");
     }
     if (callback == null)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("callback");
     }
     if (dictionary == null)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("dictionary");
     }
     this.innerWriter       = innerWriter;
     this.canonicalStream   = canonicalStream;
     this.callback          = callback;
     this.dictionary        = dictionary;
     this.elementCount      = 0;
     this.startFragment     = new MemoryStream();
     this.signatureFragment = new MemoryStream();
     this.endFragment       = new MemoryStream();
     this.writerStream      = new MemoryStream();
     this.effectiveWriter   = XmlDictionaryWriter.CreateBinaryWriter(this.writerStream, this.dictionary);
     this.effectiveWriter.StartCanonicalization(this.canonicalStream, false, null);
     ((IFragmentCapableXmlDictionaryWriter)this.effectiveWriter).StartFragment(this.startFragment, false);
 }
        public SamlDelegatingWriter(XmlDictionaryWriter innerWriter, Stream canonicalStream, ICanonicalWriterEndRootElementCallback callback, IXmlDictionary dictionary)
        {
            if (innerWriter == null)
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("innerWriter");

            if (canonicalStream == null)
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("canonicalStream");

            if (callback == null)
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("callback");

            if (dictionary == null)
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("dictionary");

            this.innerWriter = innerWriter;
            this.canonicalStream = canonicalStream;
            this.callback = callback;
            this.dictionary = dictionary;
            this.elementCount = 0;

            this.startFragment = new MemoryStream();
            this.signatureFragment = new MemoryStream();
            this.endFragment = new MemoryStream();
            this.writerStream = new MemoryStream();

            this.effectiveWriter = XmlDictionaryWriter.CreateBinaryWriter(this.writerStream, this.dictionary);
            this.effectiveWriter.StartCanonicalization(this.canonicalStream, false, null);
            ((IFragmentCapableXmlDictionaryWriter)this.effectiveWriter).StartFragment(this.startFragment, false);
        }