Skip to content

Instantly share code, notes, and snippets.

@Manuzor
Last active January 17, 2018 11:18
Show Gist options
  • Save Manuzor/e218b8faa7400ebfb2da1ce93c9af913 to your computer and use it in GitHub Desktop.
Save Manuzor/e218b8faa7400ebfb2da1ce93c9af913 to your computer and use it in GitHub Desktop.
Shows the default access levels in C#
namespace Name.Space
{
/* internal */ class TopLevelClass
{
/* private */ int Field;
/* private */ TopLevelClass() { }
/* private */ void Method() { }
/* private */ class NestedClass
{
// Same rules apply as for the contents of TopLevelClass
}
/* private */ class NestedStruct
{
// Same rules apply as for the contents of TopLevelClass
/* private */ int Field;
}
/* private */ enum NestedEnum
{
// This behaves always like public. Adding access modifiers is not allowed!
/* public */ Value0
}
/* private */ delegate void TopLevelDelegate();
/* private */ interface TopLevelInterface;
}
/* internal */ struct TopLevelStruct
{
// Same rules apply as for the contents of TopLevelClass
}
/* internal */ enum TopLevelEnum
{
// This behaves always like public. Adding access modifiers is not allowed!
/* public */ Value0
}
/* internal */ delegate void TopLevelDelegate();
/* internal */ interface TopLevelInterface
{
// This behaves always like public. Adding access modifiers is not allowed!
/* public */ void InterfaceMethod();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment