sábado, 19 de dezembro de 2009

Visual Studio 2010 and .NET Framework 4 Beta Period Extended

            Microsoft has listened to user feedback concerning Visual Studio 2010 Beta 2 performance issues and bugs and decided to extend the Beta period. The new Visual Studio version introduces numerous changes, including many that focus on multicore programming. A new checkpoint release, a Release Candidate would be publicly available during February 2010.
S. Somasegar, Senior Vice President, Microsoft Developer Division made it very clear in his blog post "Visual Studio 2010 and .NET Framework 4 Beta period extended". The launch of Visual Studio 2010 and .NET Framework 4 won't be in March, it would a few weeks later than expected in order to react to the new feedback obtained with the forthcoming Release Candidate.

A Microsoft ouviu o feedback dos usuários sobre questões de desempenho e bugs sobre o Visual Studio 2010 Beta 2 e decidiu prorrogar o período de avaliação Beta do produto. A nova versão do Visual Studio indroduz várias alterações incluindo muitas que focam a programação multicore. Uma nova versão "checkpoint" Release Candidate seria disponibilizada ao público em fevereiro de 2010.

S. Somasegar, Vice Presidente Senior da Divisão de desenvolvimento de produtos da Microsoft deixou isso muito claro em seu blog no post "Visual Studio 2010 e .NET Framework 4 Beta period extended". O lançamento o Visual Studio 2010 e .NET Framework 4 não será em março, seria algumas semanas depois do esperado para que se possa analisar o novo feedback obtido com a próxima versão Release Candidate.


Operador Null-Coalescing ?? (C#)

          Estava lendo "CLR via C#" de Jeffrey Richter noite passada quando me deparei com o operador Null-Coalescing. Sabia sobre sua existência, mas nunca soube realmente para que ele fosse utilizado.
          Muitas vezes, ao codificar, você precisa atribuir uma variável A a uma B apenas se a variável A não for nula. Se A for nula, você quer que B receba outro valor (talvez um default).
          Usando o operador condicional do C#, seu código se pareceria com algo assim:

               string fileName = tempFileName != null ? tempFileName : "Untitled";

          Se tempFileName não for nulo, fileName receberá o valor de tempFileName, caso contrário, fileName receberá o valor "Untitled".
          Utilizando o operador Null-Coalescing, seu código poderia ser abreviado para algo assim:

               string fileName = tempFileName ?? "Untitled";

          A lógica é a mesma: Se tempFileName for nulo, fileName recebe seu valor, caso contrário, recebe "Untitled".
          O operador Null-Coalescing é muito útil com os tipos anuláveis, em particular ao converter esses tipos para seu tipo de origem:

               int? count = null;
                         int amount = count ?? default(int);

          Uma vez que count é nulo, amount receberá o valor default para um tipo inteiro, ou seja, zero.

          Os operadores condicionais e o Null-Coalescing não são os operadores mais auto explicativos que existem, mesmo assim eu amo programar em C#!


          Links interessantes:
               ?? Operator (C# Reference)

[]s

Luis Fernando

segunda-feira, 14 de dezembro de 2009

WMI Code Creator

Para aqueles que querem desenvolver em C#, VB.NET ou scripts que utilizem o WMI, uma sugestão que lhes poupará horas de pesquisas: Baixem o WMICodeCreator da Microsoft (gratuito). Ele fornecerá explicação sobre toda interface necessária para o desenvolvimento e exemplos de utilização.
Interessante verificar o fonte do aplicativo que acompanha o download...




Overview

The WMI Code Creator tool generates code that uses WMI to obtain management information or perform management tasks. You can use the tool to learn how to manage computers using WMI scripting and WMI .NET. The tool generates code that runs on the local computer, a remote computer, or a group of remote computers based on your selection from the Target Computer menu on the tool. You can also execute the generated code directly from the tool.

The tool is meant to help IT Professionals quickly create management scripts and to help developers learn WMI scripting and WMI .NET. The tool helps take the complexity out of writing code that uses WMI and helps developers and IT Professionals understand how powerful and useful WMI can be for managing computers.

Using the tool, you can query for management information such as the name and version of an operating system, how much free disk space is on a hard drive, or the state of a service. You can also use the tool to execute a method from a WMI class to perform a management task. For example, you can create code that executes the Create method of the Win32_Process class to create a new process such as Notepad or another executable. The tool also allows you to generate code to receive event notifications using WMI. For example, you can select to receive an event every time a process is started or stopped, or when a computer shuts down.

The tool also allows you to browse through the available WMI namespaces and classes on the local computer to find their descriptions, properties, methods, and qualifiers.

The code that creates the tool is also included in the download. The tool was created using WMI .NET, and the code for the tool can help developers understand how WMI .NET is used to create applications and manage information. Be sure to read the end-user license agreement that is included in the download.




[]s


Luis Fernando