Exemplo n.º 1
0
 public void SetFlyWeight(ConcreteFlyWeight flyWeight, string key)
 {
     if (table == null)
     {
         table = new Hashtable();
     }
     table.Add(key, flyWeight);
 }
Exemplo n.º 2
0
    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);
    }