<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://www.dotnetzone.gr:443/cs/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>.NET Framework</title><link>https://www.dotnetzone.gr:443/cs/forums/14/ShowForum.aspx</link><description>Θέματα για threading, remoting, reflection, exception handling, security, regex κλπ.</description><dc:language>el</dc:language><generator>CommunityServer 2.1 SP3 (Build: 20423.1)</generator><item><title>Απ: Overriden methods in anonymous types?</title><link>https://www.dotnetzone.gr:443/cs/forums/thread/67415.aspx</link><pubDate>Tue, 20 Sep 2011 16:02:20 GMT</pubDate><guid isPermaLink="false">2622095e-976c-431a-859e-16783ec7ecd7:67415</guid><dc:creator>dimos.homatas</dc:creator><slash:comments>0</slash:comments><comments>https://www.dotnetzone.gr:443/cs/forums/thread/67415.aspx</comments><wfw:commentRss>https://www.dotnetzone.gr:443/cs/forums/commentrss.aspx?SectionID=14&amp;PostID=67415</wfw:commentRss><description>Είναι αυτό που λέμε "you nailed it"!&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Thanks Μάρκο!&lt;/div&gt;</description></item><item><title>Απ: Overriden methods in anonymous types?</title><link>https://www.dotnetzone.gr:443/cs/forums/thread/67408.aspx</link><pubDate>Tue, 20 Sep 2011 01:14:53 GMT</pubDate><guid isPermaLink="false">2622095e-976c-431a-859e-16783ec7ecd7:67408</guid><dc:creator>Markos</dc:creator><slash:comments>0</slash:comments><comments>https://www.dotnetzone.gr:443/cs/forums/thread/67408.aspx</comments><wfw:commentRss>https://www.dotnetzone.gr:443/cs/forums/commentrss.aspx?SectionID=14&amp;PostID=67408</wfw:commentRss><description>Δε νομίζω ότι μπορεί να γίνει κάτι. Το &lt;a href="http://msdn.microsoft.com/en-us/library/bb384767.aspx"&gt;documentation &lt;/a&gt;το ξεκαθαρίζει:&lt;br&gt;&lt;br&gt;&lt;p&gt;&lt;i&gt;In response to the declaration 
of an instance of an anonymous type, &lt;b&gt;the compiler creates a new class 
definition that contains the specified properties&lt;/b&gt;.&lt;/i&gt;&lt;/p&gt;&lt;i&gt;
&lt;/i&gt;&lt;p&gt;&lt;i&gt;&lt;b&gt;If the anonymous type contains at least one key property, the definition overrides three members inherited from &lt;span&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.object.aspx"&gt;Object&lt;/a&gt;&lt;/span&gt;: &lt;span&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.object.equals.aspx"&gt;Equals&lt;/a&gt;&lt;/span&gt;, &lt;span&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.object.gethashcode.aspx"&gt;GetHashCode&lt;/a&gt;&lt;/span&gt;, and &lt;span&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.object.tostring.aspx"&gt;ToString&lt;/a&gt;&lt;/span&gt;.&lt;/b&gt;
 The code produced for testing equality and determining the hash code 
value considers only the key properties. &lt;b&gt;If the anonymous type contains 
no key properties, only &lt;span&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.object.tostring.aspx"&gt;ToString&lt;/a&gt;&lt;/span&gt;
 is overridden.&lt;/b&gt; Explicitly named properties of an anonymous type cannot 
