473,406 Members | 2,352 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Private class public Members?

Hi,

how is it possible to have a private class with public members?
When doing some reasearch about double buffered paint actions, I stumbled on
a class GraphicBufferManager which is declared private but has public
members. Since this class is not nested in another one, how is it possible
to declare a class as private, anyway?

Thanks,

Klaus
Nov 20 '05 #1
3 1007
* "Klaus Löffelmann" <fo***********@loeffelmann.de> scripsit:
how is it possible to have a private class with public members?
Declare the class as 'Private'.
When doing some reasearch about double buffered paint actions, I stumbled on
a class GraphicBufferManager which is declared private but has public
members. Since this class is not nested in another one, how is it possible
to declare a class as private, anyway?


Where did you find this class?

--
Herfried K. Wagner [MVP]
<http://dotnet.mvps.org/>
Website Address Changed!
Nov 20 '05 #2
Klaus,
I suspect that it is really Friend to the assembly where it is defined, and
you are seeing it as private "in respect" to the assembly you are in.

Hope this helps
Jay

"Klaus Löffelmann" <fo***********@loeffelmann.de> wrote in message
news:40***********************@news.freenet.de...
Hi,

how is it possible to have a private class with public members?
When doing some reasearch about double buffered paint actions, I stumbled on a class GraphicBufferManager which is declared private but has public
members. Since this class is not nested in another one, how is it possible
to declare a class as private, anyway?

Thanks,

Klaus

Nov 20 '05 #3
Hi Herfried,

the class is used by WMPaint of class Control, and WMPaint in turn is called
by WndProc of class Control.
It's purpose - at least I think so - is to handle the internal double
buffering of the painting stuff.
I found it using the .NET Reflector (http://www.aisto.com/roeder/dotnet/).

By the way: How do you declare a class as Private, if it is not nested in a
public/friends class?

Klaus

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> schrieb im Newsbeitrag
news:c1*************@ID-208219.news.uni-berlin.de...
* "Klaus Löffelmann" <fo***********@loeffelmann.de> scripsit:
how is it possible to have a private class with public members?


Declare the class as 'Private'.
When doing some reasearch about double buffered paint actions, I stumbled on a class GraphicBufferManager which is declared private but has public
members. Since this class is not nested in another one, how is it possible to declare a class as private, anyway?


Where did you find this class?

--
Herfried K. Wagner [MVP]
<http://dotnet.mvps.org/>
Website Address Changed!

Nov 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: CoolPint | last post by:
I read in books that nested class cannot access private members of nesting class and vice versa unless they are made friends. Somehow, my compiler is letting my nested class member functions access...
6
by: Chris Mantoulidis | last post by:
Forgive me if I'm wrong but I think there is something like an extra member scope in classes. for example: class abc { ostream & operator << (ostream &, const abc &); istream & operator >>...
8
by: __PPS__ | last post by:
Hello everybody, today I had another quiz question "if class X is privately derived from base class Y what is the scope of the public, protected, private members of Y will be in class X" By...
2
by: Christoph Boget | last post by:
Let's take the following class: class MyClass { private int privateVar; public int PublicVar { get { return privateVar; } } public MyClass() {}
1
by: Joel | last post by:
Why does this work: using System; namespace ConsoleApplication1 { class Class1 { static void Main(string args)
10
by: Abelardo Vacca | last post by:
Hi, The title sums up the question pretty much. I would like to access all private members of a class including the private members of its base classes.( I already have the ReflectionPermission )...
6
by: Ken Varn | last post by:
I have an ASP.NET application that is calling a custom class that is trying to parse all of the members of my Page object using Type.GetMembers(). The problem that I am having is that private...
86
by: jopperdepopper | last post by:
Hi, finally giving php 5 a go, and going over the new approach to classes. Can someone clarify the public, private and protected to me? I quote the php manual: "The visibility of a property or...
10
by: John Goche | last post by:
Hello, page 202 of Symbian OS Explained by Jo Stichbury states "All virtual functions, public, protected or private, should be exported" then page 203 states "In the rare cases where a...
11
by: Yarco | last post by:
For example: <?php class Test { private $name = 'yarco'; } $p = new ReflectionPropery('Test', 'name'); print $p->getValue();
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.