SlideShare une entreprise Scribd logo
1  sur  41
Tech Talk – C# und das Microsoft .NET Framework Heinrich Wendel, DLR Simulations- und Softwaretechnik 30. Juli 2008
Entstehungsgeschichte ,[object Object],[object Object],[object Object]
History ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Architektur
Common Language Infrastructure ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Interoperabilität
Assemblies ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Dynamic Assembly loading ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
C# - Namespaces // Defining namespaces namespace  Dlr.Sistec { class Test { … } } // Nested namespaces namespace  Dlr { namespace  Sistec { class Test {…} } } // Using namespaces Dlr.Sistec.Test  = new Dlr.Sistec.Test(); // Short form Using Dlr.Sistec; Test = new  Test(); // Aliases Using ns = Dlr.Sistec; ns.Test = new  ns.Test();
C# - Control Flow ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
C# - Iterators Months months = new Months();  foreach (string temp in months)    Console.WriteLine(temp);  public class Months :  IEnumerable  {     string[] month = { &quot;Januar&quot;, &quot;Februar&quot;, &quot;März&quot;, &quot;April&quot;, &quot;Mai&quot;, &quot;Juni&quot;, &quot;Juli&quot;, &quot;August&quot;, &quot;September&quot;, &quot;Oktober&quot;, &quot;November&quot;, &quot;Dezember&quot;};   public IEnumerator GetEnumerator() {      for (int i = 0; i < month.Length; i++)         yield  return month[i];    }  }
C# - Switch / Enums string s = Console.ReadLine();; switch(s) { case „ January “:  … break; case „ Februar “:  … break; case „ March “:  … break; … }
C# - Switch / Enums ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Month m = …; switch (m) { case  Month.January :  break; case  Month.February :  break; case  3 :  break; … }
C# - Switch / Enums [Flags]  public enum Keys {  Shift = 1,  Ctrl = 2,  Alt = 4  } Keys k = Keys.Shift | Keys.Ctrl if ((k & Keys.Shift) == Keys.Shift) {…}
C# - Indexer String[] People = { „Schreiber, „Legenhausen“, „Wendel“}; Console.Write( People[0] ) People[1]  = Console.ReadLine() ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
C# - Properties public class Person { private string  firstName ; private string  lastName ; public void  setFirstName (string name) this.firstName = name; }  public string  getLastName () return this.lastName; } public void  setLastName (string name) this.lastName = name }  public string  getFirstName () return this.firstName; } }   public class Person {    public string  FirstName  { get  { return firstName; } set  { firstName =  value ; } } private string  firstName ;   public string  LastName  { get  { return lastName; } set  { lastName =  value ; } } private string  lastName ; }   Public class Person {    public string  FirstName  {  get; set ; } public string  LastName  {  get; set ; } }
C# - Attributes ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
C# - Attributes [AttributeUsage(AttributeTargets.All)]  public class DeveloperAttribute :  Attribute  {  public string Zuname;  public int PersID; public DeveloperAttribute(string name) {  Zuname = name;  }  } [DeveloperAttribute(&quot;Meier&quot;, PersID = 8815)]  class Program {  static void Main(string[] args) {  DeveloperAttribute  attr  =  (DeveloperAttribute)Attribute.  GetCustomAttribute(typeof(Program),  typeof(DeveloperAttribute));  Console.WriteLine(&quot;Name: {0}&quot;,  attr.Zuname );  Console.WriteLine(&quot;PersID: {0}&quot;,  attr.PersID );  }
C# - Delegates / Events public class Logger { public  delegate  void Log(string message); private  static  Log  log ger ; public  static void Main(string[] args) { log ger  = new Log(PrintToConsole); log ger.Invoke (&quot;message&quot;); } public static void  PrintToConsole(string  message) { Console.WriteLine(message); } } public class Logger { public  delegate  void Log(string message); private  static  Log  logList; public  static void Main(string[] args) { logList  +=  new Log(PrintToConsole); logList  +=  new Log(PrintTo File ); logList (&quot;message&quot;); } public static void  PrintToConsole (string message) {  … }  public static void  PrintTo File (string message) {  … } } public class Logger { public  delegate  void Log(string message); public  static  event   Log  logList ; public  static void Main(string[] args) { logList  +=  PrintToConsole; logList  +=  PrintTo File ; logList (&quot;message&quot;); } public static void  PrintToConsole (string message) {  … }  public static void  PrintTo File (string message) {  … } }
C# - Lambda Funktionen public class Logger {  public delegate void Log(string message); private static Log logList; public  static void Main(string[] args) { logList =  delegate(string message)  { Console.WriteLine(message); }; logList(&quot;message&quot;); } } public class Logger {  public delegate void Log(string message); private static Log logList; public  static void Main(string[] args) { logList =  message  =>  { Console.WriteLine(message); }; logList(&quot;message&quot;); } } List <int> evenNumbers = list.FindAll(  i => (i%2) == 0  );
[object Object],[object Object],C# - LINQ int[] numbers = { 10, 20, 30, 40, 1, 2, 3, 8 }; var  subset =  from i in numbers where i < 10 select i ; foreach (int i in subset) Console.WriteLine(i);
C# - Structs ,[object Object],[object Object],[object Object],public  struct  Point {    int x {get; set} int y {get; set} public Point(int x, int y) { … } public int getDistance(int x, int y) { … } public static Point operator +(Point p) {…} }
C# - Constructors public class Point { public Point(int x, int y) { X = x; Y = y; } public Point() { } public int X { get; set; } public int Y { get; set; } } Point p = new Point(1, 2) Point p = new Point() P.X = 1; p.Y = 2; Point p = new Point { X = 1, Y = 2 }
C# - Constructors public class Point { public int X { get; set; } public int Y { get; set; } } public class Rectangle { public Point topLeft { get; set; } public Point bottomRight { get; set; } } Rectangle r = new Rectangle {  topLeft = new Point{ X = 0, Y = 0 }, bottomRight = new Point { X = 2, Y = 2 }  } Rectangle r = new Rectangle(); Point p1 = new Point(); p1.X = 0; p1.Y = 0; Point p2 = new Point(); p2.X = 2; p2.Y = 2; r.topLeft = p1; r.bottomRight = p2;
C# - Unsafe Code ,[object Object],[object Object],[object Object],[object Object],int var1 = 5;  unsafe   {  int  *  ptr1, ptr2;  ptr1 =  & var1;  ptr2 = ptr1;  *ptr2 = 20;  }  Console.WriteLine(var1);
C# - Preprocessor ,[object Object],[object Object],[object Object]
C# - Exception Handling ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
C# - Method Calls void FunctionA( ref  int Val) { int x= Val;  Val = x* 4;  } int a= 5; FunctionA( ref  a); Console.WriteLine(a);  bool GetNodeValue( out  int Val)  { Val = 1; return true;  }  int Val; GetNodeValue(Val); Console.WriteLine(a);  void Func(params  int[]  array) { Console.WriteLine(array.Length); } Func(1); Func(7,9); Func(new int[] {3,8,10});
C# - Extension Methods public  static  class  ExtensionClass  { public  static  int MultiplyByTwo( this int number) { return number * 2; } } public class Class1 { public static void Main(string[] args) { int number = 2; Console.WriteLine( number.MultiplyByTwo() ); } }
C# - Casting object [] myObjects = new object[1] myObjects[0] = new MyClass1(); string s; // Exception s = (string) myObjects[0] public static explicit operator String(MyClass1) { return “SomeString”; } If (myObjects[0]  is  string) { s = (string) myObjects[1] } s = myObjects[0] as string
C# - Keywordmania ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
C# - Was sonst noch geht … ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Library ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Parallel Programming ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Entwicklungsumgebungen ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Tools ,[object Object],[object Object],[object Object],[object Object],[object Object]
Lizenzen ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Alternative .NET Implementierungen ,[object Object],[object Object],[object Object],[object Object],[object Object]
IKVM.NET ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
IronPython ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
 

