Skip to content

Instantly share code, notes, and snippets.

@Krita3
Created September 7, 2016 14:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Krita3/28673a3bdfb2feb2f8887680510e0e36 to your computer and use it in GitHub Desktop.
Save Krita3/28673a3bdfb2feb2f8887680510e0e36 to your computer and use it in GitHub Desktop.
Compositeパターン アイテムとアイテムディレクトリの抽象クラス
public abstract class Entry
{
protected string name = "";
public string Name
{
get
{
return this.name;
}
}
// 接頭辞をつけて一覧をログに表示する
public abstract void PrintListLog(string prefix);
// 一覧をログに表示する
public void PrintListLog()
{
PrintListLog("");
}
public override string ToString()
{
return this.Name;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment