Как привести объект AlfaTimeFrames к TimeSpan значению?

Как привести объект AlfaTimeFrames к TimeSpan значению? (Locked)
Atom
8/19/2011
watashi


Как привести объект AlfaTimeFrames к TimeSpan значению?

Спасибо.


Tags:


Thanks:


Sergey Masyura

Avatar
Date: 8/20/2011


watashi: Как привести объект AlfaTimeFrames к TimeSpan значению?

Спасибо.

В классе AlfaTimeFrames есть перегруженный оператор приведения типа:


/// <summary>
/// Привести объект <see cref="AlfaTimeFrames"/> к <see cref="TimeSpan"/> значению.
/// </summary>
/// <param name="timeFrame">Объект <see cref="AlfaTimeFrames"/>.</param>
/// <returns><see cref="TimeSpan"/> значение.</returns>
public static explicit operator TimeSpan(AlfaTimeFrames timeFrame)
{
	if (timeFrame == null)
		throw new ArgumentNullException("timeFrame");

	return timeFrame._value;
}

Thanks: watashi

watashi

Avatar
Date: 8/22/2011


_timeFrame = (TimeSpan)((ComboBoxItem)timeFrameComboBox.SelectedItem).Tag; [thumbup]

Thanks:

watashi

Avatar
Date: 8/22/2011


_timeFrame = (TimeSpan)((ComboBoxItem)timeFrameComboBox.SelectedItem).Tag; [thumbdn] _timeFrame = (TimeSpan)(AlfaTimeFrames)((ComboBoxItem)timeFrameComboBox.SelectedItem).Tag; [thumbup]

Thanks:

Sergey Masyura

Avatar
Date: 8/23/2011


watashi: _timeFrame = (TimeSpan)((ComboBoxItem)timeFrameComboBox.SelectedItem).Tag; [thumbdn] _timeFrame = (TimeSpan)(AlfaTimeFrames)((ComboBoxItem)timeFrameComboBox.SelectedItem).Tag; [thumbup]

Вероятно, приведение к ComboBoxItem можно убрать.

Thanks:


Attach files by dragging & dropping, , or pasting from the clipboard.

loading
clippy