1 //------------------------------------------------------------------------------
2 // <copyright file="IDesignerLoaderHost.cs" company="Microsoft">
3 //     Copyright (c) Microsoft Corporation.  All rights reserved.
4 // </copyright>
5 //------------------------------------------------------------------------------
6 
7 namespace System.ComponentModel.Design.Serialization {
8 
9     using System;
10     using System.Collections;
11     using System.ComponentModel.Design;
12 
13     /// <devdoc>
14     ///     IDesignerLoaderHost.  This is an extension of IDesignerHost that is passed
15     ///     to the designer loader in the BeginLoad method.  It is isolated from
16     ///     IDesignerHost to emphasize that all loading and reloading of the design
17     ///     document actually should be initiated by the designer loader, and not by
18     ///     the designer host.  However, the loader must inform the designer host that
19     ///     it wishes to invoke a load or reload.
20     /// </devdoc>
21     public interface IDesignerLoaderHost : IDesignerHost {
22 
23         /// <devdoc>
24         ///     This is called by the designer loader to indicate that the load has
25         ///     terminated.  If there were errors, they should be passed in the errorCollection
26         ///     as a collection of exceptions (if they are not exceptions the designer
27         ///     loader host may just call ToString on them).  If the load was successful then
28         ///     errorCollection should either be null or contain an empty collection.
29         /// </devdoc>
EndLoad(string baseClassName, bool successful, ICollection errorCollection)30         void EndLoad(string baseClassName, bool successful, ICollection errorCollection);
31 
32         /// <devdoc>
33         ///     This is called by the designer loader when it wishes to reload the
34         ///     design document.  The reload will happen immediately so the caller
35         ///     should ensure that it is in a state where BeginLoad may be called again.
36         /// </devdoc>
Reload()37         void Reload();
38     }
39 
40     /// <devdoc>
41     ///     IgnoreErrorsDuringReload - specifies whether errors should be ignored when Reload() is called.
42     ///                                We only allow to set to true if we CanReloadWithErrors. If we cannot
43     ///                                we simply ignore rather than throwing an exception. We probably should,
44     ///                                but we are avoiding localization.
45     ///     CanReloadWithErrors - specifies whether it is possible to reload with errors. There are certain
46     ///                           scenarios where errors cannot be ignored.
47     /// </devdoc>
48     public interface IDesignerLoaderHost2 : IDesignerLoaderHost {
49          bool IgnoreErrorsDuringReload{ get; set;}
50          bool CanReloadWithErrors{ get; set;}
51     }
52 
53 }
54 
55