August 2006 - Posts

I was so looking forward to trying Vista on my Toshiba M200.  Unfortunately, despite all attempts it wouldn't upgrade.
Problems I encountered were not enough room on my system partition.  It's only 2GB and designed for booting/loading various OS's. Annoying, but I was able to clear enough space on there.
Next install complained about a lot of toshiba applications not being supported in Vista.  And I do mean a LOT.  This bit really sucks, and somehow I doubt Toshiba will be releasing new apps there for M200's.. maybe, but not in any rush if they do ;)  So at best I was probably looking at reduced functionality. Still I forged forward wanting to try it out :)
The machine reboots after 10 minutes or more, and then fails at startup. hit enter it tries to restart and fails… endless loop.  So I do an  F8, and happily can get back to my old XP boot.  But the whole boot files have been changed, and when I try to clean up I inadvertently deleted a directory that was need for booting, so on next boot, boot fails :'(
Finally I booted up to my SD card, and ran the first part of an XP install to add the system files back to the root disc.
Very disappointing that setup failed, that cleaning up was so difficult (no DOS type restore command), and really disappointed at the large list of apps that were unsupported in Vista.
I will try again next time, but at this stage the likelihood of me *upgrading* to Vista for existing hardware seems very unlikely.
Oh, and on top of that, search as I could, there just seemed no way to actually provide feedback. maybe I need to actually get it installed and run IE7 to do that ?  I'm not sure, but seems like a good way of hearing from the wrong group ;)
 
 
 
with no comments
Filed under:
the following is the code for the custom SettingsProvider from Geoff and mine's TechEd 2006 presentation:
 
Option Strict On
Option Explicit On
 
Imports System
Imports System.Configuration
 
''' <summary>
''' simple example of a SetitngsProvider that saves each individual setting in it's own file
''' </summary>
''' <remarks>to use, add a setitng to My.Settigns designer, open the properties window
''' and set the provider to FileByFileSettingsProvider if in the same project, otherwise the full name.
''' </remarks>
Public Class FileByFileSettingsProvider
   Inherits SettingsProvider
 
#Region "constructor and initialize"
 
   Public Sub New()
      MyBase.new()
   End Sub
 
   Public Overrides Sub Initialize(ByVal name As StringByVal config As System.Collections.Specialized.NameValueCollection)
      If name Is Nothing Then name = My.Application.Info.ProductName
      m_appName = name
      MyBase.Initialize(m_appName, config)
   End Sub
 
   Private m_appName As String
 
   Public Overrides Property ApplicationName() As String
      Get
         Return m_appName
      End Get
      Set(ByVal value As String)
         m_appName = value
      End Set
 
   End Property
#End Region
 
 
 
   'HACK: hard coded root path. In practice use assembly path or similar
   Private m_rootPath As String = "E:\test\"
 
 
   Public Overrides Function GetPropertyValues(ByVal context As SettingsContext, _
                                                ByVal properties As SettingsPropertyCollection) _
                                                As SettingsPropertyValueCollection
 
      Dim values As New SettingsPropertyValueCollection
 
      For Each setting As SettingsProperty In properties
 
         Dim filepath As String = m_rootPath & setting.Name & ".xml"
 
         Dim value As New SettingsPropertyValue(setting)
         With My.Computer.FileSystem
            If .FileExists(filepath) Then
               value.SerializedValue = .ReadAllText(filepath)
               ' coment out the preceeding line and uncomment the following line to make the serialization binary
               'value.PropertyValue = GetObjectFromBytes(.ReadAllBytes(filepath))
            End If
            value.IsDirty = False
            values.Add(value)
         End With
      Next
 
      Return values
   End Function
 
 
 
   Public Overrides Sub SetPropertyValues(ByVal context As SettingsContext, _
                                          ByVal values As SettingsPropertyValueCollection)
 
      For Each value As SettingsPropertyValue In values
         Dim filepath As String = m_rootPath & value.Name & ".xml"
         My.Computer.FileSystem.WriteAllText(filepath, value.SerializedValue.ToString, False)
         ' coment out the preceeding line and uncomment the following line to make the serialization binary
         ' My.Computer.FileSystem.WriteAllBytes(filepath, GetObjectBytes(value.PropertyValue), False)
      Next
   End Sub
 
 
 
