Exemplo n.º 1
0
        /// <summary>
        /// Edits the Strategy Slot
        /// </summary>
        /// <param name="iSlot">The slot number</param>
        void EditSlot(int iSlot)
        {
            Data.IsStrategyReady = false;

            SlotTypes slotType   = Data.Strategy.Slot[iSlot].SlotType;
            bool      bIsDefined = Data.Strategy.Slot[iSlot].IsDefined;

            //We put the current Strategy into the stack only if this function is called from the
            //button SlotButton. If it is called from Add/Remove Filters the stack is already updated.
            if (bIsDefined)
            {
                Data.StackStrategy.Push(Data.Strategy.Clone());
            }

            Indicator_Dialog id = new Indicator_Dialog(iSlot, slotType, bIsDefined);

            id.ShowDialog();

            if (id.DialogResult == DialogResult.OK)
            {
                OnStrategyChange();

                Data.IsStrategyChanged = true;

                RebuildStrategyLayout();
                SetSrategyOverview();
            }
            else
            {   // Cancel was pressed
                UndoStrategy();
            }

            Data.IsStrategyReady = true;

            return;
        }
        /// <summary>
        /// Edits the Strategy Slot
        /// </summary>
        /// <param name="iSlot">The slot number</param>
        void EditSlot(int iSlot)
        {
            Data.IsStrategyReady = false;

            SlotTypes slotType   = Data.Strategy.Slot[iSlot].SlotType;
            bool      bIsDefined = Data.Strategy.Slot[iSlot].IsDefined;

            //We put the current Strategy into the stack only if this function is called from the
            //button SlotButton. If it is called from Add/Remove Filters the stack is already updated.
            if (bIsDefined)
            {
                Data.StackStrategy.Push(Data.Strategy.Clone());
            }

            Indicator_Dialog id = new Indicator_Dialog(iSlot, slotType, bIsDefined);
            id.ShowDialog();

            if (id.DialogResult == DialogResult.OK)
            {
                OnStrategyChange();

                Data.IsStrategyChanged = true;

                RebuildStrategyLayout();
                SetSrategyOverview();
            }
            else
            {   // Cancel was pressed
                UndoStrategy();
            }

            Data.IsStrategyReady = true;

            return;
        }