• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# TimeInterval类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中TimeInterval的典型用法代码示例。如果您正苦于以下问题:C# TimeInterval类的具体用法?C# TimeInterval怎么用?C# TimeInterval使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



TimeInterval类属于命名空间,在下文中一共展示了TimeInterval类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: SessionLengthGraphData

        public JsonResult SessionLengthGraphData(string game, AWSRegion region, TimeInterval interval, string start, string end)
        {
            DateTime st = Convert.ToDateTime(start);
            DateTime et = Convert.ToDateTime(end);

            return JsonResult(GameSessionsModel.Instance.GetAverageSessionLength(interval, region, st, et, game));
        }
开发者ID:parallaxisjones,项目名称:angularmetricsproj,代码行数:7,代码来源:GameController.cs


示例2: TestEquality

        public void TestEquality()
        {
            TimeInterval interval1 = new TimeInterval(new JulianDate(1.0), new JulianDate(2.0));
            TimeInterval interval2 = new TimeInterval(new JulianDate(1.0), new JulianDate(2.0));
            Assert.AreEqual(interval1, interval2);
            Assert.AreEqual(interval2, interval1);
            Assert.IsTrue(interval1.Equals(interval2));
            Assert.IsTrue(interval2.Equals(interval1));
            Assert.IsTrue(interval1 == interval2);
            Assert.IsTrue(interval2 == interval1);
            Assert.IsFalse(interval1 != interval2);
            Assert.IsFalse(interval2 != interval1);

            interval2 = new TimeInterval(new JulianDate(1.0), new JulianDate(3.0));
            Assert.AreNotEqual(interval1, interval2);
            Assert.AreNotEqual(interval2, interval1);
            Assert.IsFalse(interval1.Equals(interval2));
            Assert.IsFalse(interval2.Equals(interval1));
            Assert.IsFalse(interval1 == interval2);
            Assert.IsFalse(interval2 == interval1);
            Assert.IsTrue(interval1 != interval2);
            Assert.IsTrue(interval2 != interval1);

            Assert.AreNotEqual(interval1, 5);
        }
开发者ID:qjw2bqn,项目名称:czml-writer,代码行数:25,代码来源:TestTimeInterval.cs


示例3: UsersOnlineBySessionType

        public JsonResult UsersOnlineBySessionType(string game, AWSRegion region, TimeInterval interval, string start, string end)
        {
            DateTime st = Convert.ToDateTime(start);
            DateTime et = Convert.ToDateTime(end);

            return JsonResult(GameSessionsModel.Instance.UsersOnlineBySessionType(game, interval, region, st, et));
        }
开发者ID:parallaxisjones,项目名称:angularmetricsproj,代码行数:7,代码来源:GameController.cs


示例4: Add

        public void Add(string[] cbttPcodeList, DateTime t1, DateTime t2,
            HydrometHost svr = HydrometHost.PN, TimeInterval interval = TimeInterval.Monthly, int back=0)
        {
            // make cbttPcodeList unique.
            List<string> lst = new List<string>(cbttPcodeList);
            cbttPcodeList =  lst.Distinct().ToArray();

            //minT = t1;
            //maxT = t2;
            m_interval = interval;

            string query = String.Join(",",cbttPcodeList);

            if (query.Length >0)
            {
                DataTable m_table = new DataTable();
                if (interval == TimeInterval.Monthly)
                {
                    m_table = HydrometDataUtility.MPollTable(svr, query, t1, t2);
                }
                else if (interval == TimeInterval.Daily)
                {
                    m_table = HydrometDataUtility.ArchiveTable(svr, query, t1, t2,back);
                }
                else if (interval == TimeInterval.Irregular)
                {
                    m_table = HydrometDataUtility.DayFilesTable(svr, query, t1, t2,back);
                }
                m_table.ExtendedProperties.Add("interval", interval.ToString());
                s_counter++;
                m_table.TableName = svr.ToString()+"_"+interval.ToString() + s_counter;
                m_dataSet.Tables.Add(m_table);
            }
        }
开发者ID:usbr,项目名称:Pisces,代码行数:34,代码来源:HydrometDataCache.cs


示例5: ConstantSeries

 public ConstantSeries(string name, string parameter, double value, TimeInterval interval)
 {
     m_value = value;
       this.Name = name;
       this.Parameter = parameter;
       this.TimeInterval = interval;
 }
