public void SetFlyWeight(ConcreteFlyWeight flyWeight, string key) { if (table == null) { table = new Hashtable(); } table.Add(key, flyWeight); }
public FlyWeight GetFlyWeight(string key, string content) { if (m_FlyWeights.ContainsKey(key)) { return(m_FlyWeights[key]); } ConcreteFlyWeight theFlyWeight = new ConcreteFlyWeight(content); m_FlyWeights[key] = theFlyWeight; System.Console.WriteLine("New ConcreteFlyWeight key[" + key + "] Content[" + content + "]"); return(theFlyWeight); }