本文整理汇总了C#中ITimePeriod类的典型用法代码示例。如果您正苦于以下问题:C# ITimePeriod类的具体用法?C# ITimePeriod怎么用?C# ITimePeriod使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ITimePeriod类属于命名空间,在下文中一共展示了ITimePeriod类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
开发者ID:SleeplessByte,项目名称:life-insights,代码行数:13,代码来源:Phone.Call.cs
示例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;
}
开发者ID:debop,项目名称:NAccess,代码行数:15,代码来源:CalendarRepository.WorkTimeByUnitTime.cs
示例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;
}
开发者ID:debop,项目名称:NAccess,代码行数:34,代码来源:CalendarRepository.WorkTimeByUnitTime.cs
示例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;
}
开发者ID:debop,项目名称:NAccess,代码行数:44,代码来源:ProductRepository.Favorites.cs
示例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;
}
开发者ID:debop,项目名称:NAccess,代码行数:39,代码来源:LoggingRepository.LoginLog.cs
示例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;
}
开发者ID:debop,项目名称:NFramework,代码行数:13,代码来源:TimePeriodCollection.cs
示例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;
}
开发者ID:debop,项目名称:NFramework,代码行数:13,代码来源:TimePeriodCollection.cs
示例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;
}
开发者ID:debop,项目名称:NFramework,代码行数:13,代码来源:TimePeriodCollection.cs
示例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;
}
开发者ID:debop,项目名称:NAccess,代码行数:17,代码来源:LoggingRepository.LoginLog.cs
示例10: Add
// ----------------------------------------------------------------------
public void Add( ITimePeriod period )
{
if ( period == null )
{
throw new ArgumentNullException( "period" );
}
AddPeriod( period.Start, period );
AddPeriod( period.End, period );
Sort();
}
开发者ID:jwg4,项目名称:date-difference,代码行数:11,代码来源:TimeLineMomentCollection.cs
示例11: TimeRange
// ----------------------------------------------------------------------
public TimeRange( ITimePeriod copy )
{
if ( copy == null )
{
throw new ArgumentNullException( "copy" );
}
start = copy.Start;
end = copy.End;
isReadOnly = copy.IsReadOnly;
}
开发者ID:HoLoveSalt,项目名称:showhotel,代码行数:11,代码来源:TimeRange.cs
示例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;
}
开发者ID:debop,项目名称:NAccess,代码行数:16,代码来源:WorkTimeByRange.cs
示例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;
}
}
开发者ID:debop,项目名称:NFramework,代码行数:12,代码来源:TimeInterval.cs
示例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;
}
开发者ID:jwg4,项目名称:date-difference,代码行数:14,代码来源:TargetMomentCalculator.cs
示例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;
}
开发者ID:debop,项目名称:NFramework,代码行数:57,代码来源:TimeTool.Relation.cs
示例16: GetRelation
// ----------------------------------------------------------------------
public static PeriodRelation GetRelation( ITimePeriod period, ITimePeriod test )
{
if ( test.End < period.Start )
{
return PeriodRelation.After;
}
if ( test.Start > period.End )
{
return PeriodRelation.Before;
}
if ( test.Start == period.Start && test.End == period.End )
{
return PeriodRelation.ExactMatch;
}
if ( test.End == period.Start )
{
return PeriodRelation.StartTouching;
}
if ( test.Start == period.End )
{
return PeriodRelation.EndTouching;
}
if ( HasInside( period, test ) )
{
if ( test.Start == period.Start )
{
return PeriodRelation.EnclosingStartTouching;
}
return test.End == period.End ? PeriodRelation.EnclosingEndTouching : PeriodRelation.Enclosing;
}
bool periodContainsMyStart = HasInside( test, period.Start );
bool periodContainsMyEnd = HasInside( test, period.End );
if ( periodContainsMyStart && periodContainsMyEnd )
{
if ( test.Start == period.Start )
{
return PeriodRelation.InsideStartTouching;
}
return test.End == period.End ? PeriodRelation.InsideEndTouching : PeriodRelation.Inside;
}
if ( periodContainsMyStart )
{
return PeriodRelation.StartInside;
}
if ( periodContainsMyEnd )
{
return PeriodRelation.EndInside;
}
throw new InvalidOperationException( "invalid period relation of '" + period + "' and '" + test + "'" );
}
开发者ID:jwg4,项目名称:date-difference,代码行数:51,代码来源:TimePeriodCalc.cs
示例17: TimeOfDayChangedEventArgs
/// <summary>
/// Initializes a new instance of the <see cref="TimeOfDayChangedEventArgs"/> class.
/// </summary>
/// <param name="transitionFrom">The time period being transitioned from.</param>
/// <param name="transitionTo">The time period being transition to.</param>
public TimeOfDayChangedEventArgs(ITimePeriod transitionFrom, ITimePeriod transitionTo)
{
if (transitionTo == null)
{
throw new ArgumentNullException(nameof(transitionTo), "A state must be provided to transition to.");
}
else if (transitionFrom == null)
{
throw new ArgumentNullException(nameof(transitionFrom), "A state must be provided to transition from.");
}
this.TransitioningFrom = transitionFrom;
this.TransitioningTo = transitionTo;
}
开发者ID:danec020,项目名称:MudEngine,代码行数:19,代码来源:TimeOfDayChangedEventArgs.cs
示例18: Add
/// <summary>
/// 새로운 <paramref name="item"/>을 Chain의 제일 끝에 붙여 넣습니다. <paramref name="item"/>의 기간이 변경됩니다.
/// </summary>
/// <param name="item"></param>
public override void Add(ITimePeriod item) {
item.ShouldNotBeNull("item");
item.AssertMutable();
ITimePeriod last = Last;
if(last != null) {
AssertSpaceAfter(last.End, item.Duration);
item.Setup(last.End, last.End.Add(item.Duration));
}
if(IsDebugEnabled)
log.Debug("Period를 Chain의 끝에 추가합니다. item=[{0}]", item);
_periods.Add(item);
}
开发者ID:debop,项目名称:NFramework,代码行数:20,代码来源:TimePeriodChain.cs
示例19: FindAllWorkTimeByDayInRange
/// <summary>
/// Ư�� Calendar�� ������ ������ <see cref="WorkTimeByDay"/> ����� �����ɴϴ�.
/// </summary>
/// <param name="calendarCode">WorkTime ������ ������ �� Calendar�� �ڵ尪 (null�̸� �ȵȴ�)</param>
/// <param name="searchPeriod">�˻� �Ⱓ (null�̰ų� �Ⱓ�� ������� ��� �Ⱓ�� �����´�)</param>
/// <param name="firstResult">ù��° ��� ���� �ε��� (0���� ����. null�̸� 0���� ����)</param>
/// <param name="maxResults">��� ���� �ִ� ���ڵ� �� (null �Ǵ� 0 ������ ���� ���õȴ�)</param>
/// <param name="orders">���� ����</param>
/// <returns></returns>
public IList<WorkTimeByDay> FindAllWorkTimeByDayInRange(string calendarCode,
ITimePeriod searchPeriod,
int? firstResult,
int? maxResults,
params INHOrder<WorkTimeByDay>[] orders)
{
calendarCode.ShouldNotBeWhiteSpace("calendarCode");
if(log.IsDebugEnabled)
log.Debug(@"WorkTimeByDay ������ �ε��մϴ�... " +
@"calendarCode={0}, searchPeriod={1}, firstResult={2}, maxResults={3}, orders={4}",
calendarCode, searchPeriod, firstResult, maxResults, orders);
var query = BuildQueryOverOfWorkTimeByDay(calendarCode, null, searchPeriod).AddOrders(orders);
return Repository<WorkTimeByDay>.FindAll(query,
firstResult.GetValueOrDefault(),
maxResults.GetValueOrDefault());
}
开发者ID:debop,项目名称:NAccess,代码行数:28,代码来源:CalendarRepository.WorkTimeByUnitTime.cs
示例20: GenerateCategories
/// <summary>
/// 기간 단위에 따라 Category를 생성합니다.
/// </summary>
/// <param name="categoryCollectionList">생성된 <see cref="CategoriesElement"/> 정보가 담길 객체</param>
/// <param name="timePeriod">Gantt에 표현할 전체 기간 (프로젝트 전체 기간)</param>
/// <param name="periodFlags">Gantt Chart X축에 나타낼 기간 단위 정보</param>
public static void GenerateCategories(IList<CategoriesElement> categoryCollectionList,
ITimePeriod timePeriod,
PeriodFlags periodFlags) {
categoryCollectionList.ShouldNotBeNull("categoryCollectionList");
timePeriod.ShouldNotBeNull("periodRange");
Guard.Assert(timePeriod.HasPeriod, "Gantt에 나타낼 전체 기간은 시작과 끝이 있어야합니다.");
if(IsDebugEnabled)
log.Debug("Gantt의 기간 부분을 생성합니다. timePeriod=[{0}], periodFlags=[{1}]", timePeriod, periodFlags);
categoryCollectionList.Clear();
if((periodFlags & PeriodFlags.Year) > 0)
categoryCollectionList.Add(CreateCategories(timePeriod.ForEachYears(),
range => range.Start.Year.ToString()));
if((periodFlags & PeriodFlags.HalfYear) > 0)
categoryCollectionList.Add(CreateCategories(timePeriod.ForEachYears(),
range => (range.End.HalfyearOf() == HalfyearKind.First) ? "1st" : "2nd"));
if((periodFlags & PeriodFlags.Quarter) > 0)
categoryCollectionList.Add(CreateCategories(timePeriod.ForEachQuarters(),
range => "Q" + range.End.QuarterOf().GetHashCode().ToString()));
if((periodFlags & PeriodFlags.Month) > 0)
categoryCollectionList.Add(CreateCategories(timePeriod.ForEachMonths(),
range => range.End.GetMonthName()));
if((periodFlags & PeriodFlags.Week) > 0)
categoryCollectionList.Add(CreateCategories(timePeriod.ForEachWeeks(),
range => "W" + range.End.GetYearAndWeek().Week.Value.ToString()));
if((periodFlags & PeriodFlags.Day) > 0)
categoryCollectionList.Add(CreateCategoriesAsParallel(timePeriod.ForEachDays(), range => range.End.Day.ToString()));
if((periodFlags & PeriodFlags.Hour) > 0)
categoryCollectionList.Add(CreateCategoriesAsParallel(timePeriod.ForEachHours(),
range => "H" + range.End.Hour.ToString()));
}
开发者ID:debop,项目名称:NFramework,代码行数:45,代码来源:GanttUtil.cs
注:本文中的ITimePeriod类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论