Posts Tagged ‘csharp’
Dispose, Finalize and SuppressFinalize

I got the following question recently.
What is the difference between Dispose and
SupressFinalize in garbage collection?”
The problem with this question is it assumes Dispose and SupressFinalize have similarities, which I’m sure is not what is being asked here. So let’s rephrase it in terms that make sense.
I see three methods available to me in .NET that all seem to have something to do with garbage collection. Can you explain what Dispose, Finalize, and SupressFinalize do and why I could use or call each one in my code?”
Republished by Blog Post Promoter
Test Sending Email without a Server in ASP.NET
By now, most people are familiar with the fact that ASP.NET will send mail from the codebehind by simply adding a few lines to your web.config file and adding another few lines of code in the codebehind file.
But it wasn’t until recently that I found that you don’t need to have access to an SMTP server to test your code.
Republished by Blog Post Promoter
Silverlight – Wire up your form for programming
As I mentioned a couple of weeks ago, learning Silverlight is a lot more about relearning some basic assumptions than it is about learning a new language. We’ve already looked at the basic layout managers available and how that impacts putting a screen together. Today we want to look at how we can capture events and access the controls from our CSharp code.
< ! Read the rest of this entry »
Republished by Blog Post Promoter
Hungarian Notation – Use What Works, Spit Out The Bones
I am about to embark on the “religious” topic of naming conventions. I was reminded of this topic by the short post, “Hungarian Notation, what do I think”, by Richard Dingwall.
I’m sure there will be those of you who will disagree with me, but as I’ve stated in previous posts, these general guidelines I’ve been using for .NET programming have served me well since .NET 1.0; they are meant as strong suggestions for those who are looking for guidance, not rules I expect the industry to adopt because I know better than anyone else.
In fact, while I will propose what I consider the “best” way, I will also provide some alternatives.
Republished by Blog Post Promoter
AS is in CSharp too.
Many CSharp programmers are surprised to find that CSharp has an AS keyword that looks remarkably similar to VB.NET’s AS keyword. And while on the surface it looks similar to what AS does in VB.NET, it is quite a bit different.
To start with, you can’t declare a variable with the AS keyword. But you can assign to a variable using the AS keyword, like so:
Republished by Blog Post Promoter