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

C# AnalysisData类代码示例

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

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



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

示例1: GetResults

 public IEnumerable<AnalysisResult> GetResults(AnalysisData data)
 {
     return this.heuristics
         .GroupBy(h => h.Language)
         .Select(group => new { language = group.Key, matches = Run(group, data), groupCount = group.Count() })
         .Select(x => new AnalysisResult(x.language, x.matches, CalculateScore(this.heuristics.Count, x.groupCount, x.matches.Count())));
 }
开发者ID:nbarbettini,项目名称:polyglot-dotnet,代码行数:7,代码来源:HeuristicRunner.cs


示例2: FilterDiagnostics

            protected override void FilterDiagnostics(AnalysisData analysisData, Func<DiagnosticData, bool> predicateOpt)
            {
                if (predicateOpt == null)
                {
                    AppendDiagnostics(analysisData.Items.Where(d => this.DiagnosticIds == null || this.DiagnosticIds.Contains(d.Id)));
                    return;
                }

                AppendDiagnostics(analysisData.Items.Where(d => this.DiagnosticIds == null || this.DiagnosticIds.Contains(d.Id)).Where(predicateOpt));
            }
开发者ID:nileshjagtap,项目名称:roslyn,代码行数:10,代码来源:DiagnosticIncrementalAnalyzer_GetDiagnostics.cs


示例3: GetExistingDiagnostics

        private static ImmutableArray<DiagnosticData> GetExistingDiagnostics(AnalysisData analysisData)
        {
            if (analysisData == null)
            {
                return ImmutableArray<DiagnosticData>.Empty;
            }

            return analysisData.Items;
        }
开发者ID:noahfalk,项目名称:roslyn,代码行数:9,代码来源:DiagnosticIncrementalAnalyzer_BuildSynchronization.cs


示例4: UpdateDocumentDiagnostics

        private ImmutableArray<DiagnosticData> UpdateDocumentDiagnostics(
            AnalysisData existingData, ImmutableArray<TextSpan> range, ImmutableArray<DiagnosticData> memberDiagnostics,
            SyntaxTree tree, SyntaxNode member, int memberId)
        {
            // get old span
            var oldSpan = range[memberId];

            // get old diagnostics
            var diagnostics = existingData.Items;

            // check quick exit cases
            if (diagnostics.Length == 0 && memberDiagnostics.Length == 0)
            {
                return diagnostics;
            }

            // simple case
            if (diagnostics.Length == 0 && memberDiagnostics.Length > 0)
            {
                return memberDiagnostics;
            }

            // regular case
            var result = new List<DiagnosticData>();

            // update member location
            Contract.Requires(member.FullSpan.Start == oldSpan.Start);
            var delta = member.FullSpan.End - oldSpan.End;

            var replaced = false;
            foreach (var diagnostic in diagnostics)
            {
                if (diagnostic.TextSpan.Start < oldSpan.Start)
                {
                    result.Add(diagnostic);
                    continue;
                }

                if (!replaced)
                {
                    result.AddRange(memberDiagnostics);
                    replaced = true;
                }

                if (oldSpan.End <= diagnostic.TextSpan.Start)
                {
                    result.Add(UpdatePosition(diagnostic, tree, delta));
                    continue;
                }
            }

            // if it haven't replaced, replace it now
            if (!replaced)
            {
                result.AddRange(memberDiagnostics);
                replaced = true;
            }

            return result.ToImmutableArray();
        }
开发者ID:nevinclement,项目名称:roslyn,代码行数:60,代码来源:DiagnosticIncrementalAnalyzer.cs


示例5: CheckSemanticVersions

        private static bool CheckSemanticVersions(Project project, AnalysisData existingData, VersionArgument versions)
        {
            if (existingData == null)
            {
                return false;
            }

            return VersionStamp.CanReusePersistedVersion(versions.TextVersion, existingData.TextVersion) &&
                   project.CanReusePersistedDependentSemanticVersion(versions.ProjectVersion, versions.DataVersion, existingData.DataVersion);
        }
