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