I want to extract custom attributes
from source code from different .CS
files. I have list of files .
Scenario is that i have Project A
which reads files of Project B
. It has to extract all attributes used in Project B
.
My question is that how can i do that without using Reflection
.
Reflection deals with assemblies but i have source code.
Using Roslyn would be over kill?
what approaches are there?
I had another option to Compile using MSBuild
but for large scale projects it would not be feasable due to heavy dependencies. and it seems not a good way to build application and then going for its assemblies
i just want to have some sort of thing that tells me what attribute was on what class and possible a UML diagram of relations of that classes.
Please give your suggestions
Extraction by attribute Cells that meet a specified attribute query can be extracted to a new output raster with the Extract by Attributes tool. Examples of applications for this tool include the extraction of all cells that have a slope greater than 10 percent or the extraction of all cells attributed with zoning for commercial development.
The ability to extract attribute information from blocks into a table object or CSV file for use in another application can help save time and reduce costly errors that might occur from re-entering the data. The Data Extraction wizard is the most efficient way to extract attribute information from blocks inserted into a drawing.
Last Updated : 05 Dec, 2018 Attributes are one of the key features of modern C++ which allows the programmer to specify additional information to the compiler to enforce constraints (conditions), optimise certain pieces of code or do some specific code generation.
The key method is GetCustomAttributes, which returns an array of objects that are the run-time equivalents of the source code attributes. This method has several overloaded versions.
You could use NRefactory: https://github.com/icsharpcode/nrefactory (also available as a NuGet package)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With