public FluentWidgets Add(PropertyA pa, PropertyB pb) { return(Add(Do <Widget>(w => { w.PropertyA = pa; w.PropertyB = pb; }))); }
public override bool Equals(object obj) { var c = obj as ClassA; if (c == null) { return(false); } return(PropertyA.Equals(c.PropertyA) && PropertyB.Equals(c.PropertyB)); }
public override int GetHashCode() { return(PropertyA.GetHashCode() ^ PropertyB.GetHashCode()); }
/// <summary> /// Parse option having crude option, string or HtmlMode. Is a variable-argument method. /// </summary> public OptionParseResult Parse(string str, HtmlNode node) { bool strFormalMode = str != null; bool nodeFormalMode = node != null; if (strFormalMode == nodeFormalMode) { throw new InvalidOperationException("This is a two-mode method, please provide only single desired parameter."); } if (PriceAmount == null) { throw new NullReferenceException($"Price extraction is not defined."); } #region Option Info Parsing var newOptionParse = new OptionParseResult(); // Details try { if (Code != null) { newOptionParse.Code = Code.ExtractSingle(str, node); } } catch (NullReferenceException nrex) { Logger.Log(nrex.Message + " @ Option Code Parsing"); } try { if (PropertyA != null) { newOptionParse.PropertyA = PropertyA.ExtractSingle(str, node); } } catch (NullReferenceException nrex) { Logger.Log(nrex.Message + " @ Option PropertyA Parsing"); } try { if (PropertyB != null) { newOptionParse.PropertyB = PropertyB.ExtractSingle(str, node); } } catch (NullReferenceException nrex) { Logger.Log(nrex.Message + " @ Option PropertyB Parsing"); } try { if (PropertyC != null) { newOptionParse.PropertyC = PropertyC.ExtractSingle(str, node); } } catch (NullReferenceException nrex) { Logger.Log(nrex.Message + " @ Option PropertyC Parsing"); } #endregion Option Info Parsing #region Snapshot Info Parsing var snapshot = new Snapshot(newOptionParse) { Timestamp = DateTime.Now }; try { if (Stock != null) { newOptionParse.StockStatus = Stock.ExtractSingle(str, node); } } catch (NullReferenceException nrex) { Logger.Log(nrex.Message + " @ Option Snapshot Stock Parsing"); } //Price try { var extracted = PriceAmount.ExtractSingle(str, node); decimal.TryParse(extracted, NumberStyles.Any, CultureInfo.InvariantCulture, out decimal parsedDouble); newOptionParse.Price = new Money(parsedDouble, PriceCurrency); } catch (NullReferenceException nrex) { Logger.Log(nrex.Message + " @ Option Snapshot Price Parsing"); } #endregion Snapshot Info Parsing return(newOptionParse); }
public static FluentWidgets Add(PropertyA pa, PropertyB pb) { return(new FluentWidgets().Add(pa, pb)); }
public FluentWidgets Add(PropertyA pa) { return(Add(Do <Widget>(w => w.PropertyA = pa))); }