Archives

Example for Multiple Levels of Namespace

using System; using System.Collections.Generic; using System.IO; using System.Linq; using Windows.Foundation; using Windows.Foundation.Collections; using Windows.UI.Xaml; using Windows.UI.Xaml.Controls; using Windows.UI.Xaml.Controls.Primitives; using Windows.UI.Xaml.Data; using Windows.UI.Xaml.Input; using Windows.UI.Xaml.Media; using Windows.UI.Xaml.Navigation; namespace App2 {     namespace App1     {         namespace App3         {             class A             {             }         } } }

Fully Qualified Name in NameSpace

When accessing a class in C# , you use the fully qualifies Name of the class along with the NameSpace . The Fully Qualified Name indicates the logical hierarchy of the class . Below is the sample code that demonstrates the Fully Qualified Name namespace ConsoleApplication4 {     internal class Program     {         private static void Main(string[] args)         {             System.Console.WriteLine(“This is a…

Tools for Developing Windows 8 Apps

You can develop Windows 8 Metro Apps using the Windows 8 Developer Tools/SDK . This includes the necessary tools and SDK for developing the Windows 8 Metro Apps like Visual Studio Express 2012 for Windows 8 , Microsoft Expression Blend for Visual Studio 2012 for Windows 8 . At the time of writing this article , the Release Candidate of Microsoft Visual Studio 2012 was…

Namespace in C#

A Namespace in .NET is used to organize your code . The Namespace provides a better code readability and helps you understand how the code is arranged . They help you to organize large projects very well. The Namespace is also used to distinguish classes with same same . The Namespace can be nested into another namespace and is references with the keyword “using”. using…

Main function in c# and return type

Below is a sample source code demonstrating the Main function with no return type and return type. Example for return type of void class Program     {         static void Main(string[] args)         {             Console.WriteLine(“Return type is void”);         }     } Example for return type of int static int Main(string[] args)         {             Console.WriteLine(“Return type is int”);             return 0;                    …

Display the Command line parameters of the Main Method in C#

The Main Method in C# accepts the parameters of string Array. You could easily display the list of parameters of the Main Method in C# by using a for/foreach loop and display the parameters like the example show below using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace ConsoleApplication4 {     class Program     {         static void Main(string[] args)         {             foreach (string…

Single Line and Multi Line Comment Example in C#

using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Diagnostics; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace WindowsFormsApplication1 { #region testregion public partial class Form1 : Form { // Single Line Comment Test public Form1() { InitializeComponent(); } /* This is a Multiline Comment test */ private void Form1_Load(object sender, EventArgs e) { Debug.WriteLine(“This is a test message”); } } #endregion…

List of Tags used for XML Documentation Comments in C#

Following are the list of Tags that can be used for XML Documentation of your C# Sourcecode. 1. <c> – This is used to specify the description given within the <c> tag to be marked as code . 2. <code> – Indicate multiple lines of the description to be marked as code. 3. <example>  – specifies an example for the code 4. <exception> – specifies…

Example for Documentation Tags

using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Diagnostics; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace WindowsFormsApplication1 { #region testregion /// <summary> /// This is a test Class Form1 /// </summary> public partial class Form1 : Form { /// <summary> /// Constructor for the Form1 /// </summary> public Form1() { InitializeComponent(); } /// <summary> /// Form Load Event of the…

Liked this content?. Please spread the word :)