|
I am loading the source file not the assembly file. In this case how can i get the class properties and fields??
Thankfully,
jm
|
|
|
|
|
In that case as I have said you can compile it during runtime dynamically and then use reflection. I can't think of any other way.
|
|
|
|
|
As Giorgio said, you can compile the source and use reflection to inspect it. I'm not sure that's the solution that you really need, though. What is it that you are trying to accomplish, really?
---
single minded; short sighted; long gone;
|
|
|
|
|
Hi,
Why i am in need of this is i need to generate an XML by reading the properties from a Class file (in any language C#, VB.Net..etc).. for that i have to know the properties defined in those class files and based on the properties and datatype of those properties i need to generate a dynamic XML files
example
If a class file is something as
public Class A<br />
{<br />
private int number;<br />
private string name;<br />
<br />
public int Number<br />
{<br />
get {return number;}<br />
set {number = value;}<br />
}<br />
<br />
public string Name<br />
{<br />
get {return name;}<br />
set {name = value;}<br />
}<br />
}
based the above shown class, i have to generate by getting the properties of the class
<Bobject name="A"> <!-- "A" is class Name --><br />
<DataMember name="Number"> </DataMember> <!-- Member 1 --><br />
<DataMember name="Name"> </DataMemebr> <!-- Member 2 --><br />
</Bobject>
Like this i have to generate XML file.. For this i need to get the reflection of class, isnt it? Is any other way available to get the properties declared in a class file?
Expecting your reply.
Thankfully,
jm
Thankfully,
jm
|
|
|
|
|
It really sounds like you are trying to reinvent the wheel... Visual Studio can create XML documentation when you compile the code. Just enable "XML Documentation" in the build options for the project.
If you want this for documentation, you can add xml comments in the code, which will be included in the xml file, from which you then can create complete documentation in several different formats usings Sandcastle. The xml files created are also used in intellisense, so when using the class you will see the comments about the members in the intellisense just as with the classes in the framework. Visual Studio even helps you create the comments; just type /// on the line before a member (''' in VB), and it will provide you with a template for the comments.
Example:
public string GetInfo(int index) {
return _someInfo[index];
}
---
single minded; short sighted; long gone;
|
|
|
|
|
Hi,
Why i am in need of this is i need to generate an XML by reading the properties from a Class file (in any language C#, VB.Net..etc).. for that i have to know the properties defined in those class files and based on the properties and datatype of those properties i need to generate a dynamic XML files
example
If a class file is something as
<code>public Class A
{
private int number;
private string name;
public int Number
{
get {return number;}
set {number = value;}
}
public string Name
{
get {return name;}
set {name = value;}
}
}</code>
based the above shown class, i have to generate by getting the properties of the class
<Bobject name="A">
<DataMember name="Number"> </DataMember>
<DataMember name="Name"> </DataMember>
</Bobject>
Like this i have to generate XML file.. For this i need to get the reflection of class, isnt it? Is any other way available to get the properties declared in a class file?
Expecting your reply.
Thankfully,
jm
Thankfully,
jm
Thankfully,
jm
|
|
|
|
|
I think you may have a conceptual problem. The assembly loads the class whenever you have an instance of the class or call into the class. At that time, you can reflect the class; but if you wrote the class you should be able to indicate anything about it by even more straightforward processes.
Nonetheless, you don't load the file to reflect on the object: You reflect (usually) an instance of the object or a type object representing the class.
|
|
|
|
|
hello,
i have an MDI form that called FORM1
an I have a child form FORM2
I wrote:
form2.MDIPerent = form1
it works but in the side i get scroll bars
how I get over the scroll bars?
P.S
I try to use autoscroll = true
but it can't be done on an MDI FORM
|
|
|
|
|
you must use this code
Form2 frm = new Form2();
frm.MDIParrent = this;
frm.Show();;)
note: Your MDI Form must larger than child Form.
|
|
|
|
|
hi all,
I have a datagridview which when I populate it with data, the first row is selected by default.
IIRC in .Net 1.1 the DataGrid never used to do this.
Any one know how I can stop it?
I've tried setting every row's Selected property to false.
Thanks
|
|
|
|
|
First Check whether u have write any code in the Rowbound. If not please check whether selectedIndex prrperty is set to -1. I hope this will solve ur problem
Regards,
A Jabeer Ali
|
|
|
|
|
there isn't a selectedIndex property and I haven't hooked any events as of yet.
|
|
|
|
|
Sorry My friend. This Option is available in net.2005 for ASP:gridview.
what version u r using?
Regards,
A Jabeer Ali
|
|
|
|
|
.Net 2.0 with C# 2005.
I am using a WinForms DataGridView.
|
|
|
|
|
I have tried ClearSelection and I have also set the selection mode to select a full row
|
|
|
|
|
Check the Row Template for this Line
DataGridViewRow { Index=-1 }
Regards,
A Jabeer Ali
|
|
|
|
|
And do what may I ask?
I am unable to change it and the grid.RowTemplate.Index is read-only.
|
|
|
|
|
I've found that ClearSelection will only work if I use the DataSource property.
|
|
|
|
|
Try dataGridView1.ClearSelection(); after populating the grid with data. That should de-select anything that is selected.
|
|
|
|
|
DatagridView1.Rows(0).Selected = False
|
|
|
|
|
hello
how can i find component for receive picture from scanner in C#.net
|
|
|
|
|
Hi all,
I have design the web site with the some Control. If i press the button then the New textbox will be created. This is Working fine.But when i refresh the page after click the button also the textbox created.
Kindly help me.
Regards,
A Jabeer Ali.
Regards,
A Jabeer Ali
|
|
|
|
|
When you refresh, you do the postback again, thus the button press will occur again.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hello Christian,
Is there some kind of Application.DoEvents() call, responsible for that?
All the best,
Martin
|
|
|
|
|
From my knowlegde There is no such function available. Please tell me some solution to refresh the Button event to happen.
Regards,
A Jabeer Ali
|
|
|
|