private SensorListItem CreateSensorListItem(SensorDescription _description) { SensorListItem item = new SensorListItem(_description); item.OnMouseDown += UpdateSelectedListItem; item.OnDelete += DeleteListItem; item.OnDuplicate += _item => AddNewSensorListItem((_item as SensorListItem).GetDescription()); m_ListItems.Add(item); return item; }
private void AddNewSensorListItem(SensorDescription _sensorDescription) { SensorDescription newSensorDescription = new SensorDescription { GUID = System.Guid.NewGuid(), DisplayName = _sensorDescription.DisplayName, ExecutableSensorType = _sensorDescription.ExecutableSensorType, ShouldBeTicked = _sensorDescription.ShouldBeTicked, ExecutionOrder = _sensorDescription.ExecutionOrder, TickRate = _sensorDescription.TickRate, }; SensorListItem item = CreateSensorListItem(newSensorDescription); m_ListItemScrollView.Add(item); item.MarkUnsavedChanges(true); AddUnsavedMarker(); UpdateSelectedListItem(item); }