IVsSettingsStore.GetStringOrDefault(String, String, String, String) 方法

定义

返回字符串类型属性值或给定的默认字符串。

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

参数

collectionPath
String

中集合的路径。

propertyName
String

中属性名称。

defaultValue
String

中如果未设置该属性,则返回默认值。

value
String

弄值。 这应作为未初始化的 BSTR 传递,方法会分配足够的空间来保存属性的值。 调用方应调用 SysFreeString,以便在不再需要 BSTR 时释放它。

返回

Int32

如果返回属性,则返回; 如果属性不 S_OK S_FALSE 存在,则返回; E_INVALIDARG 如果属性类型不是整数,则返回。

适用于