<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/">
<channel>
<title></title>
<description></description>
<link>http://blogs.dotnethell.it/SwDev/</link>
<generator>HyperBlogs Professional v.2.0</generator>
<item>
<title>WPF - Keyboard shortcuts</title>
<link>http://blogs.dotnethell.it/SwDev/Post_18490.aspx</link>
<pubDate>Thu, 12 Jul 2012 12:45:24 +0100</pubDate>
<source url="http://blogs.dotnethell.it/SwDev/rss.aspx">Ignazio Catanzaro</source>
<description>&lt;p&gt;Salve a tutti, dopo una lunga assenza scrivo questo piccolo post :)

&lt;/p&gt;&lt;p&gt;Molte volte si ha bisogno di gestire i famosi quanto indispensabili shortcut da tastiera, vediamo come fare utilizzando C# e WPF :&lt;/p&gt;&lt;p&gt;Creiamo in una classe una variabile statica di tipo RoutedCommand :&lt;/p&gt;&lt;p&gt;&amp;nbsp;       &lt;b&gt;public static RoutedCommand MioCommand = new RoutedCommand();&lt;/b&gt;&lt;br&gt;&lt;/p&gt;&lt;p&gt;Inoltre, sulla variabile MioCommand bisogna necessariamente aggiungere una KeyGesture :&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &lt;b&gt;MioCommand.InputGestures.Add( new KeyGesture( Key.P , ModifierKeys.Control )); //Lo shortcut &#232; CTRL+P&lt;/b&gt;&lt;/p&gt;&lt;p&gt;Successivamente nello xaml della nostra/o window/usercontrol andiamo ad aggiungere un oggetto di tipo CommandBinding all'interno della propriet&#224; CommandBindings e ne impostiamo la propriet&#224; command assegnando ad essa la variabile statica di tipo RoutedCommand :&lt;/p&gt;&lt;p&gt;&amp;nbsp; &lt;b&gt;&amp;lt;Window.CommandBindings&amp;gt;&lt;br&gt;&amp;nbsp;   &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;CommandBinding Command=&quot;{x:Static local:MiaClasse.MioCommand }&quot; Executed=&quot;MioCommandExecuted&quot;/&amp;gt;&lt;br&gt;&amp;nbsp; &amp;lt;/Window.CommandBindings&amp;gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;Possiamo notare la presenza dell'evento &quot;Executed&quot; , tramite l'editor xaml generate l'event handler e all'interno di tale metodo eseguite le operazioni da effettuare alla pressione dello shortcut :&lt;/p&gt;&lt;p&gt;&amp;nbsp; &lt;b&gt;private void MioCommandExecuted( object sender, ExecutedRoutedEventArgs e )&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&amp;nbsp; {&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;//Operazioni varie&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&amp;nbsp; }&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;br&gt;&lt;/p&gt;&lt;p&gt;Per approfondire di piu l'argomento vi consiglio di dare una bella lettura ai seguenti articoli :&lt;/p&gt;&lt;p&gt;&lt;a href=&quot;http://msdn.microsoft.com/it-it/library/system.windows.uielement.commandbindings.aspx&quot;&gt;http://msdn.microsoft.com/it-it/library/system.windows.uielement.commandbindings.aspx&lt;/a&gt;&lt;br&gt;&lt;/p&gt;&lt;p&gt;&lt;a href=&quot;http://msdn.microsoft.com/it-it/library/system.windows.input.commandbinding.aspx&quot;&gt;http://msdn.microsoft.com/it-it/library/system.windows.input.commandbinding.aspx&lt;/a&gt;&lt;br&gt;&lt;/p&gt;&lt;p&gt;&lt;a href=&quot;http://msdn.microsoft.com/it-it/library/system.windows.input.routedcommand.aspx&quot;&gt;http://msdn.microsoft.com/it-it/library/system.windows.input.routedcommand.aspx&lt;/a&gt;&lt;br&gt;&lt;/p&gt;&lt;p&gt;&lt;a href=&quot;http://msdn.microsoft.com/it-it/library/system.windows.input.keygesture.aspx&quot;&gt;http://msdn.microsoft.com/it-it/library/system.windows.input.keygesture.aspx&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Stay tuned ;)&lt;/p&gt;</description>
<dc:creator>Ignazio Catanzaro</dc:creator>
<slash:comments>1</slash:comments>
<comments>http://blogs.dotnethell.it/SwDev/ReadComment_18490.aspx</comments>
<category>Framework .Net</category>
</item>
<item>
<title>Entity framework, metodo Last() non riconosciuto!</title>
<link>http://blogs.dotnethell.it/SwDev/Post_17599.aspx</link>
<pubDate>Mon, 09 Jan 2012 18:32:19 +0100</pubDate>
<source url="http://blogs.dotnethell.it/SwDev/rss.aspx">Ignazio Catanzaro</source>
<description>Salve a tutti!&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Nella lista dei metodi delle entit&#224; generate da Entity Framework ci sono alcuni metodi che non vengono letteralmente riconosciuti dall'EF come metodi validi.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Uno tra tutti &#232; il metodo Last() o LastOrDefault().&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Se si vuole raggirare il problema si puo eseguire il metodo Last() su una lista generata a partire dall'Entity :&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;MiaEntit&#224;.Last() (Errore, EF non riconosce il metodo Last() come valido)&lt;/div&gt;&lt;div&gt;MiaEntit&#224;.ToList().Last() (Il metodo viene eseguito su una lista generica e pertanto il listato produce il risultato voluto).&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Qui c'&#232; una lista di tutti i metodi non supportati da EF :&amp;nbsp;&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/bb738550.aspx&quot; style=&quot;font-size: 10pt; &quot;&gt;http://msdn.microsoft.com/en-us/library/bb738550.aspx&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Stay tuned! ;)&lt;/div&gt;</description>
<dc:creator>Ignazio Catanzaro</dc:creator>
<slash:comments>0</slash:comments>
<comments>http://blogs.dotnethell.it/SwDev/ReadComment_17599.aspx</comments>
<category>Framework .Net</category>
</item>
<item>
<title>Gestione Handly Printer</title>
<link>http://blogs.dotnethell.it/SwDev/Post_17242.aspx</link>
<pubDate>Fri, 17 Jun 2011 18:02:26 +0100</pubDate>
<source url="http://blogs.dotnethell.it/SwDev/rss.aspx">Ignazio Catanzaro</source>
<description>Salve a tutti!&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Chi ha a che fare con il Mobile a livello aziendale, prima o poi si ritrover&#224; ad armeggiare con le famose Handly Printers, ovvero, stampanti termiche di piccole dimensioni utilizzate ad esempio nell'ambito della tentata vendita.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Ogni stampante termica ha un suo SDK e nel migliore dei casi un linguaggio proprietario (come ad esempio le stampanti Zebra).&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Ma se volessimo semplicemente stampare del testo (ad esempio una bolla, una fattura, etc) e la nostra applicazione potrebbe usufruire potenzialmente di N diversi tipi di stampanti? Implementare nel software N SDK risulterebbe tedioso.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Come fare quindi? Semplice, utilizzando la porta seriale impostata alla connessione del dispositivo (le stampanti vengono associate al terminale Mobile tramite Bluetooth).&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;In basso, il listato della classe PrintEngine che permette la stampa tramite connessione seriale.&lt;/div&gt;&lt;div&gt;Il suo utilizzo &#232; molto semplice :&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;1) Creare un nuovo oggetto di tipo PrintEngine dando al costruttore come parametro il nome della porta seriale su cui &#232; connessa la stampante&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;PrintEngine PE = new PrintEngine(&quot;COM1&quot;);&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;2) Aggiungere righe al documento da stampare tramite il metodo AddLine();&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;PE.AddLine(&quot;Ciao io sono la prima Linea di testo&quot;);&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;3) Lanciare la stampa tramite Print();&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;PE.Print();&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;4) Visualizzare un'anteprima (Opzionale) in una textbox con il metoto Preview();&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: 'Times New Roman'; font-size: medium; &quot;&gt;&lt;pre style=&quot;background-color: transparent; border-top-style: none; border-bottom-style: none; padding-top: 10px; padding-right: 10px; padding-bottom: 10px; padding-left: 10px; font-size: 13px; font-family: 'Bitstream Vera Sans Mono', monospace; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-right-style: none; border-left-style: none; border-width: initial; border-color: initial; overflow-x: auto; overflow-y: auto; &quot;&gt;&lt;span class=&quot;c1&quot; style=&quot;color: rgb(0, 128, 0); &quot;&gt;//*******************************&lt;/span&gt;
&lt;span class=&quot;c1&quot; style=&quot;color: rgb(0, 128, 0); &quot;&gt;//Ignazio Catanzaro - 2011      *&lt;/span&gt;
&lt;span class=&quot;c1&quot; style=&quot;color: rgb(0, 128, 0); &quot;&gt;//                              * &lt;/span&gt;
&lt;span class=&quot;c1&quot; style=&quot;color: rgb(0, 128, 0); &quot;&gt;//For Compact Framework (CE-WM) *&lt;/span&gt;
&lt;span class=&quot;c1&quot; style=&quot;color: rgb(0, 128, 0); &quot;&gt;//                              * &lt;/span&gt;
&lt;span class=&quot;c1&quot; style=&quot;color: rgb(0, 128, 0); &quot;&gt;//*******************************&lt;/span&gt;&lt;/pre&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: 'Bitstream Vera Sans Mono', monospace; white-space: pre; &quot;&gt;&lt;span class=&quot;k&quot; style=&quot;color: rgb(0, 0, 255); &quot;&gt; using&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;System&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: 'Times New Roman'; font-size: medium; &quot;&gt;&lt;pre style=&quot;background-color: transparent; border-top-width: 1px; border-top-style: none; border-top-color: rgb(204, 204, 204); border-bottom-width: 1px; border-bottom-style: none; border-bottom-color: rgb(204, 204, 204); padding-top: 10px; padding-right: 10px; padding-bottom: 10px; padding-left: 10px; font-size: 13px; font-family: 'Bitstream Vera Sans Mono', monospace; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-right-style: none; border-left-style: none; border-width: initial; border-color: initial; overflow-x: auto; overflow-y: auto; &quot;&gt;&lt;span class=&quot;k&quot; style=&quot;color: rgb(0, 0, 255); &quot;&gt;using&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;System.Linq&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;k&quot; style=&quot;color: rgb(0, 0, 255); &quot;&gt;using&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;System.Collections.Generic&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;k&quot; style=&quot;color: rgb(0, 0, 255); &quot;&gt;using&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;System.Text&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;k&quot; style=&quot;color: rgb(0, 0, 255); &quot;&gt;using&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;System.IO.Ports&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

&lt;span class=&quot;k&quot; style=&quot;color: rgb(0, 0, 255); &quot;&gt;namespace&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;MPPrint&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;k&quot; style=&quot;color: rgb(0, 0, 255); &quot;&gt;public&lt;/span&gt; &lt;span class=&quot;k&quot; style=&quot;color: rgb(0, 0, 255); &quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nc&quot; style=&quot;color: rgb(43, 145, 175); &quot;&gt;PrintEngine&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
	&lt;span class=&quot;k&quot; style=&quot;color: rgb(0, 0, 255); &quot;&gt;private&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;SerialPort&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;SerialConn&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
	&lt;span class=&quot;k&quot; style=&quot;color: rgb(0, 0, 255); &quot;&gt;private&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;List&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;kt&quot; style=&quot;color: rgb(43, 145, 175); &quot;&gt;string&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Lines&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
	&lt;span class=&quot;k&quot; style=&quot;color: rgb(0, 0, 255); &quot;&gt;private&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;StringBuilder&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;PreviewBuffer&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

	&lt;span class=&quot;k&quot; style=&quot;color: rgb(0, 0, 255); &quot;&gt;public&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;PrintEngine&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
	&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
		&lt;span class=&quot;k&quot; style=&quot;color: rgb(0, 0, 255); &quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Lines&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot; style=&quot;color: rgb(0, 0, 255); &quot;&gt;new&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;List&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;kt&quot; style=&quot;color: rgb(43, 145, 175); &quot;&gt;string&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;&amp;gt;();&lt;/span&gt;

		&lt;span class=&quot;k&quot; style=&quot;color: rgb(0, 0, 255); &quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;SerialConn&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot; style=&quot;color: rgb(0, 0, 255); &quot;&gt;new&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;SerialPort&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
		&lt;span class=&quot;k&quot; style=&quot;color: rgb(0, 0, 255); &quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;SerialConn&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;BaudRate&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;9600&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
		&lt;span class=&quot;k&quot; style=&quot;color: rgb(0, 0, 255); &quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;SerialConn&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Parity&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
            &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;	&lt;/span&gt;&lt;span class=&quot;k&quot; style=&quot;color: rgb(0, 0, 255); &quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;SerialConn&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;StopBits&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;StopBits&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;One&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
		&lt;span class=&quot;k&quot; style=&quot;color: rgb(0, 0, 255); &quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;SerialConn&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;DataBits&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
	&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

        &lt;span class=&quot;p&quot;&gt;~&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;PrintEngine&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
        &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;k&quot; style=&quot;color: rgb(0, 0, 255); &quot;&gt;try&lt;/span&gt;
            &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
                &lt;span class=&quot;k&quot; style=&quot;color: rgb(0, 0, 255); &quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot; style=&quot;color: rgb(0, 0, 255); &quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;SerialConn&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;IsOpen&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
                &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
                    &lt;span class=&quot;k&quot; style=&quot;color: rgb(0, 0, 255); &quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;SerialConn&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Close&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
                &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
            &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
            &lt;span class=&quot;k&quot; style=&quot;color: rgb(0, 0, 255); &quot;&gt;catch&lt;/span&gt;
            &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
        &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

	&lt;span class=&quot;k&quot; style=&quot;color: rgb(0, 0, 255); &quot;&gt;public&lt;/span&gt; &lt;span class=&quot;k&quot; style=&quot;color: rgb(0, 0, 255); &quot;&gt;void&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;AddLine&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kt&quot; style=&quot;color: rgb(43, 145, 175); &quot;&gt;string&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Line&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
	&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;k&quot; style=&quot;color: rgb(0, 0, 255); &quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Lines&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Add&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Line&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
	&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

	&lt;span class=&quot;k&quot; style=&quot;color: rgb(0, 0, 255); &quot;&gt;public&lt;/span&gt; &lt;span class=&quot;k&quot; style=&quot;color: rgb(0, 0, 255); &quot;&gt;void&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;AddLine&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;List&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;kt&quot; style=&quot;color: rgb(43, 145, 175); &quot;&gt;string&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Lines&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
	&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;k&quot; style=&quot;color: rgb(0, 0, 255); &quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Lines&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;AddRange&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Lines&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
	&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

	&lt;span class=&quot;k&quot; style=&quot;color: rgb(0, 0, 255); &quot;&gt;public&lt;/span&gt; &lt;span class=&quot;k&quot; style=&quot;color: rgb(0, 0, 255); &quot;&gt;void&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;ClearLines&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
	&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
	    &lt;span class=&quot;k&quot; style=&quot;color: rgb(0, 0, 255); &quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Lines&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Clear&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
	&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

	&lt;span class=&quot;k&quot; style=&quot;color: rgb(0, 0, 255); &quot;&gt;public&lt;/span&gt; &lt;span class=&quot;k&quot; style=&quot;color: rgb(0, 0, 255); &quot;&gt;void&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;FormFeed&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
	&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
	    &lt;span class=&quot;k&quot; style=&quot;color: rgb(0, 0, 255); &quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot; style=&quot;color: rgb(0, 0, 255); &quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;SerialConn&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;IsOpen&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
	    &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
		&lt;span class=&quot;k&quot; style=&quot;color: rgb(0, 0, 255); &quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;SerialConn&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Write&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot; style=&quot;color: rgb(163, 21, 21); &quot;&gt;&quot;\f&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
	    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
	&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

	&lt;span class=&quot;k&quot; style=&quot;color: rgb(0, 0, 255); &quot;&gt;public&lt;/span&gt; &lt;span class=&quot;k&quot; style=&quot;color: rgb(0, 0, 255); &quot;&gt;void&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;Print&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
	&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
		&lt;span class=&quot;kt&quot; style=&quot;color: rgb(43, 145, 175); &quot;&gt;int&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;num&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
		&lt;span class=&quot;k&quot; style=&quot;color: rgb(0, 0, 255); &quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot; style=&quot;color: rgb(0, 0, 255); &quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;SerialConn&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;IsOpen&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
		&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
			&lt;span class=&quot;k&quot; style=&quot;color: rgb(0, 0, 255); &quot;&gt;using&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;List&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;kt&quot; style=&quot;color: rgb(43, 145, 175); &quot;&gt;string&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;&amp;gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Enumerator&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;enumerator&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot; style=&quot;color: rgb(0, 0, 255); &quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Lines&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;GetEnumerator&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;())&lt;/span&gt;
			&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
				&lt;span class=&quot;k&quot; style=&quot;color: rgb(0, 0, 255); &quot;&gt;while&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;enumerator&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;MoveNext&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;())&lt;/span&gt;
				&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
					&lt;span class=&quot;kt&quot; style=&quot;color: rgb(43, 145, 175); &quot;&gt;string&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;current&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;enumerator&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Current&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
					&lt;span class=&quot;k&quot; style=&quot;color: rgb(0, 0, 255); &quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;current&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;s&quot; style=&quot;color: rgb(163, 21, 21); &quot;&gt;&quot;&amp;amp;&amp;amp;FF&quot;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;current&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;s&quot; style=&quot;color: rgb(163, 21, 21); &quot;&gt;&quot;&amp;amp;&amp;amp;0&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
					&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
						&lt;span class=&quot;k&quot; style=&quot;color: rgb(0, 0, 255); &quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;current&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;s&quot; style=&quot;color: rgb(163, 21, 21); &quot;&gt;&quot;&amp;amp;&amp;amp;FF&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
						&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
							&lt;span class=&quot;k&quot; style=&quot;color: rgb(0, 0, 255); &quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;FormFeed&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
						&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
					&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
					&lt;span class=&quot;k&quot; style=&quot;color: rgb(0, 0, 255); &quot;&gt;else&lt;/span&gt;
					&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
						&lt;span class=&quot;kt&quot; style=&quot;color: rgb(43, 145, 175); &quot;&gt;byte&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[]&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;bytes&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Encoding&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Default&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;GetBytes&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;current&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
						&lt;span class=&quot;k&quot; style=&quot;color: rgb(0, 0, 255); &quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;SerialConn&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Write&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;bytes&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;bytes&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Length&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
						&lt;span class=&quot;k&quot; style=&quot;color: rgb(0, 0, 255); &quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;SerialConn&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;WriteLine&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot; style=&quot;color: rgb(163, 21, 21); &quot;&gt;&quot;\r&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
						&lt;span class=&quot;n&quot;&gt;num&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;++;&lt;/span&gt;
					&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
				&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
			&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
		&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
	&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

	&lt;span class=&quot;k&quot; style=&quot;color: rgb(0, 0, 255); &quot;&gt;public&lt;/span&gt; &lt;span class=&quot;k&quot; style=&quot;color: rgb(0, 0, 255); &quot;&gt;void&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;PrintSpace&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
	&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
		&lt;span class=&quot;k&quot; style=&quot;color: rgb(0, 0, 255); &quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot; style=&quot;color: rgb(0, 0, 255); &quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;SerialConn&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;IsOpen&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
		&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
			&lt;span class=&quot;kt&quot; style=&quot;color: rgb(43, 145, 175); &quot;&gt;short&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;num&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
			&lt;span class=&quot;k&quot; style=&quot;color: rgb(0, 0, 255); &quot;&gt;do&lt;/span&gt;
			&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
				&lt;span class=&quot;k&quot; style=&quot;color: rgb(0, 0, 255); &quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;SerialConn&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Write&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot; style=&quot;color: rgb(163, 21, 21); &quot;&gt;&quot; &quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
				&lt;span class=&quot;n&quot;&gt;num&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;+=&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
			&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
			&lt;span class=&quot;k&quot; style=&quot;color: rgb(0, 0, 255); &quot;&gt;while&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;num&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;&amp;lt;=&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;7&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
		&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
	&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

	&lt;span class=&quot;k&quot; style=&quot;color: rgb(0, 0, 255); &quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kt&quot; style=&quot;color: rgb(43, 145, 175); &quot;&gt;string&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;Preview&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
	&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
		&lt;span class=&quot;k&quot; style=&quot;color: rgb(0, 0, 255); &quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;PreviewBuffer&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot; style=&quot;color: rgb(0, 0, 255); &quot;&gt;new&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;StringBuilder&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
		&lt;span class=&quot;k&quot; style=&quot;color: rgb(0, 0, 255); &quot;&gt;using&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;List&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;kt&quot; style=&quot;color: rgb(43, 145, 175); &quot;&gt;string&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;&amp;gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Enumerator&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;enumerator&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot; style=&quot;color: rgb(0, 0, 255); &quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Lines&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;GetEnumerator&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;())&lt;/span&gt;
		&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
			&lt;span class=&quot;k&quot; style=&quot;color: rgb(0, 0, 255); &quot;&gt;while&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;enumerator&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;MoveNext&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;())&lt;/span&gt;
			&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
				&lt;span class=&quot;kt&quot; style=&quot;color: rgb(43, 145, 175); &quot;&gt;string&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;current&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;enumerator&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Current&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
				&lt;span class=&quot;k&quot; style=&quot;color: rgb(0, 0, 255); &quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(!(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;current&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;s&quot; style=&quot;color: rgb(163, 21, 21); &quot;&gt;&quot;&amp;amp;&amp;amp;1&quot;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;current&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;s&quot; style=&quot;color: rgb(163, 21, 21); &quot;&gt;&quot;&amp;amp;&amp;amp;0&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;
				&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
					&lt;span class=&quot;k&quot; style=&quot;color: rgb(0, 0, 255); &quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;PreviewBuffer&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Append&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;current&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
					&lt;span class=&quot;k&quot; style=&quot;color: rgb(0, 0, 255); &quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;PreviewBuffer&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Append&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot; style=&quot;color: rgb(163, 21, 21); &quot;&gt;&quot;\r\n&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
				&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
			&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
		&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
		&lt;span class=&quot;k&quot; style=&quot;color: rgb(0, 0, 255); &quot;&gt;return&lt;/span&gt; &lt;span class=&quot;k&quot; style=&quot;color: rgb(0, 0, 255); &quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;PreviewBuffer&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;ToString&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
	&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;background-color: transparent; border-top-width: 1px; border-top-style: none; border-top-color: rgb(204, 204, 204); border-bottom-width: 1px; border-bottom-style: none; border-bottom-color: rgb(204, 204, 204); padding-top: 10px; padding-right: 10px; padding-bottom: 10px; padding-left: 10px; font-size: 13px; font-family: 'Bitstream Vera Sans Mono', monospace; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-right-style: none; border-left-style: none; border-width: initial; border-color: initial; overflow-x: auto; overflow-y: auto; &quot;&gt;&lt;span class=&quot;p&quot;&gt;&lt;br&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;background-color: transparent; border-top-width: 1px; border-top-style: none; border-top-color: rgb(204, 204, 204); border-bottom-width: 1px; border-bottom-style: none; border-bottom-color: rgb(204, 204, 204); padding-top: 10px; padding-right: 10px; padding-bottom: 10px; padding-left: 10px; font-size: 13px; font-family: 'Bitstream Vera Sans Mono', monospace; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-right-style: none; border-left-style: none; border-width: initial; border-color: initial; overflow-x: auto; overflow-y: auto; &quot;&gt;&lt;span class=&quot;p&quot;&gt;Potete ottenere risultati come questo :&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;background-color: transparent; border-top-width: 1px; border-top-style: none; border-top-color: rgb(204, 204, 204); border-bottom-width: 1px; border-bottom-style: none; border-bottom-color: rgb(204, 204, 204); padding-top: 10px; padding-right: 10px; padding-bottom: 10px; padding-left: 10px; font-size: 13px; font-family: 'Bitstream Vera Sans Mono', monospace; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-right-style: none; border-left-style: none; border-width: initial; border-color: initial; overflow-x: auto; overflow-y: auto; &quot;&gt;&lt;img src=&quot;http://blogs.dotnethell.it/filestore/9029_img_20110613_055519.jpg&quot;&gt;&lt;/pre&gt;&lt;pre style=&quot;background-color: transparent; border-top-width: 1px; border-top-style: none; border-top-color: rgb(204, 204, 204); border-bottom-width: 1px; border-bottom-style: none; border-bottom-color: rgb(204, 204, 204); padding-top: 10px; padding-right: 10px; padding-bottom: 10px; padding-left: 10px; font-size: 13px; font-family: 'Bitstream Vera Sans Mono', monospace; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-right-style: none; border-left-style: none; border-width: initial; border-color: initial; overflow-x: auto; overflow-y: auto; &quot;&gt;&lt;br&gt;&lt;/pre&gt;&lt;pre style=&quot;background-color: transparent; border-top-width: 1px; border-top-style: none; border-top-color: rgb(204, 204, 204); border-bottom-width: 1px; border-bottom-style: none; border-bottom-color: rgb(204, 204, 204); padding-top: 10px; padding-right: 10px; padding-bottom: 10px; padding-left: 10px; font-size: 13px; font-family: 'Bitstream Vera Sans Mono', monospace; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-right-style: none; border-left-style: none; border-width: initial; border-color: initial; overflow-x: auto; overflow-y: auto; &quot;&gt;Potete, ad esempio, creare un piccolo linguaggio di markup e gestire formati di stampa diversi come ho fatto io per il mio software di gestione logistica/contabilit&#224; :&lt;/pre&gt;&lt;pre style=&quot;background-color: transparent; border-top-width: 1px; border-top-style: none; border-top-color: rgb(204, 204, 204); border-bottom-width: 1px; border-bottom-style: none; border-bottom-color: rgb(204, 204, 204); padding-top: 10px; padding-right: 10px; padding-bottom: 10px; padding-left: 10px; font-size: 13px; font-family: 'Bitstream Vera Sans Mono', monospace; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-right-style: none; border-left-style: none; border-width: initial; border-color: initial; overflow-x: auto; overflow-y: auto; &quot;&gt;&lt;br&gt;&lt;/pre&gt;&lt;pre style=&quot;background-color: transparent; border-top-width: 1px; border-top-style: none; border-top-color: rgb(204, 204, 204); border-bottom-width: 1px; border-bottom-style: none; border-bottom-color: rgb(204, 204, 204); padding-top: 10px; padding-right: 10px; padding-bottom: 10px; padding-left: 10px; font-size: 13px; font-family: 'Bitstream Vera Sans Mono', monospace; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-right-style: none; border-left-style: none; border-width: initial; border-color: initial; overflow-x: auto; overflow-y: auto; &quot;&gt;&lt;img src=&quot;http://blogs.dotnethell.it/filestore/9030_immagine.png&quot;&gt;&lt;/pre&gt;&lt;pre style=&quot;background-color: transparent; border-top-width: 1px; border-top-style: none; border-top-color: rgb(204, 204, 204); border-bottom-width: 1px; border-bottom-style: none; border-bottom-color: rgb(204, 204, 204); padding-top: 10px; padding-right: 10px; padding-bottom: 10px; padding-left: 10px; font-size: 13px; font-family: 'Bitstream Vera Sans Mono', monospace; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-right-style: none; border-left-style: none; border-width: initial; border-color: initial; overflow-x: auto; overflow-y: auto; &quot;&gt;Come potete notare attraverso alcuni tag speciali : &amp;lt;Header&amp;gt;&amp;lt;/Header&amp;gt; , &amp;lt;Body&amp;gt;&amp;lt;/Body&amp;gt;, &amp;lt;Footer&amp;gt;&amp;lt;/Footer&amp;gt;, &amp;lt;Compress&amp;gt;&amp;lt;/Compress&amp;gt;, etc...&lt;/pre&gt;&lt;pre style=&quot;background-color: transparent; border-top-width: 1px; border-top-style: none; border-top-color: rgb(204, 204, 204); border-bottom-width: 1px; border-bottom-style: none; border-bottom-color: rgb(204, 204, 204); padding-top: 10px; padding-right: 10px; padding-bottom: 10px; padding-left: 10px; font-size: 13px; font-family: 'Bitstream Vera Sans Mono', monospace; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-right-style: none; border-left-style: none; border-width: initial; border-color: initial; overflow-x: auto; overflow-y: auto; &quot;&gt;posso identificare le varie &quot;zone&quot; del formato ed operare sulla PrintEngine in modo tale da ottenere il risultato voluto.&lt;/pre&gt;&lt;pre style=&quot;background-color: transparent; border-top-width: 1px; border-top-style: none; border-top-color: rgb(204, 204, 204); border-bottom-width: 1px; border-bottom-style: none; border-bottom-color: rgb(204, 204, 204); padding-top: 10px; padding-right: 10px; padding-bottom: 10px; padding-left: 10px; font-size: 13px; font-family: 'Bitstream Vera Sans Mono', monospace; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-right-style: none; border-left-style: none; border-width: initial; border-color: initial; overflow-x: auto; overflow-y: auto; &quot;&gt;Altra cosa &quot;sfiziosa&quot; &#232; quella di creare dei &quot;posizionatori&quot;, ovvero, delle variabili (in celeste nel formato) che a runtime vengono&lt;/pre&gt;&lt;pre style=&quot;background-color: transparent; border-top-width: 1px; border-top-style: none; border-top-color: rgb(204, 204, 204); border-bottom-width: 1px; border-bottom-style: none; border-bottom-color: rgb(204, 204, 204); padding-top: 10px; padding-right: 10px; padding-bottom: 10px; padding-left: 10px; font-size: 13px; font-family: 'Bitstream Vera Sans Mono', monospace; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-right-style: none; border-left-style: none; border-width: initial; border-color: initial; overflow-x: auto; overflow-y: auto; &quot;&gt;letteralmente sostituite con i valori correnti, ad esempio : @DOMAG &#232; il magazzino del documento che a runtime verra sostituito con (1) - Centrale (vedi foto stampa).&lt;/pre&gt;&lt;pre style=&quot;background-color: transparent; border-top-width: 1px; border-top-style: none; border-top-color: rgb(204, 204, 204); border-bottom-width: 1px; border-bottom-style: none; border-bottom-color: rgb(204, 204, 204); padding-top: 10px; padding-right: 10px; padding-bottom: 10px; padding-left: 10px; font-size: 13px; font-family: 'Bitstream Vera Sans Mono', monospace; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-right-style: none; border-left-style: none; border-width: initial; border-color: initial; overflow-x: auto; overflow-y: auto; &quot;&gt;&lt;br&gt;&lt;/pre&gt;&lt;pre style=&quot;background-color: transparent; border-top-width: 1px; border-top-style: none; border-top-color: rgb(204, 204, 204); border-bottom-width: 1px; border-bottom-style: none; border-bottom-color: rgb(204, 204, 204); padding-top: 10px; padding-right: 10px; padding-bottom: 10px; padding-left: 10px; font-size: 13px; font-family: 'Bitstream Vera Sans Mono', monospace; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-right-style: none; border-left-style: none; border-width: initial; border-color: initial; overflow-x: auto; overflow-y: auto; &quot;&gt;Spero di esservi stato d'aiuto! Alla prossima!&lt;/pre&gt;&lt;pre style=&quot;background-color: transparent; border-top-width: 1px; border-top-style: none; border-top-color: rgb(204, 204, 204); border-bottom-width: 1px; border-bottom-style: none; border-bottom-color: rgb(204, 204, 204); padding-top: 10px; padding-right: 10px; padding-bottom: 10px; padding-left: 10px; font-size: 13px; font-family: 'Bitstream Vera Sans Mono', monospace; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-right-style: none; border-left-style: none; border-width: initial; border-color: initial; overflow-x: auto; overflow-y: auto; &quot;&gt;Stay Tuned!&lt;/pre&gt;&lt;pre style=&quot;background-color: transparent; border-top-width: 1px; border-top-style: none; border-top-color: rgb(204, 204, 204); border-bottom-width: 1px; border-bottom-style: none; border-bottom-color: rgb(204, 204, 204); padding-top: 10px; padding-right: 10px; padding-bottom: 10px; padding-left: 10px; font-size: 13px; font-family: 'Bitstream Vera Sans Mono', monospace; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-right-style: none; border-left-style: none; border-width: initial; border-color: initial; overflow-x: auto; overflow-y: auto; &quot;&gt;&lt;br&gt;&lt;/pre&gt;&lt;/span&gt;&lt;/div&gt;</description>
<dc:creator>Ignazio Catanzaro</dc:creator>
<slash:comments>0</slash:comments>
<comments>http://blogs.dotnethell.it/SwDev/ReadComment_17242.aspx</comments>
<category>Mobile Application</category>
</item>
<item>
<title>Auguri di buona Pasqua!</title>
<link>http://blogs.dotnethell.it/SwDev/Post_17129.aspx</link>
<pubDate>Tue, 26 Apr 2011 10:15:07 +0100</pubDate>
<source url="http://blogs.dotnethell.it/SwDev/rss.aspx">Ignazio Catanzaro</source>
<description>Anche se un po in ritardo, auguri a tutti di buona Pasqua (passata&amp;nbsp;&lt;img src=&quot;http://blogs.dotnethell.it/icons/teeth_smile.gif&quot;&gt;&amp;nbsp;).&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Spero l'abbiate trascorsa nel migliore dei modi :)&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;AUGURIIII!!!!&amp;nbsp;&lt;/div&gt;</description>
<dc:creator>Ignazio Catanzaro</dc:creator>
<slash:comments>0</slash:comments>
<comments>http://blogs.dotnethell.it/SwDev/ReadComment_17129.aspx</comments>
<category>Generale, Eventi</category>
</item>
<item>
<title>Enumeratori e Binding</title>
<link>http://blogs.dotnethell.it/SwDev/Post_17117.aspx</link>
<pubDate>Mon, 11 Apr 2011 17:14:31 +0100</pubDate>
<source url="http://blogs.dotnethell.it/SwDev/rss.aspx">Ignazio Catanzaro</source>
<description>&lt;div style=&quot;text-align: left; font-size: 10pt; font-family: 'Trebuchet MS'; &quot;&gt;Salve a Tutti!

Oggi, effettuando il refactoring di un progetto ho avuto la necessita di gestire diverse enumerazioni e i relativi Binding ai controlli, 
in pratica l'interfaccia gestisce N combobox cui Items non sono altro che i valori di un dato Enumeratore.

La questione relativamente al full framework &#232; molto semplice ovvero basta utilizzare il metodo GetValues() della classe statica Enum per
impostare come DataSource di un controllo i relativi valori dell'enumeratore :&lt;/div&gt;&lt;div&gt;&lt;font class=&quot;Apple-style-span&quot; face=&quot;'Trebuchet MS'&quot; size=&quot;2&quot;&gt;&lt;/font&gt;&lt;font class=&quot;Apple-style-span&quot; face=&quot;'Trebuchet MS'&quot; size=&quot;2&quot; style=&quot;font-size: 10pt; font-family: 'Trebuchet MS'; &quot;&gt;&lt;br&gt;&lt;/font&gt;&lt;div&gt;&lt;pre id=&quot;codeSnippet&quot; style=&quot;text-align: -webkit-auto; background-color: rgb(244, 244, 244); border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; color: black; overflow-x: visible; overflow-y: visible; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; width: 1156px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; direction: ltr; font-family: 'Trebuchet MS'; font-size: small; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: 'Courier New', Courier, monospace; font-size: 11px; line-height: 16px; &quot;&gt;tuaComboBox.DataSource = Enum.GetValues( &lt;span style=&quot;color: #0000ff;&quot;&gt;typeof&lt;/span&gt; ( TuoEnumeratore ) );&lt;/span&gt;&lt;/pre&gt;

&lt;br&gt;&lt;div style=&quot;text-align: left; font-size: 10pt; font-family: 'Trebuchet MS'; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small; &quot;&gt;Per quanto concerne il Compact Framework invece, la questione &#232; leggermente pi&#249; complessa in quanto il metodo GetValues non &#232; implementato.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left; font-family: 'Trebuchet MS'; font-size: 10pt; &quot;&gt;&lt;font class=&quot;Apple-style-span&quot; face=&quot;'Trebuchet MS'&quot;&gt;&lt;br&gt;&lt;/font&gt;&lt;/div&gt;&lt;font class=&quot;Apple-style-span&quot; face=&quot;'Trebuchet MS'&quot; size=&quot;2&quot; style=&quot;font-size: 10pt; font-family: 'Trebuchet MS'; &quot;&gt;&lt;div style=&quot;text-align: left;&quot;&gt;Abbiamo bisogno quindi di un metodo che dato come parametro l'istanza di un Enumeratore ci ritorni una lista o un'interfaccia IEnumerable :&lt;/div&gt;&lt;/font&gt;&lt;br&gt;&lt;pre id=&quot;codeSnippet&quot; style=&quot;background-color: rgb(244, 244, 244); font-family: 'Courier New', Courier, monospace; font-size: 8pt; line-height: 12pt; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; color: black; overflow-x: visible; overflow-y: visible; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; width: 100%; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; direction: ltr; text-align: left; &quot;&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;    public&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;static&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;class&lt;/span&gt; Utilies&lt;br&gt;    {&lt;br&gt;        &lt;span style=&quot;color: #0000ff;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;static&lt;/span&gt; IEnumerable&amp;lt;Enum&amp;gt; EnumToList(Enum Enumeratore)&lt;br&gt;        {&lt;br&gt;            List&amp;lt;Enum&amp;gt; _enumerazioni = &lt;span style=&quot;color: #0000ff;&quot;&gt;new&lt;/span&gt; List&amp;lt;Enum&amp;gt;();&lt;br&gt;            &lt;span style=&quot;color: #0000ff;&quot;&gt;foreach&lt;/span&gt; (FieldInfo InfoValori &lt;span style=&quot;color: #0000ff;&quot;&gt;in&lt;/span&gt; Enumeratore.GetType().GetFields(BindingFlags.Public))&lt;br&gt;            {&lt;br&gt;                _enumerazioni.Add((Enum)InfoValori.GetValue(Enumeratore));&lt;br&gt;            }&lt;br&gt;            &lt;span style=&quot;color: #0000ff;&quot;&gt;return&lt;/span&gt; _enumerazioni;&lt;br&gt;        }&lt;br&gt;    }
&lt;/pre&gt;&lt;br&gt;&lt;div style=&quot;text-align: left; font-family: 'Trebuchet MS'; font-size: 10pt; &quot;&gt;&lt;font class=&quot;Apple-style-span&quot; face=&quot;'Trebuchet MS'&quot; size=&quot;2&quot; style=&quot;font-size: 10pt; font-family: 'Trebuchet MS'; &quot;&gt;Il metodo si utilizza molto semplicemente in&lt;/font&gt;&lt;font class=&quot;Apple-style-span&quot; face=&quot;'Trebuchet MS'&quot; size=&quot;2&quot; style=&quot;font-size: 10pt; font-family: 'Trebuchet MS'; &quot;&gt;&amp;nbsp;questa maniera :&lt;/font&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left; font-family: 'Trebuchet MS'; font-size: 10pt; &quot;&gt;&lt;br&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left; &quot;&gt;&lt;i&gt;tuaComboBox.DataSource = EnumToList(new TuoEnumeratore());&lt;/i&gt;&lt;/div&gt;&lt;br&gt;&lt;font class=&quot;Apple-style-span&quot; face=&quot;'Trebuchet MS'&quot; size=&quot;2&quot; style=&quot;font-size: 10pt; font-family: 'Trebuchet MS'; &quot;&gt;Stay Tuned ;)&lt;/font&gt;&lt;/div&gt;&lt;/div&gt;</description>
<dc:creator>Ignazio Catanzaro</dc:creator>
<slash:comments>0</slash:comments>
<comments>http://blogs.dotnethell.it/SwDev/ReadComment_17117.aspx</comments>
<category>Framework .Net</category>
</item>
</channel>
</rss>
