當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。