• Welcome to Powerbasic Museum 2020-B.
 

News:

Forum in repository mode. No new members allowed.

Main Menu

C#

Started by Rick McNeely, December 09, 2012, 12:32:59 AM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

John Strasser

Quote from: Steve Rossell on December 18, 2012, 12:28:36 AM
I am sure I will become more comfortable as I go along. Not every object inherits from IDisposable. For example, I am working on an app that adds ands removes tabitems in code. I have to remove all the references to each control, unhook any event handlers, set Items to null (DataGrid with ObservableCollection), clear out the observablecollection and it's references. If this was not done the tabitem would be removed but the datagrid and other controls that still had references would not be Garbage Collected. I always using USING{} on disposable objects. It just seems like a lot more work and a lot of planning on what it will take to get an object 

Do not get me wrong. I enjoy it. C#, WPF, and XAML are very different then what I am used too. But, I am having a lot of learning something new.

And there you have the PITA aspect of OOP.  I've always found (when it comes to C++/C# at least) whenever you put anything into a class you then immediately put it in the constructor and destructor.  Even if it's just a code stub that will flag an error at compile time (so that you're forced to flesh it out).  This has often kept me out of (some) trouble.

But as for planning Steve, you're right.  If you get that right though, whoosh - you've got yourself a cool set of class libraries you can drop in almost anywhere.

PS - thanks for the links Edwin.
John
Hypnotherapist Extraordinaire, NLP Trainer
----------------------------
John Strasser
Scottsdale, AZ, USA
Phone: 480-273-8798