Exemple #1
0
        public XmlElement GetProjectExtension(string section)
        {
            var ext = (MSBuildProjectExtensions)ChildNodes.FirstOrDefault(ob => ob is MSBuildProjectExtensions);

            if (ext != null)
            {
                return(ext.GetProjectExtension(section));
            }
            return(null);
        }
Exemple #2
0
        /// <summary>
        /// 虚函数
        /// </summary>
        /// <param name="name"></param>
        /// <returns></returns>
        public virtual PiaNode this[string name]
        {
            get
            {
                if (ChildNodes.Count == 0)
                {
                    return(null);
                }

                return(ChildNodes.FirstOrDefault(n => n.NodeName.Equals(name,
                                                                        StringComparison.InvariantCultureIgnoreCase)));
            }
        }
Exemple #3
0
        public void RemoveProjectExtension(string section)
        {
            AssertCanModify();
            var ext = (MSBuildProjectExtensions)ChildNodes.FirstOrDefault(ob => ob is MSBuildProjectExtensions);

            if (ext != null)
            {
                ext.RemoveProjectExtension(section);
                if (ext.IsEmpty)
                {
                    Remove(ext);
                }
            }
        }
Exemple #4
0
        public virtual PiaNode this[string name]
        {
            get
            {
                if (ChildNodes.Count == 0)
                {
                    return(null);
                }
                //throw new ArgumentOutOfRangeException();

                return(ChildNodes.FirstOrDefault(n => n.NodeName.Equals(name,
                                                                        StringComparison.InvariantCultureIgnoreCase)));
            }
        }
Exemple #5
0
        public void SetProjectExtension(XmlElement value)
        {
            AssertCanModify();
            var ext = (MSBuildProjectExtensions)ChildNodes.FirstOrDefault(ob => ob is MSBuildProjectExtensions);

            if (ext == null)
            {
                ext            = new MSBuildProjectExtensions();
                ext.ParentNode = this;
                ChildNodes     = ChildNodes.Add(ext);
                ext.ResetIndent(false);
            }
            ext.SetProjectExtension(value);
            NotifyChanged();
        }
Exemple #6
0
 public override string ToString()
 {
     return($"{ChildNodes.FirstOrDefault()}{Prefix}*");
 }
 public override string ToString()
 {
     return($"{ChildNodes.FirstOrDefault()}{Prefix}{{{OriginalN ?? N.ToString()},}}");
 }
 protected override int GetSpanLength()
 {
     return(base.GetSpanLength() - ChildNodes.FirstOrDefault()?.ToString().Length ?? 0);
 }