Browse by Tags

All Tags » Software Development » .NET Development » C# (RSS)

Pass-through Constructors

Pass-through constructors is a term I use to describe parameterized constructors that have none of their own logic and simply pass parameters to the base class. For example: public class BaseClass { private String text; public BaseClass( String text)...

Becoming a Visual Studio Jedi Part 1

Becoming a Visual Studio 2008 (and often Visual Studio 2005) Jedi In much the same grain as James' Resharper Jedi posts, I'm beginning a series of posts on becoming a Visual Studio Jedi. It involves getting the most out of Visual Studio off-the...

Trials and Tribulations of DataGridView, Column Selections, and Sorting

I had to implement some custom sorting in a DataGridView recently. Essentially, the stakeholders wanted full column selection (like Excel) while still having the ability to sort the data based on a particular column. This particular DataGridView is data...

DataGridViewColumn.Frozen

DataGridViewColumn.Frozen is documented as "When a column is frozen, all the columns to its left (or to its right in right-to-left languages) are frozen as well." Which is nice until you think of the consequences. The consequences being that...

ITSWITCH #1: Answer

Last post I detailed some code that may or may not have something wrong in it.  If you thought InitializeOne and IntializeTwo are semantically identical (e.g. they differ only by performance), you'd be wrong. If you simply ran the code, you'd...

ITSWITCH: #1

A short pop quiz on design/coding in C#...

Nested Types

Recently Michael Features blogged about nested types . The title was almost "nested types considered harmful". I don't agree. I don't agree that they're any more harmful than any other C# construct (except goto...). Nested types...

Comparing CodeRush Refactor! Pro and Resharper 4, part 1 or N -- first glance.

Metadata view of code in referenced assemblies This is a big one for me. For whatever reason, Refactor 4 (and prior) completely disables this and sends you to the Object Browser instead. You get metadata view with CodeRush Refactor! Pro. Keyboard layout...

Entity Framework Petition of Vote of Non Confidence

I had intended to be happy simply being a signatory of ADO .NET Entity Framework Vote of No Confidence. But, there's people suggesting signatories of this petition are wackos or on the fringe. Do yourself a favour and read the petition . Read what...

Overcoming problems with MethodInfo.Invoke of methods with by-reference value type arguments

I ran into an interesting problem on the Forums recently. Basically, when you use MethodInfo.Invoke to invoke a method with by-reference value type arguments you can't have the invoked method update a variable/argument. The problem is, when you invoke...

Single-Entry, Single-Exit, Should It Still Be Applicable In Object-oriented Languages?

Before the modern high-level languages Edsger Dijkstra came up with "Structured Programming". This programming methodology relied on the programmer to form and enforce most of the structure of the program--manually keeping sub-structures and...

Dependency Injection

Dependency injection (DI) is a form of inversion of control. There seems to be a tendency in some circles to refer to dependency injection as inversion of control (IoC). Dependency injection is a form of abstraction by removing physical dependencies between...

Accumulative Construction

A while back someone asked for guidance on what order should polymorphic construction occur in C# classes. I guess I had never really put much thought into it before and have never seen other guidance on the topic; but, I can see where this can become...

Changing TextBox Text as an Undo-able Action

The TextBox class supports undoing the last action--inherited from TextBoxBase . Normally the user does this by pressing the undo key (Ctrl-Z if your keyboard doesn't have a specific Undo key) or by selecting "Undo" from the context menu. The last action...

Docking With Run-Time-Created Controls

How to Dock Fill a control created at run-time....

Sortable Value Type Code Snippet

A Visual Studio 2005 code snippet that implements a skeleton value type adhering the Framework Design Guidelines....