IRC Networks
Irc Logs Stats
Start date: 2007-09-27 02:48:27
Last update: 2008-10-24 20:19:38
Channels: 41
Logged Lines: 6230436
Size: 1822.25 MB
Powered by
Channel Info
Network: freenodeChannel: #csharp |
Search in www.irclog.org
Log from #csharp at freenode 2006-06-15
Pages: < Prev
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
Next >
[00:22]<kjr>+erm, I guess
[00:22]<kjr>+I've never needed it in any language
[00:22]<wyfaj>-sometimes you want to implement multiple interfaces (maybe from different assemblies) where methods have different semantics but the same signature...
[00:22]<sdnffdxdlld>+http://thedailywtf.com/forums/thread/77493.aspx <<< that is one scary wtf :S
[00:23]<wyfaj>-in other cases you just want to use it as a hiding mechanism....
[00:23]<gzrmsxrmn>+(any ideas where the 'this' pointer comes from in http://img466.imageshack.us/img466/6176/wtf2mx.png ? )
[00:23]<wyfaj>-for example you could implement IDisposable explicitly and only expose Close publicly.... which will internally dispose
[00:23]<wyfaj>-but to still allow disposing semantics (such as using (...)) you would still implement IDisposable
[00:24]<vynvyv>+ah i see
[00:24]<wyfaj>-so to both deal with hiding and deal with conflicts of semantics it's useful
[00:24]<vynvyv>+you can explicitly implement things even if they don't have the same signature
[00:24]<wyfaj>-yes
[00:24]<vynvyv>+and the point is you can hide what you implement?
[00:25]<vynvyv>+you gave an example but i don't really understand it since i'm not very familiar with the library
[00:26]<wyfaj>-in the case of idisposable.... sometimes "Close" may be a more appropriate name, but you wouldnt want to polute your type by having both Close and Dispose... so it would make sense to explicitly implement IDisposable in that case
[00:27]<y-gz>-but that would confuse the runtime ?
[00:27]<sdnffdxdlld>+a good example of explicit implimentation is GetENumerator when implimenting generic collections
[00:27]<wyfaj>-no
[00:27]<wyfaj>-you either explicitly call Close (and you can assume it'll internally dispose), or you can use the using (...) syntax in which case the compiler really emits a ((IDisposable)yourObj).Dispose() call
[00:28]<wyfaj>-yeah
[00:28]<vynvyv>+i don't know of the using (...) syntax
[00:28]<wyfaj>-IEnumerator/IEnumerator<T> is a better example indeed
[00:28]<vynvyv>+you mean at the top of the cs file?
[00:28]<wyfaj>-no
[00:28]<wyfaj>-bleh
[00:28]<lnvnzxu>+tieTYT: that's the using directive, wilco is talking about the using statement
[00:29]<vynvyv>+i'll see if google gives me anything on that
[00:29]<y-gz>-tieTYT: http://pastebin.com/709479
[00:29]<lnvnzxu>+using (MyTransaction foo = GetMeATransaction()) { } /* foo automatically disposed, even when there's a throw */
[00:30]<wyfaj>-in a nutshell... it compiles using (My.. what peterhu said to MyTransaction foo = null; try { foo = new MyTransaction(); ........ } finally { if (foo != null) ((IDisposable)foo).Dispose(); }
[00:30]<mnzncs>+does anyone know the answer to my quest about the browser control?
[00:31]<rxrcr>-dereks, if the hyperlinks in question have a target specified, they will open in a new browser window
[00:32]<rxrcr>-don't know if theres a way to enforce that, most people just try to control the content that is displayed.
[00:32]<vynvyv>+wilco: interesting
[00:32]<mnzncs>+chaka: they don't open in a new browser window, they open in the control
[00:32]<vynvyv>+and peterhu, interesting
[00:32]<vynvyv>+Kog: did you want to knwo something about Properties?
[00:33]<rxrcr>-dereks, change the name of the target to _blank or whatever the convention is
[00:33]<kjr>+tieTYT: if it was sane to use
[00:33]<mnzncs>+chaka: what do you mean
[00:33]<vynvyv>+oh, yep
[00:33]<mnzncs>+to _blank?
[00:33]<vynvyv>+but you might want to look at Preferences
[00:33]<wyfaj>-or you could probably handle some Navigation event in combination with Process.Start
[00:34]<vynvyv>+if Preferences is a better fit, it's got a better interface
[00:34]<wyfaj>-and cancel the navigation to actually stay on the current page in the webbrowser component
[00:34]<vynvyv>+i'd suggest using that if they both work for you
[00:34]<kfl>-hi eveybody i would like to know if its possible t play with colors in listboxes in different lines
[00:34]<wyfaj>-tieTYT: i guess when you said "Properties" you actually meant some product?
[00:34]<rxrcr>-dereks, the only way to enforce all hyperlinks to open a new window from the browser control is to change the hyperlinks you are displaying
[00:35]<mnzncs>+chaka: hmm, ok, what should i changet them to?
[00:35]<rxrcr>-dereks, instead of <a href="someurl">link</a> to <a href="someurl" target="_blank">link</a>
[00:36]<mnzncs>+chaka: ahh gotcha
[00:36]<mnzncs>+thanks
[00:36]<vynvyv>+wilco: i'm just being off topic (but Kog started it :P)
[00:37]<rxrcr>-man I suck at engrish sometimes
[00:37]<vynvyv>+it's java talk
[00:37]<wyfaj>-ok
[00:37]<kjr>+tieTYT: Preferences you say
[00:37]<vynvyv>+yes, it's a very easy way to save an apps preferences from run to run.
[00:38]<kjr>+oh... th ose are loaded at runtime automagically
[00:38]<kdzdg>+hello
[00:38]<vynvyv>+this using statement seems like a really really specific situation to have a special keyword for
[00:38]<vynvyv>+do you guys use it that often?
[00:39]<kjr>+it's another element of scope
[00:39]<kfl>-hi eveybody i would like to know if its possible t play with colors in listboxes in different lines
[00:40]<sdnffdxdlld>+I use using all the time with things like connections and other objects that I want to make sure are disposed
[00:40]<sdnffdxdlld>+it's easier than try{}finaly{} (which is what it is compiled into)
[00:41]<wyfaj>-sugar makes code more tasty
[00:41]<kjr>+smellyhippy: you smelly bastard. how's the bot coming ;)
[00:41]<vynvyv>+smellyhippy: agreed
[00:41]<vynvyv>+but couldn't it be useful if you could do that with other things
[00:42]<vynvyv>+for example, a db connection that you have to close
[00:42]<vynvyv>+what if you could do using () {} around that and at the end of that it closes it for you
[00:42]<vynvyv>+tha'd be pretty useful imo. Is that possible?
[00:42]<sdnffdxdlld>+fine kog :P tomorrow I'll have the user objects serializing/deserializing from files
[00:42]<vynvyv>+or does it only use dispose
[00:42]<wyfaj>-eh tieTYT: that is what is happening?
[00:42]<wyfaj>-if you call dispose on a connection it'll be closed....
[00:42]<vynvyv>+wilco: oh, i didn't know that
[00:43]<sdnffdxdlld>+yer ^^ what wilco said ;)
[00:43]<vynvyv>+sorry, my lack of the libraries is showing
[00:44]<sdnffdxdlld>+another handy use is if you make a custom WaitCursor class ... then you just using(new WaitCursor) {} around the code thats going to make stuff busy
[00:45]<vynvyv>+ah i thought this was purely for garbage collection
[00:45]<vynvyv>+and that the base object implements IDisposable for you
[00:45]<vynvyv>+i see where iw as wrong
[00:46]<sdnffdxdlld>+if you impliment IDiposeable then you can make Dispose do what you like .. obviosly within reason
[00:47]<vynvyv>+that's awesome
[00:47]<vynvyv>+ok, thanks guys
[00:47]<sdnffdxdlld>+I wish you could overide virtual property accessors with different combinations of get/set :/ it's silly having to new it :\
[00:47]<vynvyv>+so in the end, it does exactly what i wanted it to do :)
[00:47]<wyfaj>-smellyhippy: huh?
[00:47]<sdnffdxdlld>+yo wormy!
[00:47]<awjzdd>+y0!
[00:48]<awjzdd>+finally got interweb at the new apt!
[00:48]<wyfaj>-oh you mean add a setter to a virtual read-only property for example?
[00:48]<sdnffdxdlld>+yeah
[00:49]<wyfaj>-well
[00:49]<wyfaj>-sounds like it would be a compatibility issue...
[00:49]<koo>-Hi and please help







