<?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>Πρώτα Βήματα - Γλώσσες προγραμματισμού</title><link>https://www.dotnetzone.gr:443/cs/forums/74/ShowForum.aspx</link><description>Τα πρώτα βήματα στις γλώσσες VB6, VB.NET, και C#</description><dc:language>el</dc:language><generator>CommunityServer 2.1 SP3 (Build: 20423.1)</generator><item><title>Απ: Operator=</title><link>https://www.dotnetzone.gr:443/cs/forums/thread/38213.aspx</link><pubDate>Tue, 11 Dec 2007 22:33:44 GMT</pubDate><guid isPermaLink="false">2622095e-976c-431a-859e-16783ec7ecd7:38213</guid><dc:creator>Alexander</dc:creator><slash:comments>0</slash:comments><comments>https://www.dotnetzone.gr:443/cs/forums/thread/38213.aspx</comments><wfw:commentRss>https://www.dotnetzone.gr:443/cs/forums/commentrss.aspx?SectionID=74&amp;PostID=38213</wfw:commentRss><description>Κι εγώ αυτό είχα στο μυαλό μου, ότι με C++ γίνεται, γι αυτό μπερδευόμουνα, ευχαριστώ...&lt;br&gt;</description></item><item><title>Απ: Operator=</title><link>https://www.dotnetzone.gr:443/cs/forums/thread/38074.aspx</link><pubDate>Fri, 07 Dec 2007 06:43:41 GMT</pubDate><guid isPermaLink="false">2622095e-976c-431a-859e-16783ec7ecd7:38074</guid><dc:creator>Παναγιώτης Καναβός</dc:creator><slash:comments>0</slash:comments><comments>https://www.dotnetzone.gr:443/cs/forums/thread/38074.aspx</comments><wfw:commentRss>https://www.dotnetzone.gr:443/cs/forums/commentrss.aspx?SectionID=74&amp;PostID=38074</wfw:commentRss><description>&lt;P&gt;Άκουγα πρόσφατα ένα podcast του .NET Rocks, το οποίο ξεκίνησε λέγοντας γιατί ΔΕΝ πρέπει να χρησιμοποιούμε το IClonable! Ο λόγος είναι ότι δεν είναι καθορισμένο αν το IClonable.Clone κάνει shalow copy ή deep copy. Το αποτέλεσμα είναι ότι όποιος καλεί την Clone δεν ξέρει τελικά αν αυτό που θα πάρει θα είναι ένα deep ή ένα shallow copy του αντικειμένου. Γι αυτό στο podcast προτείνανε να μην χρησιμοποιεί κανείς το ICloneable αλλά απλά να προσθέσει τις δικές του μεθόδους στην κλάση του.&lt;/P&gt;
&lt;P&gt;Εδώ που τα λέμε πάντως, δεν είναι και τόσο καλή ιδέα να κάνει κάποιος override τον operator =. Ο operator = έχει μία πολύ συγκεκριμένη δουλειά στο .ΝΕΤ. Όποιος προγραμματιστής χρησιμοποιεί το = περιμένει να κάνει δύο πράγματα: να δημιουργήσει ένα reference, αν μιλάμε για κλάση, ή ένα αντίγραφο, αν μιλάμε για value type. Αν κάποιος αλλάξει το τί κάνει ο operator = μπορεί να προκαλέσει σύγχυση σε όσους τον χρησιμοποιήσουν.&lt;/P&gt;
&lt;P&gt;Σίγουρα όμως μου λείπουν τα κόλπα που κάναμε με τον operator = στη C++, ειδικά τον παλιό καλό καιρό όταν μόλις είχαν δημιουργηθεί οι auto_pointer κλάσεις και ο καθένας έφτιαχνε τη δική του, με τις δικές του βελτιώσεις φυσικά!&lt;/P&gt;</description></item><item><title>Απ: Operator=</title><link>https://www.dotnetzone.gr:443/cs/forums/thread/38068.aspx</link><pubDate>Fri, 07 Dec 2007 02:16:39 GMT</pubDate><guid isPermaLink="false">2622095e-976c-431a-859e-16783ec7ecd7:38068</guid><dc:creator>Νατάσα Μανουσοπούλου</dc:creator><slash:comments>0</slash:comments><comments>https://www.dotnetzone.gr:443/cs/forums/thread/38068.aspx</comments><wfw:commentRss>https://www.dotnetzone.gr:443/cs/forums/commentrss.aspx?SectionID=74&amp;PostID=38068</wfw:commentRss><description>Αυτός είναι ένας από τους περιορισμούς της C# που πάντα μου την έδινε στα νεύρα, ιδιαίτερα γιατί στη C++ είναι τόσο απλό να κάνεις overload ό,τι τελεστή τραβά η ψυχή σου &lt;img src="http://www.dotnetzone.gr/cs/emoticons/emotion-1.gif" alt="Smile" /&gt; Ο "ορθόδοξος" τρόπος για να το κάνεις αυτό είναι να υλοποιήσεις το IClonable interface που περιέχει την εξής μια method: Clone(). Αν όμως θέλεις απλά να δημιουργήσεις ένα αντίγραφο με όλα τα πεδία ίδια, τα οποία έχουν τιμές values ή strings, και όχι references σε άλλα objects, τότε σου αρκεί η&amp;nbsp;έτοιμη&amp;nbsp;Object.MemberwiseClone() που κάνει shallow copy.</description></item><item><title>Απ: Operator=</title><link>https://www.dotnetzone.gr:443/cs/forums/thread/38049.aspx</link><pubDate>Thu, 06 Dec 2007 21:31:35 GMT</pubDate><guid isPermaLink="false">2622095e-976c-431a-859e-16783ec7ecd7:38049</guid><dc:creator>Alexander</dc:creator><slash:comments>0</slash:comments><comments>https://www.dotnetzone.gr:443/cs/forums/thread/38049.aspx</comments><wfw:commentRss>https://www.dotnetzone.gr:443/cs/forums/commentrss.aspx?SectionID=74&amp;PostID=38049</wfw:commentRss><description>Ναι, κάτι τέτοιο έκανα τελικά. Πιο πολύ σαν απορία το είχα γιατί αν και
έψαξα λίγο, βρήκα για πολλούς άλλους operators, αλλά όχι για τον =, και
δεν αναφερόταν κάτι γι αυτό. Σαν λάθος έπαιρνα αυτό:&amp;nbsp;&amp;nbsp;&amp;nbsp;
Overloadable unary operator expected&amp;nbsp;&amp;nbsp; &lt;br&gt;
&lt;br&gt;</description></item><item><title>Απ: Operator=</title><link>https://www.dotnetzone.gr:443/cs/forums/thread/38048.aspx</link><pubDate>Thu, 06 Dec 2007 21:14:19 GMT</pubDate><guid isPermaLink="false">2622095e-976c-431a-859e-16783ec7ecd7:38048</guid><dc:creator>Nassos.NET</dc:creator><slash:comments>0</slash:comments><comments>https://www.dotnetzone.gr:443/cs/forums/thread/38048.aspx</comments><wfw:commentRss>https://www.dotnetzone.gr:443/cs/forums/commentrss.aspx?SectionID=74&amp;PostID=38048</wfw:commentRss><description>&lt;P&gt;Καλησπέρα Αλέξανδρε,&lt;/P&gt;
&lt;P&gt;Γιατί δεν κάνεις μια μεθοδο Clone()&amp;nbsp;και μία CopyFrom..&amp;nbsp;στην Class σου?&lt;/P&gt;
&lt;P&gt;πχ.&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:black;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;&lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;&lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:black;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;&lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;public&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;class&lt;/SPAN&gt; Person&lt;BR&gt;{&lt;BR&gt;&lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;public&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;string&lt;/SPAN&gt; Name;&lt;BR&gt;&lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;public&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;string&lt;/SPAN&gt; Surmane;&lt;BR&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;...&lt;BR&gt;&lt;BR&gt;&lt;BR&gt;&lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;public&lt;/SPAN&gt; Person Clone()&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Person retPerson &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:red;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;new&lt;/SPAN&gt; Person();&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;retPerson.Name &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:red;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;this&lt;/SPAN&gt;.Name;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;retPerson.Surname &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:red;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;this&lt;/SPAN&gt;.Surname;&lt;BR&gt;&lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return&lt;/SPAN&gt; retPerson;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;BR&gt;&lt;BR&gt;&lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;public&lt;/SPAN&gt; CopyFromPearson (Person p)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;BR&gt;&lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;this&lt;/SPAN&gt;.Name &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:red;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;=&lt;/SPAN&gt; p.Name;&lt;BR&gt;&lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;this&lt;/SPAN&gt;.Surname &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:red;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;=&lt;/SPAN&gt; p.Surname;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;BR&gt;} &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:black;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;&lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;&lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:black;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:black;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;&lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;&lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:black;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;Nassos&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description></item><item><title>Απ: Operator=</title><link>https://www.dotnetzone.gr:443/cs/forums/thread/38045.aspx</link><pubDate>Thu, 06 Dec 2007 20:31:05 GMT</pubDate><guid isPermaLink="false">2622095e-976c-431a-859e-16783ec7ecd7:38045</guid><dc:creator>Alexander</dc:creator><slash:comments>0</slash:comments><comments>https://www.dotnetzone.gr:443/cs/forums/thread/38045.aspx</comments><wfw:commentRss>https://www.dotnetzone.gr:443/cs/forums/commentrss.aspx?SectionID=74&amp;PostID=38045</wfw:commentRss><description>Ακριβώς , αλλά όχι για να συγκρίνω, για να αναθέτω τιμές (π.χ. σε ένα νέο αντικείμενο τις τιμές ενός παλιού)&lt;br&gt;</description></item><item><title>Απ: Operator=</title><link>https://www.dotnetzone.gr:443/cs/forums/thread/38044.aspx</link><pubDate>Thu, 06 Dec 2007 20:24:08 GMT</pubDate><guid isPermaLink="false">2622095e-976c-431a-859e-16783ec7ecd7:38044</guid><dc:creator>George J. Capnias</dc:creator><slash:comments>0</slash:comments><comments>https://www.dotnetzone.gr:443/cs/forums/thread/38044.aspx</comments><wfw:commentRss>https://www.dotnetzone.gr:443/cs/forums/commentrss.aspx?SectionID=74&amp;PostID=38044</wfw:commentRss><description>&lt;P&gt;Τι ακριβώς εννοείς; Εννοείς να μπορέσεις να ορίσεις τον operator όπως θέλεις για να μπορείς να χρησιμοποιήσεις για να συγκρίνεις δυο objects που προέρχονται από μία δική σου κλάση;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;George J.&lt;BR&gt;&lt;/P&gt;</description></item><item><title>Operator=</title><link>https://www.dotnetzone.gr:443/cs/forums/thread/38043.aspx</link><pubDate>Thu, 06 Dec 2007 20:15:00 GMT</pubDate><guid isPermaLink="false">2622095e-976c-431a-859e-16783ec7ecd7:38043</guid><dc:creator>Alexander</dc:creator><slash:comments>0</slash:comments><comments>https://www.dotnetzone.gr:443/cs/forums/thread/38043.aspx</comments><wfw:commentRss>https://www.dotnetzone.gr:443/cs/forums/commentrss.aspx?SectionID=74&amp;PostID=38043</wfw:commentRss><description>Καλημέρα, &lt;br&gt;
πώς μπορώ να ορίσω τον operator= ;&lt;br&gt;
(σε C#)&lt;br&gt;
&lt;br&gt;</description></item></channel></rss>