473,401 Members | 2,127 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,401 software developers and data experts.

Class visible only within current project

Is it possible to add a class, coded within a separate .cs file, that
is available only within the project?

I hope that is clear. In more detail - I want to write a DLL for
distribution that exposes one public class. I have some utilities
classes that I would like to use in my public class but not expose to
the end user. I was hoping that I just include the source file.

What I'm trying to do is make a "private" class, but that's not allowed
as I'm trying to use it.

I suppose that I could make a separate DLL for the utility classes and
then reference that DLL from the main DLL.

Mike Buchanan

Jan 8 '07 #1
2 7145
Have a look at the internal access modifier:
http://msdn2.microsoft.com/en-us/library/7c5ka91b.aspx

Greetings,

Wouter de Kort:
<go****@insightfulmes.comwrote in message
news:11*********************@42g2000cwt.googlegrou ps.com...
Is it possible to add a class, coded within a separate .cs file, that
is available only within the project?

I hope that is clear. In more detail - I want to write a DLL for
distribution that exposes one public class. I have some utilities
classes that I would like to use in my public class but not expose to
the end user. I was hoping that I just include the source file.

What I'm trying to do is make a "private" class, but that's not allowed
as I'm trying to use it.

I suppose that I could make a separate DLL for the utility classes and
then reference that DLL from the main DLL.

Mike Buchanan
Jan 8 '07 #2
go****@insightfulmes.com wrote:
Is it possible to add a class, coded within a separate .cs file, that
is available only within the project?

I hope that is clear. In more detail - I want to write a DLL for
distribution that exposes one public class. I have some utilities
classes that I would like to use in my public class but not expose to
the end user. I was hoping that I just include the source file.

What I'm trying to do is make a "private" class, but that's not allowed
as I'm trying to use it.

I suppose that I could make a separate DLL for the utility classes and
then reference that DLL from the main DLL.

Mike Buchanan
Mark the classes as internal, rather than public/private/protected and they
will be accessible only within your assembly. So you will be able to use
them throughout your assembly but they will not be accessible to anyone who
is referencing your assembly.
--
Tom Porterfield

Jan 8 '07 #3

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

Similar topics

2
by: Steve Teeples | last post by:
I learned that C# doesn't allow global variables within a project. However, I have a structure that I wish to store data within. The data is retrieved from multiple forms within my project. How...
3
by: Helmut Wagensonner | last post by:
Hi, I have created a custom textBox within a C# project. I want to put that custom textBox on a form now. I heard about a way, to place that user control onto a form within the same project,...
15
by: Mark Kamoski | last post by:
Hi Everyone-- Please help. How can one get the name of the current project and the current class? This is the situation. Suppose there is a project called "P1".
1
by: Eric | last post by:
Couple of general webform questions. Most are about html code created/managed by the editor. I work in GridLayout Mode. 1. Is there a reference or guideline for how the html should appear when...
2
by: Matt | last post by:
When I tried to open an existing proj1.csproj in VS.NET 2003. It pops up a dialog saying "The project 'proj1.csproj' must be converted to the current project format. After it has been converted,...
1
by: Yidaki | last post by:
I have a testproject with a number of pages. Here I want to build a Array with all page-names(physical name & ID's). This array will be used to fill a listbox/table/ something else. QUESTION :...
0
by: saj14saj | last post by:
(If there is a better forum to post this in, please let me know...) I am using Visual Studio 2005. I have a Solution consisting of three projects: * A main project "DiscoverNotes" written in...
1
by: Sala | last post by:
Hi creative thinkers ! I have one project in C# .. that project name ewaoNET . Now i will shifted into another project sub folders.... My current Project : Cititown Now i will use existing (...
0
by: angelica12 | last post by:
Hi, I have a class with a Main that runs some tests. This class exists within a project that is the startup project in Visual Studio. I would like to just run that class Main instead of the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: 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
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.