Partager via


IVsExpansionFunction.GetDefaultValue(String, Int32) Method

Definition

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

public:
 int GetDefaultValue([Runtime::InteropServices::Out] System::String ^ % bstrValue, [Runtime::InteropServices::Out] int % fHasDefaultValue);
int GetDefaultValue([Runtime::InteropServices::Out] std::wstring const & & bstrValue, [Runtime::InteropServices::Out] int & fHasDefaultValue);
public int GetDefaultValue (out string bstrValue, out int fHasDefaultValue);
abstract member GetDefaultValue : string * int -> int
Public Function GetDefaultValue (ByRef bstrValue As String, ByRef fHasDefaultValue As Integer) As Integer

Parameters

bstrValue
String

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

fHasDefaultValue
Int32

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

Returns

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

Remarks

COM Signature

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.

Applies to