static void ExportAsXML() { var reviews = GetReviews(); var writer = new XmlFileWriter(_xmlRootDir); XMLCreator xmlCreator = new XMLCreator(writer, _xmlRootDir); xmlCreator.CreateXMLsFrom(reviews); }
public void When_WriteAndRead_TempNodeGraph_Expect_SameNode(TempNodeGraph originalGraph) { string filePath = ArgParser.GetPath(Path.Combine(OSString, "Output_Files", "xmlOutput.xml")); XMLCreator.writeXML(originalGraph, filePath); TempNodeGraph restoredGraph = XMLCreator.readXML <TempNodeGraph>(filePath); Assert.AreEqual(originalGraph.tempNode, restoredGraph.tempNode); }
public void When_WriteAndReadAndWrite_CoreLinkedNodeGraph_Expect_SameNodeGraph(NodeGraph originalGraph) { string filePath = ArgParser.GetPath(Path.Combine(OSString, "Output_Files", "xmlOutput.xml")); XMLCreator.writeXML(originalGraph, filePath); NodeGraph restoredGraph = XMLCreator.readXML <NodeGraph>(filePath); filePath = ArgParser.GetPath(Path.Combine(OSString, "Output_Files", "xmlOutput2.xml")); XMLCreator.writeXML(restoredGraph, filePath); Assert.IsTrue(originalGraph.Equals(restoredGraph)); }
public override void OnInspectorGUI() { base.OnInspectorGUI(); XMLCreator creator = (XMLCreator)target; if (GUILayout.Button("Save Info")) { XMLManager.SaveData(creator.WorldNames, XMLManager.WORLDINFO_FOLDER_NAME, "WorldNames" + ".xml"); EditorUtility.DisplayDialog("Guadado de Datos", "se guardo correctamente la informacion ", "Ok", ""); } }
public void When_WriteAndRead_TempNodeGraphWithEdgeNodeLists_Expect_DifferentEdgeLists(TempNodeGraphWithEdgeNodeLists originalGraph) { string filePath = ArgParser.GetPath(Path.Combine(OSString, "Output_Files", "xmlOutput.xml")); XMLCreator.writeXML(originalGraph, filePath); originalGraph.edgeList = new Edge[] { new Edge(123123, 1124234), new Edge(23412312, 23451235) }; TempNodeGraphWithEdgeNodeLists restoredGraph = XMLCreator.readXML <TempNodeGraphWithEdgeNodeLists>(filePath); Assert.AreNotEqual(originalGraph.edgeList, restoredGraph.edgeList); }
private void buttonEnviarEmailXml_Click(object sender, EventArgs e) { string caminho = string.Empty; if (checkBoxXML.Checked && vendas != null) { caminho = Utility.XMLCreator.Creat(vendas); using (var context = new DatabaseEntities()) { vendas = context.Venda.OrderByDescending(x => x.Id == vendas.Id).First(); if (checkBoxEmail.Checked) { if (XMLCreator.Enviar(caminho, this.GetObj(), textBoxEmail.Text, vendas.Cliente.Nome)) { MessageBox.Show("Email enviado"); } } } } //string caminho, StringBuilder obj, string email, string nomeDest }
public override void insertData(XMLCreator xml, XmlElement parent) { xml.insertBlock(this, parent); }
public abstract void insertData(XMLCreator xml, XmlElement parent);
protected void CreateNewEntry(object sender, EventArgs e) { XMLCreator creator = new XMLCreator(); #region //Dummy entry: //XmlNode mon=creator.CreateMonitorNode("123", "32", // "materialsStand", "displayMater", // "matrixName", "matrixProducer", // "yes", // "monName", "monProducer"); //XmlNode box=creator.CreateBoxSetNode("cpuName", "cpuProducer", // "motherBoardName", "123Ram", // "videoCardName", "videoProducer", // "cooolSys", "soundCard", // "powerSupply", "expansionCard", // "hdd", "hddProducer", "usbFlash", // "opticalDisc", "memoryCard", "box"); //XmlNode per=creator.CreatePeripherals("mouse", "mouseProducer", // "keyboard", "keyBoardProducer", // "otherDevices", "videoCarmera", "microphone", // "headphones", "headProducer"); //XmlNode soft=creator.CreateSoftware("os", "osprod", // "antivir", "antivirProd", // "game1", "game1Prod", // "game2", "game2Prod", // "game3", "game3Prod", // "other", "otherProd"); #endregion XmlNode mon = creator.CreateMonitorNode(this.aspectRatioHeightTextBox.Text, this.aspectRatioWidthTextBox.Text, this.materialsStandTextBox.Text, this.materialsDisplayTextBox.Text, this.matrixNameTextBox.Text, this.matrixProducerTextBox.Text, this.ledTextBox.Text, this.monitorNameTextBox.Text, this.monitorProducerTextBox.Text); XmlNode box = creator.CreateBoxSetNode(this.cpuNameTextBox.Text, this.cpuProducerTextBox.Text, this.motherBoardTextBox.Text, this.ramTextBox.Text, this.videoCardNameTextBox.Text, this.videoCardProducerTextBox.Text, this.coolingSystemTextBox.Text, this.soundCardTextBox.Text, this.powerSupplyTextBox.Text, this.expansionCardTextBox.Text, this.hddNameTextBox.Text, this.hddProducerTextBox.Text, this.usbFlashDriveTextBox.Text, this.opticalDiscTextBox.Text, this.memoryCardReaderTextBox.Text, this.boxTextBox.Text); XmlNode per = creator.CreatePeripherals(this.mouseNameTextBox.Text, this.mouseProducerTextBox.Text, this.keyboardNameTextBox.Text, this.keyboardProducerTextBox.Text, this.otherDevicesTextBox.Text, this.videoCameraTextBox.Text, this.microphoneTextBox.Text, this.headphonesNameTextBox.Text, this.headphonesProducerTextBox.Text); XmlNode soft = creator.CreateSoftware(this.osTextBox.Text, this.osProducerTextBox.Text, this.antivirusNameTextBox.Text, this.antivirusProducerTextBox.Text, this.game1NameTextBox.Text, this.game1ProducerTextBox.Text, this.game2NameTextBox.Text, this.game2ProducerTextBox.Text, this.game3NameTextBox.Text, this.game3ProducerTextBox.Text, this.otherNameTextBox.Text, this.otherProducerTextBox.Text); XmlNode root = creator.CreateRoot(mon, box, per, soft); string newFilePath = creator.SaveToXml(root); XMLSingleFileInsert newFile = new XMLSingleFileInsert(newFilePath); newFile.Insert(); }
public PublishFullDeezerListingProcessor(IWriter writer) { _xmlCreator = new XMLCreator(writer, Constants.DeezerOperationsOutputDirectoryPath); }
private static void createXML(Protocol prot) { XMLCreator creator = new XMLCreator(); creator.create(prot); }
public PublishReviewsXMLsForDeezerProcessor(IWriter writer) { _xmlCreator = new XMLCreator(writer, Constants.DeezerOperationsOutputDirectoryPath); }
// Start is called before the first frame update void Start() { // Build Up Structure AssimpInterpreter interpreter = new AssimpInterpreter(); structure = interpreter.Interpret(AssetDatabase.GetAssetPath(files.modelFile)); VoxelGridGraphGenerator.outerLayerLimit = voxelStrategy.peelFactor; VoxelGridGraphGenerator.VoxelDistanceThreshold = voxelStrategy.GraphVoxelDeviationThreshold; VoxelGridGraphGenerator.mergeThreshold = voxelStrategy.mergeThreshold; VoxelGrid.DefaultComponentWiseResolutionDivider = voxelStrategy.ComponentResDivider; structureMiddlePoint = Utilities.GetStructureMiddlePoint(structure); bool draw = drawNodeGraph.drawNodes || drawNodeGraph.drawEdges; List <NodeGraph> nodeGraphs = new List <NodeGraph>(); List <VoxelGrid> voxelGrids = new List <VoxelGrid>(); List <(DistanceGrid, VoxelGrid)> skeletonGrids = new List <(DistanceGrid, VoxelGrid)>(); if (graphStrategy.strategy == Strategy.Voxel) { if (voxelStrategy.voxelScope == VoxelScope.component) { foreach (var component in structure.components) { gridTimer.Start(); VoxelGrid voxelGrid = new VoxelGrid(component); gridTimer.Stop(); gridProcessingTimer.Start(); if (draw || drawVoxels.fillInternalVolume || drawVoxels.skeletalize) { voxelGrid.FillInternalVolume(component); } gridProcessingTimer.Stop(); if (draw) { graphGenerationTimer.Start(); nodeGraphs.Add(VoxelGridGraphGenerator.GenerateNodeGraph(component)); graphGenerationTimer.Stop(); } if (drawVoxels.drawVoxels) { gridProcessingTimer.Start(); if (drawVoxels.skeletalize) { skeletonGrids.Add((VoxelGridGraphGenerator.GenerateSkeletalGrid(voxelGrid), voxelGrid)); } else if (drawVoxels.peel) { skeletonGrids.Add((VoxelGridGraphGenerator.GeneratePeeledGrid(voxelGrid), voxelGrid)); } gridProcessingTimer.Stop(); } voxelGrids.Add(voxelGrid); } } else if (voxelStrategy.voxelScope == VoxelScope.structure) { gridTimer.Start(); VoxelGrid voxelGrid = new VoxelGrid(structure, plane1Normal: Vect3.Right, plane2Normal: Vect3.Up, plane3Normal: Vect3.Forward); gridTimer.Stop(); gridProcessingTimer.Start(); if (draw || drawVoxels.fillInternalVolume || drawVoxels.skeletalize || drawVoxels.peel) { voxelGrid.FillInternalVolume(structure); } gridProcessingTimer.Stop(); if (draw) { graphGenerationTimer.Start(); nodeGraphs.Add(VoxelGridGraphGenerator.GenerateNodeGraph(structure)); graphGenerationTimer.Stop(); } if (drawVoxels.drawVoxels) { gridProcessingTimer.Start(); if (drawVoxels.skeletalize) { skeletonGrids.Add((VoxelGridGraphGenerator.GenerateSkeletalGrid(voxelGrid), voxelGrid)); } if (drawVoxels.peel) { skeletonGrids.Add((VoxelGridGraphGenerator.GeneratePeeledGrid(voxelGrid), voxelGrid)); } gridProcessingTimer.Stop(); } voxelGrids.Add(voxelGrid); } } else if (graphStrategy.strategy == Strategy.Mesh) { foreach (Nodegraph_Generator.Component component in structure.components) { graphGenerationTimer.Start(); nodeGraphs.Add(ComponentGraphGenerator.GenerateComponentNodeGraph(component)); graphGenerationTimer.Stop(); } if (meshStrategy.drawCollisions) { drawTimer.Start(); drawer.DrawCollisions(nodeGraphs, structureMiddlePoint); drawTimer.Stop(); } if (meshStrategy.unifyGraph) { graphGenerationTimer.Start(); NodeGraph nodeGraph = GraphUnifier.UnifyGraphs(nodeGraphs); graphGenerationTimer.Stop(); nodeGraphs.Clear(); nodeGraphs.Add(nodeGraph); } } else if (graphStrategy.strategy == Strategy.XML) { graphGenerationTimer.Start(); nodeGraphs.Add(XMLCreator.readXML <NodeGraph>(AssetDatabase.GetAssetPath(files.XMLFile))); graphGenerationTimer.Stop(); } drawTimer.Start(); if (drawStructure.drawFaces || drawStructure.drawVertices) { drawer.DrawStructure(drawStructure, structure, structureMiddlePoint); } if (drawOBBs.oBBType == OBBType.components) { foreach (var voxelGrid in voxelGrids) { foreach (var oBB in voxelGrid.componentOBBs.Values) { drawer.DrawOBB(oBB, drawOBBs, structureMiddlePoint); } } } else if (drawOBBs.oBBType == OBBType.voxelGrid) { foreach (var voxelGrid in voxelGrids) { drawer.DrawOBB(voxelGrid.orientedBbox, drawOBBs, structureMiddlePoint); } } if (drawVoxels.drawVoxels) { if (drawVoxels.skeletalize || drawVoxels.peel) { foreach (var skeletonGrid in skeletonGrids) { drawer.DrawSkeletonGrid(skeletonGrid.Item1, skeletonGrid.Item2, structureMiddlePoint); } } else { foreach (var voxelGrid in voxelGrids) { drawer.DrawVoxelGrid(voxelGrid, structureMiddlePoint); } } } if (drawNodeGraph.drawNodes || drawNodeGraph.drawEdges) { foreach (NodeGraph nodeGraph in nodeGraphs) { drawer.DrawNodeGraph(drawNodeGraph, nodeGraph, structureMiddlePoint); } } drawTimer.Stop(); if (graphStrategy.writeXML && !(graphStrategy.strategy == Strategy.XML)) { if (nodeGraphs.Count == 1) { string filename = System.IO.Path.GetFileNameWithoutExtension(AssetDatabase.GetAssetPath(files.modelFile)); filename += ".xml"; XMLCreator.writeXML(nodeGraphs[0], System.IO.Path.Combine("Assets", "XML", filename)); } else { string filename = System.IO.Path.GetFileNameWithoutExtension(AssetDatabase.GetAssetPath(files.modelFile)); int counter = 1; foreach (NodeGraph nodeGraph in nodeGraphs) { string subfilename = filename + (counter++) + ".xml"; XMLCreator.writeXML(nodeGraphs[0], System.IO.Path.Combine("Assets", "XML", subfilename)); } } } ReportProcessTimes(); }