Exemple #1
0
 public ProjectRef(BuildItem item, TranslatePath fnTranslate)
 {
     this.RefType = String.Format("{0}", Check.NotNull(item).Name);
     if (item.GetMetadata("Private") == "True")
     {
         CopyLocal = true;
     }
     if (item.GetMetadata("SpecificVersion") == "True")
     {
         SpecificVersion = true;
     }
     if (!String.IsNullOrEmpty(item.Condition))
     {
         this.Condition = item.Condition;
     }
     if (RefType == "ProjectReference")
     {
         this.FromProjectReference(item, Check.NotNull(fnTranslate));
     }
     else if (RefType == "Reference")
     {
         this.FromFileReference(item, Check.NotNull(fnTranslate));
     }
     else
     {
         throw new ApplicationException("Unkown reference type " + RefType);
     }
 }
		private void FromFileReference(BuildItem bi, TranslatePath fnTranslate)
		{
			if (!String.IsNullOrEmpty(bi.Include))
			{
				this.Assembly = new AssemblyName(bi.Include);
				SpecificVersion |= this.Assembly.Version != null;
			}
			if (!String.IsNullOrEmpty(bi.GetMetadata("HintPath")))
			{
				string path = bi.GetMetadata("HintPath");
				fnTranslate(ref path);//< output file doesn't nessessarily exist
				this.Output = path;
			}
			this.RequiresVersion = bi.GetMetadata("RequiredTargetFramework");
		}
Exemple #3
0
 private void FromFileReference(BuildItem bi, TranslatePath fnTranslate)
 {
     if (!String.IsNullOrEmpty(bi.Include))
     {
         this.Assembly    = new AssemblyName(bi.Include);
         SpecificVersion |= this.Assembly.Version != null;
     }
     if (!String.IsNullOrEmpty(bi.GetMetadata("HintPath")))
     {
         string path = bi.GetMetadata("HintPath");
         fnTranslate(ref path);                //< output file doesn't nessessarily exist
         this.Output = path;
     }
     this.RequiresVersion = bi.GetMetadata("RequiredTargetFramework");
 }
		public ProjectRef(BuildItem item, TranslatePath fnTranslate)
		{
			this.RefType = String.Format("{0}", Check.NotNull(item).Name);
			if (item.GetMetadata("Private") == "True")
				CopyLocal = true;
			if (item.GetMetadata("SpecificVersion") == "True")
				SpecificVersion = true;
			if (!String.IsNullOrEmpty(item.Condition))
				this.Condition = item.Condition;
			if (RefType == "ProjectReference")
				this.FromProjectReference(item, Check.NotNull(fnTranslate));
			else if (RefType == "Reference")
				this.FromFileReference(item, Check.NotNull(fnTranslate));
			else
				throw new ApplicationException("Unkown reference type " + RefType);
		}
Exemple #5
0
 private void FromProjectReference(BuildItem bi, TranslatePath fnTranslate)
 {
     if (!String.IsNullOrEmpty(bi.Include))
     {
         string path = bi.Include;
         if (fnTranslate(ref path))
         {
             this.Project = path;
         }
     }
     if (!String.IsNullOrEmpty(bi.GetMetadata("Project")))
     {
         this.Guid = new Guid(bi.GetMetadata("Project"));
     }
     if (!String.IsNullOrEmpty(bi.GetMetadata("Name")))
     {
         this.Assembly = new AssemblyName(bi.GetMetadata("Name"));
     }
 }
		private void FromProjectReference(BuildItem bi, TranslatePath fnTranslate)
		{
			if (!String.IsNullOrEmpty(bi.Include))
			{
				string path = bi.Include;
				if (fnTranslate(ref path))
					this.Project = path;
			}
			if (!String.IsNullOrEmpty(bi.GetMetadata("Project")))
				this.Guid = new Guid(bi.GetMetadata("Project"));
			if (!String.IsNullOrEmpty(bi.GetMetadata("Name")))
				this.Assembly = new AssemblyName(bi.GetMetadata("Name"));
		}