Unable to pass an object



I have a form that invokes two other dialog forms for controlling the
configuration of the program. The dialogs are invoked modally. Rather
than pile up a large number of variables in the primary form I created
a class to hold the configuration data, validate it, save it. etc. An
object of this class is in the main form. The data is all private but
I have public accessors for all of it. My need is to make it
availlable to the two sub-forms when I call them but no matter my
method of approach I get stymied in the compile with a variety of
errors, depending on the methodology I'm trying.

I've make the object public, private and tried to pass it to a newly
constructed form via a public method in the sub-form before showing
the dialog (I'm successful with individual items, but not the class
object.) When I make it private, it's not available in the context of
the sub-form. This I can understand. When I make it public and try
to pass it via a function I get an error along the lines of

Inconsistent accessibility: parameter type 'GWIAmon.AllCfg' is less
accessible than method 'GWIAmon.Config.SetCfg(GWIAmon.AllCfg)

I think what I'm seeing from searches is that the object has to be of
a public class, though I'm not sure what that means.

Any help would be appreciated. Right now the code is looking awfully
ugly and since I need to do this in at least two places, I'd like to
make sure that I'm not dropping data by passing member data one at a
time.

On this same note, if I do

form2.ShowDialog(this);

Where is "this" represented in form2 to such that I might have acces
to it? Or is this solely for the benefit of the form to know what
owns it?

--
Thanks,
Lilith
.



Relevant Pages

  • System.Configuration reading and writing custom section
    ... In my project I use the configuration block from enterprise library. ... Private Properties ... ... private string _sMTPServer; ...
    (microsoft.public.dotnet.framework)
  • PPPoE Question
    ... I had the configuration on my ASA5505 just the way I wanted it. ... private address on the outside. ... I could not access the Internet through the ASA. ... Is this normal for PPPoE? ...
    (comp.dcom.sys.cisco)
  • Re: Remoting Singleton Issue
    ... client that it doesn't get executed until after you exit the application, ... Adding the configuration as above should fix the problem by ... static void Main ... private System.Windows.Forms.Button button1; ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: /etc/hostname and POINTOPOINT
    ... > on qfe3. ... > possible to do the pointopoint and private bits automagically. ... broadcast-type technology, not point-to-point. ... configuration, ...
    (comp.unix.solaris)
  • RE: Upgr asp.net/ado.net connection method from VS 2003 to 2005
    ... "Manish Bafna" wrote: ... Connectionstring tag in web.config in following way: ... In .NET 2.0 there is a new configuration class called ConfigurationManager. ... Private invConn As SqlConnection ...
    (microsoft.public.dotnet.framework.adonet)