moghaddamehei_bar_csharp

در نمایش آنلاین پاورپوینت، ممکن است بعضی علائم، اعداد و حتی فونت‌ها به خوبی نمایش داده نشود. این مشکل در فایل اصلی پاورپوینت وجود ندارد.






  • جزئیات
  • امتیاز و نظرات
  • متن پاورپوینت

امتیاز

درحال ارسال
امتیاز کاربر [0 رای]

نقد و بررسی ها

هیچ نظری برای این پاورپوینت نوشته نشده است.

اولین کسی باشید که نظری می نویسد “مقدمه ای بر #C”

مقدمه ای بر #C

اسلاید 1: Introduction to C# Anders Hejlsberg Distinguished Engineer Developer Division Microsoft Corporation

اسلاید 2: C# – The Big IdeasThe first component oriented language in the C/C++ familyEverything really is an objectNext generation robust and durable softwarePreservation of investment

اسلاید 3: C# – The Big Ideas A component oriented languageC# is the first “component oriented” language in the C/C++ familyComponent concepts are first class:Properties, methods, eventsDesign-time and run-time attributesIntegrated documentation using XMLEnables one-stop programmingNo header files, IDL, etc.Can be embedded in web pages

اسلاید 4: C# – The Big Ideas Everything really is an objectTraditional viewsC++, Java: Primitive types are “magic” and do not interoperate with objectsSmalltalk, Lisp: Primitive types are objects, but at great performance costC# unifies with no performance costDeep simplicity throughout systemImproved extensibility and reusabilityNew primitive types: Decimal, SQL…Collections, etc., work for all types

اسلاید 5: C# – The Big Ideas Robust and durable softwareGarbage collectionNo memory leaks and stray pointersExceptionsError handling is not an afterthoughtType-safetyNo uninitialized variables, unsafe castsVersioningPervasive versioning considerations in all aspects of language design

اسلاید 6: C# – The Big Ideas Preservation of InvestmentC++ heritageNamespaces, enums, unsigned types, pointers (in unsafe code), etc.No unnecessary sacrificesInteroperabilityWhat software is increasingly aboutMS C# implementation talks to XML, SOAP, COM, DLLs, and any .NET languageMillions of lines of C# code in .NETShort learning curveIncreased productivity

اسلاید 7: Hello Worldusing System;class Hello{ static void Main() { Console.WriteLine(Hello world); }}

اسلاید 8: C# Program StructureNamespacesContain types and other namespacesType declarationsClasses, structs, interfaces, enums, and delegatesMembersConstants, fields, methods, properties, indexers, events, operators, constructors, destructorsOrganizationNo header files, code written “in-line”No declaration order dependence

اسلاید 9: C# Program Structureusing System;namespace System.Collections{ public class Stack { Entry top; public void Push(object data) { top = new Entry(top, data); } public object Pop() { if (top == null) throw new InvalidOperationException(); object result = top.data; top = top.next; return result; } }}

اسلاید 10: Type SystemValue typesDirectly contain dataCannot be nullReference typesContain references to objectsMay be nullint i = 123;string s = Hello world;123isHello world

اسلاید 11: Type SystemValue typesPrimitives int i;Enumsenum State { Off, On }Structsstruct Point { int x, y; }Reference typesClassesclass Foo: Bar, IFoo {...}Interfaces interface IFoo: IBar {...}Arraysstring[] a = new string[10];Delegatesdelegate void Empty();

اسلاید 12: Predefined TypesC# predefined typesReference object, stringSigned sbyte, short, int, longUnsigned byte, ushort, uint, ulongCharacter charFloating-point float, double, decimalLogical boolPredefined types are simply aliases for system-provided typesFor example, int == System.Int32

اسلاید 13: ClassesSingle inheritanceMultiple interface implementationClass membersConstants, fields, methods, properties, indexers, events, operators, constructors, destructorsStatic and instance membersNested typesMember accesspublic, protected, internal, private

اسلاید 14: StructsLike classes, exceptStored in-line, not heap allocatedAssignment copies data, not referenceNo inheritanceIdeal for light weight objectsComplex, point, rectangle, colorint, float, double, etc., are all structsBenefitsNo heap allocation, less GC pressureMore efficient use of memory

اسلاید 15: Classes And Structs class CPoint { int x, y; ... }struct SPoint { int x, y; ... }CPoint cp = new CPoint(10, 20);SPoint sp = new SPoint(10, 20);1020spcp1020CPoint

اسلاید 16: InterfacesMultiple inheritanceCan contain methods, properties, indexers, and eventsPrivate interface implementationsinterface IDataBound{ void Bind(IDataBinder binder);}class EditBox: Control, IDataBound{ void IDataBound.Bind(IDataBinder binder) {...}}

اسلاید 17: EnumsStrongly typedNo implicit conversions to/from intOperators: +, -, ++, --, &, |, ^, ~Can specify underlying typeByte, short, int, longenum Color: byte{ Red = 1, Green = 2, Blue = 4, Black = 0, White = Red | Green | Blue,}

اسلاید 18: DelegatesObject oriented function pointersMultiple receiversEach delegate has an invocation listThread-safe + and - operationsFoundation for eventsdelegate void MouseEvent(int x, int y);delegate double Func(double x);Func func = new Func(Math.Sin);double x = func(1.0);

اسلاید 19: Unified Type SystemEverything is an objectAll types ultimately inherit from objectAny piece of data can be stored, transported, and manipulated with no extra workStreamMemoryStreamFileStreamHashtabledoubleintobject

اسلاید 20: Unified Type SystemBoxingAllocates box, copies value into itUnboxingChecks type of box, copies value outint i = 123;object o = i;int j = (int)o;123io123System.Int32123j

اسلاید 21: Unified Type SystemBenefitsEliminates “wrapper classes”Collection classes work with all typesReplaces OLE Automations VariantLots of examples in .NET Frameworkstring s = string.Format( Your total was {0} on {1}, total, date);Hashtable t = new Hashtable();t.Add(0, zero);t.Add(1, one);t.Add(2, two);

اسلاید 22: Component DevelopmentWhat defines a component?Properties, methods, eventsIntegrated help and documentationDesign-time informationC# has first class supportNot naming patterns, adapters, etc.Not external filesComponents are easy to build and consume

اسلاید 23: PropertiesProperties are “smart fields”Natural syntax, accessors, inliningpublic class Button: Control{ private string caption; public string Caption { get { return caption; } set { caption = value; Repaint(); } }}Button b = new Button();b.Caption = OK;String s = b.Caption;

اسلاید 24: IndexersIndexers are “smart arrays”Can be overloadedpublic class ListBox: Control{ private string[] items; public string this[int index] { get { return items[index]; } set { items[index] = value; Repaint(); } }}ListBox listBox = new ListBox();listBox[0] = hello;Console.WriteLine(listBox[0]);

اسلاید 25: Events SourcingDefine the event signatureDefine the event and firing logicpublic delegate void EventHandler(object sender, EventArgs e);public class Button { public event EventHandler Click; protected void OnClick(EventArgs e) { if (Click != null) Click(this, e); }}

اسلاید 26: Events HandlingDefine and register event handlerpublic class MyForm: Form{ Button okButton; public MyForm() { okButton = new Button(...); okButton.Caption = OK; okButton.Click += new EventHandler(OkButtonClick); } void OkButtonClick(object sender, EventArgs e) { ShowMessage(You pressed the OK button); }}

اسلاید 27: AttributesHow do you associate information with types and members?Documentation URL for a classTransaction context for a methodXML persistence mappingTraditional solutionsAdd keywords or pragmas to languageUse external files, e.g., .IDL, .DEFC# solution: Attributes

اسلاید 28: Attributespublic class OrderProcessor{ [WebMethod] public void SubmitOrder(PurchaseOrder order) {...}}[XmlRoot(Order, Namespace=urn:acme.b2b-schema.v1)]public class PurchaseOrder{ [XmlElement(shipTo)] public Address ShipTo; [XmlElement(billTo)] public Address BillTo; [XmlElement(comment)] public string Comment; [XmlElement(items)] public Item[] Items; [XmlAttribute(date)] public DateTime OrderDate;}public class Address {...}public class Item {...}

اسلاید 29: AttributesAttributes can beAttached to types and membersExamined at run-time using reflectionCompletely extensibleSimply a class that inherits from System.AttributeType-safeArguments checked at compile-timeExtensive use in .NET FrameworkXML, Web Services, security, serialization, component model, COM and P/Invoke interop, code configuration…

اسلاید 30: XML Commentsclass XmlElement { /// <summary> /// Returns the attribute with the given name and /// namespace</summary> /// <param name=name> /// The name of the attribute</param> /// <param name=ns> /// The namespace of the attribute, or null if /// the attribute has no namespace</param> /// <return> /// The attribute value, or null if the attribute /// does not exist</return> /// <seealso cref=GetAttr(string)/> /// public string GetAttr(string name, string ns) { ... }}

اسلاید 31: Statements And ExpressionsHigh C++ fidelityIf, while, do require bool conditiongoto can’t jump into blocksSwitch statementNo fall-through, “goto case” or “goto default”foreach statementChecked and unchecked statementsExpression statements must do workvoid Foo() { i == 1; // error}

اسلاید 32: foreach StatementIteration of arraysIteration of user-defined collectionsforeach (Customer c in customers.OrderBy(name)) { if (c.Orders.Count != 0) { ... }}public static void Main(string[] args) { foreach (string s in args) Console.WriteLine(s);}

اسلاید 33: Parameter ArraysCan write “printf” style methodsType-safe, unlike C++void printf(string fmt, params object[] args) { foreach (object x in args) { ... }}printf(%s %i %i, str, int1, int2);object[] args = new object[3];args[0] = str;args[1] = int1;Args[2] = int2;printf(%s %i %i, args);

اسلاید 34: Operator OverloadingFirst class user-defined data typesUsed in base class libraryDecimal, DateTime, TimeSpanUsed in UI libraryUnit, Point, RectangleUsed in SQL integrationSQLString, SQLInt16, SQLInt32, SQLInt64, SQLBool, SQLMoney, SQLNumeric, SQLFloat…

اسلاید 35: Operator Overloadingpublic struct DBInt{ public static readonly DBInt Null = new DBInt(); private int value; private bool defined; public bool IsNull { get { return !defined; } } public static DBInt operator +(DBInt x, DBInt y) {...} public static implicit operator DBInt(int x) {...} public static explicit operator int(DBInt x) {...}}DBInt x = 123;DBInt y = DBInt.Null;DBInt z = x + y;

اسلاید 36: VersioningProblem in most languagesC++ and Java produce fragile base classes Users unable to express versioning intentC# allows intent to be expressedMethods are not virtual by defaultC# keywords “virtual”, “override” and “new” provide contextC# cant guarantee versioningCan enable (e.g., explicit override)Can encourage (e.g., smart defaults)

اسلاید 37: Versioningclass Derived: Base// version 1{ public virtual void Foo() { Console.WriteLine(Derived.Foo); }}class Derived: Base// version 2a{ new public virtual void Foo() { Console.WriteLine(Derived.Foo); }}class Derived: Base// version 2b{ public override void Foo() { base.Foo(); Console.WriteLine(Derived.Foo); }}class Base// version 1{}class Base // version 2 { public virtual void Foo() { Console.WriteLine(Base.Foo); }}

اسلاید 38: Conditional Compilation#define, #undef#if, #elif, #else, #endifSimple boolean logicConditional methodspublic class Debug{ [Conditional(Debug)] public static void Assert(bool cond, String s) { if (!cond) { throw new AssertionException(s); } }}

اسلاید 39: Unsafe CodePlatform interoperability covers most casesUnsafe codeLow-level code “within the box”Enables unsafe casts, pointer arithmeticDeclarative pinningFixed statementBasically “inline C”unsafe void Foo() { char* buf = stackalloc char[256]; for (char* p = buf; p < buf + 256; p++) *p = 0; ...}

اسلاید 40: Unsafe Codeclass FileStream: Stream{ int handle; public unsafe int Read(byte[] buffer, int index, int count) { int n = 0; fixed (byte* p = buffer) { ReadFile(handle, p + index, count, &n, null); } return n; } [dllimport(kernel32, SetLastError=true)] static extern unsafe bool ReadFile(int hFile, void* lpBuffer, int nBytesToRead, int* nBytesRead, Overlapped* lpOverlapped);}

اسلاید 41: More Informationhttp://msdn.microsoft.com/netDownload .NET SDK and documentationhttp://msdn.microsoft.com/events/pdcSlides and info from .NET PDCnews://msnews.microsoft.commicrosoft.public.dotnet.csharp.general

20,000 تومان

خرید پاورپوینت توسط کلیه کارت‌های شتاب امکان‌پذیر است و بلافاصله پس از خرید، لینک دانلود پاورپوینت در اختیار شما قرار خواهد گرفت.

در صورت عدم رضایت سفارش برگشت و وجه به حساب شما برگشت داده خواهد شد.

در صورت نیاز با شماره 09353405883 در واتساپ، ایتا و روبیکا تماس بگیرید.

افزودن به سبد خرید