Beispielcode für das Prototyp-Muster – Fotoarchiv

Dies ist der Code für ein Beispiel zum Prototyp-Muster:

Here is an using System; using System.Collections.Generic; using System.IO; using PrototypePattern; namespace CompositePattern { // Namensraum für das Kompositum-Muster // mit den Share-Operationen // Das Interface public interface IComponent <T> { void Add(IComponent <T> c); IComponent <T> Remove(T s); string Display(int depth); IComponent <T> Find(T s); IComponent <T> Share (T s,IComponent <T> home); string Name {get; set;} } // Das Kompositum [Serializable( )] public class Composite <T> : IPrototype <IComponent <T>>, IComponent <T> { List <IComponent <T>> list; public string Name {get; set;} public Composite (string name) { Name = name; ...

Get C# 3.0 Entwurfsmuster now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.