|
If I could get access to the codes generated for the delegates - hope I could find a way out
Best regards,
Paul.
Jesus Christ is LOVE! Please tell somebody.
|
|
|
|
|
There was a program called ILDASM that could disassemble a .Net program into IL. Perhaps that might help you? (But chances are delegates are still delegates even at the IL layer)
|
|
|
|
|
Thanks for the support.
EssOEss wrote:
ILDASM
As a C# programmer I should know ILDASM
Best regards,
Paul.
Jesus Christ is LOVE! Please tell somebody.
|
|
|
|
|
Hello,
What is the best way to have something like this?
protected delegate string CalculationDelegate(int count);
protected delegate string CalculationDelegate(double count);
Best regards,
Paul.
Jesus Christ is LOVE! Please tell somebody.
|
|
|
|
|
|
True? or you are smilling?
Best regards,
Paul.
Jesus Christ is LOVE! Please tell somebody.
|
|
|
|
|
Its a new feature introduced in .NET 2. Delegate overloading and something else (co-ercian i think) that allows u to pass an inherited class into the delegate and/or use a delegate definition taking derived parameters. delegates have/will become alot more powerfull in .NET 2
top secret Download xacc-ide 0.0.3 now! See some screenshots
|
|
|
|
|
I heard about anonymous delegate stuff, but not the others.
leppie wrote:
delegates have/will become alot more powerfull in .NET 2
Yeah, I planning for the .NET 2, including my IDE
Best regards,
Paul.
Jesus Christ is LOVE! Please tell somebody.
|
|
|
|
|
I want to run one instance only? How to do it?
Thank yous.
|
|
|
|
|
One way is use Process.GetProcesses() or GetProcessesByName() methods and see if is there any instance of application running.
Mazy
"One who dives deep gets the pearls,the burning desire for realization brings the goal nearer." - Babuji
|
|
|
|
|
Search this forum, this topic has been discussed lately.
mav
|
|
|
|
|
Can someone point me to where to find information, with code example in C#, on how to retrieve Names and Addresses from an Addresss Book in Public Folders of MS Exchange Server 2000.
Fred S. Parker
Email: fred@fsparker.com.au
|
|
|
|
|
|
Thank you for your prompt reply.
However, I am only interested in a solution for a Windows Form application, not Web, and using C#.
Fred S. Parker
|
|
|
|
|
The code is always the same, not matter if it is used in a VB, Web, or C# application.
You can access Exchange via CDO 1.21, WebDAV, or the Outlook COM Classes.
seaarch the Google Groups[^], you'll find thousands of examples.
|
|
|
|
|
Hello every buddy,
Can some one kindly explain me when a socket end point is disconnected what happens technically in the other point? How the other point is notified about this disconnection so it handles it?
Thank you so much
---
"Art happens when you least expect it."
|
|
|
|
|
I guess there will be some sort of timeout.
cool man
|
|
|
|
|
Can somebody point me to an article/tutorial about customizing controls? What I want to do is customize a ListBox by giving each item its own Tag property. I have a small idea about what I need to do. I made a new project and made my class inherit ListBox , but that is as much as I know. Do you think this is going to be very hard?
/\ |_ E X E GG
|
|
|
|
|
ListBox items are object s, so you _can_ already add an object that has a Tag property.
By overriding the object's ToString() method you can influence what the ListBox displays for each item.
Regards,
mav
|
|
|
|
|
You do not have to add Tag to listbox. Listbox already displays objects.
For example if you have:
class Customer
{
public FirstName { return this.firstName; };
public LastName { return this.lastName; };
...
}
then just add Custom to the listbox. So if in ListView you used Tag to get the data, for listbox you would just get the object:
Customer selectedCustomer = (Customer)listbox.SelectedItem;
if you want to display custom information, you can use DisplayMember. For example if you wanted to display first and last name, add to your Customer class:
public FirstLastName
{
get { return firstName + " " + lastName; }
}
and set in listbox:
listbox.DisplayMember = "FirstLastName";
|
|
|
|
|
Hey man, thanks for you help. I have made an implimentation of it below.
namespace listBoxTest
{
partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
Customer customer=new Customer(this.textBox1.Text, this.textBox2.Text);
this.listBox1.Items.Add(customer.firstName);
}
private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
{
Customer cust=(Customer)listBox1.SelectedItem;
this.asdfStatusStripPanel.Text=cust.firstName+" "+cust.lastName;
}
}
public class Customer
{
public string firstName;
public string lastName;
public Customer(string FirstName, string LastName)
{
firstName = FirstName;
lastName = LastName;
}
}
}
My question was regarding the code inside my listBox1_SelectedIndexChanged and the button1_Click methods. When I just add a Customer to the listBox all the code works fine, but I can't see any firstName or lastName in the listBox (which is completely understandable). Now, when I add a Customer.firstName , does that now copy the whole Customer object to the list, or does it just copy the firstName object? I think it just copyies the object (string) firstName , 'cause in listBox1_SelectedIndexChanged when I try to add the data to the class, I get an InvalidCastException .
Any idea how I can still add the (string) representation of the Customer.firstName to the ListBox, but still have access to the whole object (class) in the listBox1_SelectedIndexChanged method?
/\ |_ E X E GG
|
|
|
|
|
If you add Customer to listbox, it just copies reference to that customer.
When listbox displays the customer, first it checks if you set "DisplayMember" to display, if you did, it will display that property. If not, it will call "ToString()" on the object to display it.
IF you override ToString() on customer, you'd see in the listbox whathever you return from that method.
Or implement properties on Customer (getter method) and set DisplayMember to the name of that property.
You should add Customer to the list, then you can cast that object:
Customer cust = new ....;
listbox.Items.Add(cust);
...
Customer selectedCust = (Customer)listbox.SelectedItem;
to get first name, in customer have:
public string FirstName
{
get{ return this.firstName; }
}
and in Form1() constructor (below initialize)
listbox.DisplayMember = "FirstName";
and now just add customers to the listbox.
|
|
|
|
|
OK, I got it now. I'm alot smarter now too. Thanks for your help.
/\ |_ E X E GG
|
|
|
|
|
Hi guys
I was wondering if it's possible to use Microsoft Visual C# Standard edition for commercial in-house development? I only want Visual C# (preferrably Professional edition) but I don't want to fork out the extra cash to buy the whole VS.NET 2003 Professional.
|
|
|
|
|
Yes, the only one you can't do that with is the student edition.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|