The Labs \ Source Viewer \ SSCLI \ System.Diagnostics \ FilterElement

  1. //------------------------------------------------------------------------------
  2. // <copyright file="FilterElement.cs" company="Microsoft Corporation">
  3. //
  4. // Copyright (c) 2006 Microsoft Corporation. All rights reserved.
  5. //
  6. // The use and distribution terms for this software are contained in the file
  7. // named license.txt, which can be found in the root of this distribution.
  8. // By using this software in any fashion, you are agreeing to be bound by the
  9. // terms of this license.
  10. //
  11. // You must not remove this notice, or any other, from this software.
  12. //
  13. // </copyright>
  14. //------------------------------------------------------------------------------
  15. using System.Configuration;
  16. using System;
  17. namespace System.Diagnostics
  18. {
  19.     internal class FilterElement : TypedElement
  20.     {
  21.         public FilterElement() : base(typeof(TraceFilter))
  22.         {
  23.         }
  24.        
  25.         public TraceFilter GetRuntimeObject()
  26.         {
  27.             TraceFilter newFilter = (TraceFilter)BaseGetRuntimeObject();
  28.             newFilter.initializeData = InitData;
  29.             return newFilter;
  30.         }
  31.        
  32.         internal TraceFilter RefreshRuntimeObject(TraceFilter filter)
  33.         {
  34.             if (Type.GetType(TypeName) != filter.GetType() || InitData != filter.initializeData) {
  35.                 // type or initdata changed
  36.                 _runtimeObject = null;
  37.                 return GetRuntimeObject();
  38.             }
  39.             else {
  40.                 return filter;
  41.             }
  42.         }
  43.     }
  44. }

Developer Fusion