Solved

constructory tips and tricks

Posted on 2004-08-09
1
224 Views
Last Modified: 2010-04-15
Say i Have 4 constructors in the same class,  all of them have different parms (of course)

but they all have to call the same setUp method called tis._setPropertyInfo

Is there a way to kind of build on the work that is being done by one constructor to do the next?

so that I can just call or use the base Constructor each time?
0
Comment
Question by:jayrod
1 Comment
 
LVL 4

Accepted Solution

by:
NTAC earned 500 total points
ID: 11756816
If they are all calling the same setup method--just place the common code in that method.  

If you want--you can call one constructor from another like this:

public class Class1
{
   private string s;

    public Class1(): this("Hello")
    {

    }

    publicClass1(string test)
    {
        s = test;

    }
}

This link gives more info, as well as the C# documentation
http://www.codeproject.com/dotnet/ConstructorsInCSharp.asp
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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

Suggested Solutions

In order to hide the "ugly" records selectors (triangles) in the rowheaders, here are some suggestions. Microsoft doesn't have a direct method/property to do it. You can only hide the rowheader column. First solution, the easy way The first sol…
Article by: Najam
Having new technologies does not mean they will completely replace old components.  Recently I had to create WCF that will be called by VB6 component.  Here I will describe what steps one should follow while doing so, please feel free to post any qu…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

713 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