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]); } }
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]); } }
private void GetRiskItemDetails(RiskItemDetails rid) { String error; rid.RequestProperty("Code", out error); rid.RequestProperty("Description", out error); rid.Subscribe(); }