private void fillCondition(PriceCondition priceCondition) { fillOperator(priceCondition, priceOperator); fillUnderlyingContract(priceCondition, priceUnderlying); priceCondition.TriggerMethod = CTriggerMethod.FromFriendlyString(priceMethod.Text); priceCondition.Price = double.Parse(price.Text); }
protected override bool TryParse(string cond) { var fName = CTriggerMethod.friendlyNames.Where(n => cond.StartsWith(n)).OrderByDescending(n => n.Length).FirstOrDefault(); if (fName == null) { return(false); } try { TriggerMethod = CTriggerMethod.FromFriendlyString(fName); cond = cond.Substring(cond.IndexOf(fName) + fName.Length + 1); return(base.TryParse(cond)); } catch { return(false); } }