Ejemplo n.º 1
0
 public override void isNewSwitch(Object sender, IsNewSwitchEventArgs e)
 {
     base.isNewSwitch(sender, e);
     Thread.CurrentThread.CurrentCulture   = new CultureInfo("en-US");
     Thread.CurrentThread.CurrentUICulture = new CultureInfo("en-US");
     try
     {
         if (e.Vector.Device == Name)
         {
             IsNewSwitch?.Invoke(this, new INDIFocuserSwitchEventArgs(e.Vector, e.Device));
         }
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex.Message);
     }
 }
Ejemplo n.º 2
0
 public virtual void isNewSwitch(Object sender, IsNewSwitchEventArgs e)
 {
     Thread.CurrentThread.CurrentCulture   = new CultureInfo("en-US");
     Thread.CurrentThread.CurrentUICulture = new CultureInfo("en-US");
     if (e.Device == Name)
     {
         ISwitchVector v = GetSwitchVector(e.Vector.Name);
         if (v == null)
         {
             AddSwitchVector(e.Vector);
         }
         if (e.Vector.Name == "CONNECTION" && e.Vector.Values[0].value != ConnectionState)
         {
             ConnectionState = e.Vector.Values[0].value;
             ConnectedChanged?.Invoke(this, e);
         }
     }
 }