/// <summary> /// /// </summary> /// <param name="hasChildElements"></param> /// <returns></returns> protected override string SerializeCommandData(ref bool hasChildElements) { CommandSerializationHelper helper = new CommandSerializationHelper(); bool execStackExists = ExecutionStack != null && !ExecutionStack.empty(); helper.SerializeTaskTag(TaskTag); if (HandlerId != null && !execStackExists) { helper.SerializeAttribute(ConstInterface.MG_ATTR_HANDLERID, HandlerId); } if (OperIdx > Int32.MinValue && !execStackExists) { helper.SerializeAttribute(ConstInterface.MG_ATTR_OPER_IDX, OperIdx); } helper.SerializeDitIdx(DitIdx); if (Val != null) { helper.SerializeAttribute(XMLConstants.MG_ATTR_VALUE, XmlParser.escape(Val)); } if (CheckOnly) { helper.SerializeAttribute(ConstInterface.MG_ATTR_CHECK_ONLY, "1"); } return(helper.GetString()); }
/// <summary> /// build the XML structure of the command /// </summary> public void buildXML(StringBuilder message) { if (TaskTag != null && MGDataTable.Instance.GetTaskByID(TaskTag) != null && !((Task)MGDataTable.Instance.GetTaskByID(TaskTag)).KnownToServer) { return; } bool execStackExists = _executionStack != null && !_executionStack.empty(); BuildXMLInternal(message, execStackExists); if (execStackExists) { _executionStack.buildXML(message); } }