ProjectElement.GetMetadataAndThrow Method

Gets the attribute and throws the exception if the attribute is empty or a null reference (Nothing in Visual Basic).

Namespace:  Microsoft.VisualStudio.Package
Assembly:  MPF.Project.NonShipping (in MPF.Project.NonShipping.dll)

Syntax

'宣言
Public Function GetMetadataAndThrow ( _
    attributeName As String, _
    exception As Exception _
) As String
'使用
Dim instance As ProjectElement
Dim attributeName As String
Dim exception As Exception
Dim returnValue As String

returnValue = instance.GetMetadataAndThrow(attributeName, _
    exception)
public string GetMetadataAndThrow(
    string attributeName,
    Exception exception
)
public:
String^ GetMetadataAndThrow(
    String^ attributeName, 
    Exception^ exception
)
public function GetMetadataAndThrow(
    attributeName : String, 
    exception : Exception
) : String

Parameters

  • exception
    Type: System.Exception

    The exception to be thrown if the attribure is not found or empty.

Return Value

Type: System.String

Returns the value of the attribute.

Permissions

See Also

Reference

ProjectElement Class

ProjectElement Members

Microsoft.VisualStudio.Package Namespace