Answer the question
In order to leave comments, you need to log in
How to pass a piece of code to a method of another class (C#)?
Hello.
I have some class with a method.
Inside this method is the following line:
resultedText[0] = deserializedText[1].history[3].NUMER.ToString();
[3].NUMER
].history[[3].NUMER
].history[Answer the question
In order to leave comments, you need to log in
I would suggest using T4 .
It will be a .tt file, in which you can describe the code generation logic. In fact, it will take the file you need from the project as text and generate what you want from it. Before starting the project, you simply run the T4 file.
On one of our projects, we generate model code based on our metadata in this way.
What code? Software?
Judging by the indexes, you have a tree-like data structure (graph). In the main class, it is necessary to read data into it (there is, by the way, the TreeNode system class for this).
Then you can open the root element of the tree (or some of the branches) as a property for changes in another class.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question