conflict with these generated methods. That is, you cannot use &lt;span class="code"&gt;.Equals&lt;/span&gt;, &lt;span class="code"&gt;.GetHashCode&lt;/span&gt;, or &lt;span class="code"&gt;.ToString&lt;/span&gt; to name a property.&lt;/i&gt;&lt;/p&gt;&lt;p&gt;&lt;br&gt;&lt;/p&gt;&lt;p&gt;Οπότε το delegate είναι η μόνη σου επιλογή.&lt;br&gt;&lt;/p&gt;</description></item><item><title>Απ: Overriden methods in anonymous types?</title><link>https://www.dotnetzone.gr:443/cs/forums/thread/67404.aspx</link><pubDate>Mon, 19 Sep 2011 20:46:31 GMT</pubDate><guid isPermaLink="false">2622095e-976c-431a-859e-16783ec7ecd7:67404</guid><dc:creator>dimos.homatas</dc:creator><slash:comments>0</slash:comments><comments>https://www.dotnetzone.gr:443/cs/forums/thread/67404.aspx</comments><wfw:commentRss>https://www.dotnetzone.gr:443/cs/forums/commentrss.aspx?SectionID=14&amp;PostID=67404</wfw:commentRss><description>Ε, λίγη τύφλα που και που δικαιολογείται! Ευχαριστώ, θα το τσεκάρω, αν και με μία πρώτη ματιά μου φαίνεται ότι μοιάζει αρκετά με αυτό που έκανα - με την διαφορά ότι έχω ένα property Action&amp;lt;string&amp;gt; και όχι ένα delegate Func&amp;lt;string&amp;gt;. Παρόλα αυτά, δεν ξέρω τι θα συμβεί με το override ToString(). Θα πειραματιστώ και θα επανέλθω.</description></item><item><title>Απ: Overriden methods in anonymous types?</title><link>https://www.dotnetzone.gr:443/cs/forums/thread/67399.aspx</link><pubDate>Mon, 19 Sep 2011 19:07:17 GMT</pubDate><guid isPermaLink="false">2622095e-976c-431a-859e-16783ec7ecd7:67399</guid><dc:creator>Markos</dc:creator><slash:comments>0</slash:comments><comments>https://www.dotnetzone.gr:443/cs/forums/thread/67399.aspx</comments><wfw:commentRss>https://www.dotnetzone.gr:443/cs/forums/commentrss.aspx?SectionID=14&amp;PostID=67399</wfw:commentRss><description>&lt;strike&gt;Αυτά τα λένε από την αρχή&lt;/strike&gt;!! Ειλικρινά, δεν το κατάλαβα από το αρχικό post. Ίσως &lt;a href="http://community.devexpress.com/blogs/paulk/archive/2009/02/26/adding-generic-anonymous-delegates-to-linq-anonymous-types.aspx"&gt;αυτή &lt;/a&gt;η δημοσίευση σου φανεί χρήσιμη.&lt;br&gt;&lt;br&gt;[EDIT] =&amp;gt; Μια χαρά ανέφερες το anonymous type. Εγώ έπαθα "τύφλωση"...&lt;br&gt;</description></item><item><title>Απ: Overriden methods in anonymous types?</title><link>https://www.dotnetzone.gr:443/cs/forums/thread/67398.aspx</link><pubDate>Mon, 19 Sep 2011 18:51:31 GMT</pubDate><guid isPermaLink="false">2622095e-976c-431a-859e-16783ec7ecd7:67398</guid><dc:creator>dimos.homatas</dc:creator><slash:comments>0</slash:comments><comments>https://www.dotnetzone.gr:443/cs/forums/thread/67398.aspx</comments><wfw:commentRss>https://www.dotnetzone.gr:443/cs/forums/commentrss.aspx?SectionID=14&amp;PostID=67398</wfw:commentRss><description>Έχω anonymous type προερχόμενο από ένα Linq query και θα ήθελα να αποφύγω το να δημιουργήσω νέα κλάση (αν και τελικά αυτό έχω κάνει).</description></item><item><title>Απ: Overriden methods in anonymous types?</title><link>https://www.dotnetzone.gr:443/cs/forums/thread/67394.aspx</link><pubDate>Mon, 19 Sep 2011 18:30:51 GMT</pubDate><guid isPermaLink="false">2622095e-976c-431a-859e-16783ec7ecd7:67394</guid><dc:creator>Markos</dc:creator><slash:comments>0</slash:comments><comments>https://www.dotnetzone.gr:443/cs/forums/thread/67394.aspx</comments><wfw:commentRss>https://www.dotnetzone.gr:443/cs/forums/commentrss.aspx?SectionID=14&amp;PostID=67394</wfw:commentRss><description>Η μέθοδος ToString() μπορεί να γίνει override σε οτιδήποτε κληρονομεί από το &lt;a href="http://msdn.microsoft.com/en-us/library/system.object.tostring.aspx"&gt;Object&lt;/a&gt;. Κάτι σαν το παρακάτω δεν σου κάνει;&lt;br&gt;&lt;br&gt;&lt;pre&gt;&lt;span style="color:Black;background-color:Transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;&lt;span style="color:Blue;background-color:Transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;public&lt;/span&gt; &lt;span style="color:Blue;background-color:Transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;class&lt;/span&gt; Test&amp;lt;T&amp;gt; where T:&lt;span style="color:Blue;background-color:Transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;class&lt;/span&gt;
{
   &lt;span style="color:Blue;background-color:Transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;public&lt;/span&gt; &lt;span style="color:Blue;background-color:Transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;override&lt;/span&gt; &lt;span style="color:Blue;background-color:Transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;string&lt;/span&gt; ToString()
   {
        &lt;span style="color:Blue;background-color:Transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;return&lt;/span&gt; &lt;span style="color:Blue;background-color:Transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;base&lt;/span&gt;.ToString(); &lt;span style="color:Green;background-color:Transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;// ή ό,τι άλλο θέλεις...&lt;/span&gt;
   }
}&lt;/span&gt;&lt;/pre&gt;&lt;br&gt;</description></item><item><title>Overriden methods in anonymous types?</title><link>https://www.dotnetzone.gr:443/cs/forums/thread/67387.aspx</link><pubDate>Mon, 19 Sep 2011 17:17:37 GMT</pubDate><guid isPermaLink="false">2622095e-976c-431a-859e-16783ec7ecd7:67387</guid><dc:creator>dimos.homatas</dc:creator><slash:comments>0</slash:comments><comments>https://www.dotnetzone.gr:443/cs/forums/thread/67387.aspx</comments><wfw:commentRss>https://www.dotnetzone.gr:443/cs/forums/commentrss.aspx?SectionID=14&amp;PostID=67387</wfw:commentRss><description>Καλημέρα σας,&amp;nbsp;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;παράγω κάποια στιγμή σε ένα function μία λίστα ενός anonymous type, τα οποία και θέλω να προσθέσω σε ένα listbox (winforms).&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Το ερώτημα είναι:&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Μπορώ να προσθέσω ένα override της ToString() ; Έχει καταρχάς το anonymous type την ToString() ;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Αυτό που θέλω είναι να τα βάλω στο listbox - όταν βάζεις ένα object σε ένα listbox (αντί για string) τότε σαν listitem υπάρχει το object, αλλά σαν εμφάνιση υπάρχει ότι δίνει η ToString()&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Έχω την εντύπωση ότι δεν γίνεται...&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Δοκίμασα μια "χακιά" - έφτιαξα ένα Action&amp;lt;string&amp;gt; ονόματι ToString&amp;nbsp;&lt;img src="http://www.dotnetzone.gr/cs/emoticons/emotion-2.gif" alt="Big Smile" /&gt; , έλεγα μπας και, αλλά ενώ μπορείς να το καλέσεις από τον κώδικα κανονικά με ToString(), ε, δεν γίνεται η δουλειά!&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Φαντάζομαι ότι κάτι παίζει με την base class του object ή κάτι τέτοιο - μήπως τα anonymous types δεν κάνουν inherit το System.Object...&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Τέλος πάντων, δεν είναι κάτι επείγον, απλά έφαγα το σκάλωμα, καταλαβαίνετε&amp;nbsp;&lt;img src="http://www.dotnetzone.gr/cs/emoticons/emotion-1.gif" alt="Smile" /&gt;&lt;/div&gt;</description></item></channel></rss>