#Region "helper methods"
 
 
   'HACK: this is sub-optimal means of reading the binary stream from disk.
   Private Function GetObjectBytes(ByVal obj As ObjectAs Byte()
      Using buffer As New IO.MemoryStream()
         Dim formatter As New Runtime.Serialization.Formatters.Binary.BinaryFormatter()
         formatter.Serialize(buffer, obj)
         Return buffer.GetBuffer
      End Using
   End Function
 
   'HACK: this is sub-optimal means of writing out the binary stream to disk.
   Private Function GetObjectFromBytes(ByVal bytes As Byte()) As Object
      Using buffer As New IO.MemoryStream(bytes)
         Dim formatter As New Runtime.Serialization.Formatters.Binary.BinaryFormatter()
         Return formatter.Deserialize(buffer)
      End Using
   End Function
 
#End Region
 
 
End Class
with 1 comment(s)
Filed under: ,
This is cool!
 
David Tarditi and Sidd Puri are doing some really cool work over in Microsoft Research. They've built a development technology, Accelerator, that  "provides a high-level data-parallel programming model as a library that is available for all .Net programming languages. The library translates the data-parallel operations on-the-fly to optimized GPU pixel shader code and API calls. Future versions will target multi-core cpus" Watch this video!

Download the
Accelerator library and SDK!

Check out the Accelerator Wiki for more info.
with 1 comment(s)
Filed under:
Despite catching a cold from the moment I landed in Sydney, and a terrible tips and tricks presentation, TechEd 2006 was a lot of Fun.  First let's see how it went on the "reasons to TechEd" evaluator:
 
(1) the shirts :  Well all I saw was all cotton, so things are potentially looking good ;)   MS's forefront was nice minimalistic (not greatest quality though :o).  And of course Frank had his mambo shirt (V2), That must be a sign "long term" trends of  stability ;)
 
(2) office friendly projectiles : not bad at all.  I saw some nice softish mini football's with tail fins (or are they meant to be rockets ?)  The soccer balls on the other hand seemed a bit over the top for inside an office.  And although I saw pictures of the frisbees, I don't think I saw any in flight.  So all in all a mixed bag, some doing good, other's not quite getting it.
 
(3) booth babes :  *At* the venue itself, there didn't seem to be the gratuitous booth babes this year, instead there was a noticeable number of more beautiful smiley friendly faces everywhere, and the BIG change this year was those faces seemed to also be associated with brains capable of holding conversations !  Of course there had to be gratuitous women somewhere associated with the event and the party, and Darling Harbour nite life supplied that, from the XBox cheerleader girls, all the way to the girls kissing each other on the dance floor (yes that really did happen).  The interesting part of this was it seemed to validate my anthropological hypothesis that I put forward, that given a pretty girl you can sell *anything*, even OS2 to geeks.  Well the credit card were certainly flashing, and no-one really knew exactly what those girls kissing on the dance floor were selling, just that a lot of people wanted to buy <g> 
 
On a more serious note, it was great to see more women involved with TechEd.  The keynote was from Anne Kirah  ,and hopefully helped people to rethink how they think about the "user".   I didn't get a chance to see Anna Liu's presentation, but from what I heard it went over well, and like Anne's talk challenged the way we think about the "user" in solutions.  Probably just a co-incidence, but also a probability given the lack of presence of women presenters over the years there is most likely a large untapped reserve there that can help us see the bigger pictures.  Good news is there seems to be more women ready to present next year :)
 
