⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 scheduleitem.cs

📁 SharpNuke源代码
💻 CS
字号:
using System;
using System.Collections;

using DotNetNuke.Common.Utilities;

//
// DotNetNuke -  http://www.dotnetnuke.com
// Copyright (c) 2002-2005
// by Shaun Walker ( sales@perpetualmotion.ca ) of Perpetual Motion Interactive Systems Inc. ( http://www.perpetualmotion.ca )
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
// documentation files (the "Software"), to deal in the Software without restriction, including without limitation
// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
// to permit persons to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or substantial portions
// of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
//

namespace DotNetNuke.Services.Scheduling
{
	public class ScheduleItem
	{
		///''''''''''''''''''''''''''''''''''''''''''''''''
		//This custom business object represents
		//a single item on the schedule.
		///''''''''''''''''''''''''''''''''''''''''''''''''
		private int scheduleID;
		private string typeFullName;
		private int timeLapse;
		private string timeLapseMeasurement;
		private int retryTimeLapse;
		private string retryTimeLapseMeasurement;
		private string objectDependencies;
		private int retainHistoryNum;
		private DateTime nextStart;
		private bool catchUpEnabled;
		private bool enabled;
		private string attachToEvent;
		private int threadID;
		private int processGroup;
		private ScheduleSource scheduleSource;
		private Hashtable scheduleItemSettings;
		private string servers;
		
		public ScheduleItem() 
		{
			this.scheduleID = Null.NullInteger;
			this.typeFullName = Null.NullString;
			this.timeLapse = Null.NullInteger;
			this.timeLapseMeasurement = Null.NullString;
			this.retryTimeLapse = Null.NullInteger;
			this.retryTimeLapseMeasurement = Null.NullString;
			this.objectDependencies = Null.NullString;
			this.retainHistoryNum = Null.NullInteger;
			this.nextStart = Null.NullDate;
			this.catchUpEnabled = Null.NullBoolean;
			this.enabled = Null.NullBoolean;
			this.attachToEvent = Null.NullString;
			this.threadID = Null.NullInteger;
			this.processGroup = Null.NullInteger;
			this.servers = Null.NullString;
		}
		
		public int ScheduleID
		{
			get { return this.scheduleID; }
			set { this.scheduleID = value; }
		}
		
		public string TypeFullName
		{
			get { return this.typeFullName; }
			set { this.typeFullName = value; }
		}
		
		public int TimeLapse
		{
			get { return this.timeLapse; }
			set { this.timeLapse = value; }
		}

		public string TimeLapseMeasurement
		{
			get { return this.timeLapseMeasurement; }
			set { this.timeLapseMeasurement = value; }
		}

		public int RetryTimeLapse
		{
			get { return this.retryTimeLapse; }
			set { this.retryTimeLapse = value; }
		}

		public string RetryTimeLapseMeasurement
		{
			get { return this.retryTimeLapseMeasurement; }
			set { this.retryTimeLapseMeasurement = value; }
		}

		public string ObjectDependencies
		{
			get { return this.objectDependencies; }
			set { this.objectDependencies = value; }
		}
		
		public int RetainHistoryNum
		{
			get { return this.retainHistoryNum; }
			set { this.retainHistoryNum = value; }
		}
		
		public DateTime NextStart
		{
			get 
			{ 
				if (this.nextStart == Null.NullDate)
				{
					this.nextStart = DateTime.Now;
				}
				return this.nextStart;
			}
			set { this.nextStart = value; }
		}

		public ScheduleSource ScheduleSource
		{
			get { return this.scheduleSource; }
			set { this.scheduleSource = value; }
		}
		
		public bool CatchUpEnabled
		{
			get { return this.catchUpEnabled; }
			set { this.catchUpEnabled = value; }
		}
		
		public bool Enabled
		{
			get { return this.enabled; }
			set { this.enabled = value; }
		}
		
		public string AttachToEvent
		{
			get { return this.attachToEvent; }
			set { this.attachToEvent = value; }
		}
		
		public int ThreadID
		{
			get { return this.threadID; }
			set { this.threadID = value; }
		}
		
		public int ProcessGroup
		{
			get { return this.processGroup; }
			set { this.processGroup = value; }
		}
		
		public string Servers
		{
			get { return this.servers; }
			set { 
				if (value != null)
				{
					value = value.Trim();
					if (value.Length > 0)
					{
						if (value.IndexOf(",") > 0)
						{
							value = "," + value;
						}
						if (!value.EndsWith(","))
						{
							value += ",";
						}
					}
				}
				this.servers = value;
			}
		}
		
		public bool HasObjectDependencies(string objectDependencies)
		{
			//@SV useless if case
			if (objectDependencies.IndexOf(",") > - 1)
			{
				string[] array;
				array = objectDependencies.ToLower().Split(',');
				foreach (string dependency in array)
				{
					if (dependency == objectDependencies.ToLower())
					{
						return true;
					}
				}
			}
			else
			{
				if (this.objectDependencies.ToLower().IndexOf(objectDependencies.ToLower()) > - 1)
				{
					return true;
				}
			}
			
			return false;
		}
		
		public void AddSetting (string key, string value)
		{
			this.scheduleItemSettings.Add(key, value);
		}

		public string GetSetting(string key)
		{
			if (this.scheduleItemSettings == null)
			{
				GetSettings();
			}
			if (this.scheduleItemSettings.ContainsKey(key))
			{
				return Convert.ToString(scheduleItemSettings[key]);
			}
			else
			{
				return string.Empty;
			}
		}

		public Hashtable GetSettings()
		{
			this.scheduleItemSettings = SchedulingProvider.Instance().GetScheduleItemSettings(this.ScheduleID);
			return this.scheduleItemSettings;
		}
	}
	
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -