当前位置: 首页>>代码示例>>C#>>正文


C# UInt32.Year方法代码示例

本文整理汇总了C#中System.UInt32.Year方法的典型用法代码示例。如果您正苦于以下问题:C# UInt32.Year方法的具体用法?C# UInt32.Year怎么用?C# UInt32.Year使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.UInt32的用法示例。


在下文中一共展示了UInt32.Year方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Run

		private void Run(JulianDay startDate, JulianDay endDate, BackgroundWorker worker, DoWorkEventArgs e)
		{
			JulianDay profileStartDate = App.Model.ProfileHolder.Profile.StartProfileDate.JulianDay;
			JulianDay profileEndDate = App.Model.ProfileHolder.Profile.EndProfileDate.JulianDay;
			// profileStartDate and profileEndDate could be 0

			if (startDate == 0 && endDate == 0)
			{
				startDate = profileStartDate;
				endDate = profileEndDate;
			}

			// Clip the passed start date to the document start date
			if (startDate < profileStartDate)
				startDate = profileStartDate;

			// Always run to the end of the document since changes ripple to the end
			endDate = profileEndDate;

			// From the start date forward, truncate the daily balances
			// Don't leave before doing this!
			_Accounts.TruncateBalance(startDate);
			_Categories.TruncateBalance(startDate);

			// If Dates were never set or nothing to do
			if ((profileStartDate == 0 && profileEndDate == 0) || startDate > profileEndDate)
			{
				UpdateBalances(worker, e);
				return;
			}
#if NOTUSED
			Helper.Trace("Calculating account values between {0,2:d2}/{1,2:d2}/{2,2:d2} and {3,2:d2}/{4,2:d2}/{5,2:d2}",
				startDate.Month(), startDate.Day(), startDate.Year(), endDate.Month(), endDate.Day(), endDate.Year());
			DateTime SystemTime = DateTime.Now;
			Helper.Trace("Start: {0,2:d2}:{1,2:d2}:{2,2:d2}:{3,2:d2}", SystemTime.Hour, SystemTime.Minute, SystemTime.Second, SystemTime.Millisecond);
#endif
			// Let the packages know we are about to run
			IncomeBalances.Clear();
			SpendingBalances.Clear();
			_Incomes.RunPrepare(this);
			_Packages.RunPrepare(this);

			// Loop thru all the dates in the running date range
			for (JulianDay date = startDate; date <= endDate; date++)
			{
				if (worker != null && worker.CancellationPending)
				{
					e.Cancel = true;
					return;
				}

				// Run the packages for the given date
				_Incomes.Run(this, date);
				_Packages.Run(this, date);

				// At the end of each day, handle any negative account balances by putting them on the credit account
				_Accounts.BorrowFromCredit(this, date);

				// At the end of each month, make credit payments if needed
				JulianDay tomorrow = date + 1;
				bool bMonthlyRun = (tomorrow.Day() == 1);
				if (bMonthlyRun)
					_Accounts.PayoffCredit(this, date);
			}

			// Update the RunCount for anyone listening
			RunCount++;

			UpdateBalances(worker, e);
#if NOTUSED
			SystemTime = DateTime.Now;
			Helper.Trace("End: {0,2:d2}:{1,2:d2}:{2,2:d2}:{3,2:d2}", SystemTime.Hour, SystemTime.Minute, SystemTime.Second, SystemTime.Millisecond);
#endif
		}
开发者ID:,项目名称:,代码行数:74,代码来源:


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