Пример #1
0
        public WorkPackage Start(OSEnum pOS, String pAssignedClient)
        {
            StartDate = DateTime.UtcNow;
            ClientID  = pAssignedClient;

            _timeoutTimer          = new System.Timers.Timer();
            _timeoutTimer.Interval = TimeoutValue;
            _timeoutTimer.Elapsed += (sender, args) =>
            {
                _timeoutTimer.Stop();
                OnTimeoutHappenedEvent?.Invoke(this);
                StartDate     = DateTime.MinValue;
                ClientID      = String.Empty;
                WorkPackage   = null;
                _timeoutTimer = null;
            };
            _timeoutTimer.Start();

            return(new WorkPackage()
            {
                GUID = this.WorkItemID,
                WorkType = this.WorkType,
                Version = this.Version,
                InFiles = this.Files
            });
        }
Пример #2
0
        public WorkPackage Start(OSEnum pOS, String pAssignedClient)
        {
            StartDate = DateTime.UtcNow;
            ClientID  = pAssignedClient;

            _timeoutTimer          = new System.Timers.Timer();
            _timeoutTimer.Interval = TimeoutValue;
            _timeoutTimer.Elapsed += (sender, args) =>
            {
                _timeoutTimer.Stop();
                OnTimeoutHappenedEvent?.Invoke(this);
                StartDate     = DateTime.MinValue;
                ClientID      = String.Empty;
                WorkPackage   = null;
                _timeoutTimer = null;
            };
            _timeoutTimer.Start();

            WorkPackage = CreateWorkPackage(pOS, Parameters);
            return(WorkPackage);
        }