|
-
Sep 2nd, 2005, 02:24 AM
#1
[RESOLVED] little Q about implementing an interface's functions...
syntax issue here, suppose a class implements IDisposable, then are these two considered the same inside this class?
Code:
void IDisposable.Dispose()
{}
public void Dispose()
{}
rate my posts if they help ya!
Extract thumbnail without reading the whole image file: (C# - VB)
Apply texture to bitmaps: (C# - VB)
Extended console library: (VB)
Save JPEG with a certain quality (image compression): (C# - VB )
VB.NET to C# conversion tips!!
-
Sep 2nd, 2005, 12:51 PM
#2
Re: little Q about implementing an interface's functions...
Not if you use a fully qualified prefix for interface method declarations, as you have. However, that being said, it isn't recommended
[Edit]
The above will only work if the method is inherited from a parent class - you will get a build warning ("modifier 'new' is needed").
If you have explicitly defined your own Dispose method in the same class, you will get a build error.
Last edited by axion_sa; Sep 2nd, 2005 at 12:55 PM.
-
Sep 2nd, 2005, 01:02 PM
#3
Re: little Q about implementing an interface's functions...
hmm so usually I see the first one on MSDN, you're saying it isnt recommended?
also, what's the difference, I dont really understand kinda confused
rate my posts if they help ya!
Extract thumbnail without reading the whole image file: (C# - VB)
Apply texture to bitmaps: (C# - VB)
Extended console library: (VB)
Save JPEG with a certain quality (image compression): (C# - VB )
VB.NET to C# conversion tips!!
-
Sep 2nd, 2005, 01:16 PM
#4
Re: little Q about implementing an interface's functions...
Haven't noted anything like that in MSDN - may I ask where you found it?
When I say not recommended, I mean that designing an application so that it will inherit specific method signatures that conflict with interface method signatures
The difference between creating your own Dispose as opposed to implementing IDisposable? One imagines that when the .Net framework searches for Dispose implementations, it will search the inheritance / implementation routes used - i.e. search for IDisposable, and not Dispose itself. Although, if you're going to be calling Dispose yourself, I guess it's six of one...
-
Sep 2nd, 2005, 01:19 PM
#5
Re: little Q about implementing an interface's functions...
well look at this for example http://msdn.microsoft.com/library/de...classtopic.asp
they use IDeserializationCallback.OnDeserialization
both of the Dispose() ones I have above seem to do the same: implement the Dispose method of the IDisposable interface.
rate my posts if they help ya!
Extract thumbnail without reading the whole image file: (C# - VB)
Apply texture to bitmaps: (C# - VB)
Extended console library: (VB)
Save JPEG with a certain quality (image compression): (C# - VB )
VB.NET to C# conversion tips!!
-
Sep 2nd, 2005, 01:23 PM
#6
Re: little Q about implementing an interface's functions...
Oh! You mean using just the method name as opposed to fully qualifying it? Nope, no difference whatsoever.
Sorry - seems I was barking up the wrong tree...
-
Sep 2nd, 2005, 02:24 PM
#7
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|