Esempio n. 1
0
        private async Task <SolutionList> AnalyzeSolutions(SolutionConfiguration solutionConfiguration)
        {
            var tasks = new List <Task <Solution> >();

            foreach (var solutionInformation in solutionConfiguration.Solutions)
            {
                var solutionFile = Path.Combine(solutionConfiguration.RootFolder, solutionInformation.SolutionFile);
                tasks.Add(_solutionAnalyzer.AnalyzeSolution(solutionFile, solutionInformation.ProjectReferencesToIgnore, solutionInformation.ProjectsToIgnore));
            }

            var results = await Task.WhenAll(tasks);

            var retVal = new SolutionList();

            retVal.AddRange(results);
            return(retVal);
        }
Esempio n. 2
0
        private async void SolutionListTreeViewService_ActionPresentBlobs(object sender, ActionPresentBlobsEventArgs e)
        {
            var tasks = new List <Task <SolutionList> >();

            foreach (var blobName in e.BlobNames)
            {
                tasks.Add(_applicationStorageService.GetSolutionList(blobName));
            }

            var solutionLists = await Task.WhenAll(tasks);

            var combinedSolutionList = new SolutionList();

            //Todo: log instances that are not of type Solution
            combinedSolutionList.AddRange(solutionLists.SelectMany(s => s).OfType <Solution>());

            _html = await _htmlRenderer.RenderToString(_renderingOptionsTreeViewService.GetRenderProperties(), combinedSolutionList, "Third party dependencies", "Third party dependencies");

            _synchronizationContext.Send(new SendOrPostCallback(o =>
            {
                var htmlToRender         = (string)o;
                _webBrowser.DocumentText = htmlToRender;
            }), _html);
        }
Esempio n. 3
0
        private string ScanMemberBody(MemberDecl md)
        {
            Contract.Requires(md != null);
            solution_list.plist.Clear();
            Method m = md as Method;

            if (m == null)
            {
                return(null);
            }
            if (m.Body == null)
            {
                return(null);
            }

            List <IVariable> variables = new List <IVariable>();

            variables.AddRange(m.Ins);
            variables.AddRange(m.Outs);
            SolutionList sol_list = new SolutionList();

            sol_list.AddRange(solution_list.plist);
            if (TacnyOptions.O.ParallelExecution)
            {
                Parallel.ForEach(m.Body.Body, st =>
                {
                    // register local variables
                    VarDeclStmt vds = st as VarDeclStmt;
                    if (vds != null)
                    {
                        variables.AddRange(vds.Locals);
                    }

                    UpdateStmt us = st as UpdateStmt;
                    if (us != null)
                    {
                        if (tacnyProgram.IsTacticCall(us))
                        {
                            try
                            {
                                tacnyProgram.SetCurrent(tacnyProgram.GetTactic(us), md);
                                // get the resolved variables
                                List <IVariable> resolved = tacnyProgram.GetResolvedVariables(md);
                                resolved.AddRange(m.Ins);     // add input arguments as resolved variables
                                Atomic.ResolveTactic(tacnyProgram.GetTactic(us), us, md, tacnyProgram, variables, resolved, ref sol_list);
                                tacnyProgram.CurrentDebug.Fin();
                            }
                            catch (AggregateException e)
                            {
                                foreach (var err in e.Data)
                                {
                                    Printer.Error(err.ToString());
                                }
                            }
                        }
                    }
                });
            }
            else
            {
                foreach (var st in m.Body.Body)
                {
                    // register local variables
                    VarDeclStmt vds = st as VarDeclStmt;
                    if (vds != null)
                    {
                        variables.AddRange(vds.Locals);
                    }

                    UpdateStmt us = st as UpdateStmt;
                    if (us != null)
                    {
                        if (tacnyProgram.IsTacticCall(us))
                        {
                            try
                            {
                                tacnyProgram.SetCurrent(tacnyProgram.GetTactic(us), md);
                                // get the resolved variables
                                List <IVariable> resolved = tacnyProgram.GetResolvedVariables(md);
                                resolved.AddRange(m.Ins); // add input arguments as resolved variables
                                Atomic.ResolveTactic(tacnyProgram.GetTactic(us), us, md, tacnyProgram, variables, resolved, ref sol_list);
                                tacnyProgram.CurrentDebug.Fin();
                            }
                            catch (Exception e)
                            {
                                return(e.Message);
                            }
                        }
                    }
                }
            }
            solution_list.AddRange(sol_list.plist);
            return(null);
        }
Esempio n. 4
0
        private string ScanMemberBody(MemberDecl md)
        {
            Contract.Requires(md != null);
            solution_list.plist.Clear();
            Method m = md as Method;
            if (m == null)
                return null;
            if (m.Body == null)
                return null;
            
            List<IVariable> variables = new List<IVariable>();
            variables.AddRange(m.Ins);
            variables.AddRange(m.Outs);
            SolutionList sol_list = new SolutionList();
            sol_list.AddRange(solution_list.plist);
            if (TacnyOptions.O.ParallelExecution)
            {
                Parallel.ForEach(m.Body.Body, st =>
                    {
                        // register local variables
                        VarDeclStmt vds = st as VarDeclStmt;
                        if (vds != null)
                            variables.AddRange(vds.Locals);

                        UpdateStmt us = st as UpdateStmt;
                        if (us != null)
                        {
                            if (tacnyProgram.IsTacticCall(us))
                            {
                                try
                                {
                                    tacnyProgram.SetCurrent(tacnyProgram.GetTactic(us), md);
                                    // get the resolved variables
                                    List<IVariable> resolved = tacnyProgram.GetResolvedVariables(md);
                                    resolved.AddRange(m.Ins); // add input arguments as resolved variables
                                    Atomic.ResolveTactic(tacnyProgram.GetTactic(us), us, md, tacnyProgram, variables, resolved, ref sol_list);
                                    tacnyProgram.CurrentDebug.Fin();
                                }
                                catch (AggregateException e)
                                {
                                    foreach (var err in e.Data)
                                    {
                                        Printer.Error(err.ToString());
                                    }
                                }
                            }
                        }
                    });
            }
            else
            {
                foreach (var st in m.Body.Body)
                {
                    // register local variables
                    VarDeclStmt vds = st as VarDeclStmt;
                    if (vds != null)
                        variables.AddRange(vds.Locals);

                    UpdateStmt us = st as UpdateStmt;
                    if (us != null)
                    {
                        if (tacnyProgram.IsTacticCall(us))
                        {
                            try
                            {
                                tacnyProgram.SetCurrent(tacnyProgram.GetTactic(us), md);
                                // get the resolved variables
                                List<IVariable> resolved = tacnyProgram.GetResolvedVariables(md);
                                resolved.AddRange(m.Ins); // add input arguments as resolved variables
                                Atomic.ResolveTactic(tacnyProgram.GetTactic(us), us, md, tacnyProgram, variables, resolved, ref sol_list);
                                tacnyProgram.CurrentDebug.Fin();
                            }
                            catch (Exception e)
                            {
                                return e.Message;
                            }
                        }
                    }
                }
            }
            solution_list.AddRange(sol_list.plist);
            return null;
        }