Contenu connexe

Tendances

OOP and FP - Become a Better Programmer
OOP and FP - Become a Better ProgrammerOOP and FP - Become a Better Programmer
OOP and FP - Become a Better ProgrammerMario Fusco
 
From object oriented to functional domain modeling
From object oriented to functional domain modelingFrom object oriented to functional domain modeling
From object oriented to functional domain modelingMario Fusco
 
Design Patterns - Compiler Case Study - Hands-on Examples
Design Patterns - Compiler Case Study - Hands-on ExamplesDesign Patterns - Compiler Case Study - Hands-on Examples
Design Patterns - Compiler Case Study - Hands-on ExamplesGanesh Samarthyam
 
If You Think You Can Stay Away from Functional Programming, You Are Wrong
If You Think You Can Stay Away from Functional Programming, You Are WrongIf You Think You Can Stay Away from Functional Programming, You Are Wrong
If You Think You Can Stay Away from Functional Programming, You Are WrongMario Fusco
 
Fun with Lambdas: C++14 Style (part 1)
Fun with Lambdas: C++14 Style (part 1)Fun with Lambdas: C++14 Style (part 1)
Fun with Lambdas: C++14 Style (part 1)Sumant Tambe
 
C++11 concurrency
C++11 concurrencyC++11 concurrency
C++11 concurrencyxu liwei
 
