public bool checkControlSnapByControl(string posSnap, ObjectIndicator obIndicator)
 {
     for (int i = 0; i < tbControlSnap.Rows.Count; i++)
     {
         if (tbControlSnap.Rows[i]["position"].ToString() == posSnap)
         {
             if (((ObjectIndicator)tbControlSnap.Rows[i]["control"]).controlName != obIndicator.controlName)
             {
                 return true;
             }
         }
     }
     return false;
 }
 private bool isObjSnap(ObjectIndicator indicator, string position)
 {
     bool result = false;
     for (int i = 0; i < tbControlSnap.Rows.Count; i++)
     {
         if (((ObjectIndicator)tbControlSnap.Rows[i]["control"]).controlName == indicator.controlName)
         {
             if((tbControlSnap.Rows[i]["position"].ToString() == position))
             {
                 result = true;
                 break;
             }
         }
     }
     return result;
 }
 public void UnSnapControl(ObjectIndicator indicator, string position)
 {
     int index = -1;
     for (int i = 0; i < tbControlSnap.Rows.Count; i++)
     {
         if (((ObjectIndicator)tbControlSnap.Rows[i]["control"]).controlName == indicator.controlName)
         {
             if ((tbControlSnap.Rows[i]["position"].ToString() == position))
             {
                 index = i;
                 break;
             }
         }
     }
     if (index > -1)
     {
         tbControlSnap.Rows.RemoveAt(index);
     }
 }
 private void addControlSnap(ObjectIndicator objSignal, string position)
 {
     DataRow rowadd = tbControlSnap.NewRow();
     rowadd["control"] = objSignal;
     rowadd["position"] = position;
     tbControlSnap.Rows.Add(rowadd);
 }
        private void valueDisplayToolStripMenuItem_Click(object sender, EventArgs e)
        {
            DevExpress.XtraGauges.Win.GaugeControl gaugeControl = new DevExpress.XtraGauges.Win.GaugeControl();
            DevExpress.XtraGauges.Win.Gauges.Digital.DigitalGauge digitalGauge = new DevExpress.XtraGauges.Win.Gauges.Digital.DigitalGauge();
            DevExpress.XtraGauges.Win.Gauges.Digital.DigitalBackgroundLayerComponent digitalBackgroundLayerComponent = new DevExpress.XtraGauges.Win.Gauges.Digital.DigitalBackgroundLayerComponent();

            gaugeControl.AutoLayout = false;
            gaugeControl.Gauges.AddRange(new DevExpress.XtraGauges.Base.IGauge[] {
            digitalGauge});
            gaugeControl.Location = new System.Drawing.Point(221, 79);
            gaugeControl.Name = "gaugeControl";
            gaugeControl.Size = new System.Drawing.Size(229, 86);
            gaugeControl.TabIndex = 0;

            digitalGauge.AppearanceOff.ContentBrush = new DevExpress.XtraGauges.Core.Drawing.SolidBrushObject("Color:#FFC0C0");
            digitalGauge.AppearanceOn.ContentBrush = new DevExpress.XtraGauges.Core.Drawing.SolidBrushObject("Color:#A40000");
            digitalGauge.BackgroundLayers.AddRange(new DevExpress.XtraGauges.Win.Gauges.Digital.DigitalBackgroundLayerComponent[] {
            digitalBackgroundLayerComponent});
            digitalGauge.Bounds = new System.Drawing.Rectangle(3, 2, 221, 80);
            digitalGauge.DigitCount = 5;
            digitalGauge.Name = "digitalGauge";
            digitalGauge.Text = "1802";

            digitalBackgroundLayerComponent.BottomRight = new DevExpress.XtraGauges.Core.Base.PointF2D(259.8125F, 99.9625F);
            digitalBackgroundLayerComponent.Name = "digitalBackgroundLayerComponent";
            digitalBackgroundLayerComponent.ShapeType = DevExpress.XtraGauges.Core.Model.DigitalBackgroundShapeSetType.Style12;
            digitalBackgroundLayerComponent.TopLeft = new DevExpress.XtraGauges.Core.Base.PointF2D(20F, 0F);
            digitalBackgroundLayerComponent.ZOrder = 1000;

            ObjectIndicator indicatorAdd = new ObjectIndicator(gaugeControl);
            //indicatorAdd.ParentUserControl = this;
            SubscribeIndicator(indicatorAdd);
        }