Skip to content

Commit

Permalink
Report a diagnostic when a type inherits from a GeneratedComClass-att…
Browse files Browse the repository at this point in the history
…ributed type and does not have the GeneratedComClass attribute (#105277)
  • Loading branch information
jkoritzinsky committed Jul 23, 2024
1 parent f68d8e1 commit c5b2dcd
Show file tree
Hide file tree
Showing 17 changed files with 264 additions and 214 deletions.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ public override void Initialize(AnalysisContext context)
return;
}
}
if (type.BaseType is not null
&& type.BaseType.GetAttributes().Any(attr => generatedComClassAttributeType.Equals(attr.AttributeClass, SymbolEqualityComparer.Default)))
{
context.ReportDiagnostic(type.CreateDiagnostic(AddGeneratedComClassAttribute, type.Name));
}
}, SymbolKind.NamedType);
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@
<value>Add 'GeneratedComClassAttribute' to enable passing objects of this type to COM and allow unsafe code</value>
</data>
<data name="AddGeneratedComClassAttributeDescription" xml:space="preserve">
<value>This type implements at least one type with the 'GeneratedComInterfaceAttribute' attribute. Add the 'GeneratedComClassAttribute' to enable passing this type to COM and exposing the COM interfaces for the types with the 'GeneratedComInterfaceAttribute' from objects of this type.</value>
<value>This type implements at least one type with the 'GeneratedComInterfaceAttribute' attribute or its base type has the 'GeneratedComClassAttribute' attribute. Add the 'GeneratedComClassAttribute' to enable passing this type to COM and exposing the COM interfaces for the types with the 'GeneratedComInterfaceAttribute' from objects of this type.</value>
</data>
<data name="AddGeneratedComClassAttributeMessage" xml:space="preserve">
<value>Add the 'GeneratedComClassAttribute' to '{0}' to enable passing objects of type '{0}' to COM</value>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
<note />
</trans-unit>
<trans-unit id="AddGeneratedComClassAttributeDescription">
<source>This type implements at least one type with the 'GeneratedComInterfaceAttribute' attribute. Add the 'GeneratedComClassAttribute' to enable passing this type to COM and exposing the COM interfaces for the types with the 'GeneratedComInterfaceAttribute' from objects of this type.</source>
<target state="translated">Tento typ implementuje alespoň jeden typ s atributem GeneratedComInterfaceAttribute. Přidejte generatedComClassAttribute, aby bylo možné předat tento typ modelu COM a zpřístupnit rozhraní COM pro typy s generatedComInterfaceAttribute z objektů tohoto typu.</target>
<source>This type implements at least one type with the 'GeneratedComInterfaceAttribute' attribute or its base type has the 'GeneratedComClassAttribute' attribute. Add the 'GeneratedComClassAttribute' to enable passing this type to COM and exposing the COM interfaces for the types with the 'GeneratedComInterfaceAttribute' from objects of this type.</source>
<target state="needs-review-translation">Tento typ implementuje alespoň jeden typ s atributem GeneratedComInterfaceAttribute. Přidejte generatedComClassAttribute, aby bylo možné předat tento typ modelu COM a zpřístupnit rozhraní COM pro typy s generatedComInterfaceAttribute z objektů tohoto typu.</target>
<note />
</trans-unit>
<trans-unit id="AddGeneratedComClassAttributeMessage">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
<note />
</trans-unit>
<trans-unit id="AddGeneratedComClassAttributeDescription">
<source>This type implements at least one type with the 'GeneratedComInterfaceAttribute' attribute. Add the 'GeneratedComClassAttribute' to enable passing this type to COM and exposing the COM interfaces for the types with the 'GeneratedComInterfaceAttribute' from objects of this type.</source>
<target state="translated">Dieser Typ implementiert mindestens einen Typ mit dem GeneratedComInterfaceAttribute-Attribut. Fügen Sie "GeneratedComClassAttribute" hinzu, um die Übergabe dieses Typs an COM zu ermöglichen und die COM-Schnittstellen für die Typen mit dem GeneratedComInterfaceAttribute aus Objekten dieses Typs verfügbar zu machen.</target>
<source>This type implements at least one type with the 'GeneratedComInterfaceAttribute' attribute or its base type has the 'GeneratedComClassAttribute' attribute. Add the 'GeneratedComClassAttribute' to enable passing this type to COM and exposing the COM interfaces for the types with the 'GeneratedComInterfaceAttribute' from objects of this type.</source>
<target state="needs-review-translation">Dieser Typ implementiert mindestens einen Typ mit dem GeneratedComInterfaceAttribute-Attribut. Fügen Sie "GeneratedComClassAttribute" hinzu, um die Übergabe dieses Typs an COM zu ermöglichen und die COM-Schnittstellen für die Typen mit dem GeneratedComInterfaceAttribute aus Objekten dieses Typs verfügbar zu machen.</target>
<note />
</trans-unit>
<trans-unit id="AddGeneratedComClassAttributeMessage">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
<note />
</trans-unit>
<trans-unit id="AddGeneratedComClassAttributeDescription">
<source>This type implements at least one type with the 'GeneratedComInterfaceAttribute' attribute. Add the 'GeneratedComClassAttribute' to enable passing this type to COM and exposing the COM interfaces for the types with the 'GeneratedComInterfaceAttribute' from objects of this type.</source>
<target state="translated">Este tipo implementa al menos un tipo con el atributo “GeneratedComInterfaceAttribute”. Agregue “GeneratedComClassAttribute” para habilitar el paso de este tipo a COM y exponer las interfaces COM para los tipos con “GeneratedComInterfaceAttribute” a partir de objetos de este tipo.</target>
<source>This type implements at least one type with the 'GeneratedComInterfaceAttribute' attribute or its base type has the 'GeneratedComClassAttribute' attribute. Add the 'GeneratedComClassAttribute' to enable passing this type to COM and exposing the COM interfaces for the types with the 'GeneratedComInterfaceAttribute' from objects of this type.</source>
<target state="needs-review-translation">Este tipo implementa al menos un tipo con el atributo “GeneratedComInterfaceAttribute”. Agregue “GeneratedComClassAttribute” para habilitar el paso de este tipo a COM y exponer las interfaces COM para los tipos con “GeneratedComInterfaceAttribute” a partir de objetos de este tipo.</target>
<note />
</trans-unit>
<trans-unit id="AddGeneratedComClassAttributeMessage">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
<note />
</trans-unit>
<trans-unit id="AddGeneratedComClassAttributeDescription">
<source>This type implements at least one type with the 'GeneratedComInterfaceAttribute' attribute. Add the 'GeneratedComClassAttribute' to enable passing this type to COM and exposing the COM interfaces for the types with the 'GeneratedComInterfaceAttribute' from objects of this type.</source>
<target state="translated">Ce type implémente au moins un type avec l'attribut 'GeneratedComInterfaceAttribute'. Ajoutez le 'GeneratedComClassAttribute' pour activer le passage de ce type à COM et exposer les interfaces COM pour les types avec le 'GeneratedComInterfaceAttribute' des objets de ce type.</target>
<source>This type implements at least one type with the 'GeneratedComInterfaceAttribute' attribute or its base type has the 'GeneratedComClassAttribute' attribute. Add the 'GeneratedComClassAttribute' to enable passing this type to COM and exposing the COM interfaces for the types with the 'GeneratedComInterfaceAttribute' from objects of this type.</source>
<target state="needs-review-translation">Ce type implémente au moins un type avec l'attribut 'GeneratedComInterfaceAttribute'. Ajoutez le 'GeneratedComClassAttribute' pour activer le passage de ce type à COM et exposer les interfaces COM pour les types avec le 'GeneratedComInterfaceAttribute' des objets de ce type.</target>
<note />
</trans-unit>
<trans-unit id="AddGeneratedComClassAttributeMessage">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
<note />
</trans-unit>
<trans-unit id="AddGeneratedComClassAttributeDescription">
<source>This type implements at least one type with the 'GeneratedComInterfaceAttribute' attribute. Add the 'GeneratedComClassAttribute' to enable passing this type to COM and exposing the COM interfaces for the types with the 'GeneratedComInterfaceAttribute' from objects of this type.</source>
<target state="translated">Questo tipo implementa almeno un tipo con l'attributo 'GeneratedComInterfaceAttribute'. Aggiungere l'attributo 'GeneratedComClassAttribute' per consentire il passaggio di questo tipo a COM e l'esposizione delle interfacce COM per i tipi con l'attributo 'GeneratedComInterfaceAttribute' dagli oggetti di questo tipo.</target>
<source>This type implements at least one type with the 'GeneratedComInterfaceAttribute' attribute or its base type has the 'GeneratedComClassAttribute' attribute. Add the 'GeneratedComClassAttribute' to enable passing this type to COM and exposing the COM interfaces for the types with the 'GeneratedComInterfaceAttribute' from objects of this type.</source>
<target state="needs-review-translation">Questo tipo implementa almeno un tipo con l'attributo 'GeneratedComInterfaceAttribute'. Aggiungere l'attributo 'GeneratedComClassAttribute' per consentire il passaggio di questo tipo a COM e l'esposizione delle interfacce COM per i tipi con l'attributo 'GeneratedComInterfaceAttribute' dagli oggetti di questo tipo.</target>
<note />
</trans-unit>
<trans-unit id="AddGeneratedComClassAttributeMessage">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
<note />
</trans-unit>
<trans-unit id="AddGeneratedComClassAttributeDescription">
<source>This type implements at least one type with the 'GeneratedComInterfaceAttribute' attribute. Add the 'GeneratedComClassAttribute' to enable passing this type to COM and exposing the COM interfaces for the types with the 'GeneratedComInterfaceAttribute' from objects of this type.</source>
<target state="translated">この型は、'GeneratedComInterfaceAttribute' 属性を持つ少なくとも 1 つの型を実装します。'GeneratedComClassAttribute' を追加して、この型を COM に渡し、この型のオブジェクトから 'GeneratedComInterfaceAttribute' を持つ型の COM インターフェイスを公開できるようにします。</target>
<source>This type implements at least one type with the 'GeneratedComInterfaceAttribute' attribute or its base type has the 'GeneratedComClassAttribute' attribute. Add the 'GeneratedComClassAttribute' to enable passing this type to COM and exposing the COM interfaces for the types with the 'GeneratedComInterfaceAttribute' from objects of this type.</source>
<target state="needs-review-translation">この型は、'GeneratedComInterfaceAttribute' 属性を持つ少なくとも 1 つの型を実装します。'GeneratedComClassAttribute' を追加して、この型を COM に渡し、この型のオブジェクトから 'GeneratedComInterfaceAttribute' を持つ型の COM インターフェイスを公開できるようにします。</target>
<note />
</trans-unit>
<trans-unit id="AddGeneratedComClassAttributeMessage">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
<note />
</trans-unit>
<trans-unit id="AddGeneratedComClassAttributeDescription">
<source>This type implements at least one type with the 'GeneratedComInterfaceAttribute' attribute. Add the 'GeneratedComClassAttribute' to enable passing this type to COM and exposing the COM interfaces for the types with the 'GeneratedComInterfaceAttribute' from objects of this type.</source>
<target state="translated">이 유형은 'GeneratedComInterfaceAttribute' 특성이 있는 하나 이상의 유형을 구현합니다. 이 형식을 COM에 전달하고 이 형식의 개체에서 'GeneratedComInterfaceAttribute'가 있는 형식에 대한 COM 인터페이스를 노출하려면 'GeneratedComClassAttribute'를 추가합니다.</target>
<source>This type implements at least one type with the 'GeneratedComInterfaceAttribute' attribute or its base type has the 'GeneratedComClassAttribute' attribute. Add the 'GeneratedComClassAttribute' to enable passing this type to COM and exposing the COM interfaces for the types with the 'GeneratedComInterfaceAttribute' from objects of this type.</source>
<target state="needs-review-translation">이 유형은 'GeneratedComInterfaceAttribute' 특성이 있는 하나 이상의 유형을 구현합니다. 이 형식을 COM에 전달하고 이 형식의 개체에서 'GeneratedComInterfaceAttribute'가 있는 형식에 대한 COM 인터페이스를 노출하려면 'GeneratedComClassAttribute'를 추가합니다.</target>
<note />
</trans-unit>
<trans-unit id="AddGeneratedComClassAttributeMessage">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
<note />
</trans-unit>
<trans-unit id="AddGeneratedComClassAttributeDescription">
<source>This type implements at least one type with the 'GeneratedComInterfaceAttribute' attribute. Add the 'GeneratedComClassAttribute' to enable passing this type to COM and exposing the COM interfaces for the types with the 'GeneratedComInterfaceAttribute' from objects of this type.</source>
<target state="translated">Ten typ implementuje co najmniej jeden typ z atrybutem „GeneratedComInterfaceAttribute”. Dodaj atrybut „GeneratedComClassAttribute”, aby umożliwić przekazywanie tego typu do modelu COM i uwidacznianie interfejsów COM dla typów z atrybutem „GeneratedComInterfaceAttribute” z obiektów tego typu.</target>
<source>This type implements at least one type with the 'GeneratedComInterfaceAttribute' attribute or its base type has the 'GeneratedComClassAttribute' attribute. Add the 'GeneratedComClassAttribute' to enable passing this type to COM and exposing the COM interfaces for the types with the 'GeneratedComInterfaceAttribute' from objects of this type.</source>
<target state="needs-review-translation">Ten typ implementuje co najmniej jeden typ z atrybutem „GeneratedComInterfaceAttribute”. Dodaj atrybut „GeneratedComClassAttribute”, aby umożliwić przekazywanie tego typu do modelu COM i uwidacznianie interfejsów COM dla typów z atrybutem „GeneratedComInterfaceAttribute” z obiektów tego typu.</target>
<note />
</trans-unit>
<trans-unit id="AddGeneratedComClassAttributeMessage">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
<note />
</trans-unit>
<trans-unit id="AddGeneratedComClassAttributeDescription">
<source>This type implements at least one type with the 'GeneratedComInterfaceAttribute' attribute. Add the 'GeneratedComClassAttribute' to enable passing this type to COM and exposing the COM interfaces for the types with the 'GeneratedComInterfaceAttribute' from objects of this type.</source>
<target state="translated">Esse tipo implementa pelo menos um tipo com o atributo 'GeneratedComInterfaceAttribute'. Adicione o 'GeneratedComClassAttribute' para habilitar a passagem desse tipo para COM e expor as interfaces COM para os tipos com o 'GeneratedComInterfaceAttribute' de objetos desse tipo.</target>
<source>This type implements at least one type with the 'GeneratedComInterfaceAttribute' attribute or its base type has the 'GeneratedComClassAttribute' attribute. Add the 'GeneratedComClassAttribute' to enable passing this type to COM and exposing the COM interfaces for the types with the 'GeneratedComInterfaceAttribute' from objects of this type.</source>
<target state="needs-review-translation">Esse tipo implementa pelo menos um tipo com o atributo 'GeneratedComInterfaceAttribute'. Adicione o 'GeneratedComClassAttribute' para habilitar a passagem desse tipo para COM e expor as interfaces COM para os tipos com o 'GeneratedComInterfaceAttribute' de objetos desse tipo.</target>
<note />
</trans-unit>
<trans-unit id="AddGeneratedComClassAttributeMessage">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
<note />
</trans-unit>
<trans-unit id="AddGeneratedComClassAttributeDescription">
<source>This type implements at least one type with the 'GeneratedComInterfaceAttribute' attribute. Add the 'GeneratedComClassAttribute' to enable passing this type to COM and exposing the COM interfaces for the types with the 'GeneratedComInterfaceAttribute' from objects of this type.</source>
<target state="translated">Этот тип реализует по крайней мере один тип с атрибутом "GeneratedComInterfaceAttribute". Добавьте "GeneratedComClassAttribute", чтобы разрешить передачу этого типа в COM и предоставление COM-интерфейсов для типов с "GeneratedComInterfaceAttribute" из объектов этого типа.</target>
<source>This type implements at least one type with the 'GeneratedComInterfaceAttribute' attribute or its base type has the 'GeneratedComClassAttribute' attribute. Add the 'GeneratedComClassAttribute' to enable passing this type to COM and exposing the COM interfaces for the types with the 'GeneratedComInterfaceAttribute' from objects of this type.</source>
<target state="needs-review-translation">Этот тип реализует по крайней мере один тип с атрибутом "GeneratedComInterfaceAttribute". Добавьте "GeneratedComClassAttribute", чтобы разрешить передачу этого типа в COM и предоставление COM-интерфейсов для типов с "GeneratedComInterfaceAttribute" из объектов этого типа.</target>
<note />
</trans-unit>
<trans-unit id="AddGeneratedComClassAttributeMessage">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
<note />
</trans-unit>
<trans-unit id="AddGeneratedComClassAttributeDescription">
<source>This type implements at least one type with the 'GeneratedComInterfaceAttribute' attribute. Add the 'GeneratedComClassAttribute' to enable passing this type to COM and exposing the COM interfaces for the types with the 'GeneratedComInterfaceAttribute' from objects of this type.</source>
<target state="translated">Bu tür, 'GeneratedComInterfaceAttribute' özniteliğine sahip en az bir tür uygular. Bu türü COM'a geçirmeyi ve bu türdeki nesnelerden 'GeneratedComInterfaceAttribute' içeren türler için COM arabirimlerini açığa çıkarmayı etkinleştirmek için 'GeneratedComClassAttribute' ekleyin.</target>
<source>This type implements at least one type with the 'GeneratedComInterfaceAttribute' attribute or its base type has the 'GeneratedComClassAttribute' attribute. Add the 'GeneratedComClassAttribute' to enable passing this type to COM and exposing the COM interfaces for the types with the 'GeneratedComInterfaceAttribute' from objects of this type.</source>
<target state="needs-review-translation">Bu tür, 'GeneratedComInterfaceAttribute' özniteliğine sahip en az bir tür uygular. Bu türü COM'a geçirmeyi ve bu türdeki nesnelerden 'GeneratedComInterfaceAttribute' içeren türler için COM arabirimlerini açığa çıkarmayı etkinleştirmek için 'GeneratedComClassAttribute' ekleyin.</target>
<note />
</trans-unit>
<trans-unit id="AddGeneratedComClassAttributeMessage">
Expand Down
Loading

0 comments on commit c5b2dcd

Please sign in to comment.