Ejemplo n.º 1
0
        private void query_QueryResponse(object sender, QueryResponseEventArgs e)
        {
            this.Output += "e.ResponseEventType = " + e.ResponseEventType + " | ";

            if (e.ResponseEventType.Equals(QueryResponseEventType.Error))
            {
                Error(e.Errors[0]);
            }
            else
            {
                //AccountQuery query = sender as AccountQuery;
                ClientQuery query = sender as ClientQuery;

                // Request more data
                if (query != null)
                {
                    this.Output += "Query.State = " + query.State + " | ";

                    if (query.State == QueryState.MoreImagesAvailable)
                    {
                        query.RequestMoreData();
                    }
                }

                // Consume data
                BindingList <Client> list = this.query.GetList();
                foreach (Client client in list)
                {
                    this.Output += client.ClientCode;
                }

                OnPropertyChanged(new PropertyChangedEventArgs("Output"));
            }
        }
Ejemplo n.º 2
0
        void muByInstrumentq_QueryResponse(object sender, QueryResponseEventArgs e)
        {
            // In this example we are not handleing errors or service state
            // we are just interested on the first MarginUtilisationItem returned by the
            // ByInstrumentQuery.
            if (!e.ResponseEventType.Equals(QueryResponseEventType.Error))
            {
                if (muByInstrumentq.GetList().Count > 0)
                {
                    // Get the first MarginUtilisationItem by instrument.
                    // If we compare this to the grid provided in ITP,
                    // this would be equivalent to the first row on the second drill down
                    // on the Margin Utilisation grid.
                    firstMarginUtilisationByInstrument = muByInstrumentq.GetList()[0];

                    // Get the code and description for the risk item
                    riskItemDetails3 = new RiskItemDetails(firstMarginUtilisationByInstrument);
                    riskItemDetails3.PublicationResponse += riskItemDetails3_PublicationResponse;
                    GetRiskItemDetails(riskItemDetails3);
                }
            }
            else
            {
                Error(e.Errors[0]);
            }
        }
Ejemplo n.º 3
0
        void muByProductq_QueryResponse(object sender, QueryResponseEventArgs e)
        {
            // In this example we are not handleing errors or service state
            // we are just interested on the first MarginUtilisationItem returned by the
            // ByProductQuery.
            if (!e.ResponseEventType.Equals(QueryResponseEventType.Error))
            {
                if (muByProductq.GetList().Count > 0)
                {
                    // Get the first MarginUtilisationItem by product.
                    // If we compare this to the grid provided in ITP,
                    // this would be equivalent to the first row on the first drill down
                    // on the Margin Utilisation grid.
                    firstMarginUtilisationByProduct = muByProductq.GetList()[0];

                    // Get the details for the risk item received (code and description)
                    // using the RiskItemDetails publication. Please note that
                    // the constructor accepts a MarginUtilisationItem.
                    riskItemDetails2 = new RiskItemDetails(firstMarginUtilisationByProduct);
                    GetRiskItemDetails(riskItemDetails2);

                    // Note it requires the Reference from the MarginUtilisationItem
                    // retrieved from the ByProduct query
                    GetMarginUtilisationByInstrument(firstMarginUtilisationByProduct.Reference);

                    // Dispose ByProductQuery as we are not using it anymore
                    muByProductq.Dispose();
                }
            }
            else
            {
                Error(e.Errors[0]);
            }
        }
Ejemplo n.º 4
0
        void req_QueryResponse(object sender, QueryResponseEventArgs e)
        {
            // In this example we are not handleing errors or service state
            // we are just interested on the first RiskItem returned by the query.
            if (!e.ResponseEventType.Equals(QueryResponseEventType.Error))
            {
                if (req.GetList().Count > 0)
                {
                    // Request Margin Utilisation data for the first entity.
                    GetMarginUtilisation(req.GetList()[0]);

                    // Dispose RiskQuery as we are not using it anymore
                    req.Dispose();
                }
            }
            else
            {
                Error(e.Errors[0]);
            }
        }
Ejemplo n.º 5
0
 private static void OnQueryResponse(object sender, QueryResponseEventArgs e)
 {
 }