منتدى فيجوال بيسك لكل العرب | منتدى المبرمجين العرب

نسخة كاملة : مالفرق في استدعاء هذه الوظيفه
أنت حالياً تتصفح نسخة خفيفة من المنتدى . مشاهدة نسخة كاملة مع جميع الأشكال الجمالية .
مرحبا اخواني

لدي استفسار بسيط عن الاستدعاء التالي لم استطع ان افهمه Huh



كود :
<DllImportAttribute("user32.dll")> _
    Public Shared Function SendMessage(
            ByVal hWnd As IntPtr, _
            ByVal Msg As Integer, _
            ByVal wParam As Integer, _
            ByVal lParam As Integer) As Integer
    End Function

كود :
<DllImport("user[/align]32.dll")> _
    Public Shared Function SendMessage(
            ByVal hWnd As IntPtr, _
            ByVal Msg As Integer, _
            ByVal wParam As Integer, _
            ByVal lParam As Integer) As Integer
    End Function

وشكرا لكم
في Attributes و بشكل عام من الممكن ان تكتب الاسم كاملا أو ممكن أن تحذف كلمة ِAttribute من جملة الاستدعاء الخاصة به

يمكنك مراجعة الكود التالي و المأخوذ من اللينك التالي لمزيد من التوضيح

اللينك..............

كود :
<AttributeUsage(AttributeTargets.Method)> _
Public Class AnimalTypeAttribute
    Inherits Attribute

    ' The constructor is called when the attribute is set.
    Public Sub New(ByVal animal As Animal)
        Me.thePet = animal
    End Sub

    ' Keep a variable internally ...
    Protected thePet As Animal

    ' .. and show a copy to the outside world.
    Public Property Pet() As Animal
        Get
            Return thePet
        End Get
        Set(ByVal Value As Animal)
            thePet = Value
        End Set
    End Property


End Class

Class AnimalTypeTestClass

    <AnimalTypeAttribute(Animal.Dog)> _
    Public Sub DogMethod()
    End Sub

    <AnimalType(Animal.Cat)> _
    Public Sub CatMethod()
    End Sub

    <AnimalType(Animal.Bird)> _
    Public Sub BirdMethod()
    End Sub
End Class

Public Enum Animal
    ' Pets
    Dog = 1
    Cat
    Bird
End Enum
مرحبا silverlight

وشكرا لك لقد وصلت الفكرة ...

وكل عام وانت بخير يا أخي

وكل عام والامة الاسلامية بخير اللهم امين