From da6fc10553b457ef0d8ceb4f8898dfb2c5ddbbdd Mon Sep 17 00:00:00 2001 From: Robson Alves Date: Mon, 12 Oct 2015 07:03:18 -0300 Subject: Include and correct csharp docs Correct the csharp doc en-us language which was written intialize to initialize and include new more translated words to pt-br language. --- pt-br/csharp.html.markdown | 92 +++++++++++++++++++++++----------------------- 1 file changed, 46 insertions(+), 46 deletions(-) (limited to 'pt-br') diff --git a/pt-br/csharp.html.markdown b/pt-br/csharp.html.markdown index 1f6bea18..deba2263 100644 --- a/pt-br/csharp.html.markdown +++ b/pt-br/csharp.html.markdown @@ -136,76 +136,76 @@ on a new line! ""Wow!"", the masses cried"; const int HoursWorkPerWeek = 9001; /////////////////////////////////////////////////// - // Data Structures + // Estrutura de Dados /////////////////////////////////////////////////// - // Arrays - zero indexado - // The array size must be decided upon declaration - // The format for declaring an array is follows: - // [] = new []; + // Matrizes - zero indexado + // O tamanho do array pode ser decidido ainda na declaração + // O formato para declarar uma matriz é o seguinte: + // [] = new []; int[] intArray = new int[10]; - // Another way to declare & initialize an array + // Outra forma de declarar & inicializar uma matriz int[] y = { 9000, 1000, 1337 }; - // Indexing an array - Accessing an element + // Indexando uma matriz - Acessando um elemento Console.WriteLine("intArray @ 0: " + intArray[0]); - // Arrays are mutable. + // Matriz são alteráveis intArray[1] = 1; - // Lists - // Lists are used more frequently than arrays as they are more flexible - // The format for declaring a list is follows: - // List = new List(); + // Listas + // Listas são usadas frequentemente tanto quanto matriz por serem mais flexiveis + // O formato de declarar uma lista é o seguinte: + // List = new List(); List intList = new List(); List stringList = new List(); - List z = new List { 9000, 1000, 1337 }; // intialize - // The <> are for generics - Check out the cool stuff section + List z = new List { 9000, 1000, 1337 }; // inicializar + // O <> são para genéricos - Confira está interessante seção do material - // Lists don't default to a value; - // A value must be added before accessing the index + // Lista não possuem valores padrão. + // Um valor deve ser adicionado antes e depois acessado pelo indexador intList.Add(1); Console.WriteLine("intList @ 0: " + intList[0]); - // Others data structures to check out: - // Stack/Queue - // Dictionary (an implementation of a hash map) + // Outras estruturas de dados para conferir: + // Pilha/Fila + // Dicionário (uma implementação de map de hash) // HashSet - // Read-only Collections + // Read-only Coleção // Tuple (.Net 4+) /////////////////////////////////////// - // Operators + // Operadores /////////////////////////////////////// Console.WriteLine("\n->Operators"); - int i1 = 1, i2 = 2; // Shorthand for multiple declarations + int i1 = 1, i2 = 2; // Forma curta para declarar diversas variáveis - // Arithmetic is straightforward + // Aritmética é clara Console.WriteLine(i1 + i2 - i1 * 3 / 7); // => 3 // Modulo Console.WriteLine("11%3 = " + (11 % 3)); // => 2 - // Comparison operators - Console.WriteLine("3 == 2? " + (3 == 2)); // => false - Console.WriteLine("3 != 2? " + (3 != 2)); // => true - Console.WriteLine("3 > 2? " + (3 > 2)); // => true - Console.WriteLine("3 < 2? " + (3 < 2)); // => false - Console.WriteLine("2 <= 2? " + (2 <= 2)); // => true - Console.WriteLine("2 >= 2? " + (2 >= 2)); // => true + // Comparações de operadores + Console.WriteLine("3 == 2? " + (3 == 2)); // => falso + Console.WriteLine("3 != 2? " + (3 != 2)); // => verdadeiro + Console.WriteLine("3 > 2? " + (3 > 2)); // => verdadeiro + Console.WriteLine("3 < 2? " + (3 < 2)); // => falso + Console.WriteLine("2 <= 2? " + (2 <= 2)); // => verdadeiro + Console.WriteLine("2 >= 2? " + (2 >= 2)); // => verdadeiro - // Bitwise operators! + // Operadores bit a bit (bitwise) /* - ~ Unary bitwise complement + ~ Unário bitwise complemento << Signed left shift >> Signed right shift & Bitwise AND - ^ Bitwise exclusive OR - | Bitwise inclusive OR + ^ Bitwise exclusivo OR + | Bitwise inclusivo OR */ - // Incrementations + // Incrementações int i = 0; Console.WriteLine("\n->Inc/Dec-rementation"); Console.WriteLine(i++); //i = 1. Post-Incrementation @@ -214,11 +214,11 @@ on a new line! ""Wow!"", the masses cried"; Console.WriteLine(--i); //i = 0. Pre-Decrementation /////////////////////////////////////// - // Control Structures + // Estrutura de Controle /////////////////////////////////////// Console.WriteLine("\n->Control Structures"); - // If statements are c-like + // Declaração if é como a linguagem C int j = 10; if (j == 10) { @@ -233,9 +233,9 @@ on a new line! ""Wow!"", the masses cried"; Console.WriteLine("I also don't"); } - // Ternary operators - // A simple if/else can be written as follows - // ? : + // Operador Ternário + // Um simples if/else pode ser escrito da seguinte forma + // ? : int toCompare = 17; string isTrue = toCompare == 17 ? "True" : "False"; @@ -251,25 +251,25 @@ on a new line! ""Wow!"", the masses cried"; int fooDoWhile = 0; do { - // Start iteration 100 times, fooDoWhile 0->99 + // Inicia a interação 100 vezes, fooDoWhile 0->99 if (false) - continue; // skip the current iteration + continue; // pule a intereção atual para apróxima fooDoWhile++; if (fooDoWhile == 50) - break; // breaks from the loop completely + break; // Interrompe o laço inteiro } while (fooDoWhile < 100); - //for loop structure => for(; ; ) + //estrutura de loop for => for(; ; ) for (int fooFor = 0; fooFor < 10; fooFor++) { - //Iterated 10 times, fooFor 0->9 + //Iterado 10 vezes, fooFor 0->9 } // For Each Loop - // foreach loop structure => foreach( in ) + // Estrutura do foreach => foreach( in ) // The foreach loop loops over any object implementing IEnumerable or IEnumerable // All the collection types (Array, List, Dictionary...) in the .Net framework // implement one or both of these interfaces. -- cgit v1.2.3