public Flyweight GetFlyweight(string key) { if (!flyweights.ContainsKey(key)) { switch (key) { case "A": { flyweights[key] = new FlyweightA(); break; } case "B": { flyweights[key] = new FlyweightB(); break; } } } return flyweights[key]; }
public Flyweight GetFlyweight(string key) { if (!flyweights.ContainsKey(key)) { switch (key) { case "A": { flyweights[key] = new FlyweightA(); break; } case "B": { flyweights[key] = new FlyweightB(); break; } } } return(flyweights[key]); }