Ejemplo n.º 1
0
        public static void Run()
        {
            string           text = " This is some random text. This needs to be represented in flyweight format";
            CharacterContext ctx  = new CharacterContext();

            foreach (Char c in text)
            {
                FlyWeightCharacter fc = FlyWeightFactory.GetInstance().GetCharacter(c);
                Console.WriteLine(fc.GetFont(ctx));
            }
        }
Ejemplo n.º 2
0
 public string GetFont(CharacterContext ctx)
 {
     return(ctx.GetFont());
 }
Ejemplo n.º 3
0
 public void SetFont(CharacterContext ctx)
 {
     ctx.SetFont("NewFont");
 }