Expand the PurchaseOrderAnalyzer (Portable) project and open the DiagnosticAnalyzer.cs file.
As seen earlier, you will see your diagnostic analyzer class. It should read public class PurchaseOrderAnalyzerAnalyzer : DiagnosticAnalyzer. Add the following code to the top of this class, replacing the code for the DiagnosticId, Title, MessageFormat, Description, Category, and Rule variables. Note that I have added two enumerators called ClassTypesToCheck and MandatoryInterfaces to the class. I only want this analyzer to act on a class if it is called PurchaseOrder or SalesOrder. I also only want the IReceiptable interface to ...
With Safari, you learn the way you learn best. Get unlimited access to videos, live online training,
learning paths, books, interactive tutorials, and more.