C# 클래스 Habanero.Faces.Win.DateRangeComboBoxWin

Provides a selection of common date range options which a user can select from, modifying a start date and end date depending on the selection. The options to choose from, such as "Yesterday", "Last Week" or "This Year", can be modified by the developer. When adding this control, add an event handler on the SelectionChangeCommitted event, and obtain the StartDate and EndDate properties at this time.
NOTE: The start and end dates are the two boundaries of a potential range. Whether they should be inclusive or exclusive depends on the developer and how they are implemented. For instance, if today is Nov 13, Yesterday would provide a start date of Nov 12, 12am and an end date of Nov 13, 12am.
To add additional menu options that aren't available, simply add the new text item to the ComboBox, using Items.Add. When you pick up the SelectionChangeCommitted event, check if the new text string is selected in the Text property and use your own calculations instead of fetching the StartDate and EndDate.
상속: ComboBoxWin, IDateRangeComboBox
파일 보기 프로젝트 열기: Chillisoft/habanero.faces

공개 메소드들

메소드 설명
AddDateOption ( DateRangeOptions option ) : void

Adds a date range option to the current list of options available

DateRangeComboBoxWin ( ) : System

Constructor to initialise a new ComboBox with a selection of date range options that are suited to a timeless system

DateRangeComboBoxWin ( List optionsToDisplay ) : System

Constructor to initialiase a new ComboBox with a specific set of date range options to display

GetDateRangeString ( DateRangeOptions option ) : string

Returns the display string for the date range option supplied

RemoveDateOption ( DateRangeOptions option ) : void

Removes a date range option from the current list of options available

SetDateRangeString ( DateRangeOptions option, string newDisplayString ) : void

Amends the display string for a given date option

SetTopComboBoxItem ( string displayString ) : void

Sets the item in the ComboBox that first appears to the user

UseAllDateRangeOptions ( ) : void

Populates the ComboBox with all available DateOptions, since the default constructor only provides a standardised collection

메소드 상세

AddDateOption() 공개 메소드

Adds a date range option to the current list of options available
public AddDateOption ( DateRangeOptions option ) : void
option DateRangeOptions The date range option to add
리턴 void

DateRangeComboBoxWin() 공개 메소드

Constructor to initialise a new ComboBox with a selection of date range options that are suited to a timeless system
public DateRangeComboBoxWin ( ) : System
리턴 System

DateRangeComboBoxWin() 공개 메소드

Constructor to initialiase a new ComboBox with a specific set of date range options to display
public DateRangeComboBoxWin ( List optionsToDisplay ) : System
optionsToDisplay List A list of date range options
리턴 System

GetDateRangeString() 공개 메소드

Returns the display string for the date range option supplied
public GetDateRangeString ( DateRangeOptions option ) : string
option DateRangeOptions The date range enumeration
리턴 string

RemoveDateOption() 공개 메소드

Removes a date range option from the current list of options available
public RemoveDateOption ( DateRangeOptions option ) : void
option DateRangeOptions The date range option to remove
리턴 void

SetDateRangeString() 공개 메소드

Amends the display string for a given date option
public SetDateRangeString ( DateRangeOptions option, string newDisplayString ) : void
option DateRangeOptions The date option to amend
newDisplayString string The display string to apply
리턴 void

SetTopComboBoxItem() 공개 메소드

Sets the item in the ComboBox that first appears to the user
public SetTopComboBoxItem ( string displayString ) : void
displayString string The string to display
리턴 void

UseAllDateRangeOptions() 공개 메소드

Populates the ComboBox with all available DateOptions, since the default constructor only provides a standardised collection
public UseAllDateRangeOptions ( ) : void
리턴 void