AvailabilityPeriod Class |
Namespace: Aspose.Tasks
The AvailabilityPeriod type exposes the following members.
| Name | Description | |
|---|---|---|
| AvailabilityPeriod | Initializes a new instance of the AvailabilityPeriod class |
| Name | Description | |
|---|---|---|
| AvailableFrom |
Gets or sets the date when a resource becomes available for the specified period.
| |
| AvailableTo |
Gets or sets the last date when a resource is available for the specified period.
| |
| AvailableUnits |
Gets or sets the percentage of a resource which is available during the specified period.
|
| Name | Description | |
|---|---|---|
| Equals | (Inherited from Object.) | |
| Finalize | (Inherited from Object.) | |
| GetHashCode | (Inherited from Object.) | |
| GetType | (Inherited from Object.) | |
| MemberwiseClone | (Inherited from Object.) | |
| ToString | (Inherited from Object.) |
public void WorkWithAvailabilityPeriod() { var project = new Project(); var resource = project.Resources.Add("Work Resource"); // Add availability periods to new resource IEnumerable<AvailabilityPeriod> periods = this.GetPeriods(); foreach (var period in periods) { resource.AvailabilityPeriods.Add(period); } foreach (var period in resource.AvailabilityPeriods) { Console.WriteLine("Available From: " + period.AvailableFrom); Console.WriteLine("Available To: " + period.AvailableTo); Console.WriteLine("Available Units: " + period.AvailableUnits); Console.WriteLine(); } } private IEnumerable<AvailabilityPeriod> GetPeriods() { var periods = new List<AvailabilityPeriod>(2); var period = new AvailabilityPeriod { AvailableFrom = new DateTime(2011, 12, 12), AvailableTo = new DateTime(2013, 12, 12), AvailableUnits = 0.99 }; periods.Add(period); var period2 = new AvailabilityPeriod { AvailableFrom = new DateTime(2013, 12, 12), AvailableTo = new DateTime(2015, 12, 12), AvailableUnits = 0.94 }; periods.Add(period2); return periods; }