public XmlElement GetProjectExtension(string section) { var ext = (MSBuildProjectExtensions)ChildNodes.FirstOrDefault(ob => ob is MSBuildProjectExtensions); if (ext != null) { return(ext.GetProjectExtension(section)); } return(null); }
/// <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))); } }
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); } } }
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))); } }
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(); }
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); }