|
Hi All,
Can you pls explain with example what is difference between Expression<Func<>> and Func<> in linq to sql query generation?
Thanks in advance,
Anish Patel
|
|
|
|
|
Probably you can find here someone that could answer you, but I think that you have too much more chances if you move you post to the LINQ forum
|
|
|
|
|
Hi,
is there any restriction to the AccessibleName Property of a control? Must be the value unique within a winform?
thank you in advance.
|
|
|
|
|
By default, they're all null , so no, they don't have to be unique.
But they have a lot more value for persons using assisted-computing technologies/screen readers to help them use your software.
In and of the fact that you're using the field suggests that you might want to think about unique names, unless you know your users well.
Cheers.
|
|
|
|
|
Thanks for the Feedback, so we try to use this property as an identifier for the control-content. The issue you write about, i will have a deeper look...
|
|
|
|
|
i' trying to pass a file path to a batch file. and i'm using
"path"
but in the batch file it takes the path half , means it stops at the first spae occurs in the
path.
and i can't use the
%~f1
, because the file path is another location , not int program folder.
any idea to solve this.
thank you in advance.
|
|
|
|
|
Are you using the Process object to execute your batch file.
In this case, you can do this -
Process myProcess = new Process();
myProcess.StartInfo.FileName = "my.bat";
myProcess.StartInfo.Arguments = "/myArg";
The funniest thing about this particular signature is that by the time you realise it doesn't say anything it's too late to stop reading it.
My latest tip/trick
Visit the Hindi forum here.
|
|
|
|
|
yes ,i'm sending it this way
ProcessStartInfo ps = new ProcessStartInfo(@"C:\batch1.bat");
ps.Arguments = "\""+dllFolder+"\"";
Process.Start(ps);
|
|
|
|
|
prasadbuddhika wrote: ps.Arguments = "\""+dllFolder+"\"";
Are you trying to pass in \dllFolder\?
You need to pass in the drive too, right?
As in just try @"C:\dllFolder\" ;
The funniest thing about this particular signature is that by the time you realise it doesn't say anything it's too late to stop reading it.
My latest tip/trick
Visit the Hindi forum here.
|
|
|
|
|
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
|
|
|
|