2010-06-21 Atsushi Enomoto <atsushi@ximian.com>
[mcs.git] / class / System.ComponentModel.Composition / src / ComponentModel / System / ComponentModel / Composition / PartLifetimeContextOfT.cs
blob75aea4379716a7379f6e89cab3fde0b7e3bf3ddd
1 // -----------------------------------------------------------------------
2 // Copyright (c) Microsoft Corporation. All rights reserved.
3 // -----------------------------------------------------------------------
4 using System;
6 #if SILVERLIGHT
8 namespace System.ComponentModel.Composition
10 public sealed class PartLifetimeContext<T> : IDisposable
12 private readonly T _exportedValue;
13 private readonly Action _dispose;
15 public PartLifetimeContext(T exportedValue, Action dispose)
17 this._exportedValue = exportedValue;
18 this._dispose = dispose;
21 public T ExportedValue
23 get { return this._exportedValue; }
26 public void Dispose()
28 this._dispose();
33 #endif