コード例 #1
0
        private void ParseBaseDir(Project project)
        {
            _baseDir = project.BaseDirectory;
            NAntProperty property = new NAntProperty("BaseDir", _baseDir, "Project", false);

            Properties.Add(property);
        }
コード例 #2
0
        private void AddReadRegistrys(Project project, XmlDocument doc)
        {
            foreach (XmlElement element in doc.GetElementsByTagName("readregistry"))
            {
                if (TypeFactory.TaskBuilders.Contains(element.Name))
                {
                    ReadRegistryTask task = (ReadRegistryTask)project.CreateTask(element);
                    task.Initialize(element);

                    if (task.PropertyName != null)
                    {
                        task.Execute();

                        object val   = task.Properties[task.PropertyName];
                        string value = val == null ? "" : val.ToString();

                        NAntProperty property = new NAntProperty(
                            task.PropertyName, value,
                            element.ParentNode.Attributes["name"].Value, false);

                        property.ExpandedValue = property.Value;
                        Properties.Add(property);
                    }
                }
            }
        }
コード例 #3
0
        private void ParseLoadfiles(Project project, XmlDocument doc)
        {
            foreach (XmlElement element in doc.GetElementsByTagName("loadfile"))
            {
                if (TypeFactory.TaskBuilders.Contains(element.Name))
                {
                    LoadFileTask task = (LoadFileTask)project.CreateTask(element);
                    task.Initialize(element);

                    try
                    {
                        task.Execute();
                        NAntProperty property = new NAntProperty(
                            task.Property, task.Properties[task.Property],
                            element.ParentNode.Attributes["name"].Value,
                            true);

                        property.ExpandedValue = property.Value;
                        Properties.Add(property);
                    }
                    catch (BuildException)
                    {
                        // TODO: Do something with the error message
                    }
                }
            }
        }
コード例 #4
0
        private void ParseProperties(Project project, XmlDocument doc)
        {
            foreach (XmlElement element in doc.GetElementsByTagName("property"))
            {
                NAntProperty property = new NAntProperty(element);

                if (project != null)
                {
                    TryExpandingProperty(project, property);

                    if (!project.Properties.Contains(property.Name))
                    {
                        project.Properties.AddReadOnly(
                            property.Name, property.ExpandedValue);

                        Properties.Add(property);
                    }
                }
                else
                {
                    Properties.Add(property);
                }
            }
        }
コード例 #5
0
        private void AddReadRegistrys(Project project, XmlDocument doc)
        {
            foreach (XmlElement element in doc.GetElementsByTagName("readregistry"))
            {
                if (TypeFactory.TaskBuilders.Contains(element.Name))
                {
                    ReadRegistryTask task = (ReadRegistryTask) project.CreateTask(element);
                    task.Initialize(element);

                    if (task.PropertyName != null)
                    {
                        task.Execute();

                        object val = task.Properties[task.PropertyName];
                        string value = val == null ? "" : val.ToString();

                        NAntProperty property = new NAntProperty(
                            task.PropertyName, value,
                            element.ParentNode.Attributes["name"].Value, false);

                        property.ExpandedValue = property.Value;
                        Properties.Add(property);
                    }
                }
            }
        }
コード例 #6
0
        private void ParseTstamps(Project project, XmlDocument doc)
        {
            foreach (XmlElement element in doc.GetElementsByTagName("tstamp"))
            {
                if (TypeFactory.TaskBuilders.Contains(element.Name))
                {
                    TStampTask task = (TStampTask) project.CreateTask(element);
                    task.Initialize(element);

                    try
                    {
                        task.Execute();
                        NAntProperty property = new NAntProperty(
                            task.Property, task.Properties[task.Property],
                            element.ParentNode.Attributes["name"].Value,
                            true);

                        property.ExpandedValue = property.Value;
                        Properties.Add(property);
                    }
                    catch (BuildException)
                    {
                        // TODO: Do something with the error message
                    }
                }
            }
        }
コード例 #7
0
        private void ParseProperties(Project project, XmlDocument doc)
        {
            foreach (XmlElement element in doc.GetElementsByTagName("property"))
            {
                NAntProperty property = new NAntProperty(element);

                if (project != null)
                {
                    TryExpandingProperty(project, property);

                    if (!project.Properties.Contains(property.Name))
                    {
                        project.Properties.AddReadOnly(
                            property.Name, property.ExpandedValue);

                        Properties.Add(property);
                    }
                }
                else
                {
                    Properties.Add(property);
                }
            }
        }
コード例 #8
0
 private void ParseBaseDir(Project project)
 {
     _baseDir = project.BaseDirectory;
     NAntProperty property = new NAntProperty("BaseDir", _baseDir, "Project", false);
     Properties.Add(property);
 }