Geeks With Blogs
Greg Young Greg.ToString() December 2005 Entries
Why I don't use thread.abort
Thread.Abort can cause some nasty nasty behaviors as it forces an exception where one was not originally intending to be handled. This can wreak havoc when dealing with un-managed resources. I have for your viewing pleasure an example directly from the 1.1 framework! This particular bit of code is from FileStream's constructor! If thread aborts happen at correct times the file stays locked until the process is restarted without any hope of being recoverred. The time that this can occur is specifically ......

Posted On Friday, December 23, 2005 12:07 PM

Feedback broken so ...
I am putting this here since feedback seems to be broken at this point. this is in reference to .. http://geekswithblogs.net/r... I am not quite sure what you are on about ... the value of J is neither 5 nor 6 it is 1. ArrayList sets = new ArrayList(); Creates a new array list sets.Add(single); Adds the previous arraylist into this arraylist i.e. sets[1] = the arraylist ArrayList temp = (ArrayList) sets[0]; temp.RemoveAt(0);//removes the item from the first arraylist ......

Posted On Thursday, December 22, 2005 8:54 AM

New Article
http://geekswithblogs.net/gyoung/articles/63368.aspx “Holiday Thoughts” from EE newsletter.

Posted On Saturday, December 17, 2005 12:43 AM

Highlight DataGrid Row
or anything for that matter. I was just reading this post http://geekswithblogs.net/d... There are 2 major problems with the solution presented. 1) it requires a recompile to change the colors 2) this should really be in a style sheet Thus I present ... the style sheet implementation just set the datagridrow to be the right class. in your css .DataGridRow{ background-color: black; border: 0px; behavior: url(/styles/rollover.htc); } in a .htc file <PUBLIC:COMPONENT> ......

Posted On Thursday, December 15, 2005 10:43 AM

New stuff in 2.0

Largest design changing feature in 2.0 outside of generics.

 

public class Foo {

    private int m_Bar;

    public int Bar {

          get { return m_Bar; }

          internal set { m_Bar = value; }

}

 

I have been wanting to do this for oh so long.

 

:D

Posted On Thursday, December 15, 2005 10:32 AM

hmm this could have some intresting uses
Someone today asked me a question which I found intresting and is fairly usefull in debugging. The questions was “How do I figure out which function called my function”. In other words they wanted to note their caller without throwing an exception etc. This is quite easily done by using the StackFrame object in System.Diagnostics just promise you won’t use this in lieu of encapsulation J i.e. NEVER use this as a conditional in your code if(IamCalledBySomeFunction) { //do one behavior ......

Posted On Friday, December 2, 2005 6:38 PM

Partial Classes Ctd
I generally avoid writing multiple posts in a day in any blog system as it aggregates but ... A few days ago I made a post about partial classes being misused and the fact that they are not new and a few people came back at me discussing their use for hiding autogenerated code. I understand that this is their primary use but I challenge the thought that they are needed, does inheritance not provide the exact same end. There may be a slight amount of higher overhead using inheritance at a level far ......

Posted On Thursday, December 1, 2005 1:22 AM

Feedback & Exception Management
Is feedback broken? I have been trying to leave feedback for a few people but it has been failing. I have requested a new sourceforge space which should be available by the end of the week. I will be placing my exception management library up, I will place a link there. You are probably thinking to yourself “Wait isn't there a MS application block for that?”. Well I found the application block a small step above useless for my applications as it is fairly difficult to manage and the configuration ......

Posted On Thursday, December 1, 2005 1:06 AM

Copyright © Greg Young | Powered by: GeeksWithBlogs.net