public void EncodingXML(string input, string expected) { XMLOperations xml = new XMLOperations(); string result = xml.Encode(input); Assert.AreEqual(expected, result); }
public XmlElement SaveToXMLNode(XmlDocument xmlDocument, String NodeName) { XmlElement xmlNode = xmlDocument.CreateElement(NodeName); XMLOperations.AddAttribute(xmlNode, xmlDocument, "Coord_X", Convert.ToString(Coord_X)); XMLOperations.AddAttribute(xmlNode, xmlDocument, "Coord_Y", Convert.ToString(Coord_Y)); return(xmlNode); }
public XmlElement SaveToXMLNode(XmlDocument xmlDocument) { XmlElement xmlNode = xmlDocument.CreateElement("BuildingSite"); XMLOperations.AddAttribute(xmlNode, xmlDocument, "Name", Name); foreach (Building obj in BuildingList) { xmlNode.AppendChild(obj.SaveToXMLNode(xmlDocument)); } return(xmlNode); }
public XmlElement SaveToXMLNode(XmlDocument xmlDocument, String NodeName) { XmlElement xmlNode = xmlDocument.CreateElement(NodeName); XMLOperations.AddAttribute(xmlNode, xmlDocument, "AddBarsLeft", Convert.ToString(AddBarsLeft)); XMLOperations.AddAttribute(xmlNode, xmlDocument, "AddBarsRight", Convert.ToString(AddBarsRight)); XMLOperations.AddAttribute(xmlNode, xmlDocument, "AddBarsLeftSpacing", Convert.ToString(AddBarsLeftSpacing)); XMLOperations.AddAttribute(xmlNode, xmlDocument, "AddBarsRightSpacing", Convert.ToString(AddBarsRightSpacing)); XMLOperations.AddAttribute(xmlNode, xmlDocument, "AddBarsLeftQuant", Convert.ToString(AddBarsLeftQuant)); XMLOperations.AddAttribute(xmlNode, xmlDocument, "AddBarsRightQuant", Convert.ToString(AddBarsRightQuant)); XMLOperations.AddAttribute(xmlNode, xmlDocument, "MainSpacing", Convert.ToString(MainSpacing)); return(xmlNode); }
public XmlElement SaveToXMLNode(XmlDocument xmlDocument) { XmlElement xmlNode = xmlDocument.CreateElement("Level"); XMLOperations.AddAttribute(xmlNode, xmlDocument, "Name", Name); XMLOperations.AddAttribute(xmlNode, xmlDocument, "FloorLevel", Convert.ToString(FloorLevel)); XMLOperations.AddAttribute(xmlNode, xmlDocument, "Height", Convert.ToString(Height)); XMLOperations.AddAttribute(xmlNode, xmlDocument, "TopOffset", Convert.ToString(TopOffset)); XMLOperations.AddAttribute(xmlNode, xmlDocument, "Quant", Convert.ToString(Quant)); foreach (Wall obj in WallList) { xmlNode.AppendChild(obj.SaveToXMLNode(xmlDocument)); } return(xmlNode); }
public XmlElement SaveToXMLNode(XmlDocument xmlDocument) { XmlElement xmlNode = xmlDocument.CreateElement("OpeningPlacing"); int counter = 0; foreach (OpeningType OpeningTypeItem in Wall.Level.Building.OpeningTypeList) { if (ReferenceEquals(OpeningTypeItem, OpeningType)) { XMLOperations.AddAttribute(xmlNode, xmlDocument, "OpeningTypeNumber", Convert.ToString(counter)); } counter++; } XMLOperations.AddAttribute(xmlNode, xmlDocument, "Left", Convert.ToString(Left)); XMLOperations.AddAttribute(xmlNode, xmlDocument, "OverrideBottom", Convert.ToString(OverrideBottom)); XMLOperations.AddAttribute(xmlNode, xmlDocument, "Bottom", Convert.ToString(Bottom)); return(xmlNode); }
public XmlElement SaveToXMLNode(XmlDocument xmlDocument) { XmlElement xmlNode = xmlDocument.CreateElement("Building"); XMLOperations.AddAttribute(xmlNode, xmlDocument, "Name", Name); foreach (WallType obj in WallTypeList) { xmlNode.AppendChild(obj.SaveToXMLNode(xmlDocument)); } foreach (OpeningType obj in OpeningTypeList) { xmlNode.AppendChild(obj.SaveToXMLNode(xmlDocument)); } foreach (Level obj in LevelList) { xmlNode.AppendChild(obj.SaveToXMLNode(xmlDocument)); } return(xmlNode); }
public XmlElement SaveToXMLNode(XmlDocument xmlDocument) { XmlElement xmlNode = xmlDocument.CreateElement("Wall"); XMLOperations.AddAttribute(xmlNode, xmlDocument, "Name", Name); int counter = 0; foreach (WallType wallTypeItem in Level.Building.WallTypeList) { if (ReferenceEquals(wallTypeItem, WallType)) { XMLOperations.AddAttribute(xmlNode, xmlDocument, "WallTypeNumber", Convert.ToString(counter)); } counter++; } XMLOperations.AddAttribute(xmlNode, xmlDocument, "ReWriteHeight", Convert.ToString(ReWriteHeight)); XMLOperations.AddAttribute(xmlNode, xmlDocument, "Height", Convert.ToString(Height)); XMLOperations.AddAttribute(xmlNode, xmlDocument, "ConcreteStartOffset", Convert.ToString(ConcreteStartOffset)); XMLOperations.AddAttribute(xmlNode, xmlDocument, "ConcreteEndOffset", Convert.ToString(ConcreteEndOffset)); XMLOperations.AddAttribute(xmlNode, xmlDocument, "ReiforcementStartOffset", Convert.ToString(ReiforcementStartOffset)); XMLOperations.AddAttribute(xmlNode, xmlDocument, "ReiforcementEndOffset", Convert.ToString(ReiforcementEndOffset)); XMLOperations.AddAttribute(xmlNode, xmlDocument, "OverrideVertSpacing", Convert.ToString(OverrideVertSpacing)); XMLOperations.AddAttribute(xmlNode, xmlDocument, "OverrideHorSpacing", Convert.ToString(OverrideHorSpacing)); XmlElement StartPointNode = StartPoint.SaveToXMLNode(xmlDocument, "StartPoint"); xmlNode.AppendChild(StartPointNode); XmlElement EndPointNode = EndPoint.SaveToXMLNode(xmlDocument, "EndPoint"); xmlNode.AppendChild(EndPointNode); foreach (OpeningPlacing obj in OpeningPlacingList) { xmlNode.AppendChild(obj.SaveToXMLNode(xmlDocument)); } XmlElement VertSpacingSettingNode = VertSpacingSetting.SaveToXMLNode(xmlDocument, "VertSpacingSetting"); xmlNode.AppendChild(VertSpacingSettingNode); XmlElement HorSpacingSettingNode = HorSpacingSetting.SaveToXMLNode(xmlDocument, "HorSpacingSetting"); xmlNode.AppendChild(HorSpacingSettingNode); return(xmlNode); }
/* * Andres Alberto Yepes * 06-01-2017 * *************************************************************************************************************** * función encargada de realizar el perform activity. como base utiliza xslt para realizar la transformación de la información * recibida en la fachada a la estructura esperada por Bizagi de acuerdo al modelo de datos del proceso. No tiene acoplamiento * con la estructura del proceso, mas allá que a través de la xslt recibida anteriormente. Utiliza una clase generica para realizar * el perform activity funcionando como un DTO. * * */ private GestionDesembolsoResponse performActivity2(GestionDesembolsoRequest notificacion, InfoCasoDesembolso casoDesembolsoConsultado) { XmlDocument request = SerializerManager.SerializarToXmlDocument <GestionDesembolsoRequest>(notificacion); HUB.BizagiSOAObjects.PeformActivityGeneric.BizAgiWSParam param = new HUB.BizagiSOAObjects.PeformActivityGeneric.BizAgiWSParam(); HUB.BizagiSOAObjects.PeformActivityGeneric.BizAgiWSParamActivityData activity = new HUB.BizagiSOAObjects.PeformActivityGeneric.BizAgiWSParamActivityData(); activity.idCase = casoDesembolsoConsultado.OidTrackingDesembolso.IIdCaso; activity.taskName = casoDesembolsoConsultado.OidTrackingDesembolso.OidActividadEspera.STaskName; param.domain = Properties.Resources.DominioFNA; param.userName = casoDesembolsoConsultado.OidTrackingDesembolso.SNombreUsuarioEstacion; param.ActivityData = activity; BizagiSOALayerOperations <HUB.BizagiSOAObjects.PeformActivityGeneric.BizAgiWSParam> ejecutar = new BizagiSOALayerOperations <HUB.BizagiSOAObjects.PeformActivityGeneric.BizAgiWSParam>(); ejecutar.Url = ProxyUtils.GetServiceEndpoint("URLWorkFlowEngine"); string xmlParam = SerializerManager.SerializarToXml(param); XmlDocument paramDocXML = new XmlDocument(); paramDocXML.LoadXml(xmlParam); XPathNavigator navigatorParam = paramDocXML.CreateNavigator(); //transforma el request en un xml con la definición de esquema del proceso en Bizagi string xmlEntities = XMLOperations.XSLTransformation(casoDesembolsoConsultado.OidTrackingDesembolso.OidActividadEspera.STransformacion, request); XmlDocument docEntitiesXml = new XmlDocument(); docEntitiesXml.LoadXml(xmlEntities); XPathNavigator navEntities = docEntitiesXml.CreateNavigator(); //crea el nodo de entities navigatorParam.MoveToChild("BizAgiWSParam", String.Empty); navigatorParam.AppendChild("<Entities></Entities>"); navigatorParam.MoveToChild("Entities", String.Empty); //inserta en el nodo entities el xml con el xml transformado por la xslt navigatorParam.AppendChild(docEntitiesXml.OuterXml); processes performResp = ejecutar.performActivity(paramDocXML.OuterXml); return(getRespuestaBO(performResp, EnumSOALayerAction.PerformActivity)); }
public XmlElement SaveToXMLNode(XmlDocument xmlDocument) { XmlElement xmlNode = xmlDocument.CreateElement("WallType"); XMLOperations.AddAttribute(xmlNode, xmlDocument, "Name", Name); XMLOperations.AddAttribute(xmlNode, xmlDocument, "Thickness", Convert.ToString(Thickness)); XMLOperations.AddAttribute(xmlNode, xmlDocument, "TopOffset", Convert.ToString(TopOffset)); XMLOperations.AddAttribute(xmlNode, xmlDocument, "BottomOffset", Convert.ToString(BottomOffset)); XMLOperations.AddAttribute(xmlNode, xmlDocument, "BarTopOffset", Convert.ToString(BarTopOffset)); XMLOperations.AddAttribute(xmlNode, xmlDocument, "RoundVertToBaseLength", Convert.ToString(RoundVertToBaseLength)); XMLOperations.AddAttribute(xmlNode, xmlDocument, "VertBaseLength", Convert.ToString(VertBaseLength)); XMLOperations.AddAttribute(xmlNode, xmlDocument, "HorLapping", Convert.ToString(HorLapping)); XMLOperations.AddAttribute(xmlNode, xmlDocument, "HorLappingLength", Convert.ToString(HorLappingLength)); XMLOperations.AddAttribute(xmlNode, xmlDocument, "HorBaseLength", Convert.ToString(HorBaseLength)); XmlElement VertSpacingSettingNode = VertSpacingSetting.SaveToXMLNode(xmlDocument, "VertSpacingSetting"); xmlNode.AppendChild(VertSpacingSettingNode); XmlElement HorSpacingSettingNode = HorSpacingSetting.SaveToXMLNode(xmlDocument, "HorSpacingSetting"); xmlNode.AppendChild(HorSpacingSettingNode); return(xmlNode); }
//Сохраняет класс в узел XML public XmlElement SaveToXMLNode(XmlDocument xmlDocument) { XmlElement xmlNode = xmlDocument.CreateElement("OpeningType"); XMLOperations.AddAttribute(xmlNode, xmlDocument, "Name", Name); XMLOperations.AddAttribute(xmlNode, xmlDocument, "Purpose", Purpose); XMLOperations.AddAttribute(xmlNode, xmlDocument, "Width", Convert.ToString(Width)); XMLOperations.AddAttribute(xmlNode, xmlDocument, "Height", Convert.ToString(Height)); XMLOperations.AddAttribute(xmlNode, xmlDocument, "Bottom", Convert.ToString(Bottom)); XMLOperations.AddAttribute(xmlNode, xmlDocument, "AddEdgeLeft", Convert.ToString(AddEdgeLeft)); XMLOperations.AddAttribute(xmlNode, xmlDocument, "AddEdgeRight", Convert.ToString(AddEdgeRight)); XMLOperations.AddAttribute(xmlNode, xmlDocument, "AddEdgeTop", Convert.ToString(AddEdgeTop)); XMLOperations.AddAttribute(xmlNode, xmlDocument, "AddEdgeBottom", Convert.ToString(AddEdgeBottom)); XMLOperations.AddAttribute(xmlNode, xmlDocument, "MoveVert", Convert.ToString(MoveVert)); XMLOperations.AddAttribute(xmlNode, xmlDocument, "QuantVertLeft", Convert.ToString(QuantVertLeft)); XMLOperations.AddAttribute(xmlNode, xmlDocument, "QuantVertRight", Convert.ToString(QuantVertRight)); XMLOperations.AddAttribute(xmlNode, xmlDocument, "QuantInclined", Convert.ToString(QuantInclined)); XMLOperations.AddAttribute(xmlNode, xmlDocument, "AddIncTopLeft", Convert.ToString(AddIncTopLeft)); XMLOperations.AddAttribute(xmlNode, xmlDocument, "AddIncTopRight", Convert.ToString(AddIncTopRight)); XMLOperations.AddAttribute(xmlNode, xmlDocument, "AddIncBottomLeft", Convert.ToString(AddIncBottomLeft)); XMLOperations.AddAttribute(xmlNode, xmlDocument, "AddIncBottomRight", Convert.ToString(AddIncBottomRight)); return(xmlNode); }
private string GetFormattedString(string text, EnStringType stringType, bool isFormatted) { string result = text; try { switch (stringType) { case EnStringType.Json: result = JsonOperations.GetFormattedJson(result, isFormatted ? Formatting.Indented : Formatting.None); break; case EnStringType.Xml: result = XMLOperations.GetXmlString(result, isFormatted); break; } } catch (Exception ex) { MessageBox.Show(this, ex.Message, $"{stringType} Convert Error ...", MessageBoxButtons.OK, MessageBoxIcon.Error); } return(result); }
public override void InsertSettings(XmlDocument doc, XmlElement node) { node.AppendChild(XMLOperations.ToElement(doc, Name, Value)); }