Exemple #1
0
 /// <summary>
 /// 用指定的序列化信息和上下文初始化 <see cref="AggregateSourceException"/> 类的新实例。
 /// </summary>
 /// <param name="info"><see cref="SerializationInfo"/> 对象,包含序列化
 /// <see cref="AggregateSourceException"/> 所需的信息。</param>
 /// <param name="context"><see cref="StreamingContext"/> 对象,
 /// 该对象包含与 <see cref="AggregateSourceException"/> 相关联的序列化流的源和目标。</param>
 /// <exception cref="ArgumentNullException"><paramref name="info"/> 参数为 <c>null</c>。</exception>
 protected AggregateSourceException(SerializationInfo info, StreamingContext context)
     : base(info, context)
 {
     if (info == null)
     {
         throw CommonExceptions.ArgumentNull("info");
     }
     Contract.EndContractBlock();
     this.innerExps = (SourceException[])info.GetValue("InnerExceptions", typeof(SourceException[]));
     if (innerExps == null)
     {
         throw CommonExceptions.AggregateExceptionDeserializationFailure();
     }
     innerExpsCollection = new ReadOnlyCollection <SourceException>(innerExps);
 }