October 2005 - Posts

Lisa's on channel 9 with a video explaining snippets.  Some good parts to watch are:

  • 9:50 in or so, Lisa shows how to use the shortcut menu for snippets.  This is MUST know TV if you don't already know this.
  • 17:40 drag and dropping snippets into the IDE
  • 33:00 the VB Snippet Editor !!  (and mentions me smile )

I would like to point out to folks though the Snippet Editor Lisa demo'd is the old version.  The new one is still a source code only at gotdotnet.  it's in feature lock down at present, as we are about to release a RTM version.  The source code is built with a RTM build, so won't work with Beta 2 or earlier.  Some new features in the the up coming release of the Snippet Editor are:

  • integrated file management.  The snippet editor has a treeview that shows all installed collections and allows you to add new paths, add new snippets, delete snippets, remove paths, and use drag and drop to organise snippets .
  • Search facility !!   You can search for a keyword or phrase in snippets. The Snippet Editor searches the title, description, keywords and code for matches and filters the treeview to show only the matches.  you can then enter in another search term and filter the treeview further.
  • Export to .vsi.  You can export a snippet to a .VSI . This make it easy to share oyur snippets with friends.

More on that Snippet Editor in up coming weeks smile

Oh, and to the guys who posted on Channel 9 sayign how Lisa is very pretty... well I'm not sure how appropiate that is, but let me tell ya she's even way more charming in person.

 

with 1 comment(s)
Filed under:

The Australian Customs launched a new processing system this week.  The software originally was budgeted at $33 million dollars, blew-out to $250 Milliona dollars.  The system itself seems to be causing huge headaches and major delays.   it's also had major security issues such as displaying user information including pricing information to other users.  The system was designed to be scalable and secure - yeh right  

So what platform was used  ? A: IBM mainframe , DB2, and  websphere java.  Brief specs can be found here.

 

 

with 1 comment(s)
Filed under:

The new DataSource window in VS.NET 2005 truely rocks !  I love how you can have all different kinds of data sources in there, be it your web services, data from your database or *ANY* type in your project including, of course, your business objects. 

So when you do add business objects to the DataSource window, you may find it shows properties you don't want people to bind to, yet you still want them to be able to access those peoperties in code.  The solution is very simple. Simply mark the properties with the:

<System.ComponentModel.Browsable(False)> _

attribute, and they won't show up in the Datasource window and the binding source will throw an error if they are attempted to be bound against. 

What I found really nice was I had an abstract base class (MustInhertit) with some abstract properties defined in it (MustOverride) and applying the attribute there in the base class cascaded through nicely to all derived classes.  Of course the derived classes with their Overrides in them could re-appy the attribute setting it to either True or False, to show or hide the property respectively .  sweet smile

with 2 comment(s)
Filed under: ,

When working with a Windows.Forms application in Visual Studio 2005 (Whidbey), you may encounter a strange error when you try to open a form or control that has data binding using the new Bindingsource components.  The error usually reads like :

One or more errors encountered while loading the designer. The errors are listed below. Some errors can be fixed by rebuilding your project, while others may require code changes.

Type must be a type provided by the runtime. Parameter name: type 

at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
at System.Activator.CreateInstance(Type type, Object[] args)
at System.Windows.Forms.SecurityUtils.SecureCreateInstance(Type type, Object[] args)
at System.Windows.Forms.BindingSource.CreateBindingList(Type type)
at System.Windows.Forms.BindingSource.GetListFromType(Type type)
at System.Windows.Forms.BindingSource.ResetList()
at System.Windows.Forms.BindingSource.EnsureInnerList()
at System.Windows.Forms.BindingSource.System.ComponentModel.ISupportInitialize.EndInit()


An easy way to work around this problem is to close the form or control designer, open the data sources window, then open the form or control designer again.  The problem only occurs when you try to open a form or control designer and you haven't had the Data Sources window open in that project since you last opened it.

So the solution is simple, just open the data sources window if you come across this error.

with 1 comment(s)
Filed under: ,

A really cool side effect of what is planned for VB9, is you will never have to code in XSLT ever again !

VB9 has full support for XML literals, querying and manipulating XML with LINQ and specifically XLINQ, and it also has the dynamic features such as late binding and dynamic interfaces.  Put it all together and there is absolutely no reason you would ever need to use XSLT ever again.

Of course, some of you might want to code in XSLT, either because you're into pain or your name is Don Box, but for the rest of the world, working with XML just got a lot more friendly and less painful

with no comments
Filed under: , ,

I was reading Rocky's post about a work around for a binding issue in VS 2005.  The problem is the field being changed doesn't get updated in the display.    The work around is good, but seems like too much work, so I wrote a component that extends the BindingSource components --> CornStarch  .  As the name implies it helps the binding glue

Usage:  build this component//add it to your project then drag and drop it onto the form in question.  Next select each BindingSource component and set the ReadValuesOnchange extension property to True to apply the fix, or False if you don't want the fix.

Option Strict On

Imports System
Imports System.ComponentModel
Imports System.Collections.Generic
Imports System.Windows.Forms

<DesignerCategory("")> _
<ProvideProperty("ReadValuesOnChange", GetType(BindingSource))> _
Public Class CornStarch
    Inherits System.ComponentModel.Component
    Implements IExtenderProvider

    Public Sub New(ByVal Container As System.ComponentModel.IContainer)
        Container.Add(Me)
    End Sub

    Public Function CanExtend(ByVal extendee As Object) As Boolean Implements IExtenderProvider.CanExtend
        If TypeOf extendee Is BindingSource Then Return True
    End Function

    Public Function GetReadValuesOnChange(ByVal source As BindingSource) As Boolean
        If m_Sources.ContainsKey(source) Then
            Return m_Sources.Item(source)
        Else
            Return False
        End If
    End Function

    Public Sub SetReadValuesOnChange(ByVal source As BindingSource, ByVal value As Boolean)
        If m_Sources.ContainsKey(source) Then
            m_Sources.Item(source) = value
        Else
            m_Sources.Add(source, value)
        End If
        If value Then
            'hook
            AddHandler source.BindingComplete, AddressOf Source_BindingComplete
        Else
            'unhook
            RemoveHandler source.BindingComplete, AddressOf Source_BindingComplete
        End If
    End Sub

    Private Sub Source_BindingComplete(ByVal sender As Object, ByVal e As BindingCompleteEventArgs)
        e.Binding.ReadValue()
    End Sub

    Private m_Sources As New Dictionary(Of BindingSource, Boolean)

End Class

 

with 2 comment(s)
Filed under: ,