Show Continuous Progress with .NET ProgressBar and MarqueeAnimationSpeed

No Comments »


For some operations such as logging on to a web site or downloading a web page, you may not know how long it will take the operation to finish.  So instead of showing a progress bar with a specified percent complete, you can set the .NET ProgressBar to cycle continuously.

ProgressBarMarquee

Read the rest of this entry »

Popularity: 12% [?]

C# Read Text File into String

1 Comment »

Here is the easiest way to read an entire text file into a C# string:

string s = System.IO.File.ReadAllText( path );

Popularity: 11% [?]

Disable the Ctrl+Tab Navigator Window in Visual Studio 2008

6 Comments »

One of the many changes in the upgrade to Visual Studio 2008 is how Ctrl+Tab switches between open documents in the IDE.  Ctrl+Tab used to show the previously viewed document.  But in VS 2008, the IDE Navigator window appears as shown below, and you must press Enter to show the previous document.  An additional Enter key doesn't sound like a big inconvenience, but if you do this hundreds of times each day like most developers, you will quickly find the extra step irritating.  This article describes how to disable the Ctrl+Tab navigator window in Visual Studio 2008.

IDE Navigator

Read the rest of this entry »

Popularity: 9% [?]

Do Not Return Private C# Arrays

2 Comments »

Be careful when returning C# arrays that are private members of an object, as it essentially makes the array contents public, since the client can easily change the array.

Read the rest of this entry »

Popularity: 30% [?]

C# Empty Enumerator

9 Comments »

This article provides C# code for an empty enumerator.  This generic class can be used to simulate enumeration over an empty collection of any type of objects.  Here is the code:

Read the rest of this entry »

Popularity: 47% [?]

C# Programmer Salaries

2 Comments »

Indeed Salary Search is an index of salary information extracted from over 50 million job postings from thousands of unique sources over the last 12 months.  Many job descriptions don't contain salary information, but there are enough that do to produce statistically significant median salaries.  Following are the salaries for C# developer jobs:

Read the rest of this entry »

Popularity: 31% [?]

Generic Class: Duplicate Method Overloads

No Comments »

When two overloads of a method in a generic class are the same (have identical type arguments) as a result of the generic type you specified, which method is called?

Read the rest of this entry »

Popularity: 32% [?]

Nested Generics

1 Comment »

Given two generic classes:

public class Type1<T> {}
public class Type2<T> {}

.NET allows you to specify a generic type as the type of another generic type:

Type1<Type2<int>> obj = new Type1<Type2<int>>();

Read the rest of this entry »

Popularity: 36% [?]

Multiple Generic IEnumerable<T>

4 Comments »

It's possible to provide multiple generic enumerators for a single class.  The trick is that clients must specify which enumerator to use.

Read the rest of this entry »

Popularity: 45% [?]

Parse and Sort Comma-Delimited Numbers

1 Comment »

Here is one way to parse and sort a string with comma-delimited numbers:
Read the rest of this entry »

Popularity: 47% [?]

keep looking »
  • Featured Articles

  • Recent Posts

  • Search C# 411

     
  • Categories

  • Archives

  • Tags