コード例 #1
0
 protected virtual void LoadHeaders()
 {
     if (FirstRowHasHeaders)
     {
         Headers.AddRange(GetValues(GetHeaderLine()));
     }
 }
コード例 #2
0
ファイル: NaiveCsv.cs プロジェクト: rhyous/EasyCsv
        public override void ParseCsv()
        {
            var lines = GetLines();

            Headers.AddRange(GetHeaders(lines));
            Rows.AddRange(GetRows(lines));
        }
コード例 #3
0
 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),
     });
 }
コード例 #5
0
        public OutboundMessage(object content, IEnumerable <MessageHeader> headers, IEndpoint endpoint)
        {
            if (headers != null)
            {
                Headers.AddRange(headers);
            }

            Content  = content;
            Endpoint = endpoint;
        }
コード例 #6
0
            public ProducedMessage(byte[] message, IEnumerable <MessageHeader> headers, IEndpoint endpoint)
            {
                Message = message;

                if (headers != null)
                {
                    Headers.AddRange(headers);
                }

                Endpoint = endpoint;
            }
コード例 #7
0
 protected override void LoadHeaders()
 {
     if (FirstRowHasHeaders)
     {
         Headers.AddRange(GetValues(GetHeaderLine()));
         foreach (var header in Headers)
         {
             Table.Columns.Add(header);
         }
     }
 }
コード例 #8
0
ファイル: TableDTO.cs プロジェクト: arargame/markuplanguage
        public TableDTO AddHeaders(params HeaderDTO[] headers)
        {
            Headers.AddRange(headers);

            foreach (var header in headers)
            {
                header.Table = this;
            }

            return(this);
        }
コード例 #9
0
        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;
        }
コード例 #10
0
        /// <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);
        }
コード例 #11
0
 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));
     }
 }
コード例 #12
0
        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;
                }
            }
        }
コード例 #13
0
        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);
        }
コード例 #14
0
 public HeadersPayload(params BlockHeader[] headers)
 {
     Headers.AddRange(headers);
 }
コード例 #15
0
 /// <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);
 }
コード例 #16
0
ファイル: CsvBase.cs プロジェクト: rhyous/EasyCsv
 public CsvBase(IEnumerable <string> headers, char delimiter = ',') : this(true, delimiter)
 {
     Headers.AddRange(headers);
 }