开发者ID:usbr,项目名称:Pisces,代码行数:7,代码来源:ConstantSeries.cs


示例6: Create

        public ActionResult Create(string name, int poolId)
        {
            try
            {
                Pool p = db.PoolSet.Find(poolId);
                int max = p.Division.Pools.Max(x => x.Teams.Count);
                if (p.Teams.Count == max)
                {
                    db.FinalsLinkSet.Add(new FinalsLink() { Division = p.Division, PoolPlacement = max + 1, Finalstage = max + 1 });
                }
                Team t = db.TeamSet.Add(new Team() { Name = name, Pool = p });
                // Add time intervals and default them to the tournament's time intervals
                foreach (TimeInterval ti in p.Division.Tournament.TimeIntervals)
                {
                    TimeInterval timeinterval = new TimeInterval() { Team = t, StartTime = ti.StartTime, EndTime = ti.EndTime };
                    db.TimeIntervalSet.Add(timeinterval);
                    t.TimeIntervals.Add(timeinterval);
                }
                //Clear the schedule
                sm.DeleteSchedule(p.Division.Tournament.Id, db);

                db.SaveChanges();

                return Json(new { status = "success", message = "New team added", id = t.Id }, JsonRequestBehavior.AllowGet);
            }
            catch (Exception ex)
            {
                return Json(new { status = "error", message = "New team not added", details = ex.Message }, JsonRequestBehavior.AllowGet);
            }
        }
开发者ID:Haurum,项目名称:P3,代码行数:30,代码来源:TeamController.cs


示例7: DataTableSeries

 public DataTableSeries(DataTable tbl, TimeInterval interval, string dateColumn, string valueColumnName)
 {
     this.data = tbl;
     this.TimeInterval = interval;
     this.dateColumn = dateColumn;
     this.valueColumnName = valueColumnName;
 }
开发者ID:usbr,项目名称:Pisces,代码行数:7,代码来源:DataTableSeries.cs


示例8: SetFacultyModificator

 public void SetFacultyModificator(TimeInterval interval)
 {
     foreach (var dataProvider in _dataProviders)
     {
         dataProvider.SetFacultyModificator(interval);
     }
 }
开发者ID:v-zubritsky,项目名称:MilitaryFaculty,代码行数:7,代码来源:DataProvidersContainer.cs


示例9: SetProfessorModificator

 public void SetProfessorModificator(Person professor, TimeInterval interval)
 {
     foreach (var dataProvider in _dataProviders)
     {
         dataProvider.SetPersonModificator(professor, interval);
     }
 }
开发者ID:v-zubritsky,项目名称:MilitaryFaculty,代码行数:7,代码来源:DataProvidersContainer.cs


示例10: GetIdahoPowerData

        /// <summary>
        /// </summary>
        /// <param name="stationID">example: 13245000</param>
        /// <param name="ipcoType">Q,Qin,HW,Qx,S</param>
        /// <param name="numDays">how many days back</param>
        /// <returns></returns>
        public static Series GetIdahoPowerData(string stationID, string ipcoType, int numDays, TimeInterval interval)
        {
            string xmlFileName = GetIdahoPowerXmlFile(stationID, interval, numDays);

            var s = ParseXmlData(xmlFileName, stationID, ipcoType, interval);
            return s;
        }
开发者ID:usbr,项目名称:Pisces,代码行数:13,代码来源:IdahoPowerSeries.cs


示例11: SetCathedraModificator

 public void SetCathedraModificator(Cathedra cathedra, TimeInterval interval)
 {
     foreach (var dataProvider in _dataProviders)
     {
         dataProvider.SetCathedraModificator(cathedra, interval);
     }
 }
开发者ID:v-zubritsky,项目名称:MilitaryFaculty,代码行数:7,代码来源:DataProvidersContainer.cs


