PageRenderTime 48ms CodeModel.GetById 25ms RepoModel.GetById 0ms 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. //===================================================================================
  17. using System.ComponentModel.Composition;
  18. namespace MVVM.Client.Infrastructure.StateManagement
  19. {
  20. /// <summary>
  21. /// Holds the current state for type <typeparamref name="T"/> in a <see cref="CompositionContainer"/>.
  22. /// </summary>
  23. /// <remarks>
  24. /// <para>
  25. /// Types consuming the current state must import the <see cref="IState{T}"/>, while types setting the
  26. /// current state must acquire the <see cref="ICurrentState{T}"/> and set its <see cref="Value"/>.
  27. /// </para>
  28. /// <para>
  29. /// Parts implementing this interface do not require to be explicitly exported because this interface is
  30. /// annotated with the <see cref="InheritedExportAttribute."/>
  31. /// </para>
  32. /// </remarks>
  33. /// <typeparam name="T">The type for which the current state is managed.</typeparam>
  34. /// <seealso cref="IState{T}"/>
  35. [InheritedExport]
  36. public interface ICurrentState<T>
  37. {
  38. /// <summary>
  39. /// Gets and sets the current value.
  40. /// </summary>
  41. T Value { get; set; }
  42. }
  43. }