private static DateTime?GetCurrentTimeFromCoverageLayer(ICoverageLayer coverageLayer) //, DateTime? currentTime) { DateTime?currentTime = null; if (coverageLayer.Coverage.Time != null) { if (coverageLayer.Coverage.Filters.Count > 0) { var currentTimeFilter = coverageLayer.Coverage.Filters.OfType <IVariableValueFilter>().FirstOrDefault(); if ((null != currentTimeFilter) && (currentTimeFilter.Values.Count > 0)) { currentTime = (DateTime)currentTimeFilter.Values[0]; } } else { if (coverageLayer is INetworkCoverageGroupLayer) { var networkCoverageGroupLayer = (INetworkCoverageGroupLayer)coverageLayer; currentTime = ((NetworkCoverageFeatureCollection)networkCoverageGroupLayer.SegmentLayer.DataSource).TimeSelectionStart; } else if (coverageLayer.Coverage.Time.Values.Count > 0) { currentTime = coverageLayer.Coverage.Time.Values[0]; } } } return(currentTime); }
private static DateTime? GetCurrentTimeFromCoverageLayer(ICoverageLayer coverageLayer)//, DateTime? currentTime) { DateTime? currentTime = null; if (coverageLayer.Coverage.Time != null) { if (coverageLayer.Coverage.Filters.Count > 0) { var currentTimeFilter = coverageLayer.Coverage.Filters.OfType<IVariableValueFilter>().FirstOrDefault(); if ((null != currentTimeFilter) && (currentTimeFilter.Values.Count > 0)) { currentTime = (DateTime) currentTimeFilter.Values[0]; } } else { if (coverageLayer is INetworkCoverageGroupLayer) { var networkCoverageGroupLayer = (INetworkCoverageGroupLayer)coverageLayer; currentTime = ((NetworkCoverageFeatureCollection) networkCoverageGroupLayer.SegmentLayer.DataSource).TimeSelectionStart; } else if (coverageLayer.Coverage.Time.Values.Count > 0) { currentTime = coverageLayer.Coverage.Time.Values[0]; } } } return currentTime; }
private static DateTime?GetCurrentTimeFromCoverageLayer(ICoverageLayer coverageLayer, DateTime?currentTime) { if (coverageLayer.Coverage.Time != null) { if (coverageLayer.Coverage.Filters.Count > 0) { var currentTimeFilter = coverageLayer.Coverage.Filters.OfType <IVariableValueFilter>().FirstOrDefault(); if ((null != currentTimeFilter) && (currentTimeFilter.Values.Count > 0)) { currentTime = (DateTime)currentTimeFilter.Values[0]; } } else { if (coverageLayer.Coverage.Time.Values.Count > 0) { currentTime = coverageLayer.Coverage.Time.Values[0]; } } } return(currentTime); }
private static DateTime? GetCurrentTimeFromCoverageLayer(ICoverageLayer coverageLayer, DateTime? currentTime) { if (coverageLayer.Coverage.Time != null) { if (coverageLayer.Coverage.Filters.Count > 0) { var currentTimeFilter = coverageLayer.Coverage.Filters.OfType<IVariableValueFilter>().FirstOrDefault(); if ((null != currentTimeFilter) && (currentTimeFilter.Values.Count > 0)) { currentTime = (DateTime) currentTimeFilter.Values[0]; } } else { if (coverageLayer.Coverage.Time.Values.Count > 0) { currentTime = coverageLayer.Coverage.Time.Values[0]; } } } return currentTime; }