Пример #1
0
        /// <summary>
        /// creates a feedback pool with the given array of string
        /// the size of that array will define the size of the pool
        /// </summary>
        /// <param name="displayLabels"></param>
        public FeedbackPool(String[] displayLabels)
        {
            int nb;

            // we create an empty feedback pool if we get null displaylabels
            if (displayLabels == null)
            {
                nb = 0;
            }
            else
            {
                // the size of the pool is the number of labels
                nb = displayLabels.Length;
            }
            // get displayLabels
            this.displayLabels = displayLabels;
            // we initialize each other attribute
            label          = new Feedback[nb];
            startTimeLabel = new DateTime[nb];
            nullFb         = new LongFeedback("", false);
            for (int i = 0; i < nb; i++)
            {
                displayLabels[i]  = "";
                label[i]          = nullFb;
                startTimeLabel[i] = DateTime.MinValue;
            }

            instance = this;
        }
Пример #2
0
 public static FeedbackPool Get()
 {
     if (instance == null)
     {
         instance = new FeedbackPool(null);
     }
     return(instance);
 }