diff options
Diffstat (limited to 'mcs/class/Microsoft.Build/Microsoft.Build.Evaluation/ProjectMetadata.cs')
-rw-r--r-- | mcs/class/Microsoft.Build/Microsoft.Build.Evaluation/ProjectMetadata.cs | 80 |
1 files changed, 47 insertions, 33 deletions
diff --git a/mcs/class/Microsoft.Build/Microsoft.Build.Evaluation/ProjectMetadata.cs b/mcs/class/Microsoft.Build/Microsoft.Build.Evaluation/ProjectMetadata.cs index 45001f61a2..880a0e336b 100644 --- a/mcs/class/Microsoft.Build/Microsoft.Build.Evaluation/ProjectMetadata.cs +++ b/mcs/class/Microsoft.Build/Microsoft.Build.Evaluation/ProjectMetadata.cs @@ -2,8 +2,9 @@ // // Author: // Rolf Bjarne Kvinge (rolf@xamarin.com) +// Atsushi Enomoto (atsushi@xamarin.com) // -// Copyright (C) 2011 Xamarin Inc. +// Copyright (C) 2011,2013 Xamarin Inc. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the @@ -26,49 +27,62 @@ // using Microsoft.Build.Construction; - using System; +using System.Collections.Generic; +using System.Linq; namespace Microsoft.Build.Evaluation { - public class ProjectMetadata - { - private ProjectMetadata () - { - throw new NotImplementedException (); - } + public class ProjectMetadata + { + internal ProjectMetadata (Project project, string itemType, IEnumerable<ProjectMetadata> existingMetadata, Action<ProjectMetadata> remover, ProjectMetadataElement xml) + { + this.xml = xml; + this.project = project; + item_type = itemType; + predecessor = existingMetadata.FirstOrDefault (m => m.Name == xml.Name); + if (predecessor != null) + remover (predecessor); + is_imported = Project.ProjectCollection.OngoingImports.Any (); + } + + readonly Project project; + readonly string item_type; + readonly ProjectMetadataElement xml; + readonly ProjectMetadata predecessor; + readonly bool is_imported; - public string EvaluatedValue { - get { throw new NotImplementedException (); } - } + public string EvaluatedValue { + get { return project.ExpandString (xml.Value); } + } - public bool IsImported { - get { throw new NotImplementedException (); } - } + public bool IsImported { + get { return is_imported; } + } - public string ItemType { - get { throw new NotImplementedException (); } - } + public string ItemType { + get { return item_type; } + } - public string Name { - get { throw new NotImplementedException (); } - } + public string Name { + get { return xml.Name; } + } - public ProjectMetadata Predecessor { - get { throw new NotImplementedException (); } - } + public ProjectMetadata Predecessor { + get { return predecessor; } + } - public Project Project { - get { throw new NotImplementedException (); } - } + public Project Project { + get { return project; } + } - public string UnevaluatedValue { - get { throw new NotImplementedException (); } - } + public string UnevaluatedValue { + get { return xml.Value; } + } - public ProjectMetadataElement Xml { - get { throw new NotImplementedException (); } - } - } + public ProjectMetadataElement Xml { + get { return xml; } + } + } } |