Archive for April 2005

 
 

Detecting Design-time in C#( Native DesignMode property not telling the full truth )

The DesignMode property for a UserControl object will show that it is in DesignMode only if the immediate parent is viewed in the IDE; if it is a grand child of the object that is being viewed in the IDE, then the DesignMode property will not be true.

The workaround:

///
/// Indicates if the current view is being utilized in the VS.NET IDE or not.
///
public new bool DesignMode
{
   get
      {
         return (System.Diagnostics.Process.GetCurrentProcess().ProcessName == "devenv");
      }
}

 

[ Via Mark Jordan's blog ]

End to End Enterprise Library Demonstration (Source and Powerpoint presentation)

You can Download the source and presentation and follow the readme.txt to get set up.  The source has examples of consuming all of the application blocks.  It also includes an example of how to integrate ASP.NET’s Forms Authentication and Enterprise Library  Authentication/Authorization block.

[ Via Doug Rohrer's Blog ]

N-Tier Application Development with .NET

A few articles on n-teir architecture in .Net

Part 1:What is N-Tier Architecture?
Part 2:How to implement the Business Layer
Part 3:How to implement the Data Layer

LLBLGen::About n-tier development
N-Tier Applications and .NET

Part 1:Architecture prototype revised and tested - level 400
Part 2:Architecture prototype revised and tested - level 400

How to programmatically scroll a DataGrid to a given row?

using System.Windows.Forms;
 
namespace Devintelligence
{
  /// <summary>
  /// ScrolledDataGrid.
  /// </summary>
  public class ScrolledDataGrid : DataGrid
  {
    public ScrolledDataGrid()
    {
    }
 
 
    /// <summary>
    /// scroll the grid to a particular row
    /// </summary>
    /// <param name="rowNumber"></param>
    public void ScrollTo(int rowNumber)
    {
      if (this.DataSource != null)
      {
        GridVScrolled(this, new ScrollEventArgs(ScrollEventType.LargeIncrement, rowNumber));
      }
    }
  }
}

Why the extension for ASP.NET is .aspx

Many of us wonder why the extension for ASP.NET is .aspx. Well, long time ago, when ASP.NET was being developed at Microsoft it was referred to as ASP+ (ASP Plus). You can’t use a "+" symbol in a filename but if you turn the + symbol about 45 degrees, it looks like a x. Microsoft chose .aspx as the extension of ASP+. After the name was changed to ASP.NET, Microsoft didn’t change the extension and left it as aspx.


Page 1 of 41234