Example #1
0
        /// <summary>
        /// Posts the specified event to Loggr
        /// </summary>
        /// <param name="eventObj">A Loggr.Event that contains the event to send</param>
        /// <param name="async">A bool that specifies how the event should be posted. Typically an application will post asynchronously for best performance, but sometimes an event needs to be posted synchronously if the application needs to block until the event has completed posting</param>
        public virtual void Post(Event eventObj, bool async)
        {
            // make sure our event has at least a text field
            if (string.IsNullOrEmpty(eventObj.Text))
            {
                throw new ApplicationException("Event cannot have an empty Text field");
            }

            // modify event based on configuration
            MergeConfigurationWithEvent(eventObj);

            // post async or sync
            if (async)
            {
                PostEventDelegate del = new PostEventDelegate(PostEventBase);
                del.BeginInvoke(eventObj, null, null);
            }
            else
            {
                PostEventBase(eventObj);
            }
        }
Example #2
0
        /// <summary>
        /// Posts the specified event to Loggr
        /// </summary>
        /// <param name="eventObj">A Loggr.Event that contains the event to send</param>
        /// <param name="async">A bool that specifies how the event should be posted. Typically an application will post asynchronously for best performance, but sometimes an event needs to be posted synchronously if the application needs to block until the event has completed posting</param>
        public void Post(Event eventObj, bool async)
        {
            // modify event based on configuration
            MergeConfigurationWithEvent(eventObj);

            // post async or sync
            if (async)
            {
                PostEventDelegate del = new PostEventDelegate(PostEventBase);
                del.BeginInvoke(eventObj, null, null);
            }
            else PostEventBase(eventObj);
        }
Example #3
0
        /// <summary>
        /// Posts the specified event to Loggr
        /// </summary>
        /// <param name="eventObj">A Loggr.Event that contains the event to send</param>
        /// <param name="async">A bool that specifies how the event should be posted. Typically an application will post asynchronously for best performance, but sometimes an event needs to be posted synchronously if the application needs to block until the event has completed posting</param>
        public virtual void Post(Event eventObj, bool async)
        {
            // make sure our event has at least a text field
            if (string.IsNullOrEmpty(eventObj.Text))
                throw new ApplicationException("Event cannot have an empty Text field");

            // modify event based on configuration
            MergeConfigurationWithEvent(eventObj);

            // post async or sync
            if (async)
            {
                PostEventDelegate del = new PostEventDelegate(PostEventBase);
                del.BeginInvoke(eventObj, null, null);
            }
            else PostEventBase(eventObj);
        }