Beispiel #1
0
 /// <summary>
 /// Sets execution state of the specified method.
 /// </summary>
 /// <param name="methodIndex">Index of the method.</param>
 /// <param name="value">Execution state of the method.</param>
 protected virtual void SetMethodState(int methodIndex, QueueItemMethodState state)
 {
     lock (this)
     {
         _methodState[methodIndex] = state;
     }
 }
Beispiel #2
0
 /// <summary>
 /// Initializes internal variables of the object that are related to the implementation of IQueueItem interface.
 /// </summary>
 /// <param name="methodCount">Number of methods that are associated with the item. </param>
 protected void InitializeIQueueItemVariables(int methodCount)
 {
     _methodCount = methodCount;
     _methodState = new QueueItemMethodState[methodCount];
     for (int i = 0; i < methodCount; i++)
     {
         _methodState[i] = QueueItemMethodState.NotStarted;
     }
 }
Beispiel #3
0
        public override string GetText(int textInfoId)
        {
            if (textInfoId == ThumbnailListItem.TextInfoIdPath)
            {
                return(_pidl.Path);
            }

            int methodIndex = ThumbInfoToMethodIndex(textInfoId);

            if (methodIndex < 0)
            {
                return(string.Empty);
            }
            QueueItemMethodState methodState = GetMethodState(methodIndex);

            if (methodState == QueueItemMethodState.Finished)
            {
                return(base.GetText(textInfoId));
            }

            if (methodState == QueueItemMethodState.Started)
            {
                return(string.Empty);
            }

            lock (this)
            {
                if (base.Parent == null)
                {
                    return(string.Empty);
                }

                base.Parent.QueueManager.MoveToHead(this, methodIndex);
                base.Parent.QueueManager.StartQueues();
            }

            return(string.Empty);
        }