PageRenderTime 39ms CodeModel.GetById 16ms RepoModel.GetById 0ms app.codeStats 0ms

/V1/spikes/AGCompositeApplicationLibrary/AGComposite.Wpf/Regions/AllActiveRegion.cs

#
C# | 48 lines | 17 code | 3 blank | 28 comment | 0 complexity | 6f3995605cb702feefa26125b419f64b 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;
  18. using Microsoft.Practices.Composite.Regions;
  19. using Microsoft.Practices.Composite.Wpf.Properties;
  20. namespace Microsoft.Practices.Composite.Wpf.Regions
  21. {
  22. /// <summary>
  23. /// Region that keeps all the views in it as active. Deactivation of views is not allowed.
  24. /// </summary>
  25. public class AllActiveRegion : Region
  26. {
  27. /// <summary>
  28. /// Gets a readonly view of the collection of all the active views in the region. These are all the added views.
  29. /// </summary>
  30. /// <value>An <see cref="IViewsCollection"/> of all the active views.</value>
  31. public override IViewsCollection ActiveViews
  32. {
  33. get { return Views; }
  34. }
  35. /// <summary>
  36. /// Deactive is not valid in this Region. This method will always throw <see cref="InvalidOperationException"/>.
  37. /// </summary>
  38. /// <param name="view">The view to deactivate.</param>
  39. /// <exception cref="InvalidOperationException">Every time this method is called.</exception>
  40. public override void Deactivate(object view)
  41. {
  42. throw new InvalidOperationException(Resources.DeactiveNotPossibleException);
  43. }
  44. }
  45. }