public class LooseProperties > { > public Dictionary<string, object> Properties { get; set; } > public LooseProperties() { Properties = new Dictionary<string, object>(); } > > public object this[string property] > { > get > { > if (Properties.ContainsKey(property)) > return Properties[property]; > else > return null; > } > set > { > if (!Properties.ContainsKey(property)) > Properties.Add(property, null); > Properties[property] = value; > } > } > }then just:
lp["CompanyName"] = "Samaan Systems Ltd"; >lp["PremiumReminderDays"] = 10; >//etc >string company = (string)lp["CompanyName"]; >int days = (int) lp["PremiumReminderDays"];OK, the indexer is interesting, let me see if I can understand the code :) But maybe using pre-defined properties is the better way?