just type the keyword 'while' in your visual studio.net 2005 editor, you can see this something like this:
after typing the word while press tab twice & You will find its complete syntax on your page.
This is the code that I have got in visual studio after typing the word exception and tab twice. AWESOME!! Right!
--------------------------------------------------------------------------
[global::System.Serializable]
public class MyException : Exception
{
//
// For guidelines regarding the creation of new exception types, see
// http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpgenref/html/cpconerrorraisinghandlingguidelines.asp
// and
// http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dncscol/html/csharp07192001.asp
//
public MyException() { }
public MyException(string message) : base(message) { }
public MyException(string message, Exception inner) : base(message, inner) { }
protected MyException(
System.Runtime.Serialization.SerializationInfo info,
System.Runtime.Serialization.StreamingContext context)
: base(info, context) { }
}
-------------------------------------------------------------------------
code for creating custom attributes (type in attribute and tab twice)
-------------------------------------------------------------------------
[global::System.AttributeUsage(AttributeTargets.All, Inherited = false, AllowMultiple = true)]
sealed class MyAttribute : Attribute
{
// See the attribute guidelines at
// http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpgenref/html/cpconusingattributeclasses.asp
readonly string _positionalString;
int _namedInt;
// This is a positional argument.
public MyAttribute(string positionalString)
{
this._positionalString = positionalString;
// TODO: Implement code here.
throw new Exception("The method or operation is not implemented.");
}
public string PositionalString
{
get
{
return this._positionalString;
}
}
// This is a named argument.
public int NamedInt
{
get
{
return this._namedInt;
}
set
{
this._namedInt = value;
}
}
}
--------------------------------------------------------------------------
Similarly we can explore iterators, for, while, interfaces etc...
Thank you my best friend for reminding me of this feature!
1 comment:
Keep up the good work.
Post a Comment