Referencia c#

Páginas: 2 (324 palabras) Publicado: 21 de junio de 2011
Core C# and .NET Quick Reference
1. Data Types Primitive string bool char byte short int long float double decimal 2. Arrays Declaration int[] numArray = {1903, 1907, 1910}; int[] numArray = newint[3]; // 3 rows and 2 columns int[ , ] nums = {{1907, 1990}, {1904, 1986}, {1910, 1980}}; Array Operations Array.Sort(numArray); // sort ascending // Sort begins at element 4 and sorts 10 elementsArray.Sort(numArray, 4,10); // Use one array as a key and sort two arrays string[] values = {“Cary”, “Gary”, “Barbara”}; string[] keys = {“Grant”, “Cooper”, “Stanwyck”}; Array.Sort(keys, values); // Clearelements in array (array, 1st element, # elements) Array.Clear(numArray, 0, numArray.Length); // Copy elements from one array to another Array.Copy(src, target, numelements); 3. String OperationsMethod Compare Description String.Compare(stra, strb, case, ci) bool case – true for case insensitive ci – new CultureInfo(“en-US”) returns: ,csc /t:library /out:reslib.dll mysource.cs csc /t:winexe/r:ctls1.dll /r:ctls2.dll winapp.cs csc /keyfile:strongkey.snk secure.cs

11. Delegates and Events
Delegates [modifiers] delegate result-type delegate name ([parameter list]); // (1) Define a delegatethat calls method(s) having a single string parameter public delegate void StringPrinter(string s); // (2) Register methods to be called by delegate StringPrinter prt = new StringPrinter(PrintLower);prt += new StringPrinter(PrintUpper); prt(“Copyright was obtained in 2005”); / / execute PrintLower and PrintUpper Using Anonymous Methods with a Delegate Rather than calling a method, a delegateencapsulates code that is executed: prt = delegate(string s) { Console.WriteLine(s.ToLower()); }; prt += delegate(string s) { Console.WriteLine(s.ToUpper()); }; prt(“Print this in lower and upper case.”);Events // class.event += new delegate(event handler method); Button Total = new Button(); Total.Click += new EventHandler(GetTotal); // Event Handler method must have signature specified by...
Leer documento completo

Regístrate para leer el documento completo.

Estos documentos también te pueden resultar útiles

  • tarjeta de referencia C++
  • C Mo Se Utiliza Las Referencias En Apa
  • C Mo Hacer Referencias Bibliogr Ficas Con La Norma A
  • Manual de referencia lenguaje c
  • Cartão de referência "c"
  • referencias ámbito c
  • Referencia
  • Referencias

Conviértase en miembro formal de Buenas Tareas

INSCRÍBETE - ES GRATIS