Example #1
0
        /// <summary>
        /// Initializes Event belonging to a LibHoney object.
        /// </summary>
        public Event(LibHoney libHoney,
                     IEnumerable <KeyValuePair <string, object> > data, IEnumerable <KeyValuePair <string, Func <object> > > dynFields)
        {
            if (libHoney == null)
            {
                throw new ArgumentNullException(nameof(libHoney));
            }
            if (data == null)
            {
                throw new ArgumentNullException(nameof(data));
            }
            if (dynFields == null)
            {
                throw new ArgumentNullException(nameof(dynFields));
            }

            this.libHoney = libHoney;

            fields.Add(libHoney.Fields);
            fields.Add(data);
            fields.AddDynamic(dynFields);
            fields.EvaluateDynamicFields();  // Evalute all the dynamic fields

            // Stash these values away for Send()
            Timestamp  = DateTime.Now;
            WriteKey   = libHoney.WriteKey;
            DataSet    = libHoney.DataSet;
            ApiHost    = libHoney.ApiHost;
            SampleRate = libHoney.SampleRate;
        }
Example #2
0
        /// <summary>
        /// Initializes Builder belong to a LibHoney object.
        /// </summary>
        public Builder(LibHoney libHoney,
                       IEnumerable <KeyValuePair <string, object> > data, IEnumerable <KeyValuePair <string, Func <object> > > dynFields)
        {
            if (libHoney == null)
            {
                throw new ArgumentNullException(nameof(libHoney));
            }
            if (data == null)
            {
                throw new ArgumentNullException(nameof(data));
            }
            if (dynFields == null)
            {
                throw new ArgumentNullException(nameof(dynFields));
            }

            this.libHoney = libHoney;

            fields.Add(libHoney.Fields);
            fields.Add(data);
            fields.AddDynamic(dynFields);

            // Stash these values away for Send()
            WriteKey   = libHoney.WriteKey;
            DataSet    = libHoney.DataSet;
            ApiHost    = libHoney.ApiHost;
            SampleRate = libHoney.SampleRate;
        }
Example #3
0
 internal Event(LibHoney libHoney, FieldHolder fh, string writeKey, string dataSet, string apiHost, int sampleRate)
     : this(libHoney, fh.Fields, fh.DynamicFields)
 {
     WriteKey   = writeKey;
     DataSet    = dataSet;
     ApiHost    = apiHost;
     SampleRate = sampleRate;
 }
Example #4
0
        internal Event(Event ev)
        {
            libHoney = ev.libHoney;
            fields.Add(ev.Fields);

            Timestamp  = ev.Timestamp;
            WriteKey   = ev.WriteKey;
            DataSet    = ev.DataSet;
            ApiHost    = ev.ApiHost;
            SampleRate = ev.SampleRate;
            Metadata   = ev.Metadata;
        }
Example #5
0
 /// <summary>
 /// Initializes Event belonging to a LibHoney object.
 /// </summary>
 public Event(LibHoney libHoney, IEnumerable <KeyValuePair <string, object> > data)
     : this(libHoney,
            data, Enumerable.Empty <KeyValuePair <string, Func <object> > > ())
 {
 }
Example #6
0
 /// <summary>
 /// Initializes Builder belong to a LibHoney object.
 /// </summary>
 public Builder(LibHoney libHoney)
     : this(libHoney,
            Enumerable.Empty <KeyValuePair <string, object> > (), Enumerable.Empty <KeyValuePair <string, Func <object> > > ())
 {
 }