Scala - where objects and functions meet
Scala - where objects and functions meetScala - where objects and functions meet
Scala - where objects and functions meetMario Fusco
 
Java programming lab_manual_by_rohit_jaiswar
Java programming lab_manual_by_rohit_jaiswarJava programming lab_manual_by_rohit_jaiswar
Java programming lab_manual_by_rohit_jaiswarROHIT JAISWAR
 
Java Keeps Throttling Up!
Java Keeps Throttling Up!Java Keeps Throttling Up!
Java Keeps Throttling Up!José Paumard
 
Kotlin Bytecode Generation and Runtime Performance
Kotlin Bytecode Generation and Runtime PerformanceKotlin Bytecode Generation and Runtime Performance
Kotlin Bytecode Generation and Runtime Performanceintelliyole
 
Map(), flatmap() and reduce() are your new best friends: simpler collections,...
Map(), flatmap() and reduce() are your new best friends: simpler collections,...Map(), flatmap() and reduce() are your new best friends: simpler collections,...
Map(), flatmap() and reduce() are your new best friends: simpler collections,...Chris Richardson
 
Modern c++ (C++ 11/14)
Modern c++ (C++ 11/14)Modern c++ (C++ 11/14)
Modern c++ (C++ 11/14)Geeks Anonymes
 
Qt Memory Management & Signal and Slots
Qt Memory Management & Signal and SlotsQt Memory Management & Signal and Slots
Qt Memory Management & Signal and SlotsJussi Pohjolainen
 

Tendances (20)

OOP and FP - Become a Better Programmer
OOP and FP - Become a Better ProgrammerOOP and FP - Become a Better Programmer
OOP and FP - Become a Better Programmer
 
C++11
C++11C++11
C++11
 
From object oriented to functional domain modeling
From object oriented to functional domain modelingFrom object oriented to functional domain modeling
From object oriented to functional domain modeling
 
Design Patterns - Compiler Case Study - Hands-on Examples
Design Patterns - Compiler Case Study - Hands-on ExamplesDesign Patterns - Compiler Case Study - Hands-on Examples
Design Patterns - Compiler Case Study - Hands-on Examples
 
Java 8 Workshop
Java 8 WorkshopJava 8 Workshop
Java 8 Workshop
 
If You Think You Can Stay Away from Functional Programming, You Are Wrong
If You Think You Can Stay Away from Functional Programming, You Are WrongIf You Think You Can Stay Away from Functional Programming, You Are Wrong
If You Think You Can Stay Away from Functional Programming, You Are Wrong
 
C++11 & C++14
C++11 & C++14C++11 & C++14
C++11 & C++14
 
C# 7
C# 7C# 7
C# 7
 
Fun with Lambdas: C++14 Style (part 1)
Fun with Lambdas: C++14 Style (part 1)Fun with Lambdas: C++14 Style (part 1)
Fun with Lambdas: C++14 Style (part 1)
 
C++11 concurrency
C++11 concurrencyC++11 concurrency
C++11 concurrency
 
Scala - where objects and functions meet
Scala - where objects and functions meetScala - where objects and functions meet
Scala - where objects and functions meet
 
Java programming lab_manual_by_rohit_jaiswar
Java programming lab_manual_by_rohit_jaiswarJava programming lab_manual_by_rohit_jaiswar
Java programming lab_manual_by_rohit_jaiswar
 
Generics
GenericsGenerics
Generics
 
What's New In C# 7
What's New In C# 7What's New In C# 7
What's New In C# 7
 
Java Keeps Throttling Up!
Java Keeps Throttling Up!Java Keeps Throttling Up!
Java Keeps Throttling Up!
 
Kotlin Bytecode Generation and Runtime Performance
Kotlin Bytecode Generation and Runtime PerformanceKotlin Bytecode Generation and Runtime Performance
Kotlin Bytecode Generation and Runtime Performance
 
What's New in C++ 11?
What's New in C++ 11?What's New in C++ 11?
What's New in C++ 11?
 
Map(), flatmap() and reduce() are your new best friends: simpler collections,...
Map(), flatmap() and reduce() are your new best friends: simpler collections,...Map(), flatmap() and reduce() are your new best friends: simpler collections,...
Map(), flatmap() and reduce() are your new best friends: simpler collections,...
 
