Chaining Delegates with Return Values

Posted by: AspNetResources.com articles, news and updates, on 23 Jul 2005 | View original | Bookmarked: 0 time(s)

While reading Developing Application Frameworks in .NET by Xin Chen I came upon an interesting gotcha with chained delegates when each of them returns a value. Suppose we have the following delegate: public delegate int CalculationHandler (int x, int y); This delegate can handle a method which takes two numbers, performs their addition, multiplication, etc, and returns a result. Let’s define a contrived class with each method having the signature of our delegate. public class Math { public...

Advertisement
Free Agile Project Management Tool from Telerik
TeamPulse Community Edition helps your team effectively capture requirements, manage project plans, assign and track work, and most importantly, be continually connected with each other.
Category: ASP.NET | Other Posts: View all posts by this blogger | Report as irrelevant | View bloggers stats | Views: 1129 | Hits: 76

Similar Posts

  • Successive Method Calls With MoQ more
  • Integrating OpenID in an ASP.NET MVC Application using DotNetOpenAuth more
  • Custom Panels in Silverlight/WPF Part 2: ArrangeOverride more
  • A big step for Stored Procedures in EF4 more
  • Using Interceptors with Ado.Net Data Services and Telerik OpenAccess ORM more
  • Injecting Custom Logic in ADO.NET Data Services more
  • IIS 7 Error Pages taking over 500 Errors more
  • More things that I have learned with Azure more
  • Getting an ASP.NET Application Relative Path from a Logical Path more
  • Null Object design pattern instead of returning null more

News Categories

.NET | Agile | Ajax | Architecture | ASP.NET | BizTalk | C# | Certification | Data | DataGrid | DataSet | Debugger | DotNetNuke | Events | GridView | IIS | Indigo | JavaScript | Mobile | Mono | Patterns and Practices | Performance | Podcast | Refactor | Regex | Security | Sharepoint | Silverlight | Smart Client Applications | Software | SQL | VB.NET | Visual Studio | W3 | WCF | WinFx | WPF | WSE | XAML | XLinq | XML | XSD