TypeDescriptor.RemoveAssociation(Object, Object) 方法

定義

移除兩個物件之間的關聯。

C#
public static void RemoveAssociation (object primary, object secondary);

參數

primary
Object

主要 Object

secondary
Object

次要 Object

例外狀況

其中一或二個參數都為 null

備註

方法 RemoveAssociation 會移除方法所 CreateAssociation 形成之兩個對象之間的關聯。

WeakReference用來維護主要物件與次要對象之間的關聯;因此,當垃圾收集完成或回收物件時,這個方法不會影響。

適用於

產品 版本
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1

另請參閱