当前位置: 首页>>代码示例>>C#>>正文


C# FunctionId.GetPropertyName方法代码示例

本文整理汇总了C#中FunctionId.GetPropertyName方法的典型用法代码示例。如果您正苦于以下问题:C# FunctionId.GetPropertyName方法的具体用法?C# FunctionId.GetPropertyName怎么用?C# FunctionId.GetPropertyName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在FunctionId的用法示例。


在下文中一共展示了FunctionId.GetPropertyName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SetBlockId

 private void SetBlockId(IVsTelemetryEvent telemetryEvent, FunctionId functionId, int blockId)
 {
     var blockIdName = functionId.GetPropertyName(BlockId);
     telemetryEvent.SetIntProperty(blockIdName, blockId);
 }
开发者ID:Rickinio,项目名称:roslyn,代码行数:5,代码来源:VSTelemetryLogger.cs

示例2: LogBlockEnd

        public void LogBlockEnd(FunctionId functionId, LogMessage logMessage, int blockId, int delta, CancellationToken cancellationToken)
        {
            var kvLogMessage = logMessage as KeyValueLogMessage;
            if (kvLogMessage == null)
            {
                return;
            }

            try
            {
                // guard us from exception thrown by telemetry
                var telemetryEvent = CreateTelemetryEvent(functionId, End);
                SetBlockId(telemetryEvent, functionId, blockId);

                var durationName = functionId.GetPropertyName(Duration);
                telemetryEvent.SetIntProperty(durationName, delta);

                var cancellationName = functionId.GetPropertyName(CancellationRequested);
                telemetryEvent.SetBoolProperty(cancellationName, cancellationToken.IsCancellationRequested);

                _session.PostEvent(telemetryEvent);
            }
            catch
            {
            }
        }
开发者ID:Rickinio,项目名称:roslyn,代码行数:26,代码来源:VSTelemetryLogger.cs

示例3: CreateTelemetryEvent

        private IVsTelemetryEvent CreateTelemetryEvent(FunctionId functionId, string eventKey = null, KeyValueLogMessage logMessage = null)
        {
            var eventName = functionId.GetEventName(eventKey);
            var telemetryEvent = _service.CreateEvent(eventName);

            if (logMessage == null || !logMessage.ContainsProperty)
            {
                return telemetryEvent;
            }

            foreach (var kv in logMessage.Properties)
            {
                var propertyName = functionId.GetPropertyName(kv.Key);

                // call SetProperty. VS telemetry will take care of finding correct
                // API based on given object type for us.
                // 
                // numeric data will show up in ES with measurement prefix.
                telemetryEvent.SetProperty(propertyName, kv.Value);
            }

            return telemetryEvent;
        }
开发者ID:Rickinio,项目名称:roslyn,代码行数:23,代码来源:VSTelemetryLogger.cs


注:本文中的FunctionId.GetPropertyName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。