Exemplo n.º 1
0
        private void Add()
        {
            UserControlMeasureGraph uc = new UserControlMeasureGraph(measurements, list);

            uc.consumer = consumer;
            int n = list.Count;

            uc.Set(measurements[n], consumer);
            foreach (UserControlMeasureGraph c in list)
            {
                c.Height = c.Height + uc.Height;
            }
            list[n - 1].panelCenter.Controls.Add(uc);
            list.Add(uc);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Creates control from consumer
        /// </summary>
        /// <param name="consumer">The consumer</param>
        /// <returns>The control</returns>
        public static UserControlMeasureGraph Create(IDataConsumer consumer)
        {
            if (consumer.Count == 0)
            {
                return(null);
            }
            List <IMeasurements> l = new List <IMeasurements>();

            for (int i = 0; i < consumer.Count; i++)
            {
                l.Add(consumer[i]);
            }
            UserControlMeasureGraph uc = new UserControlMeasureGraph();

            uc.consumer     = consumer;
            uc.measurements = l;
            uc.Set(l[0], consumer);
            for (int i = 1; i < l.Count; i++)
            {
                uc.Add();
            }
            return(uc);
        }