|
here dllfolder is the path of the dll that the user browse and select. it might contains the path with spaces, so when i pass this as a parameter , in the batch file it takes the path up to the first space.
|
|
|
|
|
Is the content of dllfolder between quotes? If it is not, it should. Try this before:
dllfolder = "\"" + dllfolder + "\"";
Let us know if this helped you.
|
|
|
|
|
??? Hmmm...
You didn't use
%~1 for batchparameter access I hope, this would remove quotation marks.
I can not see any other problem. Can you show how you use the parameter in the batchfile?
|
|
|
|
|
Hi all,
I want to build my own feature like "Find all references" in VS 2008.
Is there anyone know how to build it?
Pls. help me.
|
|
|
|
|
I think that the answer stays inside the Visual Studio Extensibility and the Visual Studio SDK. Try starting from here[^]...
|
|
|
|
|
Thank you for reply.
But I want to build independent tool (not a add-in tool)
|
|
|
|
|
Then I guess that you should write your parser and parse all the source files
|
|
|
|
|
One way to do this would be to use something like an Abstract Syntax Tree to represent the code you are trying to model.
|
|
|
|
|
Thank for your help!
I google to find some information about AST, but I can find a litle infor about it.
Beside, I found CODEDOM parser (also in this site) and also looking on it.
Can you explain or give more information about AST parser for me?
|
|
|
|
|
ndkit wrote: I want to build my own feature like "Find all references" in VS 2008.
Using the source-code as a source, or would you accept using a compiled assembly as a source? The latter could be done using reflection, like so;
foreach(AssemblyName referencedAssemblyName in Assembly
.GetExecutingAssembly()
.GetReferencedAssemblies())
{
Console.WriteLine(referencedAssemblyName.FullName);
}
I are Troll
|
|
|
|
|
The source is source-code, not a compiled assembly.
|
|
|
|
|
Your requirements aren't very clear. If it isn't in Studio, what do you want to find the references in? Are you planning on using the solution or project files? Are you going to try to find references across projects? I would suggest finding a textbook for a university level class on compiler theory and see if the concepts are comfortable to you. If they seem way over your head, then find a different project to work on.
|
|
|
|
|
what references? type references (classes, structs, enums...)? file references (dll)? and why? give some context, it will help you get useful answers.
|
|
|
|
|
Sorry, I explain more details as below:
This is my context
I have two solutions A & B which have many projects.
In each project, I have class C (or method, or variable) that can be used in other project of same solution (example: A solution) or another solution (B).
Each time I want to find class C (all places that is used), I must find in both solutions A & B.
It can take more time and not easy to track information between two solutions.
So I want to build a tool to analyze both solutions & give all references of class C in A & B.
So, in order to find all references of class C, I just searching on a tool.
|
|
|
|
|
That is a big job. The proper way to do this is by creating a full C# parser, and let it loose on the source files of all the projects in the solution(s). Are you sure you can't just use your IDE's class browsing facilities?
You could cheat quite a bit, like so:
- just scan all source files for curly brackets { and } to locate classes; if you assume namespaces are used, a class would be at nesting level 2 of {};
- within each class, search for the type name you're interested in;
- within each class that mentions the type name of interest, look for the type's member you're interested in.
This will yield some false positives, as it:
- does not discern code from comment;
- does not recognize string literals;
- does not associate the member name with the type you're looking for (i.e. while looking for:
TextBox.Text, it will also find
TextBox tb;
string s=myButton.Text;
However it will also not work well with nested types, e.g. a class nested inside another class. When the inner class holds what you are looking for, it would flag the outer class as positive (hence even more false positives).
|
|
|
|
|
Hi
Just seeking some help with a linked list in C# and if it can do what I require it to do. Below is a simple version of what I want to do.
public LinkedList<Object> createList()<br />
{<br />
LinkedList<Object> l = null;<br />
MyObject oj = new MyObject;<br />
l.addLast(oj);<br />
<br />
return l;<br />
}<br />
<br />
public convertObject()<br />
{<br />
LinkedList<MyObject> list = (MyObject)executeSQL(sql, array);<br />
}
The reason for this is because i want the createList to remain generic as the actual code will be used to collect data from a database, place the data in objects and then add it to the linkedlist. At all times the link list will only contain 1 object type but i want to be able to re-use the method regardless of what object type it is. Originally I had this working using ArrayList but I would prefer to use LinkedList due to the added features.
I hope the above explained what I wanted without having to type the actual code which is a couple of pages long.
Any help would be appreciated, if you need more info then let me know.
Cheers
|
|
|
|
|
You can work around the List(T) Class (System.Collections.Generic)[^]: it gives you all the functionalities of a linked-list and it's a generic type. What you need is to write down a class, that internally uses a List<object> member, and that expose the methods that you need to do your job.
|
|
|
|
|
I have managed to get the following to work but I would like to keep it as a linkedList rather then converting it to an array.
public Access[] findAll()<br />
{<br />
string sql = "SELECT * FROM access";<br />
<br />
LinkedList<Object> list = executeSQL(sql);
<br />
Access[] aArray = new Access[list.Count];<br />
list.CopyTo(aArray, 0);<br />
<br />
return aArray;<br />
}
|
|
|
|
|
Apologies about my first reply, I misunderstood your question. How about:
public LinkedList<T> ExecuteSQL<T>(sql)
{
}
public LinkedList<T> findAll<T>()
{
string sql = "SELECT * FROM access";
return ExecuteSQL<T>(sql);
return aArray;
}
Then you can specify the type, or you can change T to Object .
[Edit]: added the l to "public", Freud would have a field-day with me
|
|
|
|
|
Thank You so much. That works, all i needed to do was add the <t> in front of the method name
|
|
|
|
|
|
I now have a new problem. My code is as follows
private LinkedList<T> makeList<T>( SqlDataReader reader )<br />
{<br />
LinkedList<T> list = new LinkedList<T>();<br />
<br />
while( reader.Read() )<br />
{<br />
list.AddLast(makeObject(reader));<br />
}<br />
<br />
return list;<br />
}<br />
<br />
public abstract object makeObject( SqlDataReader r );
this line list.AddLast(makeObject(reader)); is showwing the error "cannot convert from object to t"
What have I done wrong? and how can I fix it?
Nevermind, Problem solved by
list.AddLast((T)makeObject(reader))<code><br />
<div class="signature"><br />
<div class="modified">modified on Monday, October 18, 2010 6:22 AM</div></div>
|
|
|
|
|
The following is safer, unless you know you are only getting Type T objects, (or T is not a class)
T value = makeObject(reader) as T
if(value != null)
{
list.AddLast(value)
}
You'll Also need to :
private LinkedList<T> makeList<T>( SqlDataReader reader )
where T: class
{
}
|
|
|
|
|
I don't know if this could help, but I wonder if a makeObject<t> method would do what you want, I mean:
public abstract T makeObject<T>(SqlDataReader r);
bye
|
|
|
|
|
There is a generic linked list[^] in .net 3.5 and above, this will do exactly as you ask, or you could just use the generic List<T> type, but this doesn't expose the AddBefore/AddAfter etc members that the LinkedList<T> does.
[Edit]
See previous thread, this isn't what the OP was asking for.
|
|
|
|