blob: 9adf55c72367dd16a4593ecc9843fd563767abfa (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
// -----------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// -----------------------------------------------------------------------
using System;
using System.Collections.Generic;
using System.ComponentModel.Composition.Primitives;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace System.ComponentModel.Composition.Factories
{
partial class CatalogFactory
{
// NOTE: Do not add any more behavior to this class, as ComposablePartCatalogTests.cs
// uses this to verify default behavior of the base class.
private class DisposableComposablePartCatalog : ComposablePartCatalog
{
private readonly Action<bool> _disposeCallback;
public DisposableComposablePartCatalog(Action<bool> disposeCallback)
{
Assert.IsNotNull(disposeCallback);
_disposeCallback = disposeCallback;
}
~DisposableComposablePartCatalog()
{
Dispose(false);
}
public override IQueryable<ComposablePartDefinition> Parts
{
get { throw new NotImplementedException(); }
}
protected override void Dispose(bool disposing)
{
_disposeCallback(disposing);
base.Dispose(disposing);
}
}
}
}
|