mo.notono.us

Tuesday, January 30, 2007

Links for 2007-01-29 [del.icio.us]


Sent using R|mail.

Labels:

Monday, January 29, 2007

Links for 2007-01-28 [del.icio.us]


Sent using R|mail.

Labels:

Sunday, January 28, 2007

Generics and XML Comments - how to

XML Comments don't like generics that much. Here's how to document a generic type - currently, at least:
XML doc comments and C#'s generic syntax don't mix. In order to help work around this, we allow you to use {}'s in place of <>'s when referring to generic types in crefs. So, imagine the following code:
/// 
/// This class implements 
/// 
class Example : IComparable
{
     // implementation of IComparable    
}
From https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=91982

Labels: ,

Links for 2007-01-27 [del.icio.us]


Sent using R|mail.

Labels:

Saturday, January 27, 2007

Links for 2007-01-26 [del.icio.us]


Sent using R|mail.

Labels:

Friday, January 26, 2007

HELLO_WORLD

I'm not too happy with the _______() method - it's a bit too obvious. Otherwise the following is a great little .net console application:
using System;
using System.Diagnostics;

namespace ___
{
 class _____
 {
  static void Main(string[] args)
  {
   _______();
  }

  static void _______()
  {
   ______(_(_(_(_(_(_(_(__()))))))));
   ______(_(_(_(_(__())))));
   ______(_(_(_(_(_(_(_(_(_(_(_(__()))))))))))));
   ______(_(_(_(_(_(_(_(_(_(_(_(__()))))))))))));
   ______(_(_(_(_(_(_(_(_(_(_(_(_(_(_(__())))))))))))))));
   ______();
   ______(_(_(_(_(_(_(_(_(_(_(_(_(_(_(_(_(_(_(_(_(_(_(__())))))))))))))))))))))));
   ______(_(_(_(_(_(_(_(_(_(_(_(_(_(_(__())))))))))))))));
   ______(_(_(_(_(_(_(_(_(_(_(_(_(_(_(_(_(_(__()))))))))))))))))));
   ______(_(_(_(_(_(_(_(_(_(_(_(__()))))))))))));
   ______(_(_(_(__()))));
  }

  static string _(string _)
  {
   return _ + __();
  }

  static string ___()
  {
   return __();
  }

  static void ______()
  {
   Console.Write(___());
  }

  static void ______(string _)
  {
   Console.Write((char)(_.Length + 58));
  }

  static string __()
  {
   return new StackTrace().GetFrame(1).GetMethod().Name;
  }
 }
}

Labels: ,

Links for 2007-01-25 [del.icio.us]


Sent using R|mail.

Labels:

Thursday, January 25, 2007

Links for 2007-01-24 [del.icio.us]


Sent using R|mail.

Labels:

Wednesday, January 24, 2007

Links for 2007-01-23 [del.icio.us]


Sent using R|mail.

Labels:

Tuesday, January 23, 2007

Links for 2007-01-22 [del.icio.us]


Sent using R|mail.

Labels:

Sunday, January 21, 2007

Links for 2007-01-20 [del.icio.us]


Sent using R|mail.

Labels:

Saturday, January 20, 2007

Links for 2007-01-19 [del.icio.us]


Sent using R|mail.

Labels: ,

Friday, January 19, 2007

Links for 2007-01-18 [del.icio.us]


Sent using R|mail.

Labels:

Thursday, January 18, 2007

Links for 2007-01-17 [del.icio.us]


Sent using R|mail.

Labels:

Wednesday, January 17, 2007

ASP.NET, C#: Simpler Trace

I found myself needing to trace some variables in my ASP.NET app, but rather than calling Page.Trace from my pages, and HttpContext.Current.Trace from my static utility methods, I decided to simplify standardize the process. The result is below; it uses the Callstack and Reflection to determine the type and name of the member that called the trace method:

/// <summary>
/// Writes a name and value to the Trace output, categorized by the type and member 
/// (property or method) from which the method was called.
/// </summary>
/// <param name="name">Name of variable to trace.</param>
/// <param name="value">Value of variable to trace.</param>
public static void WriteTrace(string name, object value)
{
  System.Reflection.MethodBase callingMethodBase = new 
    System.Diagnostics.StackTrace().GetFrame(1).GetMethod();
  string callingMethod = string.Format("{0}.{1}", 
    callingMethodBase.DeclaringType.Name, 
    callingMethodBase.Name);
  string message = string.Format("{0}: {1}", name, value);

  HttpContext.Current.Trace.Write(callingMethod , message);
}

Labels: ,

Links for 2007-01-16 [del.icio.us]


Sent using R|mail.

Labels:

Monday, January 15, 2007

Links for 2007-01-14 [del.icio.us]


Sent using R|mail.

Labels:

Saturday, January 13, 2007

Links for 2007-01-12 [del.icio.us]


Sent using R|mail.

Labels:

Thursday, January 11, 2007

Links for 2007-01-10 [del.icio.us]


Sent using R|mail.

Labels:

Wednesday, January 10, 2007

Links for 2007-01-09 [del.icio.us]


Sent using R|mail.

Labels:

Tuesday, January 09, 2007

Links for 2007-01-08 [del.icio.us]


Sent using R|mail.

Labels:

Saturday, January 06, 2007

Links for 2007-01-05 [del.icio.us]


Sent using R|mail.

Labels:

Friday, January 05, 2007

Links for 2007-01-04 [del.icio.us]


Sent using R|mail.

Labels:

Wednesday, January 03, 2007

Links for 2007-01-02 [del.icio.us]


Sent using R|mail.

Labels: