private List <DirectoryDefinition> LoadDirectoryDefinitions(ProjectDefinition projectDefinition, XElement includeElement)
        {
            List <DirectoryDefinition> list = new List <DirectoryDefinition>();

            foreach (XElement dir in includeElement.Descendants(PROJECT_DIRECTORY))
            {
                DirectoryDefinition directoryDefinition = new DirectoryDefinition();

                directoryDefinition.Enabled = bool.Parse(dir.Attribute(XName.Get(ENABLED)).Value); // XSD should have validated input...

                string tmpPath = dir.Attribute(XName.Get(PROJECT_PATH)).Value;
                if (string.IsNullOrEmpty(tmpPath))
                {
                    Log.Warning("Empty directory defined in project '" + projectDefinition.Name + "'.");
                    continue;
                }

                string path = null;
                if (tmpPath.StartsWith("*"))
                {
                    tmpPath = tmpPath.TrimStart('*');
                    path    = string.IsNullOrEmpty(tmpPath) ? projectDefinition.RootDirectory.Path : Path.GetFullPath(projectDefinition.RootDirectory.Path + tmpPath);

                    if (!Directory.Exists(path))
                    {
                        Log.Warning("Unable to find directory '" + path + "' in project '" + projectDefinition.Name + "'.");
                        continue;
                    }
                }
                directoryDefinition.Path = path;
                list.Add(directoryDefinition);
            }
            return(list);
        }
        private List <DirectoryDefinition> LoadDirectoryDefinitions(XElement includeElement)
        {
            List <DirectoryDefinition> list = new List <DirectoryDefinition>();

            foreach (XElement dir in includeElement.Descendants(PROJECT_DIRECTORY))
            {
                DirectoryDefinition directoryDefinition = new DirectoryDefinition();

                directoryDefinition.Enabled = bool.Parse(dir.Attribute(XName.Get(ENABLED)).Value); // XSD should have validated input...
                directoryDefinition.Path    = dir.Attribute(XName.Get(PROJECT_PATH)).Value;

                list.Add(directoryDefinition);
            }
            return(list);
        }
Exemplo n.º 3
0
        private List<DirectoryDefinition> LoadDirectoryDefinitions(XElement includeElement)
        {
            List<DirectoryDefinition> list = new List<DirectoryDefinition>();

              foreach (XElement dir in includeElement.Descendants(PROJECT_DIRECTORY))
              {
            DirectoryDefinition directoryDefinition = new DirectoryDefinition();

            directoryDefinition.Enabled = bool.Parse(dir.Attribute(XName.Get(ENABLED)).Value); // XSD should have validated input...
            directoryDefinition.Path = dir.Attribute(XName.Get(PROJECT_PATH)).Value;

            list.Add(directoryDefinition);
              }
              return list;
        }
Exemplo n.º 4
0
        private List<DirectoryDefinition> LoadDirectoryDefinitions(ProjectDefinition projectDefinition, XElement includeElement)
        {
            List<DirectoryDefinition> list = new List<DirectoryDefinition>();

              foreach (XElement dir in includeElement.Descendants(PROJECT_DIRECTORY))
              {
            DirectoryDefinition directoryDefinition = new DirectoryDefinition();

            directoryDefinition.Enabled = bool.Parse(dir.Attribute(XName.Get(ENABLED)).Value); // XSD should have validated input...

                string tmpPath = dir.Attribute(XName.Get(PROJECT_PATH)).Value;
              if (string.IsNullOrEmpty(tmpPath))
              {
              Log.Warning("Empty directory defined in project '" + projectDefinition.Name + "'.");
                    continue;
              }

              string path = null;
                if (tmpPath.StartsWith("*"))
                {
                    tmpPath = tmpPath.TrimStart('*');
                    path = string.IsNullOrEmpty(tmpPath) ? projectDefinition.RootDirectory.Path : Path.GetFullPath(projectDefinition.RootDirectory.Path + tmpPath);

              if (!Directory.Exists(path))
              {
                  Log.Warning("Unable to find directory '" + path + "' in project '" + projectDefinition.Name + "'.");
                  continue;
              }
              }
              directoryDefinition.Path = path;
                list.Add(directoryDefinition);
              }
              return list;
        }