Beispiel #1
0
        void SubscriptionListener.onItemUpdate(ItemUpdate update)
        {
            Debug.WriteLine("Details received.");

            Debug.WriteLine(NotifyUpdate(update) +
                            " for " + update.ItemName + ":" + update.getValue(1) + " - " + update.getValue(3)
                            );


            if (update.isValueChanged(1))
            {
                rTfeed.DetailsName = update.getValue(1);
            }

            if (update.isValueChanged(2))
            {
                rTfeed.DetailsLast = update.getValue(2);
            }

            if (update.isValueChanged(3))
            {
                rTfeed.DetailsTime = update.getValue(3);
            }

            if (update.isValueChanged(4))
            {
                rTfeed.DetailsMin = update.getValue(4);
            }

            if (update.isValueChanged(5))
            {
                rTfeed.DetailsMax = update.getValue(5);
            }

            if (update.isValueChanged(6))
            {
                rTfeed.DetailsChg = update.getValue(6);
                if (float.Parse(update.getValue(6)) > 0)
                {
                    rTfeed.DetailsChgDiff = Color.Green;
                }
                else
                {
                    rTfeed.DetailsChgDiff = Color.Red;
                }
            }

            if (update.isValueChanged(7))
            {
                rTfeed.DetailsBid = update.getValue(7);
            }

            if (update.isValueChanged(8))
            {
                rTfeed.DetailsAsk = update.getValue(8);
            }
        }
Beispiel #2
0
        void SubscriptionListener.onItemUpdate(ItemUpdate update)
        {
            int itemPos = update.ItemPos;

            Debug.WriteLine("Update received.");

            Debug.WriteLine(NotifyUpdate(update) +
                            " for " + itemPos + ":" + update.getValue(1) + " - " + update.getValue(2)
                            );

            if (itemPos == 1)
            {
                if (update.isValueChanged(2))
                {
                    rTfeed.LabelText0 = update.getValue(2);
                }


                if (update.isValueChanged(1))
                {
                    rTfeed.DescText0 = update.getValue(1);
                }
            }

            if (itemPos == 2)
            {
                if (update.isValueChanged(2))
                {
                    rTfeed.LabelText1 = update.getValue(2);
                }


                if (update.isValueChanged(1))
                {
                    rTfeed.DescText1 = update.getValue(1);
                }
            }

            if (itemPos == 3)
            {
                if (update.isValueChanged(2))
                {
                    rTfeed.LabelText2 = update.getValue(2);
                }


                if (update.isValueChanged(1))
                {
                    rTfeed.DescText2 = update.getValue(1);
                }
            }

            if (itemPos == 4)
            {
                if (update.isValueChanged(2))
                {
                    rTfeed.LabelText3 = update.getValue(2);
                }


                if (update.isValueChanged(1))
                {
                    rTfeed.DescText3 = update.getValue(1);
                }
            }

            if (itemPos == 5)
            {
                if (update.isValueChanged(2))
                {
                    rTfeed.LabelText4 = update.getValue(2);
                }


                if (update.isValueChanged(1))
                {
                    rTfeed.DescText4 = update.getValue(1);
                }
            }

            if (itemPos == 6)
            {
                if (update.isValueChanged(2))
                {
                    rTfeed.LabelText5 = update.getValue(2);
                }


                if (update.isValueChanged(1))
                {
                    rTfeed.DescText5 = update.getValue(1);
                }
            }
        }