2007-01-10 Marek Sieradzki <marek.sieradzki@gmail.com>
[mono.git] / mcs / class / Microsoft.Build.Engine / Microsoft.Build.BuildEngine / MetadataReference.cs
index 41ba8f32bb8d62db4217c70f7ea09a061fdf1848..6127174647256f635a3552a85426307f056f6366 100644 (file)
@@ -36,34 +36,15 @@ namespace Microsoft.Build.BuildEngine {
        
                string          itemName;
                string          metadataName;
+               int start;
+               int length;
        
-               public MetadataReference ()
-               {
-               }
-
-               public MetadataReference (string itemName, string metadataName)
+               public MetadataReference (string itemName, string metadataName, int start, int length)
                {
                        this.itemName = itemName;
                        this.metadataName = metadataName;
-               }
-               
-               public void ParseSource (string source)
-               {
-                       string sourceWithoutParens;
-                       int dot;
-               
-                       if (source.Length < 4)
-                               throw new ArgumentException ("source is too short.");
-                       
-                       sourceWithoutParens = source.Substring (2, source.Length - 3);
-                       dot = sourceWithoutParens.IndexOf ('.');
-                       
-                       if (dot != -1) {
-                               itemName = sourceWithoutParens.Substring (0, dot);
-                               metadataName = sourceWithoutParens.Substring (dot + 1, sourceWithoutParens.Length - dot - 1); 
-                       } else {
-                               metadataName = sourceWithoutParens;
-                       }
+                       this.start = start;
+                       this.length = length;
                }
                
                public string ItemName {
@@ -77,7 +58,15 @@ namespace Microsoft.Build.BuildEngine {
                public bool IsQualified {
                        get { return (itemName == null) ? false : true; }
                }
+
+               public int Start {
+                       get { return start; }
+               }
+
+               public int End {
+                       get { return start + length - 1; }
+               }
        }
 }
 
-#endif
\ No newline at end of file
+#endif