<?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>WinForms</title><link>https://www.dotnetzone.gr:443/cs/forums/12/ShowForum.aspx</link><description>Θέματα για rich client / windows εφαρμογές, σε οποιαδήποτε γλώσσα (VB.NET, C#, managed C++, κ.α.)</description><dc:language>el</dc:language><generator>CommunityServer 2.1 SP3 (Build: 20423.1)</generator><item><title>Απ: Πως πιανεις το Exception thrown από ένα property που αλλαζει μέσο DataBinding</title><link>https://www.dotnetzone.gr:443/cs/forums/thread/20626.aspx</link><pubDate>Fri, 17 Nov 2006 23:09:55 GMT</pubDate><guid isPermaLink="false">2622095e-976c-431a-859e-16783ec7ecd7:20626</guid><dc:creator>Nassos.NET</dc:creator><slash:comments>0</slash:comments><comments>https://www.dotnetzone.gr:443/cs/forums/thread/20626.aspx</comments><wfw:commentRss>https://www.dotnetzone.gr:443/cs/forums/commentrss.aspx?SectionID=12&amp;PostID=20626</wfw:commentRss><description>Spot on!!!! mns &lt;br /&gt;
&lt;br /&gt;
Thnx a million&lt;br /&gt;
&lt;br /&gt;
Είναι το ΜΟΝΟ event που γίνετε Fire&lt;br /&gt;
&lt;br /&gt;
nice ;)</description></item><item><title>Απ: Πως πιανεις το Exception thrown από ένα property που αλλαζει μέσο DataBinding</title><link>https://www.dotnetzone.gr:443/cs/forums/thread/20621.aspx</link><pubDate>Fri, 17 Nov 2006 21:54:46 GMT</pubDate><guid isPermaLink="false">2622095e-976c-431a-859e-16783ec7ecd7:20621</guid><dc:creator>Νατάσα Μανουσοπούλου</dc:creator><slash:comments>0</slash:comments><comments>https://www.dotnetzone.gr:443/cs/forums/thread/20621.aspx</comments><wfw:commentRss>https://www.dotnetzone.gr:443/cs/forums/commentrss.aspx?SectionID=12&amp;PostID=20621</wfw:commentRss><description>Θα μπορούσες στη φόρμα σου να πιάσεις το Parse event του Binding, κι εκεί είτε:&lt;br&gt;&lt;ul&gt;&lt;li&gt;Να καλείς την CanBeTheUserAdmin και αν επιστρέψει false να βγάζεις εσύ το μήνυμα και να κάνεις το ConvertEventArgs.Value πάλι false. Αυτό επαναλαμβάνει τον κώδικα του domain σου.&lt;/li&gt;&lt;li&gt;Να δοκιμάζεις μόνος σου σε ένα try/catch να θέσεις την τιμή, και στο catch να&amp;nbsp;βγάζεις εσύ το μήνυμα και να κάνεις το ConvertEventArgs.Value πάλι false.&lt;/li&gt;&lt;/ul&gt;Επίσης θα ήταν καλό να αλλάξεις το exception type σε κάτι πιο ειδικό από το Exception.&lt;br&gt;&lt;br&gt;</description></item><item><title>Απ: Πως πιανεις το Exception thrown από ένα property που αλλαζει μέσο DataBinding</title><link>https://www.dotnetzone.gr:443/cs/forums/thread/20620.aspx</link><pubDate>Fri, 17 Nov 2006 21:35:49 GMT</pubDate><guid isPermaLink="false">2622095e-976c-431a-859e-16783ec7ecd7:20620</guid><dc:creator>Nassos.NET</dc:creator><slash:comments>0</slash:comments><comments>https://www.dotnetzone.gr:443/cs/forums/thread/20620.aspx</comments><wfw:commentRss>https://www.dotnetzone.gr:443/cs/forums/commentrss.aspx?SectionID=12&amp;PostID=20620</wfw:commentRss><description>Spantos,&lt;br /&gt;
&lt;br /&gt;
Το έκανα και αυτό, το ίδιο προβλημα, δεν 'χτυπαει' το Event!!! και εγω πηγα μέσω της MSDN και τίποτα!!!&lt;br /&gt;
&lt;br /&gt;
thanx παντος για την Απάντηση&lt;br /&gt;
&lt;br /&gt;
Νασος</description></item><item><title>Απ: Πως πιανεις το Exception thrown από ένα property που αλλαζει μέσο DataBinding</title><link>https://www.dotnetzone.gr:443/cs/forums/thread/20611.aspx</link><pubDate>Fri, 17 Nov 2006 20:44:53 GMT</pubDate><guid isPermaLink="false">2622095e-976c-431a-859e-16783ec7ecd7:20611</guid><dc:creator>spantos</dc:creator><slash:comments>0</slash:comments><comments>https://www.dotnetzone.gr:443/cs/forums/thread/20611.aspx</comments><wfw:commentRss>https://www.dotnetzone.gr:443/cs/forums/commentrss.aspx?SectionID=12&amp;PostID=20611</wfw:commentRss><description>&lt;font face="Arial" size="2"&gt;Μπορείς να χρησιμοποιήσεις το BindingComplete event του &lt;/font&gt;&lt;font face="Arial" size="2"&gt;&lt;span style="color: Black; background-color: transparent; font-family: Courier New; font-size: 11px; font-weight: normal;"&gt;Binding adminBind αντικειμένου. Σύμφωνα με το documentation:&lt;br&gt;&lt;/span&gt;&lt;/font&gt;&lt;p&gt;&lt;font face="Arial" size="2"&gt;"Occurs when a binding operation is complete, such as when data is pushed to 
the control property from the data source or vice versa&lt;/font&gt;&lt;/p&gt;&lt;font face="Arial" size="2"&gt;&lt;span style="cursor: default;"&gt;Remarks&lt;/span&gt;&lt;/font&gt;
&lt;div class="section" id="remarksSection"&gt;
&lt;p&gt;&lt;font face="Arial" size="2"&gt;This event is raised under any of the following conditions: &lt;/font&gt;&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;
&lt;p&gt;&lt;font face="Arial" size="2"&gt;Data from the data source is pushed onto the control property.&lt;/font&gt;&lt;/p&gt;
&lt;/li&gt;&lt;li&gt;
&lt;p&gt;&lt;font face="Arial" size="2"&gt;Data from the control property is pushed onto the data source.&lt;/font&gt;&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;&lt;font face="Arial" size="2"&gt;This event is raised at the completion of these operations, independent of 
the completion status. For example,&lt;b&gt; &lt;u&gt;&lt;i&gt;if a binding operation binds a null value to 
a &lt;a&gt;Value&lt;/a&gt; property, 
an exception is thrown, but the &lt;/i&gt;&lt;/u&gt;&lt;/b&gt;&lt;u&gt;&lt;i&gt;&lt;b&gt;BindingComplete event still occurs&lt;/b&gt;&lt;/i&gt;&lt;/u&gt;. The 
handler of this event can take the appropriate action, based on the success, 
error, or exceptions in the binding process, by examining the &lt;a&gt;BindingCompleteState&lt;/a&gt; 
property of the &lt;a&gt;BindingCompleteEventArgs&lt;/a&gt; 
parameter."&lt;br&gt;&lt;/font&gt;&lt;/p&gt;&lt;p&gt;&lt;font face="Arial" size="2"&gt;Ελπίζω αυτό να βοηθάει...&lt;br&gt;&lt;/font&gt;&lt;/p&gt;
&lt;/div&gt;&lt;font face="Arial" size="2"&gt;&lt;span style="color: Black; background-color: transparent; font-family: Courier New; font-size: 11px; font-weight: normal;"&gt;&lt;br&gt;&lt;/span&gt;&lt;/font&gt;</description></item><item><title>Πως πιανεις το Exception thrown από ένα property που αλλαζει μέσο DataBinding</title><link>https://www.dotnetzone.gr:443/cs/forums/thread/20608.aspx</link><pubDate>Fri, 17 Nov 2006 20:19:35 GMT</pubDate><guid isPermaLink="false">2622095e-976c-431a-859e-16783ec7ecd7:20608</guid><dc:creator>Nassos.NET</dc:creator><slash:comments>0</slash:comments><comments>https://www.dotnetzone.gr:443/cs/forums/thread/20608.aspx</comments><wfw:commentRss>https://www.dotnetzone.gr:443/cs/forums/commentrss.aspx?SectionID=12&amp;PostID=20608</wfw:commentRss><description>&lt;P&gt;Οκ έχω κάτι δύσκολο, ελπίζω να το ξέρει κάποιος.&lt;/P&gt;
&lt;P&gt;Έχω ενα Property σε ενα Class που κάτω απο ορισμένες συνθίκες throws ένα Exception ο Κώδικας του Property :&lt;/P&gt;
&lt;P&gt;&lt;span style="color: Black;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt; &lt;br /&gt;&lt;br /&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;bool&lt;/span&gt; IsAdministrator&lt;br /&gt;{&lt;br /&gt;   get { &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;return&lt;/span&gt; Convert.ToBoolean(_Record.WL_ISADMIN.Value); }&lt;br /&gt;   set&lt;br /&gt;   {&lt;br /&gt;      &lt;span style="color: Green;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;//If the New value is true&lt;/span&gt;&lt;br /&gt;      &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;if&lt;/span&gt; (value)&lt;br /&gt;      {&lt;br /&gt;         &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;if&lt;/span&gt; (CanBeTheUserAdmin())&lt;span style="color: Green;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;//Check if the Garage Has Admin User&lt;/span&gt;&lt;br /&gt;         {&lt;br /&gt;            &lt;span style="color: Green;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;//No Admin User, This Becomes Admin&lt;/span&gt;&lt;br /&gt;            _Record.WL_ISADMIN.Value &lt;span style="color: Red;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;=&lt;/span&gt; value;&lt;br /&gt;         }&lt;br /&gt;         &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;else&lt;/span&gt;&lt;span style="color: Green;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;//If the Garage Has Admin User throw Exception&lt;/span&gt;&lt;br /&gt;            &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;throw&lt;/span&gt; &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;new&lt;/span&gt; Exception(&lt;span style="color: #666666;background-color: #e4e4e4;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;"Δεν Μπορείτε να κάνετε τον Χρήστη Administrator διότι Υπαρχει ήδη Administrator για το Συνεργείο!!"&lt;/span&gt;);&lt;br /&gt;   }&lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;else&lt;/span&gt;&lt;span style="color: Green;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;//If the New value is False, applying it to the user&lt;/span&gt;&lt;br /&gt;      _Record.WL_ISADMIN.Value &lt;span style="color: Red;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;=&lt;/span&gt; value;&lt;br /&gt;}&lt;br /&gt;}&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Στην Οθόνη μου κάνω Bind ενός CheckBox με το Property του Class μου ο κώδικας:&lt;/P&gt;
&lt;P&gt;&lt;span style="color: Black;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;Binding adminBind &lt;span style="color: Red;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;=&lt;/span&gt; &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;new&lt;/span&gt; Binding(&lt;span style="color: #666666;background-color: #e4e4e4;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;"Checked"&lt;/span&gt;, user, &lt;span style="color: #666666;background-color: #e4e4e4;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;"IsAdministrator"&lt;/span&gt;);&lt;br /&gt;&lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;this&lt;/span&gt;.chkIsAdmin.DataBindings.Add(adminBind);&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Όταν το Property throws το Exception το control δεν φευγει απο Focused και λοκαρι την οθόνη χωρίς μήνυμα!!&lt;/P&gt;
&lt;P&gt;Προσπάθησα να πίασω το DataError Event του BindManager κώδικας :&lt;/P&gt;
&lt;P&gt;&lt;span style="color: Black;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt; &lt;br /&gt;&lt;br /&gt;BindingManagerBase adminManager &lt;span style="color: Red;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;=&lt;/span&gt; &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;this&lt;/span&gt;.BindingContext[user, &lt;span style="color: #666666;background-color: #e4e4e4;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;"IsAdministrator"&lt;/span&gt;];&lt;br /&gt;&lt;br /&gt;adminManager.DataError += &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;new&lt;/span&gt; BindingManagerDataErrorEventHandler(adminManager_DataError);&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Αλλα τίποτα&lt;/P&gt;
&lt;P&gt;Έχει καποιος καμία ιδέα για το πώς θα πιασω το Exception???&lt;/P&gt;
&lt;P&gt;thnx in Advance&lt;/P&gt;
&lt;P&gt;Nassos&lt;/P&gt;</description></item></channel></rss>