Compartir a través de


Package.IVsUserSettings.ImportSettings Method

Definition

Retrieves a VSPackage's configuration using the Visual Studio settings mechanism when a user selects the import option of the Import/Export Settings feature on the IDE’s Tools menu. This method is part of the implementation of the IVsUserSettings interface used to manage profiles and import/export settings to XML files.

 virtual int Microsoft.VisualStudio.Shell.Interop.IVsUserSettings.ImportSettings(System::String ^ strPageGuid, Microsoft::VisualStudio::Shell::Interop::IVsSettingsReader ^ reader, System::UInt32 flags, int % restartRequired) = Microsoft::VisualStudio::Shell::Interop::IVsUserSettings::ImportSettings;
int Microsoft.VisualStudio.Shell.Interop.IVsUserSettings.ImportSettings(std::wstring const & strPageGuid, Microsoft::VisualStudio::Shell::Interop::IVsSettingsReader const & reader, unsigned int flags, int & restartRequired);
int IVsUserSettings.ImportSettings (string strPageGuid, Microsoft.VisualStudio.Shell.Interop.IVsSettingsReader reader, uint flags, ref int restartRequired);
abstract member Microsoft.VisualStudio.Shell.Interop.IVsUserSettings.ImportSettings : string * Microsoft.VisualStudio.Shell.Interop.IVsSettingsReader * uint32 * int -> int
override this.Microsoft.VisualStudio.Shell.Interop.IVsUserSettings.ImportSettings : string * Microsoft.VisualStudio.Shell.Interop.IVsSettingsReader * uint32 * int -> int
Function ImportSettings (strPageGuid As String, reader As IVsSettingsReader, flags As UInteger, ByRef restartRequired As Integer) As Integer Implements IVsUserSettings.ImportSettings

Parameters

strPageGuid
String

GUID of the page.

flags
UInt32

Values from the __UserSettingsFlags returned by the shell, specifying how the settings are to be processed.

restartRequired
Int32

true if the Visual Studio IDE must be restarted.

Returns

If the method succeeds, it returns S_OK. If it fails, it returns an error code.

Implements

Remarks

ImportSettings searches the package object looking for ProvideProfileAttribute classes. If the object specified in ProvideProfileAttribute corresponds to the GUID passed into ImportSettings, then the IProfileManager interface of that object is retrieved. If necessary the object implementing IProfileManager is created. If the IProfileManager interface cannot be retrieved, then ImportSettings returns immediately.

If the IProfileManager interface is retrieved, then the object’s LoadSettingsFromXml method is called to import the settings from the IVsSettingsReader passed to it by Visual Studio.

The SaveSettingsToStorage method is then called to immediately store the settings imported.

Applies to