//public string DetailData { get { return _csvData; } } public Invoice() { Document = new iDocument(); _Reportheaders = new ArrayList(); _ReportFooters = new ArrayList(); _Detail = new iDetail(); }
/// <summary> /// Open a previously created document. /// It also creates the correct document-instance /// </summary> /// <param name="filename"></param> /// <returns></returns> public iDocument OpenDocument(string filename) { string type = GetTypeFromFilename(filename); iDocument myDoc = CreateDocument(type); myDoc.Open(); Console.WriteLine("Doc found and openend. Type: " + type); return(myDoc); }
/// <summary> /// Create new document according to the type of the document /// </summary> /// <param name="type">Type of doc to be created</param> /// <returns>Newly created document</returns> public iDocument NewDocument(string type) { iDocument myDoc = CreateDocument(type); myDoc.Open(); Console.WriteLine("New doc created and openend. Type: " + type); return(myDoc); }
public void Run() { DocFactory creator = new ConcreteDocCreator(); iDocument myDoc = creator.NewDocument("pdf"); docs.Add(myDoc); myDoc = creator.NewDocument("docx"); docs.Add(myDoc); myDoc = creator.OpenDocument("D:\\test.docx"); docs.Add(myDoc); CloseAllDocuments(); }