So anyway, on (3), I think it is better than booth babes, and maybe it's this head cold I *still* have, but for some reason it seems kind of strange to see TechEd become more "real" world, while the real world around it (well Darling Harbour) becomes more bizarre.  But before you think we're getting all touchy-feely in touch with our feminine selves, you should be aware that TechEd 2007 is in the land of gratuitous meter maids :D
 
 
On other things …
 
It was great to see many of Australia's best software developers & architects there in one place.  Many people mentioned to me that the reason they come to TechEd is not for the presentations (which is kind of good cause mine & Geoff's presentation surely sucked), but rather to meet up with people, and the conversations, conversations about many things.
 
Some of the more interesting "technology" conversations seemed to be focused on the world of multi-processors, and asynchronous computing.  From Nick Weinholt's use of #pragma omp parallel for , to discussions about how it would fit into managed code, discussing functional languages with Joel Pobar (which Leon has taken the meme with), LINQ and multi processing, concepts of workflow and concurrency right through to the philosophical discussions of whether language alone can solve this, or whether it's language and tools that provide the real solutions, and the directions taken there.  It was also interesting to hear the general consensus that C# is loosing it's way in that it is becoming more complex like C/C++ from which it tried to simplify and purify.  
 
Probably one of the stranger discussions I think triggered by Andrew Parsons was Structures (value types) and Events.  Kind of strange as although you can have events in Structures, none of use could really come up with good reasons as to why you would, and in fact were generally shaking our heads over the potential issues due to copy in// copy out behaviour ;) Perhaps that's a feature that should have compiler warnings on it.
 
And of course it was great to see some of the new cool hardware some of the folks had, Frank's motion tablet, Nick (Baa means NO) Randolph's ultra portable device (forgotten what they are called, a hybrid between a PDA and tablet PC with touch-screen goodness :D ).
 
 
One other thing I noticed was there were a LOT of questions about VB6 to VB.NET still, as well as questions about VB6 in Vista etc.   That being said, the ask the experts night seemed relatively quiet.
 
 
I did a double double double up Cabana session (4) with Paul Stovell which went pretty well. Very relaxed small groups which allowed for lots of discussion.  I think we got across some key points about using tools for generating code, benefits of WPF binding etc.
 
My presentation with Geoff didn't go so good.  Actually we sucked :(   I'd have to disagree with Geoff on two counts. He didn't let me down, and no we were NOT prepared enough.  Let me take the last point first.  No matter how familiar we were with the content, we weren't well rehearsed.  As a team we failed, and given I was the one with more experience, it really was up to me to lead the way. So what went wrong ?  Well it was a combination of factors.   Having a head cold didn't help. I wasn't at the stage of letting the Trojan's park their horse inside, but I didn't respond as needed when things went bad.  Instead of dealing with the problems when they arose, I dismissed them, thinking we could move on.  And we probably could have if it was just once, but it wasn't, so it really ended up as egg on face kind of experience.  That kind of left me stumbling, feeling kind of naked without the keyboard, and not really in control of the situation, and loosing my reference point when things got broken.
 
I discussed the session with a few people who were there, and the general feeling was we weren't rehearsed, and I think they're generally right.   Our familiarity with the material and our knowledge of VB was our only saving points.  So how did we get to that ?  I think a lot of it was the wrong mix and match of code/slides.  A major part of the presentation was based on a previous presentation I did at Ballarat which I think went reasonably well. That was a complete code walk-through based presentation … IDE centric.  In this case we kind of went the same way, but decided to pre-prepare some of the code (yes we were over prepared in one sense yet under rehearsed in another).  Doing so made the audience feel less connected with the code I think, and so when bugs happen, it just makes the pre baked code look half baked.  The problems with the code slipped past when we prepared, mainly because my machine went a little flakey, or more to the point the project did.  As we did a final walk through a couple of hours before the presentation we found the Data Sources window failed to work for us. We ended up trying a few things, eventually splitting the solution into tiers, but in doing so we lost valuable time, and didn't re-test everything, we only tested the basics and that the Data Sources window was now stably working (FWIW: we presumed it was the inclusion of the beta LINQ bits into the solution that caused those issues).
 
Still, when things went bad, I think the big problem was I lost my keys into where we were, my synchronisation points.  As I was playing a key role as the main presenter (something we hadn't really discussed), it was up to me to orchestrate things, not stand there somewhat dumb founded.
 
Oh well, the good news is that some people did get stuff out of the presentation. I saw them jotting down notes, and they were also asking for links to the snippet editor and exception helper, as well as at least one grasped the issues around BindingSource.  I'm not quite sure how well we demonstrated the extensibility of My, or the ease of which an end to end forms over data app can be written in 2.0, but don't think we totally failed there either.
 
I do hope for Geoff the experience wasn't too bad.  The good news there is he can probably catch some training with Mitch at Readify now, knowing that he's lived through the worst  ;) 
 
Seriously though, there's very few opportunities for speakers in Australia compared to the US, and it's important, IMO, that we encourage and help foster Aussie talent there as it all adds to our resource pool.
 
Oh, and hopefully next year (if they'll still have me), when I email back saying I want to do speaker training, they'll make sure it happens not slip through the cracks ;)
 
So some lessons learnt, and hopefully we'll improve and build from it.
 
But wait, there's still more …..
 
Captain Nemo organised "The Ron Jacobs" to do an Arcast with me.  I was just one of many that Ron interviewed, and I haven't heard it yet.  The head cold was just starting to kick in ;)
I must say though Ron is a really nice guy and a GREAT interviewer.  If he was a dentist he would be the kind you'd recommend to all your friends and family as the painless doctor. Very professional, very good. 
Kind of reminds me of those business interviews you hear on United sometimes, which I always like.  But maybe that's just his SW accent <g>  
Anyway, I'm sure it will be fun to listen to one way or the other ;) 
 
Oh, and of course there's lots lots more, but hey if I told you it all, there'd be no point in you going to TechEd.  Looking forward to TE 2007 already :D
See you there (I hope)
 
 
 
 
 
 
 
with no comments
Filed under: ,
In my earlier post, I showed how Static local variables in VB are basically local variables that get promoted to class level fields.   What I didn't mention was the way initializers are handled on Static variables.  Take for example if I modified the code from the previous post, to include an initializer for the variable i
 
Class foo
 
   Public Sub bar()
      Static i As Int32 = 100
      i += 1
      Debug.Print(" i : " & i)
   End Sub
 
End Class
 
 
Module Module1
 
   Sub Main()
      Dim f As New foo
      For j As Int32 = 1 To 100
         f.bar()
      Next
   End Sub
 
End Module
 
Now the output would be 101 to 200. 
 
If However I wrote bar as :
  Public Sub bar()
      Static i As Int32
      i = 100
      i += 1
      Debug.Print(" i : " & i)
   End Sub
then the output would always be 101
 
The simplest way to understand this is to think of the Static variable getting promoted to class level field.  when this happens, the initialization line is promoted in it's entirety. 
 
So the first example really becomes:
 
Class foo
 
   Private i As Int32 = 100
 
   Public Sub bar()
      i += 1
      Debug.Print(" i : " & i)
   End Sub
 
End Class
 
although the field is not named i anymore in the real world, the above example is basically what happens. 
 
The second example becomes:
 
Class foo
 
   Private i As Int32
 
   Public Sub bar()
      i = 100
      i += 1
      Debug.Print(" i : " & i)
   End Sub
 
End Class
 
It's pretty simple once you look at it that way I think. :)
 
Oh, and try not to confuse this with the initialization rules for variables declared inside loop structures, as that's kind of the opposite. There the initialization code get's called on every loop.  Here on the other hand you can see the initialization of a Static variable is only called once, as that variable and it's initialization all gets promoted to a field. 
 
