The Labs \ Source Viewer \ SSCLI \ System.IO.IsolatedStorage \ INormalizeForIsolatedStorage

  1. // ==++==
  2. //
  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. //
  14. // ==--==
  15. /*============================================================
  16. *
  17. * Class:  INormalizeForIsolatedStorage
  18. *
  19. *                                   
  20. *
  21. * Purpose: Evidence types can optionaly implement this interface.
  22. *          IsolatedStorage calls Normalize method before evidence
  23. *          is serialized. The Normalize method should return a copy
  24. *          of the evidence instance if any of it's fields is changed.
  25. *
  26. * Date:  Oct 17, 2000
  27. *
  28. ===========================================================*/
  29. namespace System.IO.IsolatedStorage
  30. {
  31.    
  32.     using System;
  33.    
  34.     [System.Runtime.InteropServices.ComVisible(true)]
  35.     public interface INormalizeForIsolatedStorage
  36.     {
  37.         // Return a copy of the normalized version of this instance,
  38.         // so that a the serialized version of this object can be
  39.         // mem-compared to another serialized object
  40.         //
  41.         // 1. Eg. (pseudo code to illustrate usage)
  42.         //
  43.         // obj1 = MySite(WWW.MSN.COM)
  44.         // obj2 = MySite(www.msn.com)
  45.         //
  46.         // obj1Norm = obj1.Normalize()
  47.         // obj2Norm = obj1.Normalize()
  48.         //
  49.         // stream1 = Serialize(obj1Norm)
  50.         // stream2 = Serialize(obj2Norm)
  51.         //
  52.         // AreStreamsEqual(stream1, stream2) returns true
  53.         //
  54.         // If the Object returned is a stream, the stream will be used without
  55.         // serialization. If the Object returned is a string, the string will
  56.         // be used in naming the Store. If the string is too long or if the
  57.         // string contains chars that are illegal to use in naming the store,
  58.         // the string will be serialized.
  59.         //
  60.         // 2. Eg. (pseudo code to illustrate returning string)
  61.         //
  62.         // obj1 = MySite(WWW.MSN.COM)
  63.         // obj2 = MySite(www.msn.com)
  64.         //
  65.         // string1 = obj1.Normalize()
  66.         // string2 = obj1.Normalize()
  67.         //
  68.         // AreStringsEqual(string1, string2) returns true
  69.         //
  70.         // 3. Eg. (pseudo code to illustrate returning stream)
  71.         //
  72.         // obj1 = MySite(WWW.MSN.COM)
  73.         // obj2 = MySite(www.msn.com)
  74.         //
  75.         // stream1 = obj1.Normalize()
  76.         // stream2 = obj1.Normalize()
  77.         //
  78.         // AreStreamsEqual(stream1, stream2) returns true
  79.        
  80.         object Normalize();
  81.     }
  82. }

Developer Fusion