Exemple #1
0
        public LinearGauge Add(string name)
        {
            LinearGauge linearGauge = new LinearGauge();

            linearGauge.Name = name;
            linearGauge.Scales.Add(new LinearScale());
            linearGauge.Pointers.Add(new LinearPointer());
            linearGauge.Ranges.Add(new LinearRange());
            Add(linearGauge);
            return(linearGauge);
        }
Exemple #2
0
        public override object Clone()
        {
            MemoryStream           stream = new MemoryStream();
            BinaryFormatSerializer binaryFormatSerializer = new BinaryFormatSerializer();

            binaryFormatSerializer.Serialize(this, stream);
            LinearGauge linearGauge = new LinearGauge();

            binaryFormatSerializer.Deserialize(linearGauge, stream);
            return(linearGauge);
        }
        private LinearRange[] GetColorRanges()
        {
            LinearGauge gauge = GetGauge();
            LinearScale scale = GetScale();

            if (gauge == null || scale == null)
            {
                return(null);
            }
            double    barStartValue = GetBarStartValue();
            double    position      = base.Position;
            ArrayList arrayList     = null;

            foreach (LinearRange range in gauge.Ranges)
            {
                if (range.GetScale() != scale || !(range.InRangeBarPointerColor != Color.Empty))
                {
                    continue;
                }
                double valueLimit  = scale.GetValueLimit(range.StartValue);
                double valueLimit2 = scale.GetValueLimit(range.EndValue);
                if ((barStartValue >= valueLimit && barStartValue <= valueLimit2) || (position >= valueLimit && position <= valueLimit2) || (valueLimit >= barStartValue && valueLimit <= position) || (valueLimit2 >= barStartValue && valueLimit2 <= position))
                {
                    if (arrayList == null)
                    {
                        arrayList = new ArrayList();
                    }
                    arrayList.Add(range);
                }
            }
            if (arrayList == null)
            {
                return(null);
            }
            return((LinearRange[])arrayList.ToArray(typeof(LinearRange)));
        }
Exemple #4
0
 public void Insert(int index, LinearGauge value)
 {
     base.List.Insert(index, value);
 }
Exemple #5
0
 public bool Contains(LinearGauge value)
 {
     return(base.List.Contains(value));
 }
Exemple #6
0
 public void Remove(LinearGauge value)
 {
     base.List.Remove(value);
 }
Exemple #7
0
 public int Add(LinearGauge value)
 {
     return(base.List.Add(value));
 }
Exemple #8
0
 public int IndexOf(LinearGauge value)
 {
     return(base.List.IndexOf(value));
 }