IVsExpansionFunction::GetDefaultValue Method (String^, Int32)

 

Returns the default string to be inserted before any template is edited.

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

int GetDefaultValue(
	[OutAttribute] String^% bstrValue,
	[OutAttribute] int% fHasDefaultValue
)

Parameters

bstrValue
Type: System::String^

[out] Returns a string that contains the default value.

fHasDefaultValue
Type: System::Int32

[out] Returns non-zero (true) if the expansion function has a default value; otherwise, returns zero (false). See Remarks.

Return Value

Type: System::Int32

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

From textmgr2.idl:

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

All fields in a code snippet can have a default value specified in the snippet file itself. The GetDefaultValue method can supply a dynamically generated default value through an expansion function. If an expansion function does not have a default value, it should always return zero (false) in the fHasDefaultValue parameter. The fHasDefaultValue parameter is often used by the caller of this method to determine whether to update the field in the code snippet.

Return to top
Show: