Click here to Skip to main content
15,890,527 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
What I'm trying to do it's, i think, kinda complex, but i've spent hours trying to find the right documentation, about the interfaces I need to achieve this with no luck:
I need VS write some javascript code and insert it in a certain folder, starting from:

- Right click action, on a file from an already created project.
- A window it's open that gets information about the functions from
that class in that file that i've right clicked. Besides, it should
have a dropdown, with all the names of classes that reside under a
certain folder.
- If I select an item from this dd and press the "ok" button, the IDE
should write some code, using the properties of this selected class,
and the functions from the right-clicked file, as information, to
create the javascript file and save it into the project on a certain
folder of it.

I've achieved some parts of this process:

- I know how to create an option into a context menu, using the
initialize function.
- Partially, I know how to create new files in a project.
- I know how to create a window tool and almost all the interfaces that
are needed for what I want to achieve (make dropdowns and that kind
of stuff).

But the critical part is managing the already created classes and gather info from them in the manner I need.

If someone can enlighten me on this, i'll be very thankful to him/her
Posted
Updated 2-Dec-15 8:06am
v2
Comments
BillWoodruff 2-Dec-15 13:56pm    
The file you select and wish to parse: it is C# or JavaScript ... or ?
Member 11795624 2-Dec-15 14:58pm    
The file to parse is C#. Sorry I've just to forgot to mention it
BillWoodruff 2-Dec-15 15:13pm    
Do you assume that any C# can be translated to JavaScript ?
Member 11795624 2-Dec-15 16:31pm    
Not exactly "translate. i'm going to describe that class in a JSON notation. it means each annotation, type, name adn scope of each property of that C# class will be described on my JSON pretending the previous parsing action of the C# file and using newtonsoft.json to write down it.
BillWoodruff 2-Dec-15 22:32pm    
I assume you are aware of the potential vast scope of your project (if I understand it correctly). Assuming you click on any arbitrary .cs C# file, you could be looking at many kinds of content:

1. a single static class, structs, enums, Interface definitions, public classes containing other classes private/public/static/protected/internal/readonly ... etc.

2. a given file may have complex dependencies on a project's referenced 'dll's and you will know that only by either parsing the manifest, or looking at the 'using statements for a given .cs file.

I'm sorry, but I cannot offer you any useful advice for such an ambitious project.

If I absolutely had to this project :) (and had a few years of my life to do it ?) ... I would look hard for a "shortcut:" at trying to use one of the free .NET decompilers from Telerik or JetBrains, and somehow automate the decompiler so I could read out its "unraveled" code.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900