private static void Main(string[] args) { IGraphicInterface adapter = new TextAdapterObject(); adapter.Draw(); IGraphicInterface classAdapter = new TextAdapterClass(); classAdapter.SetPosition(0, 1); StructuralPatterns.Adapter.PluggableAdapter.AbstractMethods.TreeDisplay tree = new DirectoryTreeDisplay(); tree.Display(); StructuralPatterns.Adapter.PluggableAdapter.DelegateObject.TreeDisplay treeDelegate = new StructuralPatterns.Adapter.PluggableAdapter.DelegateObject.TreeDisplay(); treeDelegate.SetDelegate(new DirectoryBrowser()); treeDelegate.Display(); tree.Display(); IComponent element = new ConcreteDecorator(new ConcreteComponent()); element.Display(); View view = View.LargeIcon; new ApplicationWindow(view).DrawContents(); new IconWindow(view).SetOrigin(new Point(10, 20)); Console.WriteLine(Environment.NewLine + "Flyweight"); GlyphContext gc = new GlyphContext(); Font times12 = new Font("Times New Roman", 12f); Font timesItalic12 = new Font(times12, FontStyle.Italic); gc.SetFont(times12, 6); gc.Insert(6); gc.SetFont(timesItalic12, 6); GlyphFactory factory = new GlyphFactory(); Row row = factory.CreateRow(); Charachter n = factory.CreateCharacter('n'); row.Insert(n, gc); row.Insert(n, gc); row.Draw(View.LargeIcon, gc); Console.WriteLine("End Flyweight" + Environment.NewLine); new Compiler().Compile(new FileStream("facade.txt", FileMode.OpenOrCreate), new BytecodeStream()); }
public override void Draw(View view, GlyphContext context) { Console.WriteLine(string.Format("Draw {0} symbol with font {1}", this.charCode, context.GetFont())); }
public void Remove(GlyphContext context) { }
public virtual void SetFont(Font font, GlyphContext context) { context.SetFont(font, 1); }
public virtual bool IsDone(GlyphContext context) { return true; }
public virtual void Next(GlyphContext context) { context.Next(1); }
public void Insert(Glyph glyph, GlyphContext context) { context.Insert(1); }
public virtual Font GetFont(GlyphContext context) { return context.GetFont(); }
public virtual void First(GlyphContext context) { }
public virtual void Draw(View view, GlyphContext context) { Console.WriteLine(string.Format("Draw glyph with font {0}", context.GetFont())); }
public virtual Glyph Current(GlyphContext context) { return this; }