public Sampling() { Id = IDUtils.NewGuid(); DateRange = new DateRange(); CollectionEventId = IDUtils.NewGuid(); ModeOfCollectionId = IDUtils.NewGuid(); CollectionSituationId = IDUtils.NewGuid(); Universes = new List<Universe>(); }
public Coverage() { Id = IDUtils.NewGuid(); TopicalCoverageId = IDUtils.NewGuid(); TemporalCoverageId = IDUtils.NewGuid(); SpatialCoverageId = IDUtils.NewGuid(); //メモとコードをあわせて保存しないといけないので、List<string>で管理することはできない。 Topics = new List<CheckOption>(); Keywords = new List<Keyword>(); DateRange = new DateRange(); Areas = new List<CheckOption>(); GeographicStructureIdSuffix = IDUtils.NewGuid(); GeographicIdSuffix = IDUtils.NewGuid(); }
private void OnDateRangeChanged(DateRange oldValue, DateRange newValue) { UpdateDays(fromDays, newValue.FromYear, newValue.FromMonth); UpdateDays(toDays, newValue.ToYear, newValue.ToMonth); RoutedPropertyChangedEventArgs<DateRange> args = new RoutedPropertyChangedEventArgs<DateRange>(oldValue, newValue); args.RoutedEvent = DateRangePicker.DateRangeChangedEvent; RaiseEvent(args); }
private XElement CreateDate(XName name, DateRange dateRange) { if (dateRange.IsEmpty) { return null; } if (dateRange.IsFromDateOnly) { return new XElement(name, new XElement(r + TAG_SIMPLE_DATE, ToString(dateRange.FromDateTime))); } return new XElement(name, new XElement(r + TAG_START_DATE, ToString(dateRange.FromDateTime)), new XElement(r + TAG_END_DATE, ToString(dateRange.ToDateTime))); }
public string ToDDIFundingInfoDateRange(DateRange dateRange) { return ToDDIFundingInfoLabel(LABEL_FUNDING_INFO_DATE_RANGE, ToString(dateRange)); }
public static string ToString(DateRange range) { return ToString(range.FromDateTime) + DATERANGE_SEPARATOR + ToString(range.ToDateTime); }
public Event() { Id = IDUtils.NewGuid(); DateRange = new DateRange(); }
public static DateRange Parse(string str, char separator) { DateRange range = new DateRange(); string[] elems = str.Split(separator); if (elems.Length != 2) { return range; } DateTime? fromDate = ParseDateTime(elems[0]); if (fromDate == null) { //fromが解析できない場合からのDateRangeを返す return range; } //toはnullでも良い。 DateTime? toDate = ParseDateTime(elems[1]); range = new DateRange(fromDate, toDate); return range; }
public static bool EqualsDateRange(DateRange range1, DateRange range2) { if (range1 == null) { if (range2 == null) { return true; } else { return false; } } return range1.Equals(range2); }
public static DateRange ReadDateRange(XElement elem, XName name) { DateRange dateRange = null; XElement dateElem = elem.Descendants(name).FirstOrDefault(); if (dateElem != null) { //日付 DateTime? fromDate = (DateTime?)dateElem.Element(r + TAG_SIMPLE_DATE); DateTime? toDate = null; if (fromDate == null) { fromDate = (DateTime?)dateElem.Element(r + TAG_START_DATE); toDate = (DateTime?)dateElem.Element(r + TAG_END_DATE); } if (fromDate != null || toDate != null) { dateRange = new DateRange(fromDate, toDate); } } return dateRange; }
public FundingInfo() { Id = IDUtils.NewGuid(); DateRange = new DateRange(); Organization = new Organization(); }
private List<XElement> CreateTimePrds(XName name, DateRange dateRange) { List<XElement> elements = new List<XElement>(); if (!dateRange.IsEmpty) { if (dateRange.IsFromDateOnly) { XElement timePrd1 = new XElement(name, new XAttribute(ATTR_DATE, ToString(dateRange.FromDate))); elements.Add(timePrd1); } else { XElement timePrd1 = new XElement(name, new XAttribute(ATTR_DATE, ToString(dateRange.FromDate)), new XAttribute(ATTR_EVENT, "start")); XElement timePrd2 = new XElement(name, new XAttribute(ATTR_DATE, ToString(dateRange.ToDate)), new XAttribute(ATTR_EVENT, "end")); elements.Add(timePrd1); elements.Add(timePrd2); } } return elements; }
private void OnDateRangeChanged(DateRange oldValue, DateRange newValue) { UpdateRangeControls(); RoutedPropertyChangedEventArgs<DateRange> args = new RoutedPropertyChangedEventArgs<DateRange>(oldValue, newValue); args.RoutedEvent = DateRangePicker.DateRangeChangedEvent; RaiseEvent(args); }
private static void OnToDateChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e) { DateRangePicker dateRangePicker = (DateRangePicker)sender; DateRange oldDateRange = dateRangePicker.DateRange; DateRange newDateRange = new DateRange(oldDateRange.FromDateTime, (DateTime?)e.NewValue); dateRangePicker.DateRange = newDateRange; }