开发者ID:nevinclement,项目名称:roslyn,代码行数:10,代码来源:DiagnosticIncrementalAnalyzer.cs


示例6: CheckSyntaxVersions

        private static bool CheckSyntaxVersions(Document document, AnalysisData existingData, VersionArgument versions)
        {
            if (existingData == null)
            {
                return false;
            }

            return document.CanReusePersistedTextVersion(versions.TextVersion, existingData.TextVersion) &&
                   document.CanReusePersistedSyntaxTreeVersion(versions.DataVersion, existingData.DataVersion);
        }
开发者ID:nevinclement,项目名称:roslyn,代码行数:10,代码来源:DiagnosticIncrementalAnalyzer.cs


示例7: PersistProjectData

        private static async Task PersistProjectData(Project project, DiagnosticState state, AnalysisData data)
        {
            // TODO: Cancellation is not allowed here to prevent data inconsistency. But there is still a possibility of data inconsistency due to
            //       things like exception. For now, I am letting it go and let v2 engine take care of it properly. If v2 doesnt come online soon enough
            //       more refactoring is required on project state.

            // clear all existing data
            state.Remove(project.Id);
            foreach (var document in project.Documents)
            {
                state.Remove(document.Id);
            }

            // quick bail out
            if (data.Items.Length == 0)
            {
                return;
            }

            // save new data
            var group = data.Items.GroupBy(d => d.DocumentId);
            foreach (var kv in group)
            {
                if (kv.Key == null)
                {
                    // save project scope diagnostics
                    await state.PersistAsync(project, new AnalysisData(data.TextVersion, data.DataVersion, kv.ToImmutableArrayOrEmpty()), CancellationToken.None).ConfigureAwait(false);
                    continue;
                }

                // save document scope diagnostics
                var document = project.GetDocument(kv.Key);
                if (document == null)
                {
                    continue;
                }

                await state.PersistAsync(document, new AnalysisData(data.TextVersion, data.DataVersion, kv.ToImmutableArrayOrEmpty()), CancellationToken.None).ConfigureAwait(false);
            }
        }
开发者ID:nevinclement,项目名称:roslyn,代码行数:40,代码来源:DiagnosticIncrementalAnalyzer.cs


示例8: FilterDiagnostics

 protected override void FilterDiagnostics(AnalysisData analysisData, Func<DiagnosticData, bool> predicateOpt = null)
 {
     // we don't care about result
     return;
 }
开发者ID:daking2014,项目名称:roslyn,代码行数:5,代码来源:DiagnosticIncrementalAnalyzer_GetDiagnostics.cs


示例9: GetResult

 public bool GetResult(AnalysisData data) => this.analysisFunc(data);
开发者ID:nbarbettini,项目名称:polyglot-dotnet,代码行数:1,代码来源:BooleanHeuristic.cs


示例10: getTests

    public List<Test> getTests(Int32 numTests, PatientObject patient)
    {
        if (Authenticated_AorC())
        {
            try
            {
                List<Test> tests = new List<Test>();
                Test filler = new Test();
                filler.anal = new List<AnalysisData>();
                Movement.Database.Patient p1 = new Movement.Database.Patient(patient.ID);
                ReadOnlyCollection<Movement.Database.Test> testList;
                testList = p1.GetAllTests();
                AnalysisData d1 = new AnalysisData();

                if (numTests == 0)
                {
                    for (int i = 0; i < testList.Count; i++)
                    {
                        filler.anal = new List<AnalysisData>();
                        filler.hand = testList[i].Hand;
                        filler.mode = testList[i].Mode;
                        filler.ID = testList[i].TestID;
                        filler.script.scriptID = testList[i].TestScript.ScriptID;
                        filler.timestamp = testList[i].Timestamp;
                        filler.rotation = testList[i].Rotation;
                        filler.script.type = testList[i].TestScript.ScriptType.Name;
                        foreach (KeyValuePair<Movement.Analysis.AnalysisMetric, Movement.Database.TestAnalysisComponent> data in testList[i].Analysis.Components)
                        {

                            d1.metric = data.Key;
                            d1.max = data.Value.Max;
                            d1.min = data.Value.Min;
                            d1.mean = data.Value.Mean;
                            d1.stdDev = data.Value.StdDev;

                            filler.anal.Add(d1);
                        }

                        tests.Add(filler);
                    }

                }
                else if (numTests < testList.Count)
                {
                    for (int j = 0; j < numTests; j++)
                    {
                        filler.anal = new List<AnalysisData>();
                        filler.hand = testList[j].Hand;
                        filler.mode = testList[j].Mode;
                        filler.ID = testList[j].TestID;
                        filler.script.scriptID = testList[j].TestScript.ScriptID;
                        filler.timestamp = testList[j].Timestamp;
                        filler.rotation = testList[j].Rotation;
                        filler.script.type = testList[j].TestScript.ScriptType.Name;
                        filler.isNormal = testList[j].AnalysisIsNormal;

                        foreach (KeyValuePair<Movement.Analysis.AnalysisMetric, Movement.Database.TestAnalysisComponent> data in testList[j].Analysis.Components)
                        {

                            d1.metric = data.Key;
                            d1.max = data.Value.Max;
                            d1.min = data.Value.Min;
                            d1.mean = data.Value.Mean;
                            d1.stdDev = data.Value.StdDev;

                            filler.anal.Add(d1);
                        }

                        tests.Add(filler);
                    }

                }
                else if (numTests > testList.Count)
                {
                    for (int i = 0; i < testList.Count; i++)
                    {
                        filler.anal = new List<AnalysisData>();
                        filler.hand = testList[i].Hand;
                        filler.mode = testList[i].Mode;
                        filler.ID = testList[i].TestID;
                        filler.script.scriptID = testList[i].TestScript.ScriptID;
                        filler.timestamp = testList[i].Timestamp;
                        filler.rotation = testList[i].Rotation;
                        filler.script.type = testList[i].TestScript.ScriptType.Name;
                        foreach (KeyValuePair<Movement.Analysis.AnalysisMetric, Movement.Database.TestAnalysisComponent> data in testList[i].Analysis.Components)
                        {

                            d1.metric = data.Key;
                            d1.max = data.Value.Max;
                            d1.min = data.Value.Min;
                            d1.mean = data.Value.Mean;
                            d1.stdDev = data.Value.StdDev;

                            filler.anal.Add(d1);
                        }

                        tests.Add(filler);
                    }
                }

//.........这里部分代码省略.........
开发者ID:hadleymj,项目名称:Senior-Design-Fall-2009,代码行数:101,代码来源:Service.cs


示例11: CanUseDocumentState

            private bool CanUseDocumentState(AnalysisData existingData, VersionStamp textVersion, VersionStamp dataVersion)
            {
                if (existingData == null)
                {
                    return false;
                }

                // make sure data stored in the cache is one from its previous text update
                return existingData.DataVersion.Equals(dataVersion) && existingData.TextVersion.Equals(textVersion);
            }
开发者ID:noahfalk,项目名称:roslyn,代码行数:10,代码来源:DiagnosticIncrementalAnalyzer.AnalyzerExecutor.cs


示例12: Run

 private static IEnumerable<string> Run(IEnumerable<IHeuristic> heuristics, AnalysisData data)
     => heuristics
         .Where(x => x.GetResult(data) == true)
         .Select(x => x.Name);
开发者ID:nbarbettini,项目名称:polyglot-dotnet,代码行数:4,代码来源:HeuristicRunner.cs


示例13: FilterDiagnostics

 protected override void FilterDiagnostics(AnalysisData analysisData)
 {
     AppendDiagnostics(analysisData.Items.Where(d => this.DiagnosticIds == null || this.DiagnosticIds.Contains(d.Id)));
 }
开发者ID:elemk0vv,项目名称:roslyn-1,代码行数:4,代码来源:DiagnosticIncrementalAnalyzer_GetDiagnostics.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# AnalysisUnit类代码示例发布时间:2022-05-24
下一篇:
C# AnalysisContext类代码示例发布时间: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