public PlaceOrdersParameterWriter(string marketId, string customerRef, IList<PlaceInstruction> placeInstructions)
 {
     this.marketId = marketId;
     this.customerRef = customerRef;
     this.placeInstructions = placeInstructions;
     this.parameterWriter = new ParameterWriter();
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="ListCurrentOrdersParameterWriter"/> class.
 /// </summary>
 /// <param name="betIds"></param>
 /// <param name="marketIds"></param>
 /// <param name="orderProjection"></param>
 public ListCurrentOrdersParameterWriter(ISet<string> betIds, ISet<string> marketIds, OrderProjection orderProjection = OrderProjection.ALL)
 {
     this.betIds = betIds;
     this.marketIds = marketIds;
     this.orderProjection = orderProjection;
     this.parameterWriter = new ParameterWriter();
 }
        public LoginParameterWriter(string username, string password)
        {
            this.username = username;
            this.password = password;

            this.parameterWriter = new ParameterWriter();
        }
 public MarketCatalogueParameterWriter(MarketFilter filter, int maxResults, ISet<MarketProjection> marketProjection)
 {
     this.filter = filter;
     this.maximumResults = maxResults;
     this.projection = marketProjection;
     this.parameterWriter = new ParameterWriter();
 }
 public MarketBookParameterWriter(IList<string> marketIds, PriceProjection priceProjection, OrderProjection orderProjection, MatchProjection matchProjection)
 {
     this.marketIds = marketIds;
     this.priceProjection = priceProjection;
     this.orderProjection = orderProjection;
     this.matchProjection = matchProjection;
     this.parameterWriter = new ParameterWriter();
 }
        /// <summary>
        /// Creates Xml document
        /// </summary>
        /// <param name="consumer">Data consumer</param>
        /// <param name="collection">Components</param>
        /// <param name="input">Input</param>
        /// <param name="start">Start</param>
        /// <param name="step">Step</param>
        /// <param name="count">Count</param>
        /// <returns>Result</returns>
        static public XmlDocument CreateXmlDocument(this IDataConsumer consumer,
                                                    XmlDocument input, double start, double step,
                                                    int count)
        {
            List <string> p    = new List <string>();
            IMeasurement  cond = null;
            string        arg  = null;
            Dictionary <string, Func <Func <object> > > d = new Dictionary <string, Func <Func <object> > >();
            XmlElement r = input.DocumentElement;

            foreach (XmlElement e in r.ChildNodes)
            {
                string name = e.Name;
                if (name.Equals("Condition"))
                {
                    cond = consumer.FindMeasurement(e.InnerText, true);
                    continue;
                }
                if (name.Equals("Argument"))
                {
                    arg = e.InnerText;
                    continue;
                }
                if (name.Equals("Parameters"))
                {
                    XmlNodeList nl = e.ChildNodes;
                    foreach (XmlElement xp in nl)
                    {
                        string pn = null;
                        string pv = null;
                        foreach (XmlElement xpp in xp.ChildNodes)
                        {
                            string npp = xpp.Name;
                            if (npp.Equals("Name"))
                            {
                                pn = xpp.InnerText;
                                continue;
                            }
                            pv = xpp.InnerText;
                        }
                        IMeasurement mcc = consumer.FindMeasurement(pn, false);
                        d[pv] = mcc.ToValueHolder();
                    }
                }
            }
            XmlParameterWriter xpv  = new XmlParameterWriter(null);
            IParameterWriter   pvv  = xpv;
            Action             acts = () =>
            {
                Dictionary <string, string> dpp = new Dictionary <string, string>();
                foreach (string k in d.Keys)
                {
                    object v = d[k]()();
                    FormulaMeasurement.CheckValue(v);
                    dpp[k] = v + "";
                }
                pvv.Write(dpp);
            };

            Action act = (cond == null) ? acts : () =>
            {
                foreach (string k in d.Keys)
                {
                    object v = d[k]()();
                    FormulaMeasurement.CheckValue(v);
                }
                if ((bool)cond.Parameter())
                {
                    acts();
                }
            };

            try
            {
                consumer.PerformFixed(start, step, count, StaticExtensionDataPerformerInterfaces.Calculation, 0, act);
            }
            catch (Exception e)
            {
                e.ShowError(10);
            }
            return(xpv.Document);
        }