protected virtual void LoadHeaders() { if (FirstRowHasHeaders) { Headers.AddRange(GetValues(GetHeaderLine())); } }
public override void ParseCsv() { var lines = GetLines(); Headers.AddRange(GetHeaders(lines)); Rows.AddRange(GetRows(lines)); }
public void AddHeader(IEnumerable <string> headers) { if (_needNumberOrder) { Headers.Add("№"); } Headers.AddRange(headers); }
/// <summary> /// Construct a new instance of the <see cref="HmacMessageRepresentationBuilder"/> class. /// </summary> public HmacMessageRepresentationBuilder() { // Additional headers needed by HMAC Headers.AddRange(new List <Func <HttpRequestMessage, string> > { m => m.Headers.GetValues <string>(HmacAuthentication.ClientIdHeader).FirstOrDefault(), m => m.Headers.CustomHeadersRepresentation(HmacAuthentication.CustomHeaders), }); }
public OutboundMessage(object content, IEnumerable <MessageHeader> headers, IEndpoint endpoint) { if (headers != null) { Headers.AddRange(headers); } Content = content; Endpoint = endpoint; }
public ProducedMessage(byte[] message, IEnumerable <MessageHeader> headers, IEndpoint endpoint) { Message = message; if (headers != null) { Headers.AddRange(headers); } Endpoint = endpoint; }
protected override void LoadHeaders() { if (FirstRowHasHeaders) { Headers.AddRange(GetValues(GetHeaderLine())); foreach (var header in Headers) { Table.Columns.Add(header); } } }
public TableDTO AddHeaders(params HeaderDTO[] headers) { Headers.AddRange(headers); foreach (var header in headers) { header.Table = this; } return(this); }
public InboundMessage(byte[] rawContent, IEnumerable <MessageHeader> headers, IOffset offset, IEndpoint endpoint, bool mustUnwrap) { if (headers != null) { Headers.AddRange(headers); } Offset = offset; Endpoint = endpoint; RawContent = rawContent; MustUnwrap = mustUnwrap; }
/// <summary> /// Add the default headers which is required to make a web request. /// Web request are normal page request that are made from a browser /// </summary> /// <returns></returns> public virtual TestApiRequest AddDefaultWebHeaders() { var defaultWebHeaders = new HeaderCollection { new TestApiHeader("User-Agent", "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36"), new TestApiHeader("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8"), new TestApiHeader("Accept-Encoding", "gzip, deflate"), new TestApiHeader("Accept-Language", "en-GB,en-US;q=0.9,en;q=0.8"), new TestApiHeader("Cache-Control", "max-age=0"), new TestApiHeader("Upgrade-Insecure-Requests", "1"), }; Headers.AddRange(defaultWebHeaders); return(this); }
public override void ReadWriteCore(BitcoinStream stream) { if (stream.Serializing) { var heardersOff = Headers.Select(h => new BlockHeaderWithTxCount(h)).ToList(); stream.ReadWrite(ref heardersOff); } else { Headers.Clear(); List <BlockHeaderWithTxCount> headersOff = new List <BlockHeaderWithTxCount>(); stream.ReadWrite(ref headersOff); Headers.AddRange(headersOff.Select(h => h._Header)); } }
public override void ParseCsv() { Clear(); var rows = GetRows(); if (rows.Count > 0) { if (HasHeaderRow) { Headers.AddRange(rows[0]); } Rows.AddRange(HasHeaderRow ? rows.Skip(1) : rows); foreach (var row in Rows) { row.Parent = this; } } }
public bool ReadFile(string filePath, out string reason) { reason = string.Empty; try { List <string> lines = new List <string>(File.ReadAllLines(filePath)); if (lines.Count > 1) { foreach (string line in lines) { if (line == lines.First()) { Headers.AddRange(lines.First().Split(Delimiter)); } else { Rows.Add(new List <string>(line.Split(Delimiter))); } } } else { reason = "File with emails is empty"; return(false); } } catch (Exception ex) { reason = ex.Message; return(false); } return(true); }
public HeadersPayload(params BlockHeader[] headers) { Headers.AddRange(headers); }
/// <summary> /// Add a collection of headers required for making the request /// </summary> /// <param name="headers">header collection</param> /// <returns></returns> public virtual TestApiRequest AddHeaders(HeaderCollection headers) { Headers.AddRange(headers); return(this); }
public CsvBase(IEnumerable <string> headers, char delimiter = ',') : this(true, delimiter) { Headers.AddRange(headers); }