예제 #1
0
        public DateTime?GetDateTime(TRB_KIND kind, TRB_PART part, TRB_PART where, TRB_STATE whereState)
        {
            DateTime?dt = null;

            switch (kind)
            {
            case TRB_KIND.MINIMUM:
                dt = ProjectCollection.Min(proj => proj.GetDateTime(kind, part, where, whereState));
                break;

            case TRB_KIND.MAXIMUM:
                dt = ProjectCollection.Max(proj => proj.GetDateTime(kind, part, where, whereState));
                break;

            case TRB_KIND.FIRST:
                break;

            case TRB_KIND.LAST:
                break;

            default:
                break;
            }

            return(dt);
        }
예제 #2
0
        public DateTime?GetDateTime(TRB_KIND kind, TRB_PART part, TRB_PART where, TRB_STATE whereState)
        {
            DateTime?dt = null;

            switch (kind)
            {
            case TRB_KIND.MINIMUM:
                dt = TimeBoxCollection.Where(trb => trb.GetDateTime(where, whereState) != null).Min(trb => trb.GetDateTime(part));
                break;

            case TRB_KIND.MAXIMUM:
                dt = TimeBoxCollection.Where(trb => trb.GetDateTime(where, whereState) != null).Max(trb => trb.GetDateTime(part));
                break;

            case TRB_KIND.FIRST:
            {
                var atrb =
                    TimeBoxCollection.Where(trb => trb.GetDateTime(where, whereState) != null).FirstOrDefault(trb => null != trb.GetDateTime(part));
                dt = atrb != null?atrb.GetDateTime(part) : null;
            }
            break;

            case TRB_KIND.LAST:
            {
                var atrb =
                    TimeBoxCollection.Where(trb => trb.GetDateTime(where, whereState) != null).LastOrDefault(trb => null != trb.GetDateTime(part));
                dt = atrb != null?atrb.GetDateTime(part) : null;
            }
            break;
            }
            return(dt);
        }