Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. More limited than internal?

More limited than internal?

Scheduled Pinned Locked Moved C#
helpquestion
9 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Meysam Mahfouzi
    wrote on last edited by
    #1

    I want some methods of one class to be only visible to my desired classes in the same project. So I need some thing more limited than internal access modifier. Can anybody help me?


    Don't forget, that's

    Persian Gulf

    not Arabian gulf!

    N B 2 Replies Last reply
    0
    • M Meysam Mahfouzi

      I want some methods of one class to be only visible to my desired classes in the same project. So I need some thing more limited than internal access modifier. Can anybody help me?


      Don't forget, that's

      Persian Gulf

      not Arabian gulf!

      N Offline
      N Offline
      Nathan Blomquist
      wrote on last edited by
      #2

      You could write a proxy class that sits in between your other classes and your "internal" class. This class would use your "internal" class and only expose those methods you want. -Nathan --------------------------- Hmmm... what's a signature?

      1 Reply Last reply
      0
      • M Meysam Mahfouzi

        I want some methods of one class to be only visible to my desired classes in the same project. So I need some thing more limited than internal access modifier. Can anybody help me?


        Don't forget, that's

        Persian Gulf

        not Arabian gulf!

        B Offline
        B Offline
        Blake Coverett
        wrote on last edited by
        #3

        Sounds like what you want is an identity demand using .NET's code access security and strong names. If those pointers don't get you headed in the right direction, I'll make a quick sample later today. -- -Blake (com/bcdev/blake)

        M 1 Reply Last reply
        0
        • B Blake Coverett

          Sounds like what you want is an identity demand using .NET's code access security and strong names. If those pointers don't get you headed in the right direction, I'll make a quick sample later today. -- -Blake (com/bcdev/blake)

          M Offline
          M Offline
          Meysam Mahfouzi
          wrote on last edited by
          #4

          Maybe, but for now, I need them for myself. I just want to follow design patterns. For example I have a Control class and a TransactionManager class. I just want to be able to work with Control class, While I am yet able to do my work with TransactionManager class.


          Don't forget, that's

          Persian Gulf

          not Arabian gulf!

          B 1 Reply Last reply
          0
          • M Meysam Mahfouzi

            Maybe, but for now, I need them for myself. I just want to follow design patterns. For example I have a Control class and a TransactionManager class. I just want to be able to work with Control class, While I am yet able to do my work with TransactionManager class.


            Don't forget, that's

            Persian Gulf

            not Arabian gulf!

            B Offline
            B Offline
            Blake Coverett
            wrote on last edited by
            #5

            Hmm, based on this reply it's clear I completely misunderstood what you were asking for in the first question. Unfortunately I can't quite parse this one at all. meisi wrote: I just want to be able to work with Control class, While I am yet able to do my work with TransactionManager class. What exactly do you mean by 'work with' in this context? -- -Blake (com/bcdev/blake)

            M 1 Reply Last reply
            0
            • B Blake Coverett

              Hmm, based on this reply it's clear I completely misunderstood what you were asking for in the first question. Unfortunately I can't quite parse this one at all. meisi wrote: I just want to be able to work with Control class, While I am yet able to do my work with TransactionManager class. What exactly do you mean by 'work with' in this context? -- -Blake (com/bcdev/blake)

              M Offline
              M Offline
              Meysam Mahfouzi
              wrote on last edited by
              #6

              Suppose that there are 3 methods in TransactionManager class, which are invoked by one method in Control class. So when I call that single method from Control class, 3 methods are called from TransactionManager class. I can do 2 things, 1- Creating an instance of Control class and calling its single method. 2- Creating an instance of TransactionManager class and calling those 3 methods myself. I don't want to be able to do the second one. I mean I want the TransactionManager to be visible(instanciatable) only for Control class. I hope it be clear. Somehow seems imposible, hum?:doh:


              Don't forget, that's

              Persian Gulf

              not Arabian gulf!

              N 1 Reply Last reply
              0
              • M Meysam Mahfouzi

                Suppose that there are 3 methods in TransactionManager class, which are invoked by one method in Control class. So when I call that single method from Control class, 3 methods are called from TransactionManager class. I can do 2 things, 1- Creating an instance of Control class and calling its single method. 2- Creating an instance of TransactionManager class and calling those 3 methods myself. I don't want to be able to do the second one. I mean I want the TransactionManager to be visible(instanciatable) only for Control class. I hope it be clear. Somehow seems imposible, hum?:doh:


                Don't forget, that's

                Persian Gulf

                not Arabian gulf!

                N Offline
                N Offline
                Nathan Blomquist
                wrote on last edited by
                #7

                Did you completely ignore my post before? Why not make TransactionManager a private class inside Control? Then you can just make Control public and expose only the methods you want to expose. I don't mean to sound harsh.... maybe I am just ignorant of you situation.... --------------------------- Hmmm... what's a signature?

                M 1 Reply Last reply
                0
                • N Nathan Blomquist

                  Did you completely ignore my post before? Why not make TransactionManager a private class inside Control? Then you can just make Control public and expose only the methods you want to expose. I don't mean to sound harsh.... maybe I am just ignorant of you situation.... --------------------------- Hmmm... what's a signature?

                  M Offline
                  M Offline
                  Meysam Mahfouzi
                  wrote on last edited by
                  #8

                  Thank you Nathan! That is exactly what I shoud do. And excuse me, I misunderstood your first post:)


                  Don't forget, that's

                  Persian Gulf

                  not Arabian gulf!

                  N 1 Reply Last reply
                  0
                  • M Meysam Mahfouzi

                    Thank you Nathan! That is exactly what I shoud do. And excuse me, I misunderstood your first post:)


                    Don't forget, that's

                    Persian Gulf

                    not Arabian gulf!

                    N Offline
                    N Offline
                    Nathan Blomquist
                    wrote on last edited by
                    #9

                    Sorry about the harsh post... I was in a bad mood yesterday. Also, my first post was a little more (shall I say) abstract than I wanted it to be. -Nathan --------------------------- Hmmm... what's a signature?

                    1 Reply Last reply
                    0
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    • Login

                    • Don't have an account? Register

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • World
                    • Users
                    • Groups