public void AddLineAndUpdate3_error(IAddLine iFace, out string allOut) { lock (this) { if (iFace == null) { throw new Exception("iFace == null"); } if (IAddLines == null) { throw new Exception("IAddLines == null"); } if (iFace.MergeSupported) { IAddLine old = IAddLines.ContainsKey(iFace.DisplayItem) ? IAddLines[iFace.DisplayItem] : null; IAddLine newIf = iFace.MergeAddLine(old); if (old == null) { IAddLines.Add(newIf.DisplayItem, newIf); } else { IAddLines[newIf.DisplayItem] = newIf; } } else if (IAddLines.ContainsKey(iFace.DisplayItem)) { IAddLines[iFace.DisplayItem] = iFace; } else { IAddLines.Add(iFace.DisplayItem, iFace); } StringBuilder sb = new StringBuilder(); foreach (KeyValuePair <eDisplayItem, IAddLine> i in IAddLines) { try { sb.AppendLine(i.Value.ToInfoLine()); } catch (Exception ex) { sb.AppendLine("--Exception --"); } } allOut = sb.ToString(); } }
public void AddLine2(IAddLine iFace) { string allText; StringBuilder debug = new StringBuilder(); try { textController.AddLineAndUpdate3(iFace, out allText, debug); FileLog_Debug(debug.ToString()); } catch (Exception) { FileLog_Debug(debug.ToString()); throw; } theForm.UserAction_DisplayText(new Data_DisplayText(true, allText, this.StopRequest)); }
public void Add(IAddLine it) { TheList.Add(it); TheList.Sort(new MyComparers()); }
public int Compare(IAddLine x, IAddLine y) { return((int)(x.DisplayItem) - (int)(y.DisplayItem)); }
public void AddLine2(IAddLine iFace) { }
public CreateLineCommand(IBetLineFactory lineFactory, IAddLine addLine, IGetAccountById getAccountById) { this.lineFactory = lineFactory; this.lines = addLine; this.getAccountById = getAccountById; }
public void AddLine2(IAddLine iFace) { Out(iFace.ToInfoLine()); }
public virtual void IncomingReport(IAddLine info) { }
public virtual IAddLine MergeAddLine(IAddLine existing) { return(existing); }
public void AddLineAndUpdate3(IAddLine iFace, out string allOut, StringBuilder debug) { lock (this) { if (iFace == null) { throw new Exception("iFace == null"); } if (IAddLines == null) { throw new Exception("IAddLines == null"); } if (iFace.MergeSupported) { IAddLine old = IAddLines.ContainsKey(iFace.DisplayItem) ? IAddLines[iFace.DisplayItem] : null; IAddLine newIf = iFace.MergeAddLine(old); if (newIf == null) { throw new Exception("newIf == null"); } if (old == null) { IAddLines.Add(newIf.DisplayItem, newIf); } else { IAddLines[newIf.DisplayItem] = newIf; } } else if (IAddLines.ContainsKey(iFace.DisplayItem)) { IAddLines[iFace.DisplayItem] = iFace; } else { IAddLines.Add(iFace.DisplayItem, iFace); } foreach (eDisplayItem report in iFace.ReportTo) { IAddLine other = IAddLines.FirstOrDefault(i => i.Key == report).Value; other?.IncomingReport(iFace); } StringBuilder sb = new StringBuilder(); foreach (KeyValuePair <eDisplayItem, IAddLine> i in IAddLines) { try { sb.AppendLine(i.Value.ToInfoLine()); } catch (Exception ex) { sb.AppendLine("--Exception --"); } } allOut = sb.ToString(); } }