With loops, a variable declared inside the loop get's promoted to method level outside of all loop blocks (stack is allocated with the method), unless of course it's declared as Static then it gets promoted to a field.  Consider the following examples:
 
   Public Sub bar()
      For x As Int32 = 1 To 10
         Dim i As Int32 = 100
         i += 1
         Debug.Print(" i : " & i)
      Next
   End Sub
 
   Public Sub bar()
      For x As Int32 = 1 To 10
         Static i As Int32 = 100
         i += 1
         Debug.Print(" i : " & i)
      Next
   End Sub
 
If you guessed the first example prints out 101 all the time whereas the second one prints out an incrementing series from 101, e.g. {101, 102, 103, 104, 105, ……,111,112, ….}, then you guessed right :)  So just to see if I can confuse you some, can you guess what this code does :
   Public Sub bar()
      For x As Int32 = 1 To 10
         Dim i As Int32
         i += 1
         Debug.Print(" i : " & i)
      Next
   End Sub
 
If you guessed a series 1 to 10, you're doing well :)
 
And this one ?:
 
   Public Sub bar()
      For x As Int32 = 1 To 10
         Dim i As Int32 = 0
         i += 1
         Debug.Print(" i : " & i)
      Next
   End Sub
 
If you guessed it always prints out 1's, you've got this sucker nailed :)
 
That's about as complex as it gets :) 
(I threw the stuff in about loops just to make it a bit more interesting <g>)
 
with no comments
Filed under:
I was just reading Julia Lerman's blog about static variables in VB.  Sadly I think Julia has had it wrong, so let me try to explain.  First let's start with some rules:
 
  • static variables can be used only inside methods. This includes Properties, Subs and Functions.
  • the method can be instance method Or Shared
  • the method can be in a class or module
 
Okay, with the rules out of the way, we still haven't said what declaring a variable as static does.  What it does is: (my definition)
 
Declaring a static variable promotes the variable declaration to a field in the containing class or module.  This allows persistence of values across method calls, while keeping the variable appearing to be encapsulated within the method.
 
The following example highlights this behavior:
 
Class foo
 
   Public Sub bar()
      Static i As Int32
      i += 1
      Debug.Print(" i : " &  i )
   End Sub
 
End Class
 
 
Module Module1
 
   Sub Main()
      Dim f As New foo
      For j As Int32 = 1 To 100
         f.bar()
      Next
   End Sub
 
End Module
You will see the output is along something like:
 
i : 1
i : 2
i : 3
i : 4
i : 5
i : 6
i : 7
 
all the way up to 100
 
So by declaring I as a static variable we have promoted it to a field, yet maintained encapsulation as it can only be accessed inside the method bar where it was declared.
 
-UPDATE- I forgot to mention about what happen with Shared and instance methods:
 
One thing to note is the static variable when promoted to a field is declared with the same lifetime as the contianing method. that is, if the method was declared as Shared, the promoted field will have Shared lifetime, otherwise it will be an instance field.
 
 
 
with 1 comment(s)
Filed under:
 
with no comments
Filed under: , ,
Dave Lem shows his Tech Ed T-shirt flair, Geoff asks him to include reality in the sizes, but of course the big question is:  Is it all cotton or a poly blend ? Remember poly blends are an indication of something wrong in the big house ;)
 
Speaking of T's, the nice people at Racxo sent me a copy of their defrag software for free, and included this T-shirt in the box:
Pretty cool huh. Oh, and it's all cotton !!  So the company must be doing good.  I must admit I do like their PerfectDisk product :)
 
 
 
 
 
with no comments
Filed under:
A while ago, my old friend Patrick Meader (who must never read my blog) **complained** to me that I needed to fill in my About page on this blog as it is almost impossible to tell who's blog this is.  The title of the blog just says "@Head : Bill's random thoughts".   
 
