The Labs \ Source Viewer \ SSCLI \ System.ComponentModel.Design.Serialization \ IDesignerSerializationProvider

  1. //------------------------------------------------------------------------------
  2. // <copyright file="IDesignerSerializationProvider.cs" company="Microsoft">
  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. namespace System.ComponentModel.Design.Serialization
  16. {
  17.    
  18.     using System;
  19.    
  20.     /// <devdoc>
  21.     /// This interface defines a custom serialization provider. This
  22.     /// allows outside objects to control serialization by providing
  23.     /// their own serializer objects.
  24.     /// </devdoc>
  25.     public interface IDesignerSerializationProvider
  26.     {
  27.        
  28.         /// <devdoc>
  29.         /// This will be called by the serialization manager when it
  30.         /// is trying to locate a serialzer for an object type.
  31.         /// If this serialization provider can provide a serializer
  32.         /// that is of the correct type, it should return it.
  33.         /// Otherwise, it should return null.
  34.         ///
  35.         /// In order to break order dependencies between multiple
  36.         /// serialization providers the serialization manager will
  37.         /// loop through all serilaization provideres until the
  38.         /// serilaizer returned reaches steady state. Because
  39.         /// of this you should always check currentSerializer
  40.         /// before returning a new serializer. If currentSerializer
  41.         /// is an instance of your serializer, then you should
  42.         /// either return it or return null to prevent an infinite
  43.         /// loop.
  44.         /// </devdoc>
  45.         object GetSerializer(IDesignerSerializationManager manager, object currentSerializer, Type objectType, Type serializerType);
  46.     }
  47. }

Developer Fusion