public ProjectMapPopupViewData(Models.Project project, bool showDetailedInformation)
        {
            //Project = project;
            DisplayNameAsUrlBlankTarget = project.DisplayNameAsUrlBlankTarget;
            KeyPhoto           = project.KeyPhoto;
            Duration           = project.Duration;
            ProjectStage       = project.ProjectStage;
            ProjectType        = project.ProjectType;
            EstimatedTotalCost = project.EstimatedTotalCost.HasValue ? project.EstimatedTotalCost.ToStringCurrency() : "Unknown";
            var leadImplementerOrg =
                project.ProjectOrganizations.FirstOrDefault(po => po.RelationshipTypeID == 33);

            LeadImplementerOrganizationName =
                leadImplementerOrg != null?leadImplementerOrg.Organization.GetDisplayNameAsUrlBlankTarget() : new HtmlString(string.Empty);

            var dict = new Dictionary <Models.ClassificationSystem, string>();

            MoreEnumerable.ForEach(project.ProjectClassifications.Select(x => x.Classification.ClassificationSystem).Distinct(), x => dict.Add(x, string.Join(", ", project.ProjectClassifications.Select(y => y.Classification).Where(y => y.ClassificationSystem == x).Select(y => y.DisplayName).ToList())));
            ClassificationsBySystem = dict;

            ProjectDisplayName   = project.DisplayName;
            ProjectDetailUrl     = project.GetDetailUrl();
            FactSheetUrl         = project.GetFactSheetUrl();
            DetailLinkDescriptor = project.IsProposal() ? $"This {Models.FieldDefinition.Project.GetFieldDefinitionLabel()} is a proposal. For description and expected results, see the" : $"For {Models.FieldDefinition.Project.GetFieldDefinitionLabel()} information & results, see the";
            InitializeDisplayNames();
            TaxonomyLevel = MultiTenantHelpers.GetTaxonomyLevel();

            ShowDetailedInformation = showDetailedInformation;
        }
Esempio n. 2
0
        public static Capture Expression(IEnumerable <string> names, Func <PList, EType> signature, Func <PList, string> compiletime, Func <PList, string> runtime = null)
        {
            var nameList = names.ToList();

            return(new Capture("Expressions", $"[ {string.Join(" ", nameList)} ]",
                               func => MoreEnumerable.ForEach(nameList, name => Expression(name, signature, compiletime, runtime).Interpret(func))));
        }
Esempio n. 3
0
 private void DiscoverTerminalChains()
 {
     // This is a very annoying workaround for the library's resolution
     // issues. Is there not a way to make it 'just work' the normal way
     // at all?
     MoreEnumerable.ForEach(vertexAdjacencyList.Where(intToListPair => intToListPair.Value.Count == 1),
                            intToListPair => terminalChainTails.Add(intToListPair.Key));
 }
Esempio n. 4
0
 public void ForEachNullSequence()
 {
     MoreEnumerable.ForEach <int>(null, x => { throw new InvalidOperationException(); });
 }
Esempio n. 5
0
 public void ForEachIndexedNullSequence()
 {
     Assert.ThrowsArgumentNullException("source", () =>
                                        MoreEnumerable.ForEach <int>(null, (x, i) => { throw new InvalidOperationException(); }));
 }