ServiceManager.Publish<TServiceType> 方法 (TServiceType)
发布指定类型的指定服务实例。
命名空间: Microsoft.Windows.Design
程序集: Microsoft.Windows.Design.Extensibility(在 Microsoft.Windows.Design.Extensibility.dll 中)
语法
声明
Public Sub Publish(Of TServiceType) ( _
serviceInstance As TServiceType _
)
public void Publish<TServiceType>(
TServiceType serviceInstance
)
public:
generic<typename TServiceType>
void Publish(
TServiceType serviceInstance
)
member Publish :
serviceInstance:'TServiceType -> unit
JScript 不支持泛型类型或方法。
类型参数
- TServiceType
参数
- serviceInstance
类型:TServiceType
服务的实例。
异常
异常 | 条件 |
---|---|
ArgumentNullException | serviceInstance 为 nullnull 引用(在 Visual Basic 中为 Nothing)。 |
备注
在 EditingContext 中创建服务之后,该服务将始终存在。 服务不能从 EditingContext 中移除。
.NET Framework 安全性
- 对直接调用方的完全信任。此成员不能由部分信任的代码使用。有关更多信息,请参见通过部分受信任的代码使用库。