Пример #1
0
 // Same as constructor above, but this one allows to set id as well.
 // This is primarily used by tests.
 public Document(string text, string title, User owner, string id)
 {
     this.text = text;
     this.title = title;
     this.owner = owner;
     this.path = "";
     this.images = new List<Picture>();
     log = new Document.DocumentLog(owner);
     this.id = id;
 }
Пример #2
0
 // Default constructor for creating a document object.
 public Document(string text, string title, string path, User owner)
 {
     this.text = text;
     this.title = title;
     this.owner = owner;
     this.path = path;
     this.images = new List<Picture>();
     log = new Document.DocumentLog(owner);
     CreateId();
 }
Пример #3
0
 // Default constructor for creating a document object.
 public Document(string text, string title, string path, User owner)
 {
     this.text   = text;
     this.title  = title;
     this.owner  = owner;
     this.path   = path;
     this.images = new List <Picture>();
     log         = new Document.DocumentLog(owner);
     CreateId();
 }
Пример #4
0
 // Same as constructor above, but this one allows to set id as well.
 // This is primarily used by tests.
 public Document(string text, string title, User owner, string id)
 {
     this.text   = text;
     this.title  = title;
     this.owner  = owner;
     this.path   = "";
     this.images = new List <Picture>();
     log         = new Document.DocumentLog(owner);
     this.id     = id;
 }
Пример #5
0
        // Creates and returns a document in it's complete version from a file on the file system.
        public static Document CreateDocumentFromFile(string id, string text, string title, bool modified, bool deleted, User owner, List <Picture> pictures, string path, Document.DocumentLog log)
        {
            Document doc = new Document();

            doc.id       = id;
            doc.text     = text;
            doc.title    = title;
            doc.owner    = owner;
            doc.path     = path;
            doc.log      = log;
            doc.images   = pictures;
            doc.modified = modified;
            doc.deleted  = deleted;
            return(doc);
        }