Modern c++ (C++ 11/14)
Modern c++ (C++ 11/14)Modern c++ (C++ 11/14)
Modern c++ (C++ 11/14)
 
Qt Memory Management & Signal and Slots
Qt Memory Management & Signal and SlotsQt Memory Management & Signal and Slots
Qt Memory Management & Signal and Slots
 

Similaire à TechTalk - Dotnet

Attributes & .NET components
Attributes & .NET componentsAttributes & .NET components
Attributes & .NET componentsBình Trọng Án
 
Clean code _v2003
 Clean code _v2003 Clean code _v2003
Clean code _v2003R696
 
Whats new in_csharp4
Whats new in_csharp4Whats new in_csharp4
Whats new in_csharp4Abed Bukhari
 
Applying Compiler Techniques to Iterate At Blazing Speed
Applying Compiler Techniques to Iterate At Blazing SpeedApplying Compiler Techniques to Iterate At Blazing Speed
Applying Compiler Techniques to Iterate At Blazing SpeedPascal-Louis Perez
 
Lo Mejor Del Pdc2008 El Futrode C#
Lo Mejor Del Pdc2008 El Futrode C#Lo Mejor Del Pdc2008 El Futrode C#
Lo Mejor Del Pdc2008 El Futrode C#Juan Pablo
 
Chapter i(introduction to java)
Chapter i(introduction to java)Chapter i(introduction to java)
Chapter i(introduction to java)Chhom Karath
 
Embedded Typesafe Domain Specific Languages for Java
Embedded Typesafe Domain Specific Languages for JavaEmbedded Typesafe Domain Specific Languages for Java
Embedded Typesafe Domain Specific Languages for JavaJevgeni Kabanov
 
Kotlin Developer Starter in Android projects
Kotlin Developer Starter in Android projectsKotlin Developer Starter in Android projects
Kotlin Developer Starter in Android projectsBartosz Kosarzycki
 
Kotlin Developer Starter in Android - STX Next Lightning Talks - Feb 12, 2016
Kotlin Developer Starter in Android - STX Next Lightning Talks - Feb 12, 2016Kotlin Developer Starter in Android - STX Next Lightning Talks - Feb 12, 2016
Kotlin Developer Starter in Android - STX Next Lightning Talks - Feb 12, 2016STX Next
 
20.1 Java working with abstraction
20.1 Java working with abstraction20.1 Java working with abstraction
20.1 Java working with abstractionIntro C# Book
 
C# 7.x What's new and what's coming with C# 8
C# 7.x What's new and what's coming with C# 8C# 7.x What's new and what's coming with C# 8
C# 7.x What's new and what's coming with C# 8Christian Nagel
 
Functional Programming You Already Know
Functional Programming You Already KnowFunctional Programming You Already Know
Functional Programming You Already KnowKevlin Henney
 

Similaire à TechTalk - Dotnet (20)

Attributes & .NET components
Attributes & .NET componentsAttributes & .NET components
Attributes & .NET components
 
Linq intro
Linq introLinq intro
Linq intro
 
Clean code _v2003
 Clean code _v2003 Clean code _v2003
Clean code _v2003
 
Whats new in_csharp4
Whats new in_csharp4Whats new in_csharp4
Whats new in_csharp4
 
ASP.NET
ASP.NETASP.NET
ASP.NET
 
Applying Compiler Techniques to Iterate At Blazing Speed
Applying Compiler Techniques to Iterate At Blazing SpeedApplying Compiler Techniques to Iterate At Blazing Speed
Applying Compiler Techniques to Iterate At Blazing Speed
 
Lo Mejor Del Pdc2008 El Futrode C#
Lo Mejor Del Pdc2008 El Futrode C#Lo Mejor Del Pdc2008 El Futrode C#
Lo Mejor Del Pdc2008 El Futrode C#
 
Chapter i(introduction to java)
Chapter i(introduction to java)Chapter i(introduction to java)
Chapter i(introduction to java)
 
Embedded Typesafe Domain Specific Languages for Java
Embedded Typesafe Domain Specific Languages for JavaEmbedded Typesafe Domain Specific Languages for Java
Embedded Typesafe Domain Specific Languages for Java
 
PostThis
PostThisPostThis
PostThis
 
Kotlin Developer Starter in Android projects
Kotlin Developer Starter in Android projectsKotlin Developer Starter in Android projects
Kotlin Developer Starter in Android projects
 
Kotlin Developer Starter in Android - STX Next Lightning Talks - Feb 12, 2016
Kotlin Developer Starter in Android - STX Next Lightning Talks - Feb 12, 2016Kotlin Developer Starter in Android - STX Next Lightning Talks - Feb 12, 2016
Kotlin Developer Starter in Android - STX Next Lightning Talks - Feb 12, 2016
 
20.1 Java working with abstraction
20.1 Java working with abstraction20.1 Java working with abstraction
20.1 Java working with abstraction
 
C# 7.0, 7.1, 7.2
C# 7.0, 7.1, 7.2C# 7.0, 7.1, 7.2
C# 7.0, 7.1, 7.2
 
C# 7.x What's new and what's coming with C# 8
C# 7.x What's new and what's coming with C# 8C# 7.x What's new and what's coming with C# 8
C# 7.x What's new and what's coming with C# 8
 
Functional Programming
Functional ProgrammingFunctional Programming
Functional Programming
 
Anti patterns
Anti patternsAnti patterns
Anti patterns
 
Ppt of c vs c#
Ppt of c vs c#Ppt of c vs c#
Ppt of c vs c#
 
Functional Programming You Already Know
Functional Programming You Already KnowFunctional Programming You Already Know
Functional Programming You Already Know
 
srgoc
srgocsrgoc
srgoc
 

Dernier

Chapter 9 PPT 4th edition.pdf internal audit
Chapter 9 PPT 4th edition.pdf internal auditChapter 9 PPT 4th edition.pdf internal audit
Chapter 9 PPT 4th edition.pdf internal auditNhtLNguyn9
 
Memorándum de Entendimiento (MoU) entre Codelco y SQM
Memorándum de Entendimiento (MoU) entre Codelco y SQMMemorándum de Entendimiento (MoU) entre Codelco y SQM
Memorándum de Entendimiento (MoU) entre Codelco y SQMVoces Mineras
 
8447779800, Low rate Call girls in Shivaji Enclave Delhi NCR
8447779800, Low rate Call girls in Shivaji Enclave Delhi NCR8447779800, Low rate Call girls in Shivaji Enclave Delhi NCR
8447779800, Low rate Call girls in Shivaji Enclave Delhi NCRashishs7044
 
Call US-88OO1O2216 Call Girls In Mahipalpur Female Escort Service
Call US-88OO1O2216 Call Girls In Mahipalpur Female Escort ServiceCall US-88OO1O2216 Call Girls In Mahipalpur Female Escort Service
Call US-88OO1O2216 Call Girls In Mahipalpur Female Escort Servicecallgirls2057
 
Unlocking the Future: Explore Web 3.0 Workshop to Start Earning Today!
Unlocking the Future: Explore Web 3.0 Workshop to Start Earning Today!Unlocking the Future: Explore Web 3.0 Workshop to Start Earning Today!
Unlocking the Future: Explore Web 3.0 Workshop to Start Earning Today!Doge Mining Website
 
Cybersecurity Awareness Training Presentation v2024.03
Cybersecurity Awareness Training Presentation v2024.03Cybersecurity Awareness Training Presentation v2024.03
Cybersecurity Awareness Training Presentation v2024.03DallasHaselhorst
 
8447779800, Low rate Call girls in Rohini Delhi NCR
8447779800, Low rate Call girls in Rohini Delhi NCR8447779800, Low rate Call girls in Rohini Delhi NCR
8447779800, Low rate Call girls in Rohini Delhi NCRashishs7044
 
Global Scenario On Sustainable and Resilient Coconut Industry by Dr. Jelfina...
Global Scenario On Sustainable  and Resilient Coconut Industry by Dr. Jelfina...Global Scenario On Sustainable  and Resilient Coconut Industry by Dr. Jelfina...
Global Scenario On Sustainable and Resilient Coconut Industry by Dr. Jelfina...ictsugar
 
Independent Call Girls Andheri Nightlaila 9967584737
Independent Call Girls Andheri Nightlaila 9967584737Independent Call Girls Andheri Nightlaila 9967584737
Independent Call Girls Andheri Nightlaila 9967584737Riya Pathan
 
Fordham -How effective decision-making is within the IT department - Analysis...
Fordham -How effective decision-making is within the IT department - Analysis...Fordham -How effective decision-making is within the IT department - Analysis...
Fordham -How effective decision-making is within the IT department - Analysis...Peter Ward
 
Flow Your Strategy at Flight Levels Day 2024
Flow Your Strategy at Flight Levels Day 2024Flow Your Strategy at Flight Levels Day 2024
Flow Your Strategy at Flight Levels Day 2024Kirill Klimov
 
Financial-Statement-Analysis-of-Coca-cola-Company.pptx
Financial-Statement-Analysis-of-Coca-cola-Company.pptxFinancial-Statement-Analysis-of-Coca-cola-Company.pptx
Financial-Statement-Analysis-of-Coca-cola-Company.pptxsaniyaimamuddin
 
Youth Involvement in an Innovative Coconut Value Chain by Mwalimu Menza
Youth Involvement in an Innovative Coconut Value Chain by Mwalimu MenzaYouth Involvement in an Innovative Coconut Value Chain by Mwalimu Menza
Youth Involvement in an Innovative Coconut Value Chain by Mwalimu Menzaictsugar
 
Market Sizes Sample Report - 2024 Edition
Market Sizes Sample Report - 2024 EditionMarket Sizes Sample Report - 2024 Edition
Market Sizes Sample Report - 2024 EditionMintel Group
 
Darshan Hiranandani [News About Next CEO].pdf
Darshan Hiranandani [News About Next CEO].pdfDarshan Hiranandani [News About Next CEO].pdf
Darshan Hiranandani [News About Next CEO].pdfShashank Mehta
 

Dernier (20)

Japan IT Week 2024 Brochure by 47Billion (English)
Japan IT Week 2024 Brochure by 47Billion (English)Japan IT Week 2024 Brochure by 47Billion (English)
Japan IT Week 2024 Brochure by 47Billion (English)
 
Enjoy ➥8448380779▻ Call Girls In Sector 18 Noida Escorts Delhi NCR
Enjoy ➥8448380779▻ Call Girls In Sector 18 Noida Escorts Delhi NCREnjoy ➥8448380779▻ Call Girls In Sector 18 Noida Escorts Delhi NCR
Enjoy ➥8448380779▻ Call Girls In Sector 18 Noida Escorts Delhi NCR
 
Chapter 9 PPT 4th edition.pdf internal audit
Chapter 9 PPT 4th edition.pdf internal auditChapter 9 PPT 4th edition.pdf internal audit
Chapter 9 PPT 4th edition.pdf internal audit
 
Call Us ➥9319373153▻Call Girls In North Goa
Call Us ➥9319373153▻Call Girls In North GoaCall Us ➥9319373153▻Call Girls In North Goa
Call Us ➥9319373153▻Call Girls In North Goa
 
No-1 Call Girls In Goa 93193 VIP 73153 Escort service In North Goa Panaji, Ca...
No-1 Call Girls In Goa 93193 VIP 73153 Escort service In North Goa Panaji, Ca...No-1 Call Girls In Goa 93193 VIP 73153 Escort service In North Goa Panaji, Ca...
No-1 Call Girls In Goa 93193 VIP 73153 Escort service In North Goa Panaji, Ca...
 
Memorándum de Entendimiento (MoU) entre Codelco y SQM
Memorándum de Entendimiento (MoU) entre Codelco y SQMMemorándum de Entendimiento (MoU) entre Codelco y SQM
Memorándum de Entendimiento (MoU) entre Codelco y SQM
 
8447779800, Low rate Call girls in Shivaji Enclave Delhi NCR
8447779800, Low rate Call girls in Shivaji Enclave Delhi NCR8447779800, Low rate Call girls in Shivaji Enclave Delhi NCR
8447779800, Low rate Call girls in Shivaji Enclave Delhi NCR
 
Call US-88OO1O2216 Call Girls In Mahipalpur Female Escort Service
Call US-88OO1O2216 Call Girls In Mahipalpur Female Escort ServiceCall US-88OO1O2216 Call Girls In Mahipalpur Female Escort Service
Call US-88OO1O2216 Call Girls In Mahipalpur Female Escort Service
 
Unlocking the Future: Explore Web 3.0 Workshop to Start Earning Today!
Unlocking the Future: Explore Web 3.0 Workshop to Start Earning Today!Unlocking the Future: Explore Web 3.0 Workshop to Start Earning Today!
Unlocking the Future: Explore Web 3.0 Workshop to Start Earning Today!
 
Cybersecurity Awareness Training Presentation v2024.03
Cybersecurity Awareness Training Presentation v2024.03Cybersecurity Awareness Training Presentation v2024.03
Cybersecurity Awareness Training Presentation v2024.03
 
8447779800, Low rate Call girls in Rohini Delhi NCR
8447779800, Low rate Call girls in Rohini Delhi NCR8447779800, Low rate Call girls in Rohini Delhi NCR
8447779800, Low rate Call girls in Rohini Delhi NCR
 
Global Scenario On Sustainable and Resilient Coconut Industry by Dr. Jelfina...
Global Scenario On Sustainable  and Resilient Coconut Industry by Dr. Jelfina...Global Scenario On Sustainable  and Resilient Coconut Industry by Dr. Jelfina...
Global Scenario On Sustainable and Resilient Coconut Industry by Dr. Jelfina...
 
Independent Call Girls Andheri Nightlaila 9967584737
Independent Call Girls Andheri Nightlaila 9967584737Independent Call Girls Andheri Nightlaila 9967584737
Independent Call Girls Andheri Nightlaila 9967584737
 
Fordham -How effective decision-making is within the IT department - Analysis...
Fordham -How effective decision-making is within the IT department - Analysis...Fordham -How effective decision-making is within the IT department - Analysis...
Fordham -How effective decision-making is within the IT department - Analysis...
 
Flow Your Strategy at Flight Levels Day 2024
Flow Your Strategy at Flight Levels Day 2024Flow Your Strategy at Flight Levels Day 2024
Flow Your Strategy at Flight Levels Day 2024
 
Financial-Statement-Analysis-of-Coca-cola-Company.pptx
Financial-Statement-Analysis-of-Coca-cola-Company.pptxFinancial-Statement-Analysis-of-Coca-cola-Company.pptx
Financial-Statement-Analysis-of-Coca-cola-Company.pptx
 
Youth Involvement in an Innovative Coconut Value Chain by Mwalimu Menza
Youth Involvement in an Innovative Coconut Value Chain by Mwalimu MenzaYouth Involvement in an Innovative Coconut Value Chain by Mwalimu Menza
Youth Involvement in an Innovative Coconut Value Chain by Mwalimu Menza
 
Market Sizes Sample Report - 2024 Edition
Market Sizes Sample Report - 2024 EditionMarket Sizes Sample Report - 2024 Edition
Market Sizes Sample Report - 2024 Edition
 
Corporate Profile 47Billion Information Technology
Corporate Profile 47Billion Information TechnologyCorporate Profile 47Billion Information Technology
Corporate Profile 47Billion Information Technology
 
Darshan Hiranandani [News About Next CEO].pdf
Darshan Hiranandani [News About Next CEO].pdfDarshan Hiranandani [News About Next CEO].pdf
Darshan Hiranandani [News About Next CEO].pdf
 

TechTalk - Dotnet

  • 1. Tech Talk – C# und das Microsoft .NET Framework Heinrich Wendel, DLR Simulations- und Softwaretechnik 30. Juli 2008
  • 2.
  • 3.
  • 5.
  • 7.
  • 8.
  • 9. C# - Namespaces // Defining namespaces namespace Dlr.Sistec { class Test { … } } // Nested namespaces namespace Dlr { namespace Sistec { class Test {…} } } // Using namespaces Dlr.Sistec.Test = new Dlr.Sistec.Test(); // Short form Using Dlr.Sistec; Test = new Test(); // Aliases Using ns = Dlr.Sistec; ns.Test = new ns.Test();
  • 10.
  • 11. C# - Iterators Months months = new Months(); foreach (string temp in months) Console.WriteLine(temp); public class Months : IEnumerable {   string[] month = { &quot;Januar&quot;, &quot;Februar&quot;, &quot;März&quot;, &quot;April&quot;, &quot;Mai&quot;, &quot;Juni&quot;, &quot;Juli&quot;, &quot;August&quot;, &quot;September&quot;, &quot;Oktober&quot;, &quot;November&quot;, &quot;Dezember&quot;};   public IEnumerator GetEnumerator() {     for (int i = 0; i < month.Length; i++)       yield return month[i];   } }
  • 12. C# - Switch / Enums string s = Console.ReadLine();; switch(s) { case „ January “: … break; case „ Februar “: … break; case „ March “: … break; … }
  • 13.
  • 14. C# - Switch / Enums [Flags] public enum Keys { Shift = 1, Ctrl = 2, Alt = 4 } Keys k = Keys.Shift | Keys.Ctrl if ((k & Keys.Shift) == Keys.Shift) {…}
  • 15.
  • 16. C# - Properties public class Person { private string firstName ; private string lastName ; public void setFirstName (string name) this.firstName = name; } public string getLastName () return this.lastName; } public void setLastName (string name) this.lastName = name } public string getFirstName () return this.firstName; } } public class Person { public string FirstName { get { return firstName; } set { firstName = value ; } } private string firstName ; public string LastName { get { return lastName; } set { lastName = value ; } } private string lastName ; } Public class Person { public string FirstName { get; set ; } public string LastName { get; set ; } }
  • 17.
  • 18. C# - Attributes [AttributeUsage(AttributeTargets.All)] public class DeveloperAttribute : Attribute { public string Zuname; public int PersID; public DeveloperAttribute(string name) { Zuname = name; } } [DeveloperAttribute(&quot;Meier&quot;, PersID = 8815)] class Program { static void Main(string[] args) { DeveloperAttribute attr = (DeveloperAttribute)Attribute. GetCustomAttribute(typeof(Program), typeof(DeveloperAttribute)); Console.WriteLine(&quot;Name: {0}&quot;, attr.Zuname ); Console.WriteLine(&quot;PersID: {0}&quot;, attr.PersID ); }
  • 19. C# - Delegates / Events public class Logger { public delegate void Log(string message); private static Log log ger ; public static void Main(string[] args) { log ger = new Log(PrintToConsole); log ger.Invoke (&quot;message&quot;); } public static void PrintToConsole(string message) { Console.WriteLine(message); } } public class Logger { public delegate void Log(string message); private static Log logList; public static void Main(string[] args) { logList += new Log(PrintToConsole); logList += new Log(PrintTo File ); logList (&quot;message&quot;); } public static void PrintToConsole (string message) { … } public static void PrintTo File (string message) { … } } public class Logger { public delegate void Log(string message); public static event Log logList ; public static void Main(string[] args) { logList += PrintToConsole; logList += PrintTo File ; logList (&quot;message&quot;); } public static void PrintToConsole (string message) { … } public static void PrintTo File (string message) { … } }
  • 20. C# - Lambda Funktionen public class Logger { public delegate void Log(string message); private static Log logList; public static void Main(string[] args) { logList = delegate(string message) { Console.WriteLine(message); }; logList(&quot;message&quot;); } } public class Logger { public delegate void Log(string message); private static Log logList; public static void Main(string[] args) { logList = message => { Console.WriteLine(message); }; logList(&quot;message&quot;); } } List <int> evenNumbers = list.FindAll( i => (i%2) == 0 );
  • 21.
  • 22.
  • 23. C# - Constructors public class Point { public Point(int x, int y) { X = x; Y = y; } public Point() { } public int X { get; set; } public int Y { get; set; } } Point p = new Point(1, 2) Point p = new Point() P.X = 1; p.Y = 2; Point p = new Point { X = 1, Y = 2 }
  • 24. C# - Constructors public class Point { public int X { get; set; } public int Y { get; set; } } public class Rectangle { public Point topLeft { get; set; } public Point bottomRight { get; set; } } Rectangle r = new Rectangle { topLeft = new Point{ X = 0, Y = 0 }, bottomRight = new Point { X = 2, Y = 2 } } Rectangle r = new Rectangle(); Point p1 = new Point(); p1.X = 0; p1.Y = 0; Point p2 = new Point(); p2.X = 2; p2.Y = 2; r.topLeft = p1; r.bottomRight = p2;
  • 25.
  • 26.
  • 27.
  • 28. C# - Method Calls void FunctionA( ref int Val) { int x= Val; Val = x* 4; } int a= 5; FunctionA( ref a); Console.WriteLine(a); bool GetNodeValue( out int Val) { Val = 1; return true; } int Val; GetNodeValue(Val); Console.WriteLine(a); void Func(params int[] array) { Console.WriteLine(array.Length); } Func(1); Func(7,9); Func(new int[] {3,8,10});
  • 29. C# - Extension Methods public static class ExtensionClass { public static int MultiplyByTwo( this int number) { return number * 2; } } public class Class1 { public static void Main(string[] args) { int number = 2; Console.WriteLine( number.MultiplyByTwo() ); } }
  • 30. C# - Casting object [] myObjects = new object[1] myObjects[0] = new MyClass1(); string s; // Exception s = (string) myObjects[0] public static explicit operator String(MyClass1) { return “SomeString”; } If (myObjects[0] is string) { s = (string) myObjects[1] } s = myObjects[0] as string
  • 31.
  • 32.
  • 33.
  • 34.
  • 35.
  • 36.
  • 37.
  • 38.
  • 39.
  • 40.
  • 41.  

Notes de l'éditeur

  1. Coding Guidelines Sprache