Skip to content

Instantly share code, notes, and snippets.

Chris Wu ChengYiWu

Block or report user

Report or block ChengYiWu

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@ChengYiWu
ChengYiWu / Decortor_PrintWord2.cs
Last active Jul 21, 2017
【Design Patterns】Decorator 實作與應用
View Decortor_PrintWord2.cs
public Document PrintWord2(IList<AttachmentModel> attachments){
// 「封面一」 + 「空白頁」
MeetingMinutesWordPrinter cover1 = new MinutesCoverDocumentPrinter("(附件一)"); // 產生「封面一」的文件
MeetingMinutesWordPrinter conver1WithWhitePage = new WhitePageDecorator(cover1); // 將「封面一」文件後面加入「空白頁」
// 「附件」 + 「區塊」 + 「頁碼」
MeetingMinutesWordPrinter attachment = new MinutesAttachmentPrinter(attachments); // 產生「附件」的文件
MeetingMinutesWordPrinter attachmentWithPageNumber = new PageNumberDecorator(new NewSectionDecorator(attachment)); // 將「附件」文件區域加入「頁碼」顯示
// 「封面二」 + 「區塊」
@ChengYiWu
ChengYiWu / PrintWord2.cs
Last active Jul 21, 2017
【Design Patterns】Decorator 實作與應用
View PrintWord2.cs
public Document PrintWord2(IList<PlanModel> plans){
// 產生一份空白文件
Document doc = new Document();
// 產生封面
// ...
// 產生空白頁
// ...
// 產生附件
// ...
// 設定區塊
You can’t perform that action at this time.