/// <summary> /// Adds the specified export to the <see cref="CompositionBatch"/>. /// </summary> /// <param name="export"> /// The <see cref="Export"/> to add to the <see cref="CompositionBatch"/>. /// </param> /// <returns> /// A <see cref="ComposablePart"/> that can be used remove the <see cref="Export"/> /// from the <see cref="CompositionBatch"/>. /// </returns> /// <exception cref="ArgumentNullException"> /// <paramref name="export"/> is <see langword="null"/>. /// </exception> /// <remarks> /// </remarks> public ComposablePart AddExport(Export export) { Requires.NotNull(export, nameof(export)); ComposablePart part = new SingleExportComposablePart(export); AddPart(part); return(part); }
/// <summary> /// Adds the specified export to the <see cref="CompositionBatch"/>. /// </summary> /// <param name="export"> /// The <see cref="Export"/> to add to the <see cref="CompositionBatch"/>. /// </param> /// <returns> /// A <see cref="ComposablePart"/> that can be used remove the <see cref="Export"/> /// from the <see cref="CompositionBatch"/>. /// </returns> /// <exception cref="ArgumentNullException"> /// <paramref name="export"/> is <see langword="null"/>. /// </exception> /// <remarks> /// </remarks> public ComposablePart AddExport(Export export) { Requires.NotNull(export, "export"); ComposablePart part = new SingleExportComposablePart(export); this.AddPart(part); return(part); }
/// <summary> /// Adds the specified export to the <see cref="CompositionBatch"/>. /// </summary> /// <param name="export"> /// The <see cref="Export"/> to add to the <see cref="CompositionBatch"/>. /// </param> /// <returns> /// A <see cref="ComposablePart"/> that can be used remove the <see cref="Export"/> /// from the <see cref="CompositionBatch"/>. /// </returns> /// <exception cref="ArgumentNullException"> /// <paramref name="export"/> is <see langword="null"/>. /// </exception> /// <remarks> /// </remarks> public ComposablePart AddExport(Export export) { Requires.NotNull(export, "export"); Contract.Ensures(Contract.Result <ComposablePart>() != null); ComposablePart part = new SingleExportComposablePart(export); this.AddPart(part); return(part); }
/// <summary> /// Adds the specified export to the <see cref="CompositionBatch"/>. /// </summary> /// <param name="export"> /// The <see cref="Export"/> to add to the <see cref="CompositionBatch"/>. /// </param> /// <returns> /// A <see cref="ComposablePart"/> that can be used remove the <see cref="Export"/> /// from the <see cref="CompositionBatch"/>. /// </returns> /// <exception cref="ArgumentNullException"> /// <paramref name="export"/> is <see langword="null"/>. /// </exception> /// <remarks> /// </remarks> public ComposablePart AddExport(Export export) { Requires.NotNull(export, "export"); ComposablePart part = new SingleExportComposablePart(export); this.AddPart(part); return part; }
/// <summary> /// Adds the specified export to the <see cref="CompositionBatch"/>. /// </summary> /// <param name="export"> /// The <see cref="Export"/> to add to the <see cref="CompositionBatch"/>. /// </param> /// <returns> /// A <see cref="ComposablePart"/> that can be used remove the <see cref="Export"/> /// from the <see cref="CompositionBatch"/>. /// </returns> /// <exception cref="ArgumentNullException"> /// <paramref name="export"/> is <see langword="null"/>. /// </exception> /// <remarks> /// </remarks> public ComposablePart AddExport(Export export) { Requires.NotNull(export, "export"); Contract.Ensures(Contract.Result<ComposablePart>() != null); ComposablePart part = new SingleExportComposablePart(export); this.AddPart(part); return part; }