//------------------------------------------------------------------------------ // // Copyright (c) Microsoft Corporation. All rights reserved. // //------------------------------------------------------------------------------ namespace System.ComponentModel.Design.Serialization { using System; using System.Collections; using System.ComponentModel.Design; /// /// This service may be provided by a designer loader to provide /// a way for the designer to fabricate new names for objects. /// If this service isn't available the designer will choose a /// default implementation. /// public interface INameCreationService { /// /// Creates a new name that is unique to all the components /// in the given container. The name will be used to create /// an object of the given data type, so the service may /// derive a name from the data type's name. The container /// parameter can be null if no container search is needed. /// string CreateName(IContainer container, Type dataType); /// /// Determines if the given name is valid. A name /// creation service may have rules defining a valid /// name, and this method allows the sevice to enforce /// those rules. /// bool IsValidName(string name); /// /// Determines if the given name is valid. A name /// creation service may have rules defining a valid /// name, and this method allows the sevice to enforce /// those rules. It is similar to IsValidName, except /// that this method will throw an exception if the /// name is invalid. This allows implementors to provide /// rich information in the exception message. /// void ValidateName(string name); } }