If you're in C# 2.0, you can use generics.
using System;
using System.Collections.Generic;
using System.Text;
namespace genericsDemo
{
class Program
{
static void Main(string[] args)
{
// using the List collection class
List<widget> Widgets = new List<widget>();
Widgets.Add(new Widget("tin-foil hat"));
Widgets.Add(new Widget("European swallow"));
Widgets.Add(new Widget("African swallow"));
Widgets.Add(new Widget(1));
foreach (Widget it in Widgets)
Console.WriteLine(it.WidgetName);
// give a pause to review your good work
Console.Readline("hit any key to... blah
blah blah");
}
}
public class Widget
{
private object _widgetName = "";
public object WidgetName
{
get { return _widgetName; }
set { _widgetName = value; }
}
// constructor that takes an object argument
public Widget(object widgetName)
{
this._widgetName = widgetName;
}
}
}
Warmest Regards,
Phillip B. Holmes
http://phillipholmes.com
214-995-6175 (cell)
==================>
-----Original Message-----
From: Nathan Strutz [mailto:strutz gmail.com]
Sent: Tuesday, August 01, 2006 7:37 PM
To: Net-Talk
Subject: Re: C## equivalent of evaluate()?
Hummm...
I wonder if your data structure is a bit off.
--
Internal Virus Database is out-of-date.
Checked by AVG Free Edition.
Version: 7.1.394 / Virus Database: 268.10.1/390 - Release
Date: 7/17/2006
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~|
Introducing the Fusion Authority Quarterly Update. 80 pages
of hard-hitting,
up-to-date ColdFusion information by your peers, delivered
to your door four times a year.
http://www.f
usionauthority.com/quarterly
Archive: http://www.houseoffusion.com/groups/Net-T
alk/message.cfm/messageid:3085
Subscription: http://www.houseoffusion.com/groups/Net-Talk/subscribe
.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/u
nsubscribe.cfm?user=22184.15789.44
|