|
The short answer is no, they are equivalent. A slightly longer answer is that the compiler recognises from the context that the second version requires the new EventHandler(...) and generates the same code for both.
For a really detailed answer take a look at a copy of Jeff Richter's "CLR via C#". But I warn you, that may tell you more than you wanted to know!
Alan.
|
|
|
|
|
Thanks. I guessed that was what would happen but wanted clarification.
|
|
|
|
|
I'm writing a vs extension.
I need to add an item to the editor context menu if the class in current cursor position is inherited from another class (<b>Document</b> in my case).
public class MyDocument : Document
{
....
}
public class OtherDocument : NotReallyDocument
{
....
}
New menu item should be visible when user opens context menu (right-clicks) inside first class, and not visible in the second.
I can set the visibility in overriden OleMenuCommand.BeforeQueryStatus like this:
protected override void BeforeQueryStatus(object sender, EventArgs e)
{
((OleMenuCommand)sender).Visible = MyUtils.DetermineVisible();
((OleMenuCommand)sender).Enabled = MyUtils.DetermineVisible();
}
But how to determine that menu is opened from inside specific class?
(sorry for my bad english)
|
|
|
|
|
I'm having a really hard time finding information on programatically chaining sock proxies. I've been able to find proxies that are not anonymous but work well, so I figured the only way to find reliable and anonymous proxies is to chain 2 or more together non-anonymous proxies. But I want to be able to do it programatically in C#. Anyone have any suggestions or experience doing this? Its for scanning my company's competitor websites and gathering information regularly without being noticed.
Thanks,
Dave
|
|
|
|
|
|
davehere40 wrote: Its for scanning my company's competitor websites and gathering information regularly without being noticed
While it's not unusual practice, it is still unethical and you could well be breaching Terms & Conditions.
|
|
|
|
|
hi guys, I want to show a table inside the webbrowser control but it just display the text that's inside the table but not the entire table. Something wrong in there please help. Thanks
mshtml.IHTMLDocument2 doc = this.webBrowser1.Document.DomDocument as IHTMLDocument2;
doc = (mshtml.IHTMLDocument2)this.webBrowser1.Document.DomDocument;
doc.designMode = "On";
doc.body.innerHTML=
<table><tr><td>noway</td></tr></table>
|
|
|
|
|
I am writing to a 1K Mifare Card (RFID) in my windows application. How can I secure/personalize/encrypt this card so that only my application can read and write the data over it.
Thank You
|
|
|
|
|
Hi,
I am working in the same side. If you get any solution please inform me. One thing we can do is to make an encryption decryption class for the data. before storing the data to the tag you must convert it through some algorithm. For Example you can reverse the order of bits in each byte before storing to the tag. You must have to reverse the bytes again when you will read from the tag.
I am going through the different Issue. I am trying to store the data of 1433 bytes in 1K. if you have any idea of compressing the bytes please share that. Can we use the block 3 of each sector. I don't need the password. How can I override that.
Thank You.
Regards
|
|
|
|
|
|
This problem has been solved, the bug was somewhere else in my code. I am thankful to everybody who read my problem description.
|
|
|
|
|
I know this is simple but I just can't remember and can't find it. How do you change programatically which button is selected and which field has the cursor in it so the user doesn't have to keep tabbing or clicking.
|
|
|
|
|
could it be you are looking for the focus function?
Eyal
|
|
|
|
|
yeah that's it alright and I see a million articles on the topic. Thx so much
|
|
|
|
|
bfis108137 wrote: How do you change programatically which button is selected and which field has the cursor in it so the user doesn't have to keep tabbing or clicking
|
|
|
|
|
Hi guys, bit of a problem here, im attempting to write an orm layer for myself and i cant seem to figure this one out.
i style class properties with a custom attribute:
[ORMProperty("ID")]
public int ID { get; set; }
[ORMProperty("Name", typeof(Name))]
public Name CustomerName { get; set; }
normally i would use: Name wtf = Name.Deserialize("SOMEBASE64SERIALIZEDSTIRNG"); to create the string back into a class. now, what i would like to do is take the value of the typeof() while doing the reflection, create an instance of that class, call its .Deserialize(), and then set the result as the appropriate reference to that property.
|
|
|
|
|
damianrda wrote: now, what i would like to do is take the value of the typeof() while doing the reflection, create an instance of that class, call its .Deserialize(), and then set the result as the appropriate reference to that property.
When? How? What part of your system? You have not provided enough information for us to understand your design. Do you have previous experience authoring and using custom attributes?
led mike
|
|
|
|
|
Hi,
I am creating a panel which derives from Panel.
This panel should be able to Autoscroll vertically but not horizontally.
However, I did not find a way to disable scrolling only for one direction (although one can not show the scrollbar this won't avoid growing of the Displayrectange in that direction).
please advise,
Eyal
|
|
|
|
|
Hi
Is it possible to write in a text file with a color other than black?
How?
|
|
|
|
|
mahraja wrote: Is it possible to write in a text file with a color other than black?
Yes, simple!
File.Write(" "), see, it's white now...
|
|
|
|
|
Huh? I write in grey-on-blue.
|
|
|
|
|
No, not directly because a text file only contains unicode characters, which don't have color information.
You could automate Wordpad or Word to write a .rtf or .doc file which can contain color information.
A simpler alternative might be to define your own file header format, containing color information (and anything else you want). Then your application could read this header and display the following text in the desired color.
|
|
|
|
|
Alan Balkany wrote: automate Wordpad or Word
Or use a RichTextBox.
Alan Balkany wrote: define your own file header format
Or use XML.
|
|
|
|
|
Or use a RichTextBox.
Good idea.
|
|
|
|
|
idiot.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|