本文整理汇总了C#中ITimePeriod类的典型用法代码示例。如果您正苦于以下问题:C# ITimePeriod类的具体用法?C# ITimePeriod怎么用?C# ITimePeriod使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ITimePeriod类属于命名空间,在下文中一共展示了ITimePeriod类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Call
/// <summary>
/// Creates a new call
/// </summary>
/// <param name="number"></param>
/// <param name="period"></param>
/// <param name="action"></param>
public Call(Phone.Number number, ITimePeriod period, Action action)
{
this.Number = number;
this.Period = period;
_result = action;
}
示例2: BuildCriteriaOfWorkTimeByDay
/// <summary>
/// <see cref="WorkTimeByDay"/> ������ ��ȸ�ϱ� ���� Criteria�� ����մϴ�.
/// </summary>
/// <param name="calendarCode"></param>
/// <param name="workDay"></param>
/// <param name="workPeriod"></param>
/// <param name="isWork"></param>
/// <returns></returns>
public DetachedCriteria BuildCriteriaOfWorkTimeByDay(string calendarCode,
DateTime? workDay = null,
ITimePeriod workPeriod = null,
bool? isWork = null)
{
return BuildQueryOverOfWorkTimeByDay(calendarCode, workDay, workPeriod, isWork).DetachedCriteria;
}
示例3: BuildQueryOverOfWorkTimeByDay
/// <summary>
/// <see cref="WorkTimeByDay"/> ������ ��ȸ�ϱ� ���� Criteria�� ����մϴ�.
/// </summary>
/// <param name="calendarCode"></param>
/// <param name="workDay"></param>
/// <param name="workPeriod"></param>
/// <param name="isWork"></param>
/// <returns></returns>
public QueryOver<WorkTimeByDay, WorkTimeByDay> BuildQueryOverOfWorkTimeByDay(string calendarCode,
DateTime? workDay = null,
ITimePeriod workPeriod = null,
bool? isWork = null)
{
if(log.IsDebugEnabled)
log.Debug(@"WorkTimeByDay ������ ��ȸ�ϱ� ���� Criteria�� ����մϴ�... " +
@"calendarCode={0}, workDay={1}, workRange={2}, isWork={3}",
calendarCode, workDay, workPeriod, isWork);
var query = QueryOver.Of<WorkTimeByDay>();
if(calendarCode.IsNotWhiteSpace())
query.AddWhere(wt => wt.CalendarCode == calendarCode);
if(workDay.HasValue)
query.AddWhere(wt => wt.WorkDay == workDay);
if(workPeriod.IsAnytime == false)
query.AddBetween(wt => wt.WorkDay, workPeriod.StartAsNullable, workPeriod.EndAsNullable);
if(isWork.HasValue)
query.AddNullAsTrue(wt => wt.IsWork, isWork.Value);
return query;
}
示例4: BuildQueryOverOfFavorite
/// <summary>
/// 즐겨찾기를 위한 질의 객체 (<see cref="DetachedCriteria"/>)를 빌드합니다.
/// </summary>
/// <param name="product">지정된 제품, null이면 검색조건에서 제외합니다.</param>
/// <param name="company">지정된 회사, null이면 검색조건에서 제외합니다.</param>
/// <param name="ownerCode">소유자 코드, null이면 검색조건에서 제외합니다.</param>
/// <param name="ownerKind">소유자 종류, <see cref="ActorKinds.Unknown"/>이면 검색조건에서 제외합니다.</param>
/// <param name="registerCode">등록자 코드</param>
/// <param name="registTimeRange">등록일 검색 범위</param>
/// <returns></returns>
public virtual QueryOver<Favorite, Favorite> BuildQueryOverOfFavorite(Product product,
Company company,
string ownerCode,
ActorKinds? ownerKind = null,
string registerCode = null,
ITimePeriod registTimeRange = null)
{
if(IsDebugEnabled)
log.Debug(@"즐겨찾기 조회를 위한 QueryOver를 생성합니다... " +
@"company={0}, product={1}, ownerCode={2}, ownerKind={3}, registerCode={4}, registTimeRange={5}",
company, product, ownerCode, ownerKind, registerCode, registTimeRange);
var query = QueryOver.Of<Favorite>();
if(product != null)
query.AddWhere(f => f.ProductCode == product.Code);
if(company != null)
query.AddWhere(f => f.CompanyCode == company.Code);
if(ownerCode.IsNotWhiteSpace())
query.AddWhere(f => f.OwnerCode == ownerCode);
if(ownerKind.HasValue)
query.AddWhere(f => f.OwnerKind == ownerKind.Value);
if(registerCode.IsNotWhiteSpace())
query.AddWhere(f => f.RegisterCode == registerCode);
if(registTimeRange != null && registTimeRange.IsAnytime == false)
query.AddBetween(f => f.RegistDate, registTimeRange.StartAsNullable, registTimeRange.EndAsNullable);
return query;
}
示例5: BuildQueryOverOfUserLoginLog
/// <summary>
/// 사용자 로그인 이력을 조회하기 위한 Criteria를 빌드합니다.
/// </summary>
/// <param name="productCode">제품 코드</param>
/// <param name="companyCode">회사 코드</param>
/// <param name="loginId">로그인 ID (사용자 코드가 아니다)</param>
/// <param name="localeKey">지역화 정보 (<see cref="CultureInfo.Name"/>)</param>
/// <param name="loginTimePeriod">로그인 시간의 검색 범위</param>
/// <returns></returns>
public QueryOver<UserLoginLog, UserLoginLog> BuildQueryOverOfUserLoginLog(string productCode,
string companyCode = null,
string loginId = null,
string localeKey = null,
ITimePeriod loginTimePeriod = null)
{
if(log.IsDebugEnabled)
log.Debug(@"사용자 로그인 이력을 조회하기 위한 Criteria를 빌드합니다... " +
@"productCode={0}, companyCode={1}, loginId={2}, localeKey={3}, loginTimePeriod={4}",
productCode, companyCode, loginId, localeKey, loginTimePeriod);
var query = QueryOver.Of<UserLoginLog>();
if(productCode.IsNotWhiteSpace())
query.AddWhere(ulog => ulog.ProductCode == productCode);
if(companyCode.IsNotWhiteSpace())
query.AddWhere(ulog => ulog.CompanyCode == companyCode);
if(loginId.IsNotWhiteSpace())
query.AddWhere(ulog => ulog.LoginId == loginId);
if(localeKey.IsNotWhiteSpace())
query.AddWhere(ulog => ulog.LocaleKey == localeKey);
if(loginTimePeriod != null && loginTimePeriod.IsAnytime == false)
query.AddBetween(ulog => ulog.LoginTime, loginTimePeriod.StartAsNullable, loginTimePeriod.EndAsNullable);
return query;
}
示例6: HasIntersectionPeriods
/// <summary>
/// <paramref name="target"/> 기간과 기간이 교차하는 TimePeriod 요소가 존재하는가?
/// </summary>
/// <param name="target"></param>
/// <returns></returns>
public virtual bool HasIntersectionPeriods(ITimePeriod target) {
var result = _periods.Any(p => target.IntersectsWith(p));
if(IsDebugEnabled)
log.Debug("target[{0}]과 기간이 교차하는 요소가 존재하는가? [{1}]", target, result);
return result;
}
示例7: HasOverlapPeriods
/// <summary>
/// 대상 TimePeriod와 기간이 겹치는 TimePeriod 요소가 존재하는가?
/// </summary>
/// <param name="target"></param>
/// <returns></returns>
public virtual bool HasOverlapPeriods(ITimePeriod target) {
var result = _periods.Any(p => target.OverlapsWith(p));
if(IsDebugEnabled)
log.Debug("target[{0}]과 기간이 겹치는 요소가 존재하는가? [{1}]", target, result);
return result;
}
示例8: HasInsidePeriods
/// <summary>
/// 대상 TimePeriod 를 포함하는 TimePeriod 요소가 존재하는가?
/// </summary>
/// <param name="target"></param>
/// <returns></returns>
public virtual bool HasInsidePeriods(ITimePeriod target) {
var result = _periods.Any(p => target.HasInside(p));
if(IsDebugEnabled)
log.Debug("target[{0}]을 포함하는 요소가 존재하는가? [{1}]", target, result);
return result;
}
示例9: BuildCriteriaOfUserLoginLog
/// <summary>
/// 사용자 로그인 이력을 조회하기 위한 Criteria를 빌드합니다.
/// </summary>
/// <param name="productCode">제품 코드</param>
/// <param name="companyCode">회사 코드</param>
/// <param name="loginId">로그인 ID (사용자 코드가 아니다)</param>
/// <param name="localeKey">지역화 정보 (<see cref="CultureInfo.Name"/>)</param>
/// <param name="loginTimePeriod">로그인 시간의 검색 범위</param>
/// <returns></returns>
public DetachedCriteria BuildCriteriaOfUserLoginLog(string productCode,
string companyCode = null,
string loginId = null,
string localeKey = null,
ITimePeriod loginTimePeriod = null)
{
return BuildQueryOverOfUserLoginLog(productCode, companyCode, loginId, localeKey, loginTimePeriod).DetachedCriteria;
}
示例10: Add
// ----------------------------------------------------------------------
public void Add( ITimePeriod period )
{
if ( period == null )
{
throw new ArgumentNullException( "period" );
}
AddPeriod( period.Start, period );
AddPeriod( period.End, period );
Sort();
}
示例11: TimeRange
// ----------------------------------------------------------------------
public TimeRange( ITimePeriod copy )
{
if ( copy == null )
{
throw new ArgumentNullException( "copy" );
}
start = copy.Start;
end = copy.End;
isReadOnly = copy.IsReadOnly;
}
示例12: WorkTimeByRange
/// <summary>
/// 생성자
/// </summary>
/// <param name="calendar"></param>
/// <param name="timeRange"></param>
/// <param name="previousCumulatedWorkInMinute"></param>
public WorkTimeByRange(Calendar calendar, ITimePeriod timeRange, int previousCumulatedWorkInMinute)
: base(calendar, timeRange.Start)
{
timeRange.ShouldNotBeNull("timeRange");
Guard.Assert(timeRange.HasPeriod, @"timeRange는 명시적인 구간을 가져야 합니다.");
TimePeriod.Setup(timeRange.Start, timeRange.End);
CumulatedInMinute = previousCumulatedWorkInMinute + WorkInMinute;
}
示例13: TimeInterval
public TimeInterval(ITimePeriod src) : base(src) {
src.ShouldNotBeNull("src");
var interval = src as ITimeInterval;
if(interval != null) {
_start = interval.StartInterval;
_end = interval.EndInterval;
_startEdge = interval.StartEdge;
_endEdge = interval.EndEdge;
_isIntervalEnabled = interval.IsIntervalEnabled;
}
}
示例14: EvaluatePeriod
// ----------------------------------------------------------------------
protected override bool EvaluatePeriod( ITimePeriod period, int periodCount )
{
TimeSpan allPeriodDuration = new TimeSpan( period.Duration.Ticks * periodCount );
if ( allPeriodDuration >= remainingDuration )
{
targetMoment = period.Start.Add( new TimeSpan( remainingDuration.Ticks / periodCount ) );
return false;
}
remainingDuration = remainingDuration.Subtract( allPeriodDuration );
return true;
}
示例15: GetReleation
/// <summary>
/// <paramref name="period"/>가 <paramref name="target"/>과의 시간 축으로 선 후행 관계를 판단합니다.
/// </summary>
/// <param name="period"></param>
/// <param name="target"></param>
/// <returns></returns>
public static PeriodRelation GetReleation(this ITimePeriod period, ITimePeriod target) {
period.ShouldNotBeNull("period");
target.ShouldNotBeNull("target");
var relation = PeriodRelation.NoRelation;
if(period.Start > target.End) {
relation = PeriodRelation.After;
}
else if(period.End < target.Start) {
relation = PeriodRelation.Before;
}
else if(period.Start == target.Start && period.End == target.End) {
relation = PeriodRelation.ExactMatch;
}
else if(period.Start == target.End) {
relation = PeriodRelation.StartTouching;
}
else if(period.End == target.Start) {
relation = PeriodRelation.EndTouching;
}
else if(HasInside(period, target)) {
if(period.Start == target.Start)
relation = PeriodRelation.EnclosingStartTouching;
else
relation = (period.End == target.End) ? PeriodRelation.EnclosingEndTouching : PeriodRelation.Enclosing;
}
// 기간이 대상 기간 내부에 속할 때
else {
var insideStart = HasInside(target, period.Start);
var insideEnd = HasInside(target, period.End);
if(insideStart && insideEnd) {
relation = Equals(period.Start, target.Start)
? PeriodRelation.InsideStartTouching
: period.End == target.End
? PeriodRelation.InsideEndTouching
: PeriodRelation.Inside;
}
else if(insideStart)
relation = PeriodRelation.StartInside;
else if(insideEnd)
relation = PeriodRelation.EndInside;
}
if(IsDebugEnabled)
log.Debug("period[{0}]와 target[{1}] 간의 Relation은 [{2}] 입니다.", period.AsString(), target.AsString(), relation);
return relation;
}