# ProjectDuration

A duration quantity that distinguishes working time from elapsed time and retains its display unit.

Struct 

`OfficeIMO.Project`

**Namespace**

`OfficeIMO.Project`

**Assembly**

`OfficeIMO.Project`

**Source revision**

`ba882f6b0d07` with working tree changes

**Source**

[ProjectDuration.cs:31](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Project/Model/ProjectDuration.cs#L31)

**Base**

`ValueType`

**Implements**

`IEquatable<ProjectDuration>`

**Modifiers**

sealed

A duration quantity that distinguishes working time from elapsed time and retains its display unit.

## Inheritance

- ValueType
- ProjectDuration

## Usage

Explore 20 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

### Returned or exposed by 16

- Property [ProjectBaseline.Duration](/api/project/officeimo-project-projectbaseline/#property-duration)
- Property [ProjectDependency.Lag](/api/project/officeimo-project-projectdependency/#property-lag)
- Method [ProjectDuration.ElapsedDays](/api/project/officeimo-project-projectduration/#method-elapseddays-decimal)
- Method [ProjectDuration.ElapsedHours](/api/project/officeimo-project-projectduration/#method-elapsedhours-decimal)
- Method [ProjectDuration.Estimated](/api/project/officeimo-project-projectduration/#method-estimated-boolean)
- Method [ProjectDuration.WorkingDays](/api/project/officeimo-project-projectduration/#method-workingdays-decimal)
- Method [ProjectDuration.WorkingHours](/api/project/officeimo-project-projectduration/#method-workinghours-decimal)
- Method [ProjectDuration.WorkingMinutes](/api/project/officeimo-project-projectduration/#method-workingminutes-decimal)
- Property [ProjectTask.ActualDuration](/api/project/officeimo-project-projecttask/#property-actualduration)
- Property [ProjectTask.Duration](/api/project/officeimo-project-projecttask/#property-duration)
- Property [ProjectTask.LevelingDelay](/api/project/officeimo-project-projecttask/#property-levelingdelay)
- Property [ProjectTask.RemainingDuration](/api/project/officeimo-project-projecttask/#property-remainingduration)
- Property [ProjectTaskSchedule.Duration](/api/project/officeimo-project-projecttaskschedule/#property-duration)
- Property [ProjectTaskWorkSchedule.ActualDuration](/api/project/officeimo-project-projecttaskworkschedule/#property-actualduration)
- Property [ProjectTaskWorkSchedule.RemainingDuration](/api/project/officeimo-project-projecttaskworkschedule/#property-remainingduration)
- Property [ProjectViewLink.Lag](/api/project/officeimo-project-projectviewlink/#property-lag)

### Accepted by parameters 4

- Method [ProjectDocument.AddRecurringTask](/api/project/officeimo-project-projectdocument/#method-addrecurringtask-string-collections-generic-ienumerable-system-datetime-officeimo-project-projectduration-officeimo-project-projecttask-officeimo-project-projectcalendar-int32-threading-cancellationtoken) parameter `duration`
- Method [ProjectDuration.Equals](/api/project/officeimo-project-projectduration/#method-equals-officeimo-project-projectduration) parameter `other`
- Method [ProjectTask.After](/api/project/officeimo-project-projecttask/#method-after-string-officeimo-project-projectdependencytype-nullable-officeimo-project-projectduration) parameter `lag`
- Method [ProjectTask.SetDuration](/api/project/officeimo-project-projecttask/#method-setduration-officeimo-project-projectduration) parameter `value`

Filter members 

Show inherited

## Constructors

`public ProjectDuration(decimal value, ProjectDurationUnit unit, bool elapsed = false, bool estimated = false)` [#](#constructor-ctor-decimal-officeimo-project-projectdurationunit-boolean-boolean)

[ProjectDuration.cs:31](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Project/Model/ProjectDuration.cs#L31)

Creates a duration. Negative values are reserved for dependency lag, not task duration.

Parameters

**value decimal required**

**unit OfficeIMO.Project.ProjectDurationUnit required**

**elapsed bool = false optional**

**estimated bool = false optional**

## Methods

`public static ProjectDuration ElapsedDays(decimal value)` [#](#method-elapseddays-decimal)

[ProjectDuration.cs:88](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Project/Model/ProjectDuration.cs#L88)

Creates an elapsed-day duration.

Parameters

**value decimal required**

Returns

`ProjectDuration`

`public static ProjectDuration ElapsedHours(decimal value)` [#](#method-elapsedhours-decimal)

[ProjectDuration.cs:90](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Project/Model/ProjectDuration.cs#L90)

Creates an elapsed-hour duration.

Parameters

**value decimal required**

Returns

`ProjectDuration`

Equals 2 overloads

`public bool Equals(ProjectDuration other)` [#](#method-equals-officeimo-project-projectduration)

[ProjectDuration.cs:94](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Project/Model/ProjectDuration.cs#L94)

Tests quantity, unit, elapsed semantics, and estimate marker.

Parameters

**other OfficeIMO.Project.ProjectDuration required**

Returns

`bool`

`public override bool Equals(object? obj)` [#](#method-equals-object)

[ProjectDuration.cs:96](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Project/Model/ProjectDuration.cs#L96)

Indicates whether this instance and a specified object are equal.

Parameters

**obj object? required**

The object to compare with the current instance.

Returns

`bool` true if obj and this instance are the same type and represent the same value; otherwise, false.

`public ProjectDuration Estimated(bool value = true)` [#](#method-estimated-boolean)

[ProjectDuration.cs:92](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Project/Model/ProjectDuration.cs#L92)

Returns a copy with the estimate marker.

Parameters

**value bool = true optional**

Returns

`ProjectDuration`

`public override int GetHashCode()` [#](#method-gethashcode)

[ProjectDuration.cs:98](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Project/Model/ProjectDuration.cs#L98)

Returns the hash code for this instance.

Returns

`int` A 32-bit signed integer that is the hash code for this instance.

`public override string ToString()` [#](#method-tostring)

[ProjectDuration.cs:100](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Project/Model/ProjectDuration.cs#L100)

Returns an invariant diagnostic representation, not a locale-specific Project input string.

Returns

`string`

`public static ProjectDuration WorkingDays(decimal value)` [#](#method-workingdays-decimal)

[ProjectDuration.cs:82](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Project/Model/ProjectDuration.cs#L82)

Creates a working-day duration.

Parameters

**value decimal required**

Returns

`ProjectDuration`

`public static ProjectDuration WorkingHours(decimal value)` [#](#method-workinghours-decimal)

[ProjectDuration.cs:84](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Project/Model/ProjectDuration.cs#L84)

Creates a working-hour duration.

Parameters

**value decimal required**

Returns

`ProjectDuration`

`public static ProjectDuration WorkingMinutes(decimal value)` [#](#method-workingminutes-decimal)

[ProjectDuration.cs:86](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Project/Model/ProjectDuration.cs#L86)

Creates a working-minute duration.

Parameters

**value decimal required**

Returns

`ProjectDuration`

## Inherited Methods

`public Type GetType()` [#](#method-gettype)

Inherited from object

Returns

`Type`

## Properties

`public decimal Value { get; }` [#](#property-value)

[ProjectDuration.cs:74](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Project/Model/ProjectDuration.cs#L74)

Quantity in the selected unit.

`public ProjectDurationUnit Unit { get; }` [#](#property-unit)

[ProjectDuration.cs:76](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Project/Model/ProjectDuration.cs#L76)

Display and conversion unit.

`public bool IsElapsed { get; }` [#](#property-iselapsed)

[ProjectDuration.cs:78](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Project/Model/ProjectDuration.cs#L78)

True when all time counts, including non-working time.

`public bool IsEstimated { get; }` [#](#property-isestimated)

[ProjectDuration.cs:80](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Project/Model/ProjectDuration.cs#L80)

True when the duration is marked as an estimate.

<!-- PowerForge markdown artifact sha256:E64DE750FC221C692AA5ED779EA05604DAFEAC35B59D009429C737E88BA9F5B4 -->
