IMHOTEP Framework
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Pages
Notification.cs
1 using UnityEngine;
2 using System.Collections;
3 using System;
4 
5 public class Notification {
6 
7  private string text;
8  private DateTime expireDate;
9  private Sprite notificationSprite;
10  private DateTime creationDate;
11  private AdditionalInfo additionalInfo;
12 
14 
20  public Notification(string text, TimeSpan timeToLive)
21  {
22  this.text = text;
23  this.notificationSprite = null;
24  this.additionalInfo = null;
25  this.creationDate = DateTime.Now;
26  if(timeToLive == TimeSpan.Zero)
27  {
28  this.expireDate = DateTime.MaxValue;
29  }
30  else
31  {
32  this.expireDate = DateTime.Now + timeToLive;
33  }
34  }
35 
37 
44  public Notification(string text, TimeSpan timeToLive, Sprite notificationSprite) : this(text, timeToLive)
45  {
46  this.notificationSprite = notificationSprite;
47  }
48 
49  public Notification(string text, TimeSpan timeToLive, Sprite notificationSprite, AdditionalInfo additionalInfo) : this(text, timeToLive)
50  {
51  this.additionalInfo = additionalInfo;
52  }
53 
54  public string Text
55  {
56  get { return text; }
57  //set { text = value; }
58  }
59 
60  public DateTime ExpireDate
61  {
62  get { return expireDate; }
63  }
64 
65  public DateTime CreationDate
66  {
67  get { return creationDate; }
68  }
69 
70  public Sprite NotificationSprite
71  {
72  get { return notificationSprite; }
73  }
74 
76  {
77  get { return additionalInfo; }
78  }
79 
80 
81 
82 
83 }
Notification(string text, TimeSpan timeToLive)
A constructor.
Definition: Notification.cs:20
Notification(string text, TimeSpan timeToLive, Sprite notificationSprite)
A constructor.
Definition: Notification.cs:44