示例#1
0
 public virtual void isNewBlob(Object sender, IsNewBlobEventArgs e)
 {
     Thread.CurrentThread.CurrentCulture   = new CultureInfo("en-US");
     Thread.CurrentThread.CurrentUICulture = new CultureInfo("en-US");
     if (e.Device == Name)
     {
         IBlobVector v = GetBlobVector(e.Vector.Name);
         if (v == null)
         {
             AddBlobVector(e.Vector);
         }
     }
 }
示例#2
0
 public override void isNewBlob(Object sender, IsNewBlobEventArgs e)
 {
     base.isNewBlob(sender, e);
     Thread.CurrentThread.CurrentCulture   = new CultureInfo("en-US");
     Thread.CurrentThread.CurrentUICulture = new CultureInfo("en-US");
     try
     {
         if (e.Vector.Device == Name)
         {
             INDIClient caller = (INDIClient)sender;
             for (int i = 0; i < e.Vector.Values.Count; i++)
             {
                 Console.WriteLine("Received BLOB " + e.Vector.Values[i].Name + " of size " + e.Vector.Values[i].size + " from device " + e.Device + "@" + caller.Address + ":" + caller.Port);
                 IsNewBlob?.Invoke(this, new INDIDetectorBlobEventArgs(e.Vector.Values[i].value, e.Vector.Values[i].Name, e.Vector.Name, e.Vector.Values[0].format));
             }
         }
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex.Message);
     }
 }