Partilhar via


Método IVsExpansionFunction.GetDefaultValue

Retorna a seqüência de caracteres padrão a ser inserido antes de qualquer modelo é editado.

Namespace:  Microsoft.VisualStudio.TextManager.Interop
Assembly:  Microsoft.VisualStudio.TextManager.Interop.8.0 (em Microsoft.VisualStudio.TextManager.Interop.8.0.dll)

Sintaxe

'Declaração
Function GetDefaultValue ( _
    <OutAttribute> ByRef bstrValue As String, _
    <OutAttribute> ByRef fHasDefaultValue As Integer _
) As Integer
int GetDefaultValue(
    out string bstrValue,
    out int fHasDefaultValue
)
int GetDefaultValue(
    [OutAttribute] String^% bstrValue, 
    [OutAttribute] int% fHasDefaultValue
)
abstract GetDefaultValue : 
        bstrValue:string byref * 
        fHasDefaultValue:int byref -> int
function GetDefaultValue(
    bstrValue : String, 
    fHasDefaultValue : int
) : int

Parâmetros

  • bstrValue
    Tipo: String%

    [out] Retorna um string que contém o valor padrão.

  • fHasDefaultValue
    Tipo: Int32%

    [out] Retorna diferente de zero (true) se a função de expansão possui um valor padrão; Caso contrário, retorna zero (false). Consulte Comentários.

Valor de retorno

Tipo: Int32
Se o método for bem-sucedido, ele retorna S_OK.Se ele falhar, ele retorna um código de erro.

Comentários

COM assinatura

De textmgr2.idl:

bool IVsExpansionFunction::GetDefaultValue(
   [out] BSTR *bstrValue,
   [out] bool *fHasDefaultValue
);

Todos os campos em um trecho de código podem ter um valor padrão especificado no próprio arquivo trecho. O GetDefaultValue método pode fornecer um valor padrão gerado dinamicamente por meio de uma função de expansão. Se uma função de expansão não tem um valor padrão, ele deve sempre retornar zero (false) na fHasDefaultValue parâmetro. O fHasDefaultValue parâmetro é freqüentemente usado pelo chamador desse método para determinar se deve atualizar o campo no trecho de código.

Segurança do .NET Framework

Consulte também

Referência

IVsExpansionFunction Interface

Namespace Microsoft.VisualStudio.TextManager.Interop