예제 #1
0
        public XmlNode GetNodeAtColumn(XmlNode node)
        {
            int nodePos = NodePos;

            if (NodeType == XmlNodeType.Attribute)
            {
                if (node.Attributes != null)
                {
                    return(node.Attributes.GetNamedItem(NodeName));
                }
            }
            else
            if (node.HasChildNodes)
            {
                for (int k = 0; k < node.ChildNodes.Count; k++)
                {
                    XmlNode child = node.ChildNodes.Item(k);
                    if (child.NodeType == NodeType &&
                        ((NodeType != XmlNodeType.Element || NodeName.Equals(child.Name))))
                    {
                        if (nodePos == 0)
                        {
                            return(child);
                        }
                        else
                        {
                            nodePos--;
                        }
                    }
                }
            }
            return(null);
        }
예제 #2
0
        // TODO Generalize to any element (ie, if element allows value attribute,
        // otherwise use inner text) via HtmlSchema

        public string Value()
        {
            if (NodeName.Equals("textarea"))
            {
                return(InnerText);
            }
            return(Attribute("value"));
        }
예제 #3
0
 public HtmlElement Value(string value)
 {
     if (NodeName.Equals("textarea"))
     {
         InnerText = value;
     }
     else
     {
         Attribute("value", value);
     }
     return(this);
 }
예제 #4
0
        /// <summary>
        /// Returns true if Hudson instances are equal
        /// </summary>
        /// <param name="other">Instance of Hudson to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(Hudson other)
        {
            if (other is null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Class == other.Class ||
                     Class != null &&
                     Class.Equals(other.Class)
                     ) &&
                 (
                     AssignedLabels == other.AssignedLabels ||
                     AssignedLabels != null &&
                     other.AssignedLabels != null &&
                     AssignedLabels.SequenceEqual(other.AssignedLabels)
                 ) &&
                 (
                     Mode == other.Mode ||
                     Mode != null &&
                     Mode.Equals(other.Mode)
                 ) &&
                 (
                     NodeDescription == other.NodeDescription ||
                     NodeDescription != null &&
                     NodeDescription.Equals(other.NodeDescription)
                 ) &&
                 (
                     NodeName == other.NodeName ||
                     NodeName != null &&
                     NodeName.Equals(other.NodeName)
                 ) &&
                 (
                     NumExecutors == other.NumExecutors ||

                     NumExecutors.Equals(other.NumExecutors)
                 ) &&
                 (
                     Description == other.Description ||
                     Description != null &&
                     Description.Equals(other.Description)
                 ) &&
                 (
                     Jobs == other.Jobs ||
                     Jobs != null &&
                     other.Jobs != null &&
                     Jobs.SequenceEqual(other.Jobs)
                 ) &&
                 (
                     PrimaryView == other.PrimaryView ||
                     PrimaryView != null &&
                     PrimaryView.Equals(other.PrimaryView)
                 ) &&
                 (
                     QuietingDown == other.QuietingDown ||

                     QuietingDown.Equals(other.QuietingDown)
                 ) &&
                 (
                     SlaveAgentPort == other.SlaveAgentPort ||

                     SlaveAgentPort.Equals(other.SlaveAgentPort)
                 ) &&
                 (
                     UnlabeledLoad == other.UnlabeledLoad ||
                     UnlabeledLoad != null &&
                     UnlabeledLoad.Equals(other.UnlabeledLoad)
                 ) &&
                 (
                     UseCrumbs == other.UseCrumbs ||

                     UseCrumbs.Equals(other.UseCrumbs)
                 ) &&
                 (
                     UseSecurity == other.UseSecurity ||

                     UseSecurity.Equals(other.UseSecurity)
                 ) &&
                 (
                     Views == other.Views ||
                     Views != null &&
                     other.Views != null &&
                     Views.SequenceEqual(other.Views)
                 ));
        }
예제 #5
0
 public bool Equals(Node node) =>
 PathPrefix.Equals(node.PathPrefix) &&
 NodeName.Equals(node.NodeName) &&
 IsFileNode.Equals(node.IsFileNode);