Beispiel #1
0
 public override void UpdateFile(String original, String updated)
 {
     foreach (var s in FileContents.Where(itm => itm.Contains(original)).ToList())
     {
         var pos = Array.IndexOf(FileContents, s);
         if (pos > -1)
         {
             FileContents[pos] = FileContents[pos].Replace(original, updated);
         }
     }
 }
Beispiel #2
0
 private void Initialize()
 {
     Files = new List <String>();
     foreach (var s in FileContents.Where(s => "FILE" == s.Substring(0, 4).ToUpper()))
     {
         var equalIndex = s.IndexOf("=", StringComparison.Ordinal) + 1;
         var fn         = s.Substring(equalIndex, s.Length - equalIndex);
         if (!System.IO.Path.IsPathRooted(s))
         {
             var uri = System.IO.Path.Combine(System.IO.Path.GetDirectoryName(FFileName), fn);
             Files.Add(uri);
         }
         else
         {
             Files.Add(System.IO.Path.GetFullPath(fn));
         }
     }
 }
Beispiel #3
0
 private void Initialize()
 {
     Files = new List <String>();
     foreach (var s in FileContents.Where(itm => itm[0] != '#').ToList())
     {
         IsUri = s.StartsWith("file://");
         var check = IsUri ? new Uri(s).LocalPath:s;
         if (!System.IO.Path.IsPathRooted(check))
         {
             var u = System.IO.Path.Combine(System.IO.Path.GetDirectoryName(FFileName), check);
             UpdateFile(s, IsUri ? new Uri(u).AbsoluteUri : u);
             Files.Add(u);
         }
         else
         {
             Files.Add(System.IO.Path.GetFullPath(s));
         }
     }
 }