|
I didn't think there was such a thing in C#. In C+, inline is a compiler suggestion.
Christian Graus - Microsoft MVP - C++
"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 )
|
|
|
|
|
Christian Graus wrote: I didn't think there was such a thing in C#
There is but you have no control over it, it's something that the JIT compiler does if it deems it necessary.
|
|
|
|
|
Just like C++ then ? :P
Christian Graus - Microsoft MVP - C++
"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 )
|
|
|
|
|
Yep , I'm not even sure you can find out when it's been JITted, I remember someone a few years ago having real trouble tracking down a bug and it was eventually sussed out that the method had been inlined. This might have been in a beta version though.
|
|
|
|
|
i want to use splitter control in vc# 2005, but how to do ?
thanks
|
|
|
|
|
Drag and drop it from toolbox on your form
|
|
|
|
|
you joking!?
i know this, but i don't know how to set it's properties and attributes ?
|
|
|
|
|
You set it's properties just like you would with any other control. Is this .NET 2.0? If so, you automatically get two panels (a left and right, by default) that you can then drop other controls onto.
If it's earlier than .NET 2.0, you need to drop a panel on the form, drop the splitter control, and then drop another panel. If I remember correctly, the splitter will automatically dock left...if not you will need to set the dock properties by hand. After that, you just drop controls onto the respective panels.
-----------------------------
In just two days, tomorrow will be yesterday.
|
|
|
|
|
1. Drop the control you want on the left hand side on the form, and dock it left.
2. Drop the splitter control on your form (it will dock to the left automatically).
3. Drop the control you want on the right hand side on the form, and dock it fill.
That should be it.
- S
50 cups of coffee and you know it's on!
|
|
|
|
|
There are actually 2 different controls that provide similar functionality. There is the 'legacy' splitter control that is the same as the previous versions of visual studio. You have to drop a panel, then the splitter, then another panel.
The better control, IMO, is the SplitContainer. This shows up with a default left and right panels already configured. You can change the orientation so it is top and bottom. It is a container control so you can drop pretty much whatever you want inside of the contained panels.
You'll most likely want to set the minimum sizes for the panels (property names will be Panel1MinSize and Panel2MinSize. This will keep the user from shrinking them too far.
I hope that helps a little.
Pete
|
|
|
|
|
hello,
i want to read a remote directory (ftp/http) or any convenient method..and get all the links or names of the files withinn that folder. is there any way to achive this..if it is ftp..assume that i have the ftp username and password.better if it is a method for a web application .
regards
aneef
|
|
|
|
|
Hello everyone,
I have an XML file which contains the following lines of codes:
<?xml version="1.0" encoding="utf-8"?>
<TestCase Name="Reports" Id="6b5af" Owner="" Priority="0" Enabled="True">
<Items>
<Request Method="GET" Version="1.1" Url="www.goog.com"/>
<Request Method="GET" Version="1.1" Url="www.goog.com" />
</Items>
</TestCase>
I am trying to isolate the lines containing the "Request" element. Is there a quick way of getting just the lines <Request .../> in a string form?
Any help would be greatly appreciated. Thanks a lot!
G
|
|
|
|
|
1) Load the whole fragment into a System.Xml.XmlDocument
2) Use XPath to create an XmlNodeList of the Request Nodes
3) Get the strings from the OuterXml property of each node
|
|
|
|
|
Dear Abisodun,
I am new to C# and XML. COuld you please help me with writing 2) and 3) in C #?
Thanks a lot.
G
|
|
|
|
|
You'll have to show us some code.. The Classes are well documented.
|
|
|
|
|
Hi,
I'm struggling with a property grid control.
Here is what I do:
- I display properties associated to a specific object in the property view.
- For each property, I use a specific editor and allows value to be changed in another form. Each property has access to a specific editor which inherits from 'UITypeEditor'.
- In the EditValue method of my editor, I call my form using the 'ShowDialog' method.
Here is the beginning of my EditValue method:
public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)<br />
{<br />
string startingPropertyValue = null;
PropertySpec currentPropertySpec = null;<br />
<br />
if (context != null && context.Instance != null && provider != null) <br />
{<br />
editorService = provider.GetService(typeof(IWindowsFormsEditorService)) as IWindowsFormsEditorService;<br />
}
My problem is that I'm not able to retrieve the values selected in my second form and display them for each selected property.
Can you help me please ?
Thanks.
Pat.
p.f. Goudjo-Ako
Bringing our energy together !
|
|
|
|
|
Hello developers,
I am kind of stuck.Please if you can help me with the following
How to create a grid at run time in side a for loop?
hence the number of the grids on a page is equals to the number of times a for loop runs.
My data table contains list od "Id"s from users selection using a checkbox.
Ex. for(int i=0;i<=dt.rows.count;i++)
{
execute a stored procedure with Id parameter.
ds.fill(sda);
gridview gv +i=new GridView();
gv+i.datasource=ds.tables[0];
gv+i.bind();
}
Hence the total number of the grid on a page is equal to dt.rows.count
Please advice
What i mean is to create gridviews dynamically on run time based on user input?
Email : Kibrommail@yahoo.com
Thanks
-- modified at 15:56 Tuesday 3rd July, 2007
|
|
|
|
|
Can someone help me!? I know in JavaScript I could use eval() to achieve this but I am not sure how to accomplish the same things in C#. Let's say I had a method in which one of the arguments was a string or any variable for that matter, and based on that variable passed to the method another method of the given name in the variable would run...(see example below), I am just getting into C# and any help with this would be much appreciated...!
public static void RunAMethod(string methodname)
{
methodname(); //method to run
}
///---- so I could do this from another method
RunAMethod("runwhatevermethodIwant");
///-----
Is this possible???
|
|
|
|
|
|
Reflection is way slow. You should consider to use delegates, which are quite similar to C's function pointers. The topic is not very simple, but delegates are very powerful and elegant. Here[^] is an introductory article on MSDN Magazine.
If you truly believe you need to pick a mobile phone that "says something" about your personality, don't bother. You don't have a personality. A mental illness, maybe - but not a personality. - Charlie Brooker
My Blog - My Photos - ScrewTurn Wiki
|
|
|
|
|
Delegates seem very interesting to me also...although I am having a little difficulty visualizing their usage properly from the MSDN article, is there anyway you could write out a little snippet showing how I could use delegates to call a method whose name is based on a string I enter?
Thanks!
|
|
|
|
|
Can you call a delegate with a method name defined in a string?!? Because this seems to be what he wants.
-----
If atheism is a religion, then not collecting stamps is a hobby. -- Unknown
|
|
|
|
|
No. Not directly at least.
The point is that invoking methods at runtime by their name is not very clean, in my opinion. Since I guess the methods he wants to invoke are parameterless and with no return value, using delegates would be very easy and would improve the robustness of the code.
If you truly believe you need to pick a mobile phone that "says something" about your personality, don't bother. You don't have a personality. A mental illness, maybe - but not a personality. - Charlie Brooker
My Blog - My Photos - ScrewTurn Wiki
|
|
|
|
|
I agree with you in the way that he should consider using an interface instead instead of calling a method by a name specified in a string.
-----
If atheism is a religion, then not collecting stamps is a hobby. -- Unknown
|
|
|
|
|
Thank you very much for both of your replies, I had a hunch that Reflection might be something I needed to look into, and I'll definitely give it a shot. 
|
|
|
|