public void BindTo( Type objectType, PropertyAccess desiredAccess )
{
if ( IsBound )
throw new AlreadyBoundException( this );
string[] split = m_Binding.Split( '.' );
PropertyInfo[] chain = new PropertyInfo[split.Length];
for ( int i = 0; i < split.Length; ++i )
{
bool isFinal = ( i == ( chain.Length - 1 ) );
chain[i] = objectType.GetProperty( split[i], BindingFlags.Instance | BindingFlags.Public | BindingFlags.IgnoreCase );
if ( chain[i] == null )
throw new UnknownPropertyException( this, split[i] );
objectType = chain[i].PropertyType;
PropertyAccess access = desiredAccess;
if ( !isFinal )
access |= PropertyAccess.Read;
if ( ( access & PropertyAccess.Read ) != 0 && !chain[i].CanRead )
throw new WriteOnlyException( this );
if ( ( access & PropertyAccess.Write ) != 0 && !chain[i].CanWrite )
throw new ReadOnlyException( this );
}
m_Access = desiredAccess;
m_Chain = chain;
}