Then today, I saw Frank's post about how do you find people's blogs, and I decided to type my name into google and see what it finds.
 
If I search for "Bill McCarthy", I'm the second hit.  If I search for "Bill McCarthy" +blog , I'm the first hit !!  How cool is that given that my name is never listed on my blog !!  That's some seriously cool cross referencing google is doing… it's kind of scary, almost human….  it's as if ……
with 1 comment(s)
Filed under: ,
 
In a desperate attempt to get the basic functionality working, Paul "someone please help me" Stovell has called on outside help.
(1) Philip Beadle describes how to get it working on the latest CTP, and warns people that the added entries don't display. LOL. Seems Paul is using outdated technology already, and when it come to the real thing it just doesn't work ;)
(2) Paul then gets help from Chris Burrows to get fix his export to outlook "feature". So now Paul "zoned out" Stovell's export to outlook *almost* works. This his third take at it, actually imports into Outlook 2003, but has the times completely wrong. Here's a hint: there are not sessions **listed** for 1AM :P
 
If that wasn't bad enough, he still hasn't got the hint about a session having multiple speakers !! that's what happens when you write your object model by hand instead of using tools like xsd.exe :D
 
Okay, if that wasn't laughable enough, look at this:
 
 
versus this:
 
 
Yes, two message box approaches for indicating whether or not the calendar was successfully exported.  yes the first message box example is from Paul's showcase of WPF technology !!  Modal, boring, intrusive…. so yesteryear.  The second example is from my **QUALITY** windows.forms application, showing use of gradient fills, transparency, animation, while being non intrusive, and based on modern UI models :)
 
Okay, so the human toll is just getting too high.  People forced to click on stupid "OK" buttons by Paul's axis of evil. 
 
<news flash>
An internal source has alluded that Paul's evil empire is now planning on bringing out a pay per use application that fixes the wrong calendar entries his so called "free" version strews though-out your outlook calendar.
</news flash>
 
<FUD>
And why is that Paul "spyware" Stovell's application needs to "call home" each time you run it ?  What personal details is it collecting ?  Surely there is a reason his application doesn’t allow you to work offline ???
</FUD>
 
 
This war needs to end.    In fact it must end, because as it stands, with Paul's terrible outlook code, incorrect object model, and *MODAL DIALOG BOXES", it's clear his app is no real competition.  At this rate I'll be soon facing anti-trust court cases, as there is NO real competition to my app. 
 
So will people please help Paul fix his app ???  Please !!
 
To that end, I will extend an olive branch to Paul, and help him fix his object model.  Here goes:
- Paul, try using tools to create your object model.  A session can have multiple speakers.
(geez it's not rocket surgery)
 
Oh, on a more serious note, Pual's use of WPF is worth looking at, as it shows some of the cool things that you can do easily in WPF in regard to the binding of columns and items in columns.  (just don't use it to export to outlook)
 
 
 
 
 
 
 
 
with 2 comment(s)
Filed under:
We've had below average rainfall for a few years now, and this coming year looks to be one of even more extremes.  Last weekend I had the tractor out, clearing some fire breaks, and all the gullies were dry.  In a wet year the gullies are normally water logged, with water often flowing over the surface even.  This winter the ground is firm and dry !   
On top of that, some of the plumcots (cross between plums and apricots) are starting to bloom.  It's technically the middle of winter but it feels so much like an early spring.   The temps haven't been that much warmer, but they have felt warmer, as we haven't had that wind chill that normally comes with the wet air from the southern ocean.
I can't help but think of the physics and chemistry lessons involving entropy.
Anyway, just wanted to make a note of the strange weather :)
 
