More limited than internal?
-
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!
-
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!
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?
-
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!
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)
-
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)
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!
-
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!
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)
-
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)
Suppose that there are 3 methods in
TransactionManager
class, which are invoked by one method inControl
class. So when I call that single method fromControl
class, 3 methods are called fromTransactionManager
class. I can do 2 things, 1- Creating an instance ofControl
class and calling its single method. 2- Creating an instance ofTransactionManager
class and calling those 3 methods myself. I don't want to be able to do the second one. I mean I want theTransactionManager
to be visible(instanciatable) only forControl
class. I hope it be clear. Somehow seems imposible, hum?:doh:
Don't forget, that's
Persian Gulf
not Arabian gulf!
-
Suppose that there are 3 methods in
TransactionManager
class, which are invoked by one method inControl
class. So when I call that single method fromControl
class, 3 methods are called fromTransactionManager
class. I can do 2 things, 1- Creating an instance ofControl
class and calling its single method. 2- Creating an instance ofTransactionManager
class and calling those 3 methods myself. I don't want to be able to do the second one. I mean I want theTransactionManager
to be visible(instanciatable) only forControl
class. I hope it be clear. Somehow seems imposible, hum?:doh:
Don't forget, that's
Persian Gulf
not Arabian gulf!
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?
-
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?
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!
-
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!
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?