Tagged Questions
4
votes
4answers
453 views
Is there a difference between Protected Internal and Internal Protected?
public class TestClass
{
protected internal int FieldA;
internal protected int FieldB;
}
Is there a difference between Protected Internal and Internal Procted Members?
2
votes
5answers
367 views
Protected internal class inside a namespace compiles without error
protected internal class foo
{
//this compiles without any errors
}
also
internal class bar
{
public int quix;
protected internal int zyx;
//this compiles without any errors
}
Are ...
6
votes
2answers
911 views
protected internal [duplicate]
The C# Language Reference on MSDN defines 'protected internal' as "Access is limited to the current assembly or types derived from the containing class". But from a semantic point of view, 'protected ...
1
vote
4answers
530 views
protected internal class working within class but not working outside
I was trying few things and would like to know why this is happening so.
Say, I have a class called A in namespace n and I was trying to create protected internal class B.
namespace n
{
public ...
1
vote
2answers
239 views
Inconsistent accessibility with abstract classes
I have an internal abstract class InternalClassBase and two (also internal) classes InternalClass1 and InternalClass2, which inherit from InternalClassBase.
I also have a public abstract class ...
1
vote
1answer
120 views
I have a protected class that I'd like to be a property inside a public class, but accessible to derived classes in the same assembly
I'm using C# 4.
The comments explain the purpose of the classes and why they're structured the way they are.
/// <summary>
/// I want this internal just to reduce the number of publicly
/// ...
2
votes
1answer
571 views
C# - Internal Properties “readable” in quickwatch but not using reflection?
I see that the "Quick Watch" window has access to all properties, irrespective of access restrictions (internal, protected, private) of a class in a library, even when the library is referenced in a ...
1
vote
1answer
248 views
Internal and protected in a private api
I work in development team of about 12 and we build a reasonable set of API's that we use on a strictly in-house only basis. Typically all classes and interfaces are public because that is just how ...
8
votes
5answers
334 views
What do you choose, protected or internal?
If I have a class with a method I want protected and internal. I want that only derived classes in the assembly would be able to call it.
Since protected internal means protected or internal, you ...
4
votes
3answers
2k views
C# set accessor accessible to all types in assembly, and get assessor only to derivated types. How to?
This property in a type with no access modifier (thus internal access):
class SomeType {
private int length;
internal int Length {
get { return length; }
set length = value; }
...
4
votes
2answers
148 views
How to limit subclassing of public abstact class to types in same assembly and thus allow protected members typed to internal types
This question is similar to c# internal abstract class, how to hide usage outside but my motiviation is different. Here is the scenario
I started with the following:
internal class InternalTypeA ...