IRC Networks
Irc Logs Stats
Start date: 2007-09-27 02:48:27
Last update: 2008-04-02 18:00:08
Channels: 41
Logged Lines: 6229042
Size: 1807.46 MB
Powered by
Channel Info
Network: freenodeChannel: #csharp |
Search in www.irclog.org
Log from #csharp at freenode 2006-08-06
[00:00]<cxrfnm>bbtech, register the keyPress event to the textbox
[00:00]<cxrfnm>and compare to see if the key is "return"
[00:01]<22vnax>khaled: ok thanks
[00:01]<cxrfnm>and call your ok button's click event
[00:01]<cxrfnm>bbtech, i think return is keycode # 13
[00:01]<cxrfnm>not sure
[00:01]<rwyfcygs>Calling events directly is ebil
[00:02]<rwyfcygs>Call the routine the event calls instead (that is all it does, right?) :-)
[00:02]<zyccus>awilkins: DJB = Dan Bernstein, author of lots of things, most famous including qmail and djbdns. He likes parsable file formats.
[00:03]<rwyfcygs>I found his webpage, eventually.
[00:03]<rwyfcygs>Reading his stuff about IPv6
[00:03]<zyccus>people mostly hate him
[00:04]<zyccus>well, developers do
[00:08]<nffylsys_>I'm having a problem with the propertygrid control
[00:08]<nffylsys_>can anyone help?
[00:08]<nffylsys_>I'm trying to get a drop down list
[00:08]<nffylsys_>according to msdn, I create a class derived from StringConverter
[00:08]<nffylsys_>and override GetStandardValuesSupported and GetStandardValues
[00:09]<nffylsys_>I've done that
[00:09]<nffylsys_>but the problem is
[00:09]<nffylsys_>...
[00:09]<nffylsys_>is anyone alive?
[00:09]<rwyfcygs>Braiiiiiiiiiins!
[00:09]<22vnax>ok, I'm confused what is the best way to invoke the ok buttons click event... 1. call okBTN_Click() 2. call? okBTN.Click?
[00:09]<kjr>awilkins: you're too late, Google took mine already
[00:10]<rwyfcygs>bbtech: all event procedures should do is call another routine(maybe with a parameter) ; that's a design/style thing, not a necessity
[00:10]<rwyfcygs>bbtech: So to get the same effect, call the same routine the event procedure does.
[00:11]<pzggjgg1000>What could cause a StackOverFlowException?
[00:11]<22vnax>concrete example?
[00:11]<nffylsys_>the problem is that when I try to select an item in the drop down list, it says the property value is not valid, because it can't convert type string to type Tilesetting
[00:11]<rwyfcygs>Of you end up like my old shop with 24-page txtPrompt_KeyUp events which run the entire application with a bizarre twisted state machine run on 19-deep nested IF statements
[00:11]<pzggjgg1000>(Besides overflowing the stack.)
[00:11]<nffylsys_>Tilesetting is the name of the class I derived from StringConverter
[00:11]<nffylsys_>so...any idea what I should do?
[00:12]<cxrfnm>bbtech, 1. okBtn_Click(sender, e);
[00:12]<rwyfcygs>well, if your OK button event handler presently does more than one line of code, break it out into a routine that describes what you expect to happen (like VerifyAndCloseBox)
[00:12]<rwyfcygs>Then change the OK button to just call VerifyAndCloseBox
[00:12]<22vnax>oh, I see
[00:13]<rwyfcygs>And then you can add a VerifyAndCloseBox to the KeyUp event, inside a conditional testing for key 13
[00:13]<rwyfcygs>'cause what you want to do is not simulate an OK button push, you just want to do the same thing as the OK button does.
[00:13]<22vnax>awilkins: got it, thanks! :D
[00:14]<rwyfcygs>Coming from VB6, I know the horrors of putting all your code in GUI elements.
[00:14]<nffylsys_>anybody have any idea about what I should do?
[00:14]<nffylsys_>:(
[00:14]<rwyfcygs>(guilty, as charged)
[00:16]<zyccus>awilkins: I spent most of Friday undoing some of that crap which my ex-colleague had left me. I needed to call his code, but it was all bound up with the form he'd made. Grr.
[00:17]<pzggjgg1000>How would I tell where, say, a StackOverflowException comes from?
[00:18]<pzggjgg1000>I'm doing significant, but non-infinite, recursion.
[00:19]<pzggjgg1000>Actually, nevermind, it WAS infinite recursion. I blame my brain.
[00:19]<rwyfcygs>I've not encountered a stack overflow in recent years that wasn't infinite recursion
[00:20]<cxrfnm>is it possible to access a private field using NUnit to verify its contents ?
[00:20]<cxrfnm>how are private fields tested ?
[00:20]<rwyfcygs>Well, you can write your test routines into your class.
[00:21]<rwyfcygs>Or use Reflection (ugh)
[00:21]<cxrfnm>awilkins, i would prefer to keep my tests outside the actual design
[00:21]<cxrfnm>using Reflection, how ?
[00:21]<nffylsys_>gah
[00:21]<nffylsys_>can NOBODY help?
[00:21]<rwyfcygs>Reflection can peek inside classes, look at MemberInfo
[00:22]<rwyfcygs>khaled: On the other hand, testing a class by looking at it's internals is hardly contract-based programming, is it?
[00:22]<cxrfnm>awilkins, contract-based programming, is that a new concept ?
[00:22]<cxrfnm>something like OOP ?
[00:23]<rwyfcygs>OOP is an expresson of contract-based programming
[00:23]<pzggjgg1000>It's only been around since people wrote function documentation and said "DON'T DO THIS.".
[00:23]<pzggjgg1000>And people, on the whole, either didn't do that, or got really weird problems.
[00:24]<rwyfcygs>The point is, you have a class, you have an idea of how your interface should behave, and you shouldn't care about what goes on inside (in theory)
[00:24]<cxrfnm>may be, i will look into that later, thanks
[00:24]<cxrfnm>awilkins, i am working on a wrapper for a c library
[00:25]<cxrfnm>i have this property called Refcount which should not have direct access
[00:25]<rwyfcygs>But you want to verify it's contents?
[00:25]<cxrfnm>yes
[00:25]<cxrfnm>i have function like Ref to increment it and UnRef to decrement the value
[00:26]<cxrfnm>i guess , it is ok to have a accessor public property
[00:26]<rwyfcygs>You could put it inside a conditional compilation block
[00:26]<rwyfcygs>#if DEBUG // etc
[00:27]<cxrfnm>how do you handle the value of DEBUG ?
[00:27]<cxrfnm>passing to the compiler?
[00:27]<pzggjgg1000>-DDEBUG[=foo] when compiling?
[00:27]<cxrfnm>i wonder if mono supports that
[00:27]<pzggjgg1000>It should.
[00:27]<cxrfnm>is that a 2.0 feature ?
[00:27]<pzggjgg1000>I think the preprocessor was around before 2.0.
[00:27]<rwyfcygs>It's a pretty standard compiler feature in compilers that support preprocessor macros
[00:28]<rwyfcygs>Even VB supports it :-)
[00:28]<cxrfnm>yeh..i know gcc has it
[00:28]<cxrfnm>never C# would have something like this
[00:28]<nffylsys_>...
[00:28]<nffylsys_>please help?
[00:28]<pzggjgg1000>How would I specify a relative path to a XML file for XmlTextReader?
[00:29]<cxrfnm>by the way, is it possible to compile dependent source files one by one?
[00:29]<cxrfnm>come with like
[00:29]<cxrfnm>csc -c file1.cs
[00:29]<pzggjgg1000>khaled: Yes, and compile them to dlls.
[00:29]<cxrfnm>csc -c file2.cs
[00:29]<pzggjgg1000>khaled: Well. Shared objects.
[00:29]<cxrfnm>whats the compiler switch ?
[00:30]<zyccus>khaled: you can use a mocking framework to test private stuff
[00:30]<zyccus>khaled: e.g. typemocks, rhino mocks
[00:30]<rwyfcygs>nunit.mocks (silly me, duh)
[00:31]<zyccus>khaled: I only found this out recently - until now I've been adjusting my designs to make it easier to test







