|
/*
* Created by: Steinar Dragsnes
* Created: 21.11.2008
*/
using System;
namespace DateTimeZone
{
/// <summary>
/// Contract for a simple time zone representation.
/// </summary>
public interface ITimeZone
{
/// <summary>
/// This time zone's offset from GMT.
/// </summary>
double Offset { get; }
/// <summary>
/// Calculated hour offset derived from Offset.
/// </summary>
int HourOffset { get; }
/// <summary>
/// Calculated minute offset derived from Offset.
/// </summary>
int MinuteOffset { get; }
/// <summary>
/// The Id.
/// </summary>
string CanonicalID { get; }
/// <summary>
/// Location alias.
/// </summary>
string Aliases { get; }
/// <summary>
/// The definition of when a summer time zone change occurs.
/// </summary>
DaylightSavingTime SummerChange { get; }
/// <summary>
/// The definition of when a revertion to a standard time zone change occurs.
/// </summary>
DaylightSavingTime WinterChange { get; }
///<summary>
///Returns a <see cref="T:System.String"></see> that represents the current <see cref="T:System.Object"></see>.
///</summary>
///
///<returns>
///A <see cref="T:System.String"></see> that represents the current <see cref="T:System.Object"></see>.
///</returns>
///<filterpriority>2</filterpriority>
string ToString();
/// <summary>
/// Printing the content of this
/// </summary>
/// <returns>A string formatted to print the c# code needed to define the TimeZone based on the values in this class</returns>
string PrintValues();
/// <summary>
/// A convenience method that checks if the newly converted date for a time zone is within that
/// time zone's definted DST rules.
/// </summary>
/// <param name="time"></param>
/// <returns></returns>
bool IsDST(System.DateTime time);
/// <summary>
/// Convenience getter for checking if a time zone has DST.
/// </summary>
bool HasDST { get; }
/// <summary>
/// Convenience method for calculating the point in time when the winter time starts.
/// </summary>
/// <param name="year">For which year to calculate the winter change.</param>
/// <returns>A point in time representing the winter change.</returns>
DateTime GetDSTEnd(int year);
/// <summary>
/// Convenience method for calculating the point in time when the summer time starts.
/// </summary>
/// <param name="year">For which year to calculate the summer change.</param>
/// <returns>A point in time representing the summer change.</returns>
DateTime GetDSTStart(int year);
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.