about delegate

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Tony Johansson

    #1

    about delegate

    Hello!

    When I define a class the default access modifier is internal.

    So if I just write
    class MyTest
    {
    . . .
    }
    this definition has internal as access modifier

    but if I define a delegate as
    delegete returnType SomeName (someArgumentLi st);
    Is it the same here that internal is the default access modifier if none is
    given

    //Tony


  • Nicholas Paldino [.NET/C# MVP]

    #2
    Re: about delegate

    Tony,

    Yes, that is the case.


    --
    - Nicholas Paldino [.NET/C# MVP]
    - mvp@spam.guard. caspershouse.co m

    "Tony Johansson" <johansson.ande rsson@telia.com wrote in message
    news:Fzi3j.956$ R_4.712@newsb.t elia.net...
    Hello!
    >
    When I define a class the default access modifier is internal.
    >
    So if I just write
    class MyTest
    {
    . . .
    }
    this definition has internal as access modifier
    >
    but if I define a delegate as
    delegete returnType SomeName (someArgumentLi st);
    Is it the same here that internal is the default access modifier if none
    is given
    >
    //Tony
    >

    Comment

    • Jon Skeet [C# MVP]

      #3
      Re: about delegate

      Tony Johansson <johansson.ande rsson@telia.com wrote:
      this definition has internal as access modifier
      >
      but if I define a delegate as
      delegete returnType SomeName (someArgumentLi st);
      Is it the same here that internal is the default access modifier if none is
      given
      If it's declared outside another type, that's true.
      If it's declared within another type, it's private by default. (The
      same is true for other types too.)

      --
      Jon Skeet - <skeet@pobox.co m>
      http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
      World class .NET training in the UK: http://iterativetraining.co.uk

      Comment

      • Tony Johansson

        #4
        Re: about delegate

        Hello!

        When I write this delegete returnType SomeName (someArgumentLi st);
        I call it to define a delegate but you call it to declare.
        In C++ it was a big difference between define a class and to declare a
        class.

        In my exemple here with the delegate I assume you agree with me
        that to define and declare is the same.

        It's just a matter of taste.

        //Tony

        "Jon Skeet [C# MVP]" <skeet@pobox.co mskrev i meddelandet
        news:MPG.21b7d0 7f1caef6a677@ms news.microsoft. com...
        Tony Johansson <johansson.ande rsson@telia.com wrote:
        >this definition has internal as access modifier
        >>
        >but if I define a delegate as
        >delegete returnType SomeName (someArgumentLi st);
        >Is it the same here that internal is the default access modifier if none
        >is
        >given
        >
        If it's declared outside another type, that's true.
        If it's declared within another type, it's private by default. (The
        same is true for other types too.)
        >
        --
        Jon Skeet - <skeet@pobox.co m>
        http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
        World class .NET training in the UK: http://iterativetraining.co.uk

        Comment

        • Jon Skeet [C# MVP]

          #5
          Re: about delegate

          Tony Johansson <johansson.ande rsson@telia.com wrote:
          When I write this delegete returnType SomeName (someArgumentLi st);
          I call it to define a delegate but you call it to declare.
          Well, it's declaring a delegate type.
          In C++ it was a big difference between define a class and to declare a
          class.

          In my exemple here with the delegate I assume you agree with me
          that to define and declare is the same.
          Well, it depends what you use "declare" and "define" to mean. I tend to
          use "declaratio n" because that's what the spec does. For instance:

          "A delegate-declaration is a type-declaration (ยง9.6) that declares a
          new delegate type."

          --
          Jon Skeet - <skeet@pobox.co m>
          http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
          World class .NET training in the UK: http://iterativetraining.co.uk

          Comment

          Working...