/// <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); }