/// <summary>
/// Duplicates an logic condition.
/// </summary>
public void DuplicateFilter(int slotToDuplicate)
{
Data.Log("Duplicate a Filter");
if (Slot[slotToDuplicate].SlotType == SlotTypes.OpenFilter && OpenFilters < MaxOpenFilters ||
Slot[slotToDuplicate].SlotType == SlotTypes.CloseFilter && CloseFilters < MaxCloseFilters)
{
IndicatorSlot tempSlot = Slot[slotToDuplicate].Clone();
if (Slot[slotToDuplicate].SlotType == SlotTypes.OpenFilter)
{
int iAddedslot = AddOpenFilter();
Slot[iAddedslot] = tempSlot.Clone();
}
if (Slot[slotToDuplicate].SlotType == SlotTypes.CloseFilter)
{
int addedslot = AddCloseFilter();
Slot[addedslot] = tempSlot.Clone();
}
// Sets the slot numbers.
for (int slot = 0; slot < Slots; slot++)
{
indicatorSlot[slot].SlotNumber = slot;
}
}
return;
}