Source/Editors/DateTimeAdv/HourPeriodLabel.cs
(开头部分) 3KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
#if FRAMEWORK20
using System;
using System.Collections.Generic;
using System.Text;
using System.ComponentModel;
using System.Globalization;
namespace DevComponents.Editors.DateTimeAdv
{
/// <summary>
/// Represents a label for the NumericHourInput control that shows whether time is AM or PM.
/// </summary>
public class HourPeriodLabel : VisualLabel
{
#region Private Variables
#endregion
#region Events
#endregion
#region Constructor
#endregion
#region Internal Implementation
private NumericHourInput _HourInput;
public NumericHourInput HourInput
{
get { return _HourInput; }
set
{
if (_HourInput != null)
_HourInput.ValueChanged -= new EventHandler(HourChanged);
_HourInput = value;
if (_HourInput != null)
_HourInput.ValueChanged += new EventHandler(HourChanged);
}
}
private void HourChanged(object sender, EventArgs e)
{
if (_HourInput == null) return;
string s = "";
if (!_HourInput.IsEmpty)
{
if (_HourInput.Period == eHourPeriod.AM)
{
if (_AMText != null && _AMText.Length > 0)
s = _AMText;
else
s = DateTimeInput.GetActiveCulture().DateTimeFormat.AMDesignator;
}
else
{
if (_PMText != null && _PMText.Length > 0)
s = _PMText;
else
s = DateTimeInput.GetActiveCulture().DateTimeFormat.PMDesignator;
}
if (_UseSingleLetterLabel && s.Length > 0)
s = s[0].ToString();
后面还有 45 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。