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


C# AnalysisData类代码示例

本文整理汇总了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;未经允许,请勿转载。