Around and About .NET World

Il blog di Marco Minerva
posts - 1671, comments - 2232, trackbacks - 2135

My Links

News

Contattami su Live Messenger:


MCTS: Windows, Web, Distributed Applications & SQL Server

MCPD: Enterprise Applications

Tag Cloud

Archives

Post Categories

Links

venerdì 7 settembre 2007

[70-526] Errata corrige "Special" #5

A quanto pare sul BackgroundWorker ci sono più domande sbagliate che corrette. Una di esse chiede come si può controllare se si è verificato un errore nell'esecuzione del metodo in background. La seguente soluzione è segnalata come corretta (il codice è inserito nel gestore dell'evento RunWorkerCompleted):

if (e.Error == null) MessageBox.Show("Error");

Ma non è così. La proprietà Error viene impostata sull'eventuale eccezione che si verifica durante l'esecuzione del metodo in background, quindi per sapere se c'è stato un errore si deve controllare se essa è diversa da null:

if (e.Error != null) MessageBox.Show("Error");

C'è un altra domanda relativa al controllo della condizione di errore in un BackgroundWorker. Questa volta, l'opzione indicata come corretta spiega che, se e.Error è uguale a false, non si è verificata alcuna eccezione. In realtà, poiché Error è di tipo Exception, se c'è stato alcun errore, tale proprietà vale null.

Technorati tags: , , ,

posted @ lunedì 1 gennaio 0001 00:00 | Feedback (0) | Filed Under [ Certificazioni ]

Un add-in per navigare tra i commenti del codice

Visual Studio already had the ability to recognize and quickly navigate (with Ctrl LeftClick) to URLs embedded in the comments of the code. This is great, but what is really needed is a way of referring quickly and easily from one part of the code to another part of the code (or to architectural documents checked in with the code). That is exactly what the HyperAddin does: It makes creating and following hyper-links in your code trivial. Now you only have to explain something once in a comment and refer to it many times (got lots of overloaded methods? They should all refer to the 'master' that does the real work).

Con queste parole viene introdotto HyperAddin, un add-in per Visual Studio che permette di aggiungere funzionalità di navigazione ipertestuale tra i commenti del proprio codice. In poche parole, grazie ad esso è possibile inserire un link all'interno di un commento: facendo clic su di esso, la finestra dell'editor passerà automaticamente alla destinazione del link, ad esempio il commento ad un altro metodo. Il progetto è ospitato su CodePlex. L'add-in è compatibile sia con Visual Studio 2005 sia con la beta di VS 2008 e supporta lo stile dei commenti di C#, C++, JScript e VB .NET.

Technorati Tags: , ,

posted @ lunedì 1 gennaio 0001 00:00 | Feedback (6) | Filed Under [ C# VB .NET Orcas & .NET 3.5 ]

Windows Vista e Outlook 2007

Outlook 2007 eseguito su Windows Vista ha un problema che riguarda i limiti del sottosistema GDI: se si esegue Outlook 2007 per un lungo periodo di tempo, l'aggiornamento dello schermo potrebbe non avvenire in maniera corretta. In particolare, parti della finestra di Outlook possono divenire bianche e le icone e le barre degli strumenti possono scomparire. In questo post sono contenuti maggiori dettagli sul problema e la descrizione di un workaround per la sua soluzione, in attesa del rilascio di una patch.

Technorati Tags: ,

posted @ lunedì 1 gennaio 0001 00:00 | Feedback (4) | Filed Under [ Windows Related ]

Powered by:
Powered By Subtext Powered By ASP.NET