Esempio n. 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());
            this.Add(linearGauge);
            return(linearGauge);
        }
Esempio n. 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 = this.GetGauge();
            LinearScale scale = this.GetScale();

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