Exemplo n.º 1
0
 public Document(string filePath, IDocumentListener listener)
 {
     // set name from file path
     _name = Path.GetFileNameWithoutExtension(filePath);
     if (null != listener)
     {
         // add listener
         AddListener(listener);
         // notify listener of document creation
         listener.OnNewDocument(this);
     }
     // load file
     Load(filePath);            
     // rechange name to match filePath
     _name = Path.GetFileNameWithoutExtension(filePath);
 }
Exemplo n.º 2
0
 public Document(string name, string description, string author, DateTime dateCreated, IDocumentListener listener)
 {
     _name = name;
     _description = description;
     _author = author;
     _dateCreated = dateCreated;
     if (null != listener)
     {
         // add listener
         AddListener(listener);
         // notify listener of document creation
         listener.OnNewDocument(this);
     }
 }