Validates a file path by validating all the parts of the path. If the file name is invalid, it throws an exception if the project is in automation; otherwise it shows a dialog box with the error message.
Namespace: Microsoft.VisualStudio.Package
Assembly: MPF.Project.NonShipping (in MPF.Project.NonShipping.dll)
Syntax
'宣言
Public Shared Sub ValidateFileName ( _
serviceProvider As IServiceProvider, _
filePath As String _
)
'使用
Dim serviceProvider As IServiceProvider
Dim filePath As String
Utilities.ValidateFileName(serviceProvider, _
filePath)
public static void ValidateFileName(
IServiceProvider serviceProvider,
string filePath
)
public:
static void ValidateFileName(
IServiceProvider^ serviceProvider,
String^ filePath
)
public static function ValidateFileName(
serviceProvider : IServiceProvider,
filePath : String
)
Parameters
serviceProvider
Type: System.IServiceProviderThe IServiceProvider.
filePath
Type: System.StringThe path to validate.
Remarks
If the file name is invalid it throws an InvalidOperationException if the project is in automation. Otherwise it shows a dialog box with the error message.
Permissions
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.