basics of c# by sabir
DESCRIPTION
Basics of C#TRANSCRIPT
![Page 1: Basics of c# by sabir](https://reader036.vdocuments.net/reader036/viewer/2022062303/55662752d8b42a61238b5063/html5/thumbnails/1.jpg)
Basics Of C#
Sabir Ali
![Page 2: Basics of c# by sabir](https://reader036.vdocuments.net/reader036/viewer/2022062303/55662752d8b42a61238b5063/html5/thumbnails/2.jpg)
Topics To Be Covered(L1- L5)
Introduction to C#.NET, C# Language
Introduction to .NET(. Net Framework)
CTS, CLR, Managed code ,Native code
Toolbox, Properties Window
Controls ,Forms
MDI
![Page 3: Basics of c# by sabir](https://reader036.vdocuments.net/reader036/viewer/2022062303/55662752d8b42a61238b5063/html5/thumbnails/3.jpg)
C# is a multi-paradigm programming language encompassing strong typing, imperative, declarative, functional, generic, object-oriented (class-based), and component-oriented programming disciplines.
What is C#?
![Page 4: Basics of c# by sabir](https://reader036.vdocuments.net/reader036/viewer/2022062303/55662752d8b42a61238b5063/html5/thumbnails/4.jpg)
In January 1999, Anders Hejlsberg formed a team to build a new language called Cool,"C-like Object Oriented Language"
First release in Jan,2002 with .NET Framework 1.0 and Visual Studio 2002.
Influenced by C++,Java,Delphi,Smalltalk,Eiffel
Got ISO standardization in 2003.
Major Changes in C# version 3.0
Brief History of C#
![Page 5: Basics of c# by sabir](https://reader036.vdocuments.net/reader036/viewer/2022062303/55662752d8b42a61238b5063/html5/thumbnails/5.jpg)
Simple Modern Object oriented Type safe Scalable Code Interoperability Updatable
Features of C#
![Page 6: Basics of c# by sabir](https://reader036.vdocuments.net/reader036/viewer/2022062303/55662752d8b42a61238b5063/html5/thumbnails/6.jpg)
No Pointers
No global variables or functions
Automatically garbage collection
Strict type casting
Checked exceptions are not present
LINQ and Lambda Expressions
Delegates and Events Management
Windows form
Distinguishing Features of C#
![Page 7: Basics of c# by sabir](https://reader036.vdocuments.net/reader036/viewer/2022062303/55662752d8b42a61238b5063/html5/thumbnails/7.jpg)
Software platform by Microsoft
Language neutral
It’s a complete environment that allows developer to develop, run and deploy various applications .
offers a fundamental shift in Microsoft strategy: it moves application development from client-centric to server-centric.
Introduction to .NET Framework
![Page 8: Basics of c# by sabir](https://reader036.vdocuments.net/reader036/viewer/2022062303/55662752d8b42a61238b5063/html5/thumbnails/8.jpg)
What you can build with .NET framework: Console Application Windows Form Application Web Application (ASP.NET) Web Services Windows Services Service Oriented Applications.
![Page 9: Basics of c# by sabir](https://reader036.vdocuments.net/reader036/viewer/2022062303/55662752d8b42a61238b5063/html5/thumbnails/9.jpg)
Overview of its Working
![Page 10: Basics of c# by sabir](https://reader036.vdocuments.net/reader036/viewer/2022062303/55662752d8b42a61238b5063/html5/thumbnails/10.jpg)
Main Components of .NET Framework :
![Page 11: Basics of c# by sabir](https://reader036.vdocuments.net/reader036/viewer/2022062303/55662752d8b42a61238b5063/html5/thumbnails/11.jpg)
Provides environment to make development process easier.
Its provide common runtime for all .NET code Provides services to execute process such as
- Memory Management
-Garbage Collection
- Code Access Security
- JIT compilation of code
CLR: Common Language Runtime
![Page 12: Basics of c# by sabir](https://reader036.vdocuments.net/reader036/viewer/2022062303/55662752d8b42a61238b5063/html5/thumbnails/12.jpg)
Part of CLR Contains common type for all languages. Helps in code Inter –operability. Provides a base set of data types for all languages
that id supported by .NET Framework. Like Size of integer is same in all the .NET compliant
languages .
CTS (Common Type System)
![Page 13: Basics of c# by sabir](https://reader036.vdocuments.net/reader036/viewer/2022062303/55662752d8b42a61238b5063/html5/thumbnails/13.jpg)
.NET Framework has various compiler for various languages it support.
These compiler produces intermediate code that is common for all languages .
This code is understandable only in .Net framework environment.
MSIL
![Page 14: Basics of c# by sabir](https://reader036.vdocuments.net/reader036/viewer/2022062303/55662752d8b42a61238b5063/html5/thumbnails/14.jpg)
JIT Compiler
Major element in CLR
Loads MSIL to target machine.
Translates the MSIL code to an assembly using CPU architecture.
Compiles the CIL code to Native Code in runtime whenever required in target machine.
![Page 15: Basics of c# by sabir](https://reader036.vdocuments.net/reader036/viewer/2022062303/55662752d8b42a61238b5063/html5/thumbnails/15.jpg)
Managed Code
Code that has managed execution by .NET Framework.
Every aspect are managed by CLR. Any language that are in .NET framework are
is having managed code. Runtime services like code security, type
checking, garbage collection etc.
![Page 16: Basics of c# by sabir](https://reader036.vdocuments.net/reader036/viewer/2022062303/55662752d8b42a61238b5063/html5/thumbnails/16.jpg)
UnManaged Code
Code that are not executed under controlled environment Executed under direct control of OS.
Typically VB,C++,C,COM etc are unmanaged. Get Services like memory management, code
security from Operating System.
![Page 17: Basics of c# by sabir](https://reader036.vdocuments.net/reader036/viewer/2022062303/55662752d8b42a61238b5063/html5/thumbnails/17.jpg)
Compilation In .NET Framework
(Source: http://www.xprogramming.com/xpmag/whatisxp.htm)
![Page 18: Basics of c# by sabir](https://reader036.vdocuments.net/reader036/viewer/2022062303/55662752d8b42a61238b5063/html5/thumbnails/18.jpg)
Introduction toWindowsApplication
Developer can use to quickly build the user interface (UI) for an application.
Create a user interface by dragging and dropping controls from a toolbox to your form.
Double-click the control to add handlers for the control.
![Page 19: Basics of c# by sabir](https://reader036.vdocuments.net/reader036/viewer/2022062303/55662752d8b42a61238b5063/html5/thumbnails/19.jpg)
Toolbox
The toolbox contains a selection of all the controls available .
Can be customized.
Having all the controls derived from System.Windows.Forms.Control class.
![Page 20: Basics of c# by sabir](https://reader036.vdocuments.net/reader036/viewer/2022062303/55662752d8b42a61238b5063/html5/thumbnails/20.jpg)
Commonly used controls are:
Label
TextBox
Button
CheckBox
RadioButton
Groupbox
PictureBox
![Page 21: Basics of c# by sabir](https://reader036.vdocuments.net/reader036/viewer/2022062303/55662752d8b42a61238b5063/html5/thumbnails/21.jpg)
Properties of a control (Common)
Anchor
BackColor
Enabled
Name
TabIndex
Visible
![Page 22: Basics of c# by sabir](https://reader036.vdocuments.net/reader036/viewer/2022062303/55662752d8b42a61238b5063/html5/thumbnails/22.jpg)
MDI Forms
MDI forms contains parent-child relationship. One parent form can contain many child. Parent forms are having certain form boundary Each child form is accessible within that boundary. If the parent form is closing it will destroy all the
child instances.
MDI are used when certain form works independently and handling different modules under common project.
![Page 23: Basics of c# by sabir](https://reader036.vdocuments.net/reader036/viewer/2022062303/55662752d8b42a61238b5063/html5/thumbnails/23.jpg)
Thank you !!!
Any Question??
![Page 24: Basics of c# by sabir](https://reader036.vdocuments.net/reader036/viewer/2022062303/55662752d8b42a61238b5063/html5/thumbnails/24.jpg)
Spill Over:
Lambda Expression:
Lambda expression is an inline delegate introduced with C # 3.0 language. It’s a concise way to represent an anonymous method. It provides a syntax to create and invoke functions. Although Lambda expressions are simpler to use than anonymous methods, they do slightly differ on how they are implemented. Both anonymous methods and Lambda expressions allow you define the method implementation inline, however, an anonymous method explicitly requires you to define the parameter types and the return type for a method. Lambda expression uses the type inference feature of C# 3.0 which allows the compiler to infer the type of the variable based on the context.
Language-Integrated Query (LINQ) is the name for a set of technologies based on the integration of query capabilities directly into the C# language (also in Visual Basic and potentially any other .NET language). With LINQ, a query is now a first-class language construct, just like classes, methods, events and so on.