public override bool Equals(object obj) { TetServiceEntryWrapper wrapper = obj as TetServiceEntryWrapper; if (wrapper == null) { return(false); } if (wrapper._servicename != null) { if (_servicename != null) { return(wrapper._servicename == _servicename); } else { return(wrapper._servicename == _entry.servicename); } } else { if (_servicename != null) { return(wrapper._entry.servicename == _servicename); } else { return(_entry.servicename == wrapper._entry.servicename); } } }
void serviceBrowser_OnServiceUpdated(ref TetServiceEntry serviceEntry) { TetServiceEntryWrapper wrapper = new TetServiceEntryWrapper(serviceEntry); if (!services.Contains(wrapper)) { services.Add(wrapper); } else { services.Remove(wrapper); services.Add(wrapper); } UpdateEyetrackerCombo(); }
private void UpdateEyetrackerCombo() { eyetrackers.Items.Clear(); TetServiceEntryWrapper selected = eyetrackers.SelectedItem as TetServiceEntryWrapper; foreach (TetServiceEntryWrapper eyetracker in services) { if (eyetracker.IsRunning) { eyetrackers.Items.Add(eyetracker); } } if (eyetrackers.Items.Count == 0) { UpdateButtons(); return; } if (selected != null) { int index = eyetrackers.Items.IndexOf(selected); if (index != -1) { eyetrackers.SelectedIndex = index; } else { eyetrackers.SelectedIndex = 0; } } else { eyetrackers.SelectedIndex = 0; } UpdateButtons(); }
void serviceBrowser_OnServiceUpdated(ref TetServiceEntry serviceEntry) { TetServiceEntryWrapper wrapper = new TetServiceEntryWrapper(serviceEntry); if (!services.Contains(wrapper)) { services.Add(wrapper); } else { services.Remove(wrapper); services.Add(wrapper); } UpdateEyetrackerCombo(); }