예제 #1
0
파일: Job.cs 프로젝트: wuhaiying83/EMR
        public override void ReadData(SerializedObject objSerializedObject)
        {
            base.ReadData(objSerializedObject);

            Name = objSerializedObject.Values.GetValue <string>("Name", string.Empty);

            _objTasks = objSerializedObject.Objects.GetObject <ITaskList>("Tasks", null);
            if (_objTasks == null)
            {
                _objTasks = new ITaskList();
            }

            Status = objSerializedObject.Values.GetValue <JobStatusType>("Status", JobStatusType.Queued);

            /// Create an ManualResetEvent for each of the job statuses that are currently
            /// defined.  We will use these to signal threads whenever a particular status
            /// has been set.
            ///
            _objWaitForStatusEvents = new Dictionary <JobStatusType, ManualResetEvent>();
            foreach (JobStatusType enuJobStatus in Enum.GetValues(typeof(JobStatusType)))
            {
                _objWaitForStatusEvents.Add(enuJobStatus, new ManualResetEvent(false));
            }

            _objStartThread = null;
            _objPauseEvent  = new ManualResetEvent(true);
        }
예제 #2
0
파일: Job.cs 프로젝트: wuhaiying83/EMR
        public override void ReadData(BinaryReaderExtension objBinaryReader)
        {
            base.ReadData(objBinaryReader);

            _strName   = objBinaryReader.ReadString();
            _enuStatus = (JobStatusType)objBinaryReader.ReadByte();
            _objTasks  = objBinaryReader.ReadTransportableObject <ITaskList>();
        }
예제 #3
0
파일: Job.cs 프로젝트: wuhaiying83/EMR
 public Job(string strName, IEnumerable <ITask> objTasks)
     : base()
 {
     Name      = strName;
     _objTasks = new ITaskList(objTasks);
 }