Solved

I need to "hide" text in a class definition

Posted on 2004-09-07
4
217 Views
Last Modified: 2010-04-23
Folks:

I am new to VB.net.  I have experience in C++.

I have a class module (call it a.vb) that contains all the code necessary for a class I have designed.  It actually works.  (Scary)  My issue is, this class contains a lot of private stuff - enums, structures, variables, interfaced to legacy DLLs, etc.  I always code private data before any functions or procedures; and I always code New() first.  In this particular case, new is around line 800.  This is annoying.

I want to do one of two things -
1)  Move all the junk to another file and #include it.  (Excuse my C.)

2)  The IDE has methods of collapsing definitions of procedures etc.  Is there a way to define a section - such that everything between the section and end section will collapse?

Answers to eather question will be appreciated.  I'll split points if I get good answers to both.  Also, if there is a third possibility - let me know.  As I said - I am new and want to learn the new tricks.

Thanks  
0
Comment
Question by:jflanner
  • 2
4 Comments
 
LVL 37

Expert Comment

by:gregoryyoung
ID: 12000251
#region foo
//code
#end region



you can put the code into a seperate class easily, if they are in the same namespace there is no need to #include.

namespace foo
    friend class bar
         public static test as integer
    end class
end namespace

namespace foo
    public class t
         public function get foo as integer
                return bar.test
         end function
    end class
end namespace
0
 
LVL 37

Accepted Solution

by:
gregoryyoung earned 500 total points
ID: 12000267
sorry its ...

#Region " You region name"
#End Region
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question