Esempio n. 1
0
        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;
        }
Esempio n. 2
0
        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);
        }