Welcome to Windows Presentation Foundation (WPF)
Top Tasks :

WPF Community Bloggers

Wednesday, August 06, 2008 - Posts

  • Write your own NUnit constraint (in VB) - Part 2

    So in part 1 we created our own constraint and want some of that syntax sugar, the Is helper class uses static (shared) methods to create the constraints so we either hack the NUnit source or try something else. What I ended up doing may not be ideal as it really plays with the syntax but it was fun all the same :) I created a new class called This and did the following. Imports System.Collections Imports NUnit.Framework.Constraints Imports NUnit.Framework.SyntaxHelpers Public Class This Inherits SyntaxHelper Public Shared ReadOnly Property [Is]() As This Get Return New This() End Get End Property Public Function AssignableFrom(ByVal expectedType As Type) As Constraint Return New AssignableFromConstraint(expectedType) End Function Public Function AtLeast(ByVal expected As IComparable) As Constraint Return GreaterThanOrEqualTo(expected) End Function Public Function AtMost(ByVal expected As IComparable) As Constraint Return LessThanOrEqualTo(expected) End Function Public Function EqualTo(ByVal Read More...
  • [WPF] Découvrons la collection CompositeCollection

    Je dois reconnaitre que j'ai découvert très récemment cette collection mais elle semble être bien pratique. En effet, la CompositeCollection vous permet de mélanger plusieurs collections et éléments de façon à ce qu'ils soient affichés comme une seul... Read More...

Copyright © 2006 Microsoft Corporation. All Rights Reserved. | Terms of Use | Privacy Statement | Contact Us