Пример #1
0
        public void newTick(Tick tick)
        {
            if (this.InvokeRequired)
            {
                this.Invoke(new TickDelegate(newTick), new object[] { tick });
            }
            else
            {
                if ((tick == null) || (tick.sym != work.symbol))
                {
                    return;
                }
                if (touched)
                {
                    return;
                }

                decimal changedval = obuybut.Checked ? (limitbut.Checked ? tick.ask : tick.bid) : (limitbut.Checked ? tick.bid : tick.ask);
                if (changedval != 0)
                {
                    if (this.oprice.InvokeRequired)
                    {
                        SetTickCallBack d = new SetTickCallBack(newTick);
                        this.Invoke(d, new object[] { tick });
                    }
                    else
                    {
                        oprice.Value = (decimal)changedval;
                    }
                }
            }
        }
Пример #2
0
        public void newTick(Tick tick)
        {
            if (this.InvokeRequired)
                this.Invoke(new TickDelegate(newTick), new object[] { tick });
            else
            {
                if ((tick == null) || (tick.sym != work.symbol)) return;
                if (touched) return;

                decimal changedval = obuybut.Checked ? (limitbut.Checked ? tick.ask : tick.bid) : (limitbut.Checked ? tick.bid : tick.ask);
                if (changedval != 0)
                {
                    if (this.oprice.InvokeRequired)
                    {
                        SetTickCallBack d = new SetTickCallBack(newTick);
                        this.Invoke(d, new object[] { tick });
                    }
                    else oprice.Value = (decimal)changedval;
                }
            }
        }