[mono-android] SPAM-LOW: Passing a class between classes
Karl Heinz Brehme Arredondo
karl at e-magesolutions.com
Mon Nov 21 14:02:39 EST 2011
How do you instantiate xmlhandler in the caller?
I think there can exist in the caller:
Common data = new data();
xmlhandler xmlH = new smlhandler(data);
If xmlhandler is an activitie, and if i'ts not possible to add an overrided
constructor with Common as a parameter, you can make common data as public
property on xmlhandler and construct it "by hand" putting there the value..
Or you can create a Form class and create this xmlhandler : Form and use at
the same way..
Karl
From: "Paul F. Johnson" <paul at all-the-johnsons.co.uk>
Organization: Home
Reply-To: <paul at all-the-johnsons.co.uk>, "monodroid at lists.ximian.com"
<monodroid at lists.ximian.com>
Date: Mon, 21 Nov 2011 18:51:24 +0000
To: "monodroid at lists.ximian.com" <monodroid at lists.ximian.com>
Subject: SPAM-LOW: [mono-android] Passing a class between classes
Hi,
I have a standard winform which looks like this (in part)
namespace marker
{
public class xmlhandler : Form, Isettings
{
public xmlhandler(common data)
{
this.data = data;
xmlsetup();
}
common data;
public string path, sep, conpath, respath;
public bool group;
public int intro, meth, res, dis, addy, ci, cm, cr, cd, ca;
public int cci, ccm, ccr, ccd, cca;
public string date, cod;
public void xmlsetup()
{
path = System.Environment.CurrentDirectory;
string sep = Path.DirectorySeparatorChar.ToString();
conpath = path + string.Format("{0}configure.xml",sep);
respath = path + string.Format("{0}Resources{0}configure.xml", sep,
sep);
group = data.groups;
ci = data.intro;
cm = data.meth;
cr = data.result;
cd = data.discuss;
ca = data.addition;
cod = data.date;
}
where common is just a class containing a pile of variables.
Is this possible to do within the mono for android framework (with the
exception of finding the path) and if it is, how is it done? There
doesn't seem to be a way that I can see.
Paul
--
Vertraue mir, ich weiss, was ich mache...
_______________________________________________
Monodroid mailing list
Monodroid at lists.ximian.com
UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/monodroid/attachments/20111121/27a8641c/attachment.html
More information about the Monodroid
mailing list