Καλώς ορίσατε στο dotNETZone.gr - Σύνδεση | Εγγραφή | Βοήθεια
σε

 

Αρχική σελίδα Ιστολόγια Συζητήσεις Εκθέσεις Φωτογραφιών Αρχειοθήκες

PropertyInfo, MethodInfo, Type is Static;

Îåêßíçóå áðü ôï ìÝëïò Nassos.NET. Τελευταία δημοσίευση από το μέλος Nassos.NET στις 05-12-2008, 13:48. Υπάρχουν 2 απαντήσεις.
Ταξινόμηση Δημοσιεύσεων: Προηγούμενο Επόμενο
  •  05-12-2008, 11:54 46724

    PropertyInfo, MethodInfo, Type is Static;

    Καλησπέρα σε Όλους,

    Έχω ένα propertyInfo ή methodInfo και θέλω να μάθω αν είναι Static, επίσης το ίδιο θέλω να μάθω και όταν έχω ένα Type.

    PS. δεν με βολέυει το GetProperty, GetMethods με bindingFlags γιατί τα object είναι στο tag ενός Tree.

    Ευχαριστώ

    Νάσος


    "Success is the ability to go from one failure to another with no loss of enthusiasm."
    Winston Churchill

    "Quality means doing it right when no one is looking."
    Henry Ford

  •  05-12-2008, 13:44 46726 σε απάντηση της 46724

    Απ: PropertyInfo, MethodInfo, Type is Static;

    Καλησπέρα Νάσο...

    Εάν έχεις ένα reference (MethodInfo, PropertyInfo) τότε μπορείς να γράψεις τα εξής

    methodInfo.IsStatic
    propertyInfo.GetGetMethod().IsStatic

    Τώρα για την περίπτωση του Type, υποθέτω ότι είναι static class... και σε επίπεδο IL περιγράφεται ως abstract και sealed... οποτε

    bool isStatic = type.IsAbstact && type.IsSealed

    Ελπίζω να βοήθησα


    Palladinos Nick
    Software Engineer
    -----------------------
    The limits of my language mean the limits of my world. (Ludwig Wittgenstein)
  •  05-12-2008, 13:48 46727 σε απάντηση της 46726

    Απ: PropertyInfo, MethodInfo, Type is Static;

    Φίλε Νίκο,

    Σε Ευχαριστώ, το GetGetMethod().IsStatic το βρήκα, το type ούτε που το σκέφτηκα!!

    thnx

    PS. CU@11/12/08 Wink


    "Success is the ability to go from one failure to another with no loss of enthusiasm."
    Winston Churchill

    "Quality means doing it right when no one is looking."
    Henry Ford

Προβολή Τροφοδοσίας RSS με μορφή XML
Με χρήση του Community Server (Commercial Edition), από την Telligent Systems