Clone() public method

Returns a copy
public Clone ( ) : IndicatorSlot
return IndicatorSlot
示例#1
0
        /// <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;
        }
示例#2
0
        /// <summary>
        /// Moves a filter downwards.
        /// </summary>
        public void MoveFilterDownwards(int slotToMove)
        {
            if (slotToMove < Slots - 1 && Slot[slotToMove].SlotType == Slot[slotToMove + 1].SlotType)
            {
                IndicatorSlot tempSlot = Slot[slotToMove + 1].Clone();
                Slot[slotToMove + 1] = Slot[slotToMove].Clone();
                Slot[slotToMove]     = tempSlot.Clone();

                // Sets the slot numbers.
                for (int slot = 0; slot < Slots; slot++)
                {
                    indicatorSlot[slot].SlotNumber = slot;
                }
            }

            return;
        }
        /// <summary>
        /// Moves a filter upwards.
        /// </summary>
        public void MoveFilterUpwards(int slotToMove)
        {
            if (slotToMove <= 1 || Slot[slotToMove].SlotType != Slot[slotToMove - 1].SlotType)
            {
                return;
            }
            IndicatorSlot tempSlot = Slot[slotToMove - 1].Clone();

            Slot[slotToMove - 1] = Slot[slotToMove].Clone();
            Slot[slotToMove]     = tempSlot.Clone();

            // Sets the slot numbers.
            for (int slot = 0; slot < Slots; slot++)
            {
                Slot[slot].SlotNumber = slot;
            }
        }
示例#4
0
        /// <summary>
        /// Moves a filter upwards.
        /// </summary>
        public void MoveFilterUpwards(int slotToMove)
        {
            Data.Log("Move a Filter Upwards");

            if (slotToMove > 1 && Slot[slotToMove].SlotType == Slot[slotToMove - 1].SlotType)
            {
                IndicatorSlot tempSlot = Slot[slotToMove - 1].Clone();
                Slot[slotToMove - 1] = Slot[slotToMove].Clone();
                Slot[slotToMove]     = tempSlot.Clone();

                // Sets the slot numbers.
                for (int slot = 0; slot < Slots; slot++)
                {
                    indicatorSlot[slot].SlotNumber = slot;
                }
            }

            return;
        }