示例12: Lookup

        /// <summary>
        /// Lookup hydromet Series.
        /// name is  interval_cbtt_pcode
        /// </summary>
        /// <param name="name"></param>
        /// <returns></returns>
        public override ParserResult Lookup(string name, TimeInterval defaultInterval)
        {
            var interval = defaultInterval;

            TimeSeriesName tn = new TimeSeriesName(name);
            if( tn.HasInterval)
            {
                interval = tn.GetTimeInterval();
            }

            if (tn.Valid)
            {
                Logger.WriteLine("Hydromet Lookup " + tn.siteid + "," + tn.pcode);
                var s = new Series();

                if (interval ==  TimeInterval.Monthly)
                {
                    s = new HydrometMonthlySeries(tn.siteid, tn.pcode,svr);
                }
                else if (interval == TimeInterval.Irregular)
                {
                    s = new HydrometInstantSeries(tn.siteid, tn.pcode,svr);
                }
                else if (interval == TimeInterval.Daily)
                {
                    s = new HydrometDailySeries(tn.siteid, tn.pcode,svr);
                }

                return new ParserResult(s);
            }
            else
            {
                return base.Lookup(name,interval);
            }
        }
开发者ID:usbr,项目名称:Pisces,代码行数:41,代码来源:HydrometVariableResolver.cs


示例13: PassToIso8601Interval

        public void PassToIso8601Interval()
        {
            //Since ToIso8601Interval is just a simple wrapper around two calls to
            //CesiumFormattingHelper.ToIso8601, this test is just a smoke screen.
            string expectedBasicInterval = "19800801T000000Z/20720703T000000Z";
            string expectedExtendedInterval = "1980-08-01T00:00:00Z/2072-07-03T00:00:00Z";
            string expectedCompactInterval = "19800801T00Z/20720703T00Z";

            JulianDate start = new GregorianDate(1980, 08, 01).ToJulianDate();
            JulianDate stop = new GregorianDate(2072, 07, 03).ToJulianDate();

            string basicInterval = CesiumFormattingHelper.ToIso8601Interval(start, stop, Iso8601Format.Basic);
            Assert.AreEqual(expectedBasicInterval, basicInterval);

            string extendedInterval = CesiumFormattingHelper.ToIso8601Interval(start, stop, Iso8601Format.Extended);
            Assert.AreEqual(expectedExtendedInterval, extendedInterval);

            string compactInterval = CesiumFormattingHelper.ToIso8601Interval(start, stop, Iso8601Format.Compact);
            Assert.AreEqual(expectedCompactInterval, compactInterval);

            TimeInterval interval = new TimeInterval(start, stop);
            basicInterval = CesiumFormattingHelper.ToIso8601Interval(interval, Iso8601Format.Basic);
            Assert.AreEqual(expectedBasicInterval, basicInterval);

            extendedInterval = CesiumFormattingHelper.ToIso8601Interval(interval, Iso8601Format.Extended);
            Assert.AreEqual(expectedExtendedInterval, extendedInterval);

            compactInterval = CesiumFormattingHelper.ToIso8601Interval(interval, Iso8601Format.Compact);
            Assert.AreEqual(expectedCompactInterval, compactInterval);
        }
开发者ID:qjw2bqn,项目名称:czml-writer,代码行数:30,代码来源:TestCesiumFormattingHelper.cs


示例14: PrivateVsPublic

        public JsonResult PrivateVsPublic(string game, AWSRegion region, TimeInterval interval, string start, string end)
        {
            DateTime st = Convert.ToDateTime(start);
            DateTime et = Convert.ToDateTime(end);

            return JsonResult(GameSessionsModel.Instance.GetPrivateSessionTimeSeries(game, interval, st, et));
        }
开发者ID:parallaxisjones,项目名称:angularmetricsproj,代码行数:7,代码来源:GameController.cs


示例15: GetAverageSessionLength

        public List<PVTimeSeries> GetAverageSessionLength(TimeInterval interval, AWSRegion region, DateTime startDate, DateTime endDate, string gameShortName)
        {
            List<PVTimeSeries> timeSeriesData = new List<PVTimeSeries>();
            DataTable queryResults = new DataTable();

            GameMonitoringConfig game = Games.Instance.GetMonitoredGames().Where(x => x.ShortTitle == gameShortName).FirstOrDefault();
            string query = String.Format(
                        @"select DATE(RecordCreated) as RecordTimeStamp,
                         SessionTypeFriendly as SeriesName,
                         round(avg(minute(timediff(RecordLastUpdateTime, RecordCreated)))) * 60 * 1000 as AverageSessionLength
                            from {0}
                            WHERE GameId = '{1}'
                            AND DATE(RecordCreated) BETWEEN '{2}' and '{3}'
                            AND minute(timediff(RecordLastUpdateTime, RecordCreated)) > 1
                            group by DATE(RecordCreated), SessionTypeFriendly
                            order by RecordCreated asc;",
                        "GameSessionMeta", game.Id, startDate.ToString("yyyy-MM-dd HH:mm:ss"), endDate.ToString("yyyy-MM-dd HH:mm:ss"));

            try
            {
                queryResults = DBManager.Instance.Query(Datastore.Monitoring, query);
                timeSeriesData = Charts.Instance.ProcessedTimeSeries(queryResults, interval, startDate, endDate, "RecordTimestamp");

            }
            catch (Exception ex)
            {
                Logger.Instance.Exception(ex.Message, ex.StackTrace);
            }

            return timeSeriesData;
        }
开发者ID:parallaxisjones,项目名称:angularmetricsproj,代码行数:31,代码来源:GameSessionsModel.cs


示例16: ReadCorpsDataFile

        public static Series ReadCorpsDataFile(string url, TimeInterval interval, params string[] headers)
        {
            string units = headers[headers.Length - 1];
            if( units == "n (ft)") // hack for Banks Lake.
                units = "(ft)";

            Series rval = new Series(units, interval);
            rval.HasFlags = true;

            string fileName = FileUtility.GetTempFileName(".txt");
            Web.GetTextFile(url, fileName, true);

            int[] widths = new int[] { 9, 5, 9, 9, 9, 9, 9, 9, 9, 9, 9,9,9 };

            var tf = new FixedWidthTextFile(fileName, widths);

            int col, row;
            tf.FindIndexToRange(headers, out row, out col);
            if (row < 0 || col < 0)
            {
                Logger.WriteLine("Error: no index found for headers '" + String.Join("','", headers) + "'");
                return rval;
            }

            rval.Name = String.Join(" ", headers, 0, headers.Length - 1);
            ReadDataIntoSeries(tf, rval, row + headers.Length, col);

            return rval;
        }
开发者ID:usbr,项目名称:Pisces,代码行数:29,代码来源:CorpsDataFile.cs


示例17: AverageSessionLengthChart

        public List<PVTableRow> AverageSessionLengthChart(string gameShort, TimeInterval interval, AWSRegion region, DateTime startDate, DateTime endDate)
        {
            GameMonitoringConfig game = Games.Instance.GetMonitoredGames().Where(x => x.ShortTitle == gameShort).FirstOrDefault();
            List<PVTableRow> DataTableInfo = GetAverageSessionLengthTable(interval, region, startDate, endDate, game);

            return DataTableInfo;
        }
开发者ID:parallaxisjones,项目名称:angularmetricsproj,代码行数:7,代码来源:GameSessionsModel.cs


示例18: MomentTest

 public void MomentTest() {
     DateTime moment = ClockProxy.Clock.Now;
     TimeInterval timeInterval = new TimeInterval(moment);
     Assert.AreEqual(timeInterval.Start, moment);
     Assert.AreEqual(timeInterval.End, moment);
     Assert.IsTrue(timeInterval.IsMoment);
     Assert.IsTrue(timeInterval.IsDegenerate);
 }
开发者ID:debop,项目名称:NFramework,代码行数:8,代码来源:TimeIntervalFixture.cs


示例19: TestRetainValue

 public void TestRetainValue()
 {
     JulianDate start = new JulianDate(DateTime.UtcNow);
     JulianDate stop = start + Duration.FromDays(1.5);
     TimeInterval interval = new TimeInterval(start, stop);
     Assert.AreEqual(start, interval.Start);
     Assert.AreEqual(stop, interval.Stop);
 }
开发者ID:qjw2bqn,项目名称:czml-writer,代码行数:8,代码来源:TestTimeInterval.cs


示例20: TestCalculateDuration

        public void TestCalculateDuration()
        {
            JulianDate start = new JulianDate(2451545.0);
            JulianDate stop = start + Duration.FromDays(1.5);
            TimeInterval interval = new TimeInterval(start, stop);

            Assert.AreEqual(Duration.FromDays(1.5), interval.ToDuration());
        }
开发者ID:qjw2bqn,项目名称:czml-writer,代码行数:8,代码来源:TestTimeInterval.cs



注:本文中的TimeInterval类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# TimeOfDay类代码示例发布时间:2022-05-24
下一篇:
C# TimeEntryModel类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap