PageRenderTime 17ms CodeModel.GetById 12ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/V4/MVVM RI/MVVM.Client/Infrastructure/StateManagement/ICurrentState.cs

#
C# | 44 lines | 9 code | 1 blank | 34 comment | 0 complexity | 6369c3c49a3df40ace7d36016c74c2f9 MD5 | raw file
 1//===================================================================================
 2// Microsoft patterns & practices
 3// Composite Application Guidance for Windows Presentation Foundation and Silverlight
 4//===================================================================================
 5// Copyright (c) Microsoft Corporation.  All rights reserved.
 6// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY
 7// OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT
 8// LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
 9// FITNESS FOR A PARTICULAR PURPOSE.
10//===================================================================================
11// The example companies, organizations, products, domain names,
12// e-mail addresses, logos, people, places, and events depicted
13// herein are fictitious.  No association with any real company,
14// organization, product, domain name, email address, logo, person,
15// places, or events is intended or should be inferred.
16//===================================================================================
17using System.ComponentModel.Composition;
18
19namespace MVVM.Client.Infrastructure.StateManagement
20{
21    /// <summary>
22    /// Holds the current state for type <typeparamref name="T"/> in a <see cref="CompositionContainer"/>.
23    /// </summary>
24    /// <remarks>
25    /// <para>
26    /// Types consuming the current state must import the <see cref="IState{T}"/>, while types setting the
27    /// current state must acquire the <see cref="ICurrentState{T}"/> and set its <see cref="Value"/>.
28    /// </para>
29    /// <para>
30    /// Parts implementing this interface do not require to be explicitly exported because this interface is
31    /// annotated with the <see cref="InheritedExportAttribute."/>
32    /// </para>
33    /// </remarks>
34    /// <typeparam name="T">The type for which the current state is managed.</typeparam>
35    /// <seealso cref="IState{T}"/>
36    [InheritedExport]
37    public interface ICurrentState<T>
38    {
39        /// <summary>
40        /// Gets and sets the current value.
41        /// </summary>
42        T Value { get; set; }
43    }
44}