public void LoadConfigurations() { try { var xdoc = XDocument.Load("configuration.xml"); var entries = from e in xdoc.Descendants("HapticDevices") select new { HapticType = (string)e.Attribute("hapticType"), WorkstationName = (string)e.Attribute("workstationName"), ListeningMode = (string)e.Attribute("listeningMode"), IpAddress = (string)e.Attribute("ipAddress") }; for (int i = 0; i < entries.Count(); i++) { HapticDevice device = new HapticDevice(); device.hapticType = entries.ElementAt(i).HapticType; device.workstationName = entries.ElementAt(i).WorkstationName; device.listeningMode = entries.ElementAt(i).ListeningMode; device.ipAddress = entries.ElementAt(i).IpAddress; _devices.AddLast(device); } } catch (Exception e) { Console.WriteLine("Error in loading configurations: " + e); } }
private bool DeviceOperation(HapticDevice device) { device.Force.Update(); return(true); }