Sunday 28 April 2013


Accessing Enum Description in C# :-

code example:-

public enum USERS
    {
        [Description("TND")]
         USER1= 1,
        [Description("TND")]
        
USER2,
        [Description("ND")]
        
USER3,
        [Description("ND")]
        
USER4,
        [Description("ND")]
        
USER5,       
        [Description("T")]
        USER6,        
    }


public string GetDescriptionFromEnumValue(Enum value)
    {
        DescriptionAttribute attribute = value.GetType()
            .GetField(value.ToString())
            .GetCustomAttributes(typeof(DescriptionAttribute), false)
            .SingleOrDefault() as DescriptionAttribute;
        return attribute == null ? value.ToString() : attribute.Description;
    }





.Net Framework

  1. The .Net framework is a revolutionary platform that helps you to write the following types of applications:
  2. Windows applications
  3. Web applications
  4. Web services

The .Net framework applications are multi-platform applications. The framework has been designed in such a way that it can be used from any of the following languages: C#, C++, Visual Basic, Jscript, COBOL etc. All these languages can access the framework as well as communicate with each other.
The .Net framework consists of an enormous library of codes used by the client languages like C#. Following are some of the components of the .Net framework:
  1. Common Language Runtime (CLR)
  2. The .Net Framework Class Library
  3. Common Language Specification
  4. Common Type System
  5. Metadata and Assemblies
  6. Windows Forms
  7. ASP.Net and ASP.Net AJAX
  8. ADO.Net
  9. Windows Workflow Foundation (WF)
  10. Windows Presentation Foundation
  11. Windows Communication Foundation (WCF)
  12. LINQ
For the jobs each of these components perform, please see ASP.Net - Introduction and for details of each component, please consult Microsoft's documentation.

(IDE) For C#

Microsoft provides the following development tools for C# programming:
  1. Visual Studio 2010 (VS)
  2. Visual C# 2010 Express (VCE)
  3. Visual Web Developer
Visual C# Express and Visual Web Developer Express edition are trimmed down versions of Visual Studio and has the same look and feel. They retain most features of Visual Studio. In this tutorial, we have used Visual C # 2010 Express.

Overview of c-sharp

OVERVIEW OF C#

C# was developed by Anders Hejlsberg and his team during the development of .Net Framework.
C# is designed for Common Language Infrastructure (CLI), which consists of the executable code and runtime environment that allows use of various high-level languages to be used on different computer platforms and architectures.
The following reasons make C# a widely used professional language:

  1. Modern, general purpose programming language
  2. Object oriented.
  3. Component oriented.
  4. Easy to learn.
  5. Structured language.
  6. It produces efficient programs.
  7. It can be compiled on a variety of computer platforms.
  8. Part of .Net Framework.    
      Features of C#
  1. Boolean Conditions
  2. Automatic Garbage Collection
  3. Standard Library
  4. Assembly Versioning
  5. Properties and Events
  6. Delegates and Events Management
  7. Easy to use Generics
  8. Indexers
  9. Conditional Compilation
  10. Simple Multithreading
  11. LINQ and Lambda Expressions
  12. Integration with Windows