/// <summary> /// Sobre escritura del método equals /// </summary> /// <param name="obj">Objeto a comparar</param> /// <returns></returns> public override bool Equals(object obj) { if (!(obj is Measure) || obj == null) { return(false); } if (this == obj) { return(true); } Measure measureAComparar = (Measure)obj; if (Namespace == null && measureAComparar.Namespace == null && LocalName == null && measureAComparar.LocalName == null) { return(true); } if ((Namespace == null && measureAComparar.Namespace != null) || (Namespace != null && measureAComparar.Namespace == null)) { return(false); } if ((LocalName == null && measureAComparar.LocalName != null) || (LocalName != null && measureAComparar.LocalName == null)) { return(false); } return(Namespace.Equals(measureAComparar.Namespace) && LocalName.Equals(measureAComparar.LocalName)); }
public bool IsEmptyData() { bool isEmpty = false; if (Name.Equals(DEFAULT_NAME)) { if (Uuid.Equals(DEFAULT_UUID)) { if (Rssi == DEFAULT_RSSI) { if (Status.Equals(DEFAULT_STATUS)) { if (LocalName.Equals(DEFAULT_LOCAL_NAME)) { if (Connectable.Equals(DEFAULT_CONNECTABLE)) { isEmpty = true; } } } } } } return(isEmpty); }
/// /// <summary> * if this is a new layout, return the partition key signaturename else return Signature/@Name of this or its /// * appropriate parent /// * </summary> /// * <returns> the name of the signature </returns> /// public override string getSignatureName() { if (LocalName.Equals(ElementName.SIGNATURE)) { return(getName()); } if (LocalName.Equals(ElementName.SHEET)) { KElement parentNode = getParentNode_KElement(); if (parentNode is JDFSignature) { JDFSignature sig = (JDFSignature)parentNode; return(sig.getSignatureName()); } } else if (LocalName.Equals(ElementName.SURFACE)) { KElement parentNode = getParentNode_KElement().getParentNode_KElement(); if (parentNode is JDFSignature) { JDFSignature sig = (JDFSignature)parentNode; return(sig.getSignatureName()); } } return(base.getSignatureName()); }
protected internal override AttributeInfo getTheAttributeInfo() { AttributeInfo ai = base.getTheAttributeInfo(); if (LocalName.Equals(ElementName.SURFACE)) { ai.updateReplace(atrInfoTable); } return(ai); }
/// <summary> /// Asserts that the name of the element is among specified element names. /// </summary> /// <param name="allowedNames">The allowed names.</param> public void AssertName(params string[] allowedNames) { foreach (var en in allowedNames) { if (LocalName.Equals(en, StringComparison.OrdinalIgnoreCase)) { return; } } throw new InvalidOperationException("Assertion failed. Expected element name '" + string.Join("|", allowedNames) + "', actual: '" + LocalName + "'."); }
/// /// <summary> * init this comment by adding agentname, agentversion and id /// * </summary> /// * <returns> boolean </returns> /// public override bool init() { EnumVersion v = getVersion(true); if (v.getValue() >= EnumVersion.Version_1_3.getValue() && LocalName.Equals(ElementName.COMMENT)) { appendAnchor(null); setAgentName(JDFAudit.getStaticAgentName()); setAgentVersion(JDFAudit.getStaticAgentVersion()); } return(base.init()); }
public override bool init() { bool bRet = base.init(); if (LocalName.Equals(ElementName.SIGNATURE)) // signatures are // resource elements // only!, no class { removeAttribute(AttributeName.CLASS); } return(bRet); }
/// /// <summary> * if this is a new layout, return the partition key signaturename else /// * return Signature/@Name of this or its appropriate parent /// * </summary> /// * <returns> the name of the signature </returns> /// public override string getSheetName() { if (LocalName.Equals(ElementName.SHEET)) { return(getName()); } if (LocalName.Equals(ElementName.SURFACE)) { JDFSheet sh = (JDFSheet)getParentNode_KElement(); return(sh.getSheetName()); } return(base.getSheetName()); }
/// /// <summary> * version fixing routine for JDF /// * /// * uses heuristics to modify this element and its children to be compatible with a given version<br> /// * in general, it will be able to move from low to high versions but potentially fail when attempting to move from /// * higher to lower versions /// * </summary> /// * <param name="version"> version that the resulting element should correspond to </param> /// * <returns> true if successful </returns> /// public override bool fixVersion(EnumVersion version) { if (version != null) { if (version.getValue() >= EnumVersion.Version_1_3.getValue() && LocalName.Equals(ElementName.COMMENT)) { appendAnchor(null); } else { removeAttribute(AttributeName.ID); removeAttribute(AttributeName.AGENTNAME); removeAttribute(AttributeName.AGENTVERSION); removeAttribute(AttributeName.AUTHOR); removeAttribute(AttributeName.TIMESTAMP); } } return(base.fixVersion(version)); }