• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# FunctionId类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: ParseAggregateArgument

        /// <devdoc>
        ///     parse the argument to an Aggregate function.
        ///     the syntax is
        ///          Func(child[(relation_name)].column_name)
        ///     When the function is called we have already parsed the Aggregate name, and open paren
        /// </devdoc>
        private ExpressionNode ParseAggregateArgument(FunctionId aggregate) {
            Debug.Assert(token == Tokens.LeftParen, "ParseAggregateArgument(): Invalid argument, token <> '('");

            bool child;
            string relname;
            string colname;

            Scan();

            try {
                if (token != Tokens.Child) {
                    if (token != Tokens.Name)
                        throw ExprException.AggregateArgument();

                    colname = NameNode.ParseName(text, start, pos);
                    ScanToken(Tokens.RightParen);
                    return new AggregateNode(_table, aggregate, colname);
                }

                child = (token == Tokens.Child);
                prevOperand = Scalar;

                // expecting an '(' or '.'
                Scan();

                if (token == Tokens.LeftParen) {
                    //read the relation name
                    ScanToken(Tokens.Name);
                    relname = NameNode.ParseName(text, start, pos);
                    ScanToken(Tokens.RightParen);
                    ScanToken(Tokens.Dot);
                }
                else {
                    relname = null;
                    CheckToken(Tokens.Dot);
                }

                ScanToken(Tokens.Name);
                colname = NameNode.ParseName(text, start, pos);
                ScanToken(Tokens.RightParen);
            }
            catch (Exception e){
                // 
                if (!Common.ADP.IsCatchableExceptionType(e)) {
                    throw;
                }
                throw ExprException.AggregateArgument();
            }
            return new AggregateNode(_table, aggregate, colname, !child, relname);
        }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:56,代码来源:ExpressionParser.cs


示例17: BlockStart

 public void BlockStart(string message, FunctionId functionId, int blockId)
 {
     WriteEvent(2, message ?? string.Empty, (int)functionId, blockId);
 }
开发者ID:riversky,项目名称:roslyn,代码行数:4,代码来源:RoslynEventSource.cs


示例18: BlockStop

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


示例19: LogString

 public void LogString(string message, FunctionId functionId)
 {
     WriteEvent(1, message ?? string.Empty, (int)functionId);
 }
开发者ID:elemk0vv,项目名称:roslyn-1,代码行数:4,代码来源:RoslynCompilerEventSource.cs


示例20: LogBlockStart

 public void LogBlockStart(FunctionId functionId, LogMessage logMessage, int uniquePairId, CancellationToken cancellationToken)
 {
     var eventName = functionId.GetEventName();
     _pendingActivities[uniquePairId] = new TelemetryActivity(_service, eventName, startCodeMarker: 0, endCodeMarker: 0, codeMarkerData: null, parentCorrelationId: Guid.Empty);
 }
开发者ID:TyOverby,项目名称:roslyn,代码行数:5,代码来源:VSTelemetryActivityLogger.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# FunctionObject类代码示例发布时间:2022-05-24
下一篇:
C# FunctionDefinition类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap