IVsShell.SetProperty(Int32, Object) 方法

定义

设置环境属性。

public:
 int SetProperty(int propid, System::Object ^ var);
public:
 int SetProperty(int propid, Platform::Object ^ var);
int SetProperty(int propid, winrt::Windows::Foundation::IInspectable const & var);
public int SetProperty (int propid, object var);
abstract member SetProperty : int * obj -> int
Public Function SetProperty (propid As Integer, var As Object) As Integer

参数

propid
Int32

中环境属性的标识符。 请参阅 __VSSPROPID

var
Object

中变体结构,其中包含有关如何设置由标识的属性的信息 propid

返回

Int32

如果该方法成功,则它会返回 S_OK。 如果该方法失败,则会返回错误代码。

注解

COM 签名

从 vsshell:

HRESULT IVsShell::SetProperty(  
   [in] VSSPROPID propid,  
   [in] VARIANT var  
);  

传入的变量值在属性类型之间可能不同。 单击 __VSSPROPID 上面 (的枚举链接) ,获取有关如何为不同属性值设置变体结构的说明。

适用于