コード例 #1
0
        /// <summary>
        /// Publishes event to the current telemetry pipeline
        /// </summary>
        /// <param name="action">The action being recorded</param>
        /// <param name="propertyBag">Associated property bag--this may be null</param>
        public static void PublishTelemetryEvent(TelemetryAction action, IReadOnlyDictionary <TelemetryProperty, string> propertyBag = null)
        {
            // Conversions to strings are expensive, so skip it if possible
            if (!IsEnabled)
            {
                return;
            }

            TelemetrySink.PublishTelemetryEvent(action.ToString(), ConvertFromProperties(propertyBag));
        }
コード例 #2
0
        /// <summary>
        /// Publishes event with single property/value pair to the current telemetry pipeline
        /// </summary>
        /// <param name="action"></param>
        /// <param name="property"></param>
        /// <param name="value"></param>
        public static void PublishTelemetryEvent(TelemetryAction action, TelemetryProperty property, string value)
        {
            // Conversions to strings are expensive, so skip it if possible
            if (!IsEnabled)
            {
                return;
            }

            TelemetrySink.PublishTelemetryEvent(action.ToString(), property.ToString(), value);
        }
コード例 #3
0
 public void PublishEvent(string eventName, IReadOnlyDictionary <string, string> propertyBag)
 {
     TelemetrySink.PublishTelemetryEvent(eventName, propertyBag);
 }