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


C# FunctionId类代码示例

本文整理汇总了C#中FunctionId的典型用法代码示例。如果您正苦于以下问题:C# FunctionId类的具体用法?C# FunctionId怎么用?C# FunctionId使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: 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

示例2: AggregateNode

        internal AggregateNode(DataTable table, FunctionId aggregateType, string columnName, bool local, string relationName) : base(table) {
            Debug.Assert(columnName != null, "Invalid parameter column name (null).");
            this.aggregate = (Aggregate)(int)aggregateType;

            if (aggregateType == FunctionId.Sum)
                this.type = AggregateType.Sum;
            else if (aggregateType == FunctionId.Avg)
                this.type = AggregateType.Mean;
            else if (aggregateType == FunctionId.Min)
                this.type = AggregateType.Min;
            else if (aggregateType == FunctionId.Max)
                this.type = AggregateType.Max;
            else if (aggregateType == FunctionId.Count)
                this.type = AggregateType.Count;
            else if (aggregateType == FunctionId.Var)
                this.type = AggregateType.Var;
            else if (aggregateType == FunctionId.StDev)
                this.type = AggregateType.StDev;
            else {
                throw ExprException.UndefinedFunction(Function.FunctionName[(Int32)aggregateType]);
            }

            this.local = local;
            this.relationName = relationName;
            this.columnName = columnName;
        }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:26,代码来源:AggregateNode.cs

示例3: CreateOption

        private static Option<bool> CreateOption(FunctionId id)
        {
            var name = Enum.GetName(typeof(FunctionId), id);

            return new Option<bool>(nameof(FunctionIdOptions), name, defaultValue: false,
                storageLocations: new LocalUserProfileStorageLocation(@"Roslyn\Internal\Performance\FunctionId\" + name));
        }
开发者ID:XieShuquan,项目名称:roslyn,代码行数:7,代码来源:FunctionIdOptions.cs

示例4: Function

 internal Function()
 {
     this.parameters = new Type[3];
     this.name = null;
     this.id = FunctionId.none;
     this.result = null;
     this.IsValidateArguments = false;
     this.argumentCount = 0;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:9,代码来源:Function.cs

示例5: Construct

            public void Construct(FunctionId functionId, string message, int blockId, CancellationToken cancellationToken)
            {
                this.functionId = functionId;
                this.tick = Environment.TickCount;
                this.blockId = blockId;
                this.cancellationToken = cancellationToken;

                RoslynEventSource.Instance.BlockStart(message, functionId, blockId);
            }
开发者ID:riversky,项目名称:roslyn,代码行数:9,代码来源:EtwLogger.cs

示例6: LogBlockEnd

        public void LogBlockEnd(FunctionId functionId, LogMessage logMessage, int uniquePairId, int delta, CancellationToken cancellationToken)
        {
            if (!_pendingActivities.TryRemove(uniquePairId, out var activity))
            {
                Contract.Requires(false, "when can this happen?");
                return;
            }

            activity.Dispose();
        }
开发者ID:TyOverby,项目名称:roslyn,代码行数:10,代码来源:VSTelemetryActivityLogger.cs

示例7: TraceLogBlock

            public TraceLogBlock(FeatureId featureId, FunctionId functionId, string message, int uniquePairId, CancellationToken cancellationToken)
            {
                this.featureId = featureId;
                this.functionId = functionId;
                this.uniquePairId = uniquePairId;
                this.cancellationToken = cancellationToken;

                this.watch = Stopwatch.StartNew();
                Trace.WriteLine(string.Format("[{0}] Start({1}) : {2}/{3} - {4}", Thread.CurrentThread.ManagedThreadId, uniquePairId, featureId.ToString(), functionId.ToString(), message));
            }
开发者ID:EkardNT,项目名称:Roslyn,代码行数:10,代码来源:TraceLogger.cs

示例8: Construct

            public void Construct(ILogger logger, FunctionId functionId, LogMessage logMessage, int blockId, CancellationToken cancellationToken)
            {
                this.logger = logger;
                this.functionId = functionId;
                this.logMessage = logMessage;
                this.tick = Environment.TickCount;
                this.blockId = blockId;
                this.cancellationToken = cancellationToken;

                logger.LogBlockStart(functionId, logMessage, blockId, cancellationToken);
            }
开发者ID:jerriclynsjohn,项目名称:roslyn,代码行数:11,代码来源:Logger.LogBlock.cs

示例9: GetDefaultValue

 private static bool GetDefaultValue(FunctionId id)
 {
     switch (id)
     {
         // change not to enable any etw events by default.
         // we used to couple this to other logger such as code marker but now it is only specific to etw.
         // each events should be enabled specifically when needed.
         default:
             return false;
     }
 }
开发者ID:Rickinio,项目名称:roslyn,代码行数:11,代码来源:FunctionIdOptions.cs

示例10: LogBlockEnd

 public void LogBlockEnd(FunctionId functionId, LogMessage logMessage, int uniquePairId, int delta, CancellationToken cancellationToken)
 {
     if (cancellationToken.IsCancellationRequested)
     {
         RoslynEventSource.Instance.BlockCanceled(functionId, delta, uniquePairId);
     }
     else
     {
         RoslynEventSource.Instance.BlockStop(functionId, delta, uniquePairId);
     }
 }
开发者ID:Rickinio,项目名称:roslyn,代码行数:11,代码来源:EtwLogger.cs

示例11: LogBlockStart

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

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

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

示例12: Log

        public void Log(FunctionId functionId, LogMessage logMessage)
        {
            var kvLogMessage = logMessage as KeyValueLogMessage;
            if (kvLogMessage == null)
            {
                return;
            }

            try
            {
                // guard us from exception thrown by telemetry
                if (!kvLogMessage.ContainsProperty)
                {
                    _session.PostSimpleEvent(functionId.GetEventName());
                    return;
                }

                var telemetryEvent = CreateTelemetryEvent(functionId, logMessage: kvLogMessage);
                _session.PostEvent(telemetryEvent);
            }
            catch
            {
            }
        }
开发者ID:Rickinio,项目名称:roslyn,代码行数:24,代码来源:VSTelemetryLogger.cs

示例13: LogBlockEnd

 public void LogBlockEnd(FunctionId functionId, LogMessage logMessage, int uniquePairId, int delta, CancellationToken cancellationToken)
 {
     _model.BlockDisposed(functionId);
 }
开发者ID:Rickinio,项目名称:roslyn,代码行数:4,代码来源:PerfEventActivityLogger.cs

示例14: GetOption

 public static Option<bool> GetOption(FunctionId id)
 {
     return s_options.GetOrAdd(id, s_optionCreator);
 }
开发者ID:XieShuquan,项目名称:roslyn,代码行数:4,代码来源:FunctionIdOptions.cs

示例15: BlockCanceled

 public void BlockCanceled(FunctionId functionId, int tick, int blockId)
 {
     WriteEvent(5, (int)functionId, tick, blockId);
 }
开发者ID:riversky,项目名称:roslyn,代码行数:4,代码来源:RoslynEventSource.cs


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