Class FakeDateTimeZoneSource.Builder
Builder for FakeDateTimeZoneSource, allowing the built object to
be immutable, but constructed via object/collection initializers.
  
  
  Since 1.1.x
  
  
  Availability net35-Client, PCL
  
  Inheritance
Object
    FakeDateTimeZoneSource.Builder
  Inherited Members
      Object.ToString()
    
    
      Object.Equals(Object)
    
    
      Object.Equals(Object, Object)
    
    
      Object.ReferenceEquals(Object, Object)
    
    
      Object.GetHashCode()
    
    
      Object.GetType()
    
    
      Object.MemberwiseClone()
    
  Namespace: NodaTime.Testing.TimeZones
Assembly: NodaTime.Testing.dll
Syntax
public sealed class Builder : IEnumerable<DateTimeZone>, IEnumerable
  Constructors
Builder()
Creates a new builder.
  
  
  Since 1.1.x
  
  
  Availability net35-Client, PCL
  
  Declaration
public Builder()
  Properties
BclIdsToZoneIds
The dictionary mapping BCL System.TimeZoneInfo IDs to the canonical IDs
served within the provider being built.
  
  
  Since 1.1.x
  
  
  Availability net35-Client, PCL
  
  Declaration
public IDictionary<string, string> BclIdsToZoneIds { get; }
  Property Value
| Type | Description | 
|---|---|
| IDictionary<String, String> | 
VersionId
The version ID to advertise; defaults to "TestZones".
  
  
  Since 1.1.x
  
  
  Availability net35-Client, PCL
  
  Declaration
public string VersionId { get; set; }
  Property Value
| Type | Description | 
|---|---|
| String | 
Zones
List of zones, exposed as a property for use when a test needs to set properties as
well as adding zones.
  
  
  Since 1.1.x
  
  
  Availability net35-Client, PCL
  
  Declaration
public IList<DateTimeZone> Zones { get; }
  Property Value
| Type | Description | 
|---|---|
| IList<DateTimeZone> | 
Methods
Add(DateTimeZone)
Adds a time zone to the builder.
  
  
  Since 1.1.x
  
  
  Availability net35-Client, PCL
  
  Declaration
public void Add(DateTimeZone zone)
  Parameters
| Type | Name | Description | 
|---|---|---|
| DateTimeZone | zone | 
Build()
Builds a time zone source from this builder. The returned
builder will be independent of this builder; further changes
to this builder will not be reflected in the returned source.
  
  
  Since 1.1.x
  
  
  Availability net35-Client, PCL
  
  Declaration
public FakeDateTimeZoneSource Build()
  Returns
| Type | Description | 
|---|---|
| FakeDateTimeZoneSource | 
Remarks
This method performs some sanity checks, and throws exceptions if
they're violated. Those exceptions are not documented here, and you
shouldn't be catching them anyway. (This is aimed at testing...)
  
  GetEnumerator()
Returns the zones within the builder. This mostly exists
to enable collection initializers.
  
  
  Since 1.1.x
  
  
  Availability net35-Client, PCL
  
  Declaration
public IEnumerator<DateTimeZone> GetEnumerator()
  Returns
| Type | Description | 
|---|---|
| IEnumerator<DateTimeZone> | 
Explicit Interface Implementations
IEnumerable.GetEnumerator()
Explicit interface implementation of System.Collections.IEnumerator.
  
  
  Since 1.1.x
  
  
  Availability net35-Client, PCL
  
  Declaration
IEnumerator IEnumerable.GetEnumerator()
  Returns
| Type | Description | 
|---|---|
| IEnumerator | 
Implements
      System.Collections.Generic.IEnumerable<T>
  
  
      System.Collections.IEnumerable