/Home /Archive /Syndicate /About /Contact  
CSharpFeeds - All C# Feeds in One Place!





Example Code. Some time back I wrote about techniques for implementing non-deterministic finite automata (NDFAs) using some of the new features of C# 3.0. Recently I’ve had a need to revisit that work to provide a client with a means to generate a bunch of really complex state machines in a lightweight, extensible and easily understood [...]


I’m still not understanding why it won’t give me a warning when I create an internal class with a public method. Here’s an example: class MyInternalClass{    public void Test(){} //no compiler warning } Ok, at the end of the day, Test is really an “internal” method since the acessibility of a member can never be greater than the one of i ... [ read more ]


I want to start this by discussing the purpose of method type inference, and clearing up some potential misunderstandings about type inference errors. First off though, a brief note on nomenclature. Throughout this series when I say "type inference" I mean "method type inference", not any of the other forms of type inference we have in C# 3.0. (Implicitly typed locals, implicitly typed arrays ... [ read more ]


The ASP.NET MVC team developed a URL routing engine, similar to the engine in Rails, which has made it’s way into the rest of ASP.NET. ScottGu has covered it a few times in the past, and this post has some good examples of it. Here’s a quick example: routes.MapRoute("ShowProductByCategory", "Products/Show/{Category}/{id}", new { controller [...]


Snapshot enumerators are part of Bindable LINQ’s internal implementation which make editing collections while enumerating them possible. When you first started with .NET, you undoubtedly wrote code that looks like this: foreach (string item in strings) { if (item.StartsWith("H")) { strings.Remove(item); [...]


As with other LINQ operations, Bindable LINQ allows you to execute aggregates over values that can change over time. In the general sense, a Bindable LINQ aggregate is an operation that turns a series of values into a single value, and is not necessarily limited to numeric operations. Examples of such aggregates are classics such [...]


One of the upcoming additions in .NET 3.5 SP1 is a StringFormat parameter you can pass along with your bindings. Sacha Barber has an example of how to use it: <TextBlock Text="{Binding Path=AccountBalance, StringFormat='You have {0:c} in your bank account.'}" /> However, if you can’t install the service pack or you [...]


In the first and second parts of this post about building a provider model from the scratch, I talked about some main steps of the process. In the first part I talked about main classes in the provider model as well as the configuration system and in the second part I talked about the abstract part of the model. Now in the third and last part of this series I want to finish the discussion b ... [ read more ]
Well, not really... As you surely know, you cannot have mutiple inheritance in .NET. That really sucks. Yes, I agree that multiple inheritance might bring several problems but when applied correctly,  it really helps. Don't believe me? Ok, take a look at WTL . Back to .NET...Since we can't use multiple inheritance, we end up defining several interfaces and injecting classes tha ... [ read more ]


Back in November I wrote a bit about a corner case in method type inference which does not work as expected or as specified in C# 3.0. A number of people made blog comments, sent me mail, and entered "Connect" issues with additional problems and ideas for how we could improve this algorithm. (Particular thanks to nikov for his many fascinating and detailed Connect reports.) As a result, as so ... [ read more ]


I've just spent about 30 minutes checking out the recently announced Microsoft Source Analysis for C# . I definitely love the idea, but I'm not sure I'll be using it just yet. Here are some of my impressions (again, I haven't spent a lot of time on it yet)... All using directives must be placed inside of the namespace Hmm, but VS itself violates that rule on every class we create...! T ... [ read more ]



All feed content is property of original publisher. Designated trademarks and brands are the property of their respective owners.