PageRenderTime 48ms CodeModel.GetById 20ms RepoModel.GetById 0ms app.codeStats 0ms

/V4/PrismLibrary/Desktop/Prism/Regions/IRegionBehaviorFactory.cs

#
C# | 52 lines | 12 code | 3 blank | 37 comment | 0 complexity | 293d08f94b0dd7deae0a065fbd593533 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 System.Collections.Generic;
  19. namespace Microsoft.Practices.Prism.Regions
  20. {
  21. /// <summary>
  22. /// Interface for RegionBehaviorFactories. This factory allows the registration of the default set of RegionBehaviors, that will
  23. /// be added to the <see cref="IRegionBehaviorCollection"/>s of all <see cref="IRegion"/>s, unless overridden on a 'per-region' basis.
  24. /// </summary>
  25. [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix", Justification = "It is more of a factory than a collection")]
  26. public interface IRegionBehaviorFactory : IEnumerable<string>
  27. {
  28. /// <summary>
  29. /// Adds a particular type of RegionBehavior if it was not already registered. the <paramref name="behaviorKey"/> string is used to check if the behavior is already present
  30. /// </summary>
  31. /// <param name="behaviorKey">The behavior key that's used to find if a certain behavior is already added.</param>
  32. /// <param name="behaviorType">Type of the behavior to add. .</param>
  33. void AddIfMissing(string behaviorKey, Type behaviorType);
  34. /// <summary>
  35. /// Determines whether a behavior with the specified key already exists
  36. /// </summary>
  37. /// <param name="behaviorKey">The behavior key.</param>
  38. /// <returns>
  39. /// <see langword="true"/> if a behavior with the specified key is present; otherwise, <see langword="false"/>.
  40. /// </returns>
  41. bool ContainsKey(string behaviorKey);
  42. /// <summary>
  43. /// Creates an instance of the Behaviortype that's registered using the specified key.
  44. /// </summary>
  45. /// <param name="key">The key that's used to register a behavior type.</param>
  46. /// <returns>The created behavior. </returns>
  47. IRegionBehavior CreateFromKey(string key);
  48. }
  49. }