Oh, and this year I've only planted a few trees so far.  Transplanted a pine tree that was growing under one of the chestnuts, and planted a handful of narrow leave peppermints (Eucalyptus radiata) I've been growing.  Will probably plant another 30 or so of the Euc.radiata this year.  Not as many as last year or the year before, but we'll see what next year brings :)  
The Euc.radiata seem to have grown on well. I propagated them from seedlings that grew in a sand pile placed under a tree :)  Seems a very effective easy way to do it, and this year I might try placing trays of sand under a few more trees to see what seeds naturally sprout.
 
 
 
with no comments
Filed under:
So Paul has thrown down the glove and declared war over the TechEd browsers ;)    I can see he has started the FUD wars even !!  For the record, my app, does have mouse over glow effects on the buttons :P  And as for the so called bug in the maps that directs you to the ladies toilets, that sir is "by design", not a bug.  We actually guestimate how drunk you are based on your mouse response times… the drunker we think you are, the most likely you are to be given the directions to the lav's . (dam forgot to patent that one)
 
Saddly we can see the war has already got nasty.  Paul has set up his app such that no-one sees my name listed for my session !!!  (wow, are the lawyers going to have a field day with that one or what ?? !!! <g>)
 
 
with no comments
Filed under:
Last month I got a call from Chuck, asking that I put together a rich client app for TechEd.  Well yesterday Chuck called me and gave it the green light to go public.  The app is written in .NET 2.0
 
Features include:
  • session calendar
  • search
  • export to Outlook
  • maps
  • blog feeds
 
The application, 290 KB zip, includes the all session data and all the maps !  It also does smart pinging for session updates based on the last IfModifiedSince property of the WebRequest.
 
 
Enjoy :)
 
 
 
 
 
source for my BindingSourcePlus class. 
 
 
Option Strict On
Option Explicit On
 
Imports System
Imports System.Windows.Forms
 
<System.ComponentModel.DesignerCategory("")> _
Public Class BindingSourcePlus
   Inherits BindingSource
 
#Region ".ctors"
 
   Public Sub New()
      '
   End Sub
 
   Public Sub New(ByVal components As System.ComponentModel.IContainer)
      MyBase.New(components)
   End Sub
 
#End Region
 
 
#Region "UI thread sensitive ListChanged invoke"
 
   Private m_Host As Control
 
   ''' <summary>
   ''' Get/Set the Host control to allow the Bindingsource to marshal LsitChanged events to the UI thread
   ''' </summary>
   ''' <value>the containing control or Form</value>
   ''' <returns></returns>
   ''' <remarks></remarks>
   Public Property Host() As Control
      Get
         Return m_Host
      End Get
      Set(ByVal value As Control)
         m_Host = value
      End Set
   End Property
 
 
   Protected Overrides Sub OnListChanged(ByVal e As System.ComponentModel.ListChangedEventArgs)
      Dim cntl As Control = Me.Host
      If cntl IsNot Nothing AndAlso cntl.InvokeRequired Then
         cntl.Invoke(New OnListChangedDelegate(AddressOf OnListChanged), e)
      Else
         MyBase.OnListChanged(e)
      End If
   End Sub
 
 
   Private Delegate Sub OnListChangedDelegate(ByVal e As System.ComponentModel.ListChangedEventArgs)
 
#End Region
 
 
#Region "cornstarch implementation see: http://msmvps.com/blogs/bill/archive/2005/10/05/69012.aspx"
 
 
   Private m_ReadValuesOnChange As Boolean
 
   Public Property ReadValuesOnChange() As Boolean
      Get
         Return m_ReadValuesOnChange
      End Get
      Set(ByVal value As Boolean)
         m_ReadValuesOnChange = value
      End Set
   End Property
 
   Protected Overrides Sub OnBindingComplete(ByVal e As System.Windows.Forms.BindingCompleteEventArgs)
      If m_ReadValuesOnChange Then
         e.Binding.ReadValue()
      End If
      MyBase.OnBindingComplete(e)
   End Sub
 
#End Region
 
 
End Class
 
 
 
with 2 comment(s)
Filed under: