private void SendAsync(string message, string eventId, string eventType)
        {
            if (_isInitialized && _isRunning)
            {
                HubData newData = new HubData();
                newData.Eventname       = string.Format("{0}_{1}", eventType, DateTime.Now.Ticks);
                newData.EventId         = eventId;
                newData.EventMessage    = message.TrimEnd(_trimChars);
                newData.EventproviderId = ProviderId.ToString();
                newData.Eventprovider   = ProviderName;
                newData.EventSource     = EventSourceName;
                newData.Senttimestamp   = newData.Eventtimestamp = DateTime.Now.ToUniversalTime();
                newData.Eventtype       = eventType;

                this.SendAsync(newData);
            }
        }
        private void SendAsync(HubData newData)
        {
            // Create the event data aand serialize the class to a Jason object
            var serializedString = JsonConvert.SerializeObject(newData);

            // Create an  EventData from the Jason object
            EventData data = new EventData(Encoding.UTF8.GetBytes(serializedString))
            {
                PartitionKey = this.PartitionKey
            };

            // If the serialized data is too small return
            if (data.SerializedSizeInBytes > _minimumSize &&
                data.SerializedSizeInBytes <= _maximumSize)
            {
                _hubClient.SendAsync(data);
            }
        }