/// <summary> /// Initializes a new instance of the <see cref="CSF.Zpt.Metal.MetalMacro"/> class. /// </summary> /// <param name="name">Name.</param> /// <param name="element">Element.</param> public MetalMacro(string name, ZptElement element) { if(name == null) { throw new ArgumentNullException(nameof(name)); } if(element == null) { throw new ArgumentNullException(nameof(element)); } this.Name = name; this.Element = element; }
/// <summary> /// Attempts to get a root object, from which to begin traversal of the path. /// </summary> /// <returns><c>true</c>, if the root object was retrieved, <c>false</c> otherwise.</returns> /// <param name="walker">A TALES path walker.</param> /// <param name="element">A ZPT element.</param> /// <param name="model">The TALES model.</param> /// <param name="result">Exposes the result of this operation.</param> protected virtual bool TryGetTraversalRoot(PathWalker walker, ZptElement element, TalesModel model, out object result) { bool output; if(walker.NextPart() && model.TryGetLocalRootObject(walker.CurrentPart.Value, element, out result)) { output = true; } else { output = false; result = null; } return output; }
/// <summary> /// Determines whether the specified <see cref="CSF.Zpt.Rendering.ZptElement"/> is equal to the current /// <see cref="CSF.Zpt.DocumentProviders.ZptXmlLinqElement"/>. /// </summary> /// <param name="other"> /// The <see cref="CSF.Zpt.Rendering.ZptElement"/> to compare with the current /// <see cref="CSF.Zpt.DocumentProviders.ZptXmlLinqElement"/>. /// </param> /// <returns> /// <c>true</c> if the specified <see cref="CSF.Zpt.Rendering.ZptElement"/> is equal to the current /// <see cref="CSF.Zpt.DocumentProviders.ZptXmlLinqElement"/>; otherwise, <c>false</c>. /// </returns> public override bool Equals(ZptElement other) { bool output; if(Object.ReferenceEquals(this, other)) { output = true; } else { var ele = other as ZptXmlLinqElement; output = (ele != null && ele.Node == this.Node); } return output; }