public void LoadMap() { SpriteRenderer defaultSR; SpriteRenderer XmlSR; string path; path = loadOptionDropDown.captionText.text; //Debug.Log (loadOptionDropDown.captionText.text); List <BrickXml> loadedBrickXml = new List <BrickXml>(); loadedBrickXml = XMLObjectSerializer.Deserialize <List <BrickXml> >(Application.dataPath + "/XmlMaps/" + path); /* for (int i = 0; i < loadedBrickXml.Count; i++) * { * Debug.Log (loadedBrickXml[i].brickNumber + " " + loadedBrickXml[i].brickPosX + " " + loadedBrickXml[i].brickPosY); * } */ for (int i = 0; i < defaultBricksMap.Count; i++) { defaultSR = defaultBricksMap [i].GetComponent <SpriteRenderer>(); XmlSR = bricks [loadedBrickXml [i].brickNumber].GetComponent <SpriteRenderer>(); defaultSR.sprite = XmlSR.sprite; } }
public ActionResult VirtualTerminalTransactionPost(VirtualTerminalTransactionPostModels.VT_TRANSACTION transaction) { try { ServicePointManager.SecurityProtocol = (SecurityProtocolType)3072; //tls protocol override com.collectorsolutions.stage.ProcessingGateway ws = new com.collectorsolutions.stage.ProcessingGateway(); //The web service XmlDocument xmlRequest = new XmlDocument(); XMLObjectSerializer obj = new XMLObjectSerializer(); //stub any optional/required parameters here that are not in the view// transaction.COLLECTIONMODE = "1"; transaction.CSIUSERID = "1"; transaction.URLSILENTPOST = ""; transaction.PHONE = Regex.Replace(transaction.PHONE, @"\D", ""); xmlRequest.LoadXml(obj.objectXMLConverter <VirtualTerminalTransactionPostModels.VT_TRANSACTION>(transaction)); //post/receive response// var reader = new StringReader(ws.VT_Transaction_POST(xmlRequest).OuterXml); var serializer = new XmlSerializer(typeof(VirtualTerminalTransactionPostResponseModels.VT_TRANSACTION)); var response = (VirtualTerminalTransactionPostResponseModels.VT_TRANSACTION)serializer.Deserialize(reader); //send data to partial view so it can be displayed// TempData["VTPostResponse"] = response; if (response.RESPONSECODE.StartsWith("Y")) { return(Redirect("https://stage.collectorsolutions.com/magic-ui/VirtualTerminal/csi-live/" + response.TRANSACTIONID)); } else { return(View()); } } catch (Exception e) { return(View("Error")); } }
public ActionResult VirtualTerminalTransactionPost(VirtualTerminalTransactionPostModels.VT_TRANSACTION transaction) { try { com.collectorsolutions.secure.legacy.ProcessingGateway ws = new com.collectorsolutions.secure.legacy.ProcessingGateway(); //The web service XmlDocument xmlRequest = new XmlDocument(); XMLObjectSerializer obj = new XMLObjectSerializer(); var xml = String.Empty; transaction.URLSILENTPOST = @"https://actweb.acttax.com/act_webdev/common/JavaSecure/CollectorSolutions/realtimeNotification.jsp"; transaction.PHONE = Regex.Replace(transaction.PHONE, @"\D", ""); xmlRequest.LoadXml(obj.objectXMLConverter <VirtualTerminalTransactionPostModels.VT_TRANSACTION>(transaction)); var reader = new StringReader(ws.VT_Transaction_POST(xmlRequest).OuterXml); var serializer = new XmlSerializer(typeof(VirtualTerminalTransactionPostResponseModels.VT_TRANSACTION)); var response = (VirtualTerminalTransactionPostResponseModels.VT_TRANSACTION)serializer.Deserialize(reader); TempData["VTPostResponse"] = response; if (response.RESPONSECODE.StartsWith("Y")) { //PCB Test return(Redirect("https://secure.collectorsolutions.com/csi_ecollections_portal_ui/interchange.aspx?ciid=99999991&ste=5&transid=" + response.TRANSACTIONID)); } else { return(View()); } } catch (Exception e) { return(View("Error")); } }
public void serializeObjectXMLTest() { IDataFiller filler = new LargeDataFillerImpl(); DataRepository dataRepo = new DataRepository(filler); dataRepo.setDataContext(); XMLObjectSerializer <DataContext> .Serialize(dataRepo.getDataContext(), FILENAME); }
public void SaveHighScoreXML() { hScore.highScore = DebrySpawn.score; path = Application.dataPath + "/HighScore.xml"; if (hScore.highScore > bestScore.highScore) { XMLObjectSerializer.Serialize(hScore, path); } }
public void SaveNewChar() { PlayerInfo = XMLObjectDeserializer.Deserialize <List <XMLCharacterInfo> > (Application.dataPath + "/XMLPlayerInfo/" + "PlayerCreated.xml"); PlayerInfo[SelectedButton].name = CharName.text; PlayerInfo [SelectedButton].avatarIndex = PCSScript.imageIndex; XMLObjectSerializer.Serialize(PlayerInfo, Application.dataPath + "/XMLPlayerInfo/" + "PlayerCreated.xml"); //Debug.Log ("File is saved as " + CharName.text); Debug.Log(Application.persistentDataPath); }
public void LoadMap() { string path; path = loadOptionDropDown.captionText.text; //Debug.Log (loadOptionDropDown.captionText.text); loadedBrickXml = XMLObjectSerializer.Deserialize <List <BrickXml> >(Application.dataPath + "/XmlMaps/" + path); ResetMap(); }
public void SavePlayerSession(float xpAmount) { selectedPlayer = PIScript.playerSelected; PlayerInfo = XMLObjectDeserializer.Deserialize <List <XMLCharacterInfo> >(Application.dataPath + "/XMLPlayerInfo/" + "PlayerCreated.xml"); currentAmount = (float)PlayerInfo [selectedPlayer].addXp; currentAmount += xpAmount; XPCalculator(); XMLObjectSerializer.Serialize(PlayerInfo, Application.dataPath + "/XMLPlayerInfo/" + "PlayerCreated.xml"); }
public void performanceTest() { Process.GetCurrentProcess().PriorityClass = ProcessPriorityClass.High; Thread.CurrentThread.Priority = ThreadPriority.Highest; var watch = new Stopwatch(); GC.Collect(); GC.WaitForPendingFinalizers(); GC.Collect(); watch.Start(); dataFiller1 = new LargeDataFillerImpl(); dataFiller1.GetPeopleList(); dataFiller1.GetItemsList(); dataFiller1.GetStatesList(); dataFiller1.GetEventsList(); watch.Stop(); Console.WriteLine("LargeDataFiller time = {0}", watch.Elapsed.TotalMilliseconds); watch.Reset(); watch.Start(); dataFiller2 = new LargeJsonDataFillerImpl(); dataFiller2.GetPeopleList(); dataFiller2.GetItemsList(); dataFiller2.GetStatesList(); dataFiller2.GetEventsList(); watch.Stop(); Console.WriteLine("LargeJsonDataFiller time = {0}", watch.Elapsed.TotalMilliseconds); watch.Reset(); watch.Start(); XMLObjectSerializer <DataContext> .Deserialize("XmlData/DataContextData.xml"); watch.Stop(); Console.WriteLine("XmlSerializer time = {0}", watch.Elapsed.TotalMilliseconds); watch.Reset(); watch.Start(); OwnSerializer.Deserialize("OwnSerializerData/SerializedData.data"); watch.Stop(); Console.WriteLine("OwnSerializer time = {0}", watch.Elapsed.TotalMilliseconds); }
public void SaveMap() { if (!string.IsNullOrEmpty(inputSaveText.text)) { string path = inputSaveText.text; XMLObjectSerializer.Serialize(brickListXml, Application.dataPath + "/XmlMaps/" + path + ".xml"); Debug.Log("File Saved as " + inputSaveText.text); inputSaveText.text = ""; SavedMapFilesDirectory(); } else { Debug.Log("Name to save to is missing!"); } }
public void CharXMLGenerator() { for (int i = 0; i <= 3; i++) { PlayerInfo.Add(new XMLCharacterInfo()); PlayerInfo[i].name = "New Character"; PlayerInfo[i].avatarIndex = 0; PlayerInfo[i].levelNum = 1; PlayerInfo[i].levelXp = 0; PlayerInfo[i].addXp = 0; PlayerInfo[i].subXp = 0; PlayerInfo[i].multXp = 0; PlayerInfo[i].divXp = 0; } XMLObjectSerializer.Serialize(PlayerInfo, Application.dataPath + "/XMLPlayerInfo/" + "PlayerCreated.xml"); Debug.Log("saved"); }
public static bool WriteConfiguredSources <T>(List <T> configuredSources, String configurationFileAbsolutePath) { bool operationStatus = false; try { if (File.Exists(configurationFileAbsolutePath)) { File.Delete(configurationFileAbsolutePath); } File.WriteAllText(configurationFileAbsolutePath, XMLObjectSerializer.GetXMLFromObject(configuredSources)); } catch (Exception ex) { Logger.ExceptionLoggingService.Instance.WriteError("Error in writing the configuration file: ", ex); } return(operationStatus); }
public static List <T> GetConfiguredSources <T>(String configurationFileAbsolutePath) { List <T> sources = null; try { if (File.Exists(configurationFileAbsolutePath)) { String fileContent = File.ReadAllText(configurationFileAbsolutePath); sources = (List <T>)XMLObjectSerializer.ObjectToXML(fileContent, new List <T>().GetType()); } } catch (Exception ex) { Logger.ExceptionLoggingService.Instance.WriteError("Error in reading the configuration file: ", ex); } return(sources); }
public ActionResult CalculateFee(CalculateFeeModels.FEE collection) { try { com.collectorsolutions.secure.legacy.ProcessingGateway ws = new com.collectorsolutions.secure.legacy.ProcessingGateway(); //The web service XmlDocument xmlRequest = new XmlDocument(); XMLObjectSerializer obj = new XMLObjectSerializer(); xmlRequest.LoadXml(obj.objectXMLConverter <CalculateFeeModels.FEE>(collection)); //post/receive response// var reader = new StringReader(ws.calculateFee(xmlRequest).OuterXml); var serializer = new XmlSerializer(typeof(CalculateFeeResponseModels.FEE)); var response = (CalculateFeeResponseModels.FEE)serializer.Deserialize(reader); //send data to partial view so it can be displayed// TempData["CalculateFeeResponse"] = response; return(View()); } catch { return(View()); } }
public ActionResult CalculateFee(CalculateFeeModels.FEE fee) { try { ServicePointManager.SecurityProtocol = (SecurityProtocolType)3072; com.collectorsolutions.stage.ProcessingGateway ws = new com.collectorsolutions.stage.ProcessingGateway(); //The web service XmlDocument xmlRequest = new XmlDocument(); XMLObjectSerializer obj = new XMLObjectSerializer(); xmlRequest.LoadXml(obj.objectXMLConverter <CalculateFeeModels.FEE>(fee)); //post/receive response// var reader = new StringReader(ws.calculateFee(xmlRequest).OuterXml); var serializer = new XmlSerializer(typeof(CalculateFeeResponseModels.FEE)); var response = (CalculateFeeResponseModels.FEE)serializer.Deserialize(reader); //send data to partial view so it can be displayed// TempData["CalculateFeeResponse"] = response; return(View()); } catch (Exception e) { return(View("Error")); } }
public ActionResult ExportDetailedTransactions(ExportDetailedTransactionsModels.EXPORT transaction) { try { ServicePointManager.SecurityProtocol = (SecurityProtocolType)3072; //tls protocol override com.collectorsolutions.stage.ProcessingGateway ws = new com.collectorsolutions.stage.ProcessingGateway(); //The web service XmlDocument xmlRequest = new XmlDocument(); XMLObjectSerializer obj = new XMLObjectSerializer(); //stub any optional/required parameters here that are not in the view// xmlRequest.LoadXml(obj.objectXMLConverter <ExportDetailedTransactionsModels.EXPORT>(transaction)); //post/receive response// var reader = new StringReader(ws.export_DetailedTransactions(xmlRequest).OuterXml); var serializer = new XmlSerializer(typeof(ExportDetailedTransactionsResponseModels.EXPORT)); var response = (ExportDetailedTransactionsResponseModels.EXPORT)serializer.Deserialize(reader); //send data to partial view so it can be displayed// TempData["ExportDetailedTransactionsResponse"] = response; return(View()); } catch (Exception e) { return(View("Error")); } }
// Use this for initialization void Start() { bricks = Bricks; brickCollider = bricks [0].GetComponent <BoxCollider2D>(); offsetx = brickCollider.size.x; offsety = brickCollider.size.y; position = startPosition.position; for (int i = 0; i < columns; i++) { for (int j = 0; j < rows; j++) { randomNumber = Random.Range(0, Bricks.Length); Instantiate(bricks[randomNumber], position, Quaternion.identity); //assign values and add object to List<BrickXml> to be serialized later BrickXml brick = new BrickXml(); brick.brickNumber = randomNumber; brick.brickPosX = position.x; brick.brickPosY = position.y; BricksLists.Add(brick); //end assigning position.x += offsetx; //numberOfBricks++; } position.x = startPosition.position.x; position.y -= offsety; } // testing purposes only for (int i = 0; i < BricksLists.Count; i++) { //Debug.Log (BricksLists [i].brickNumber + " " + BricksLists [i].brickPosX + " " + BricksLists [i].brickPosY); } XMLObjectSerializer.Serialize(BricksLists, Application.dataPath + "/bricksList.xml"); }
public ActionResult VirtualTerminalTransactionGet(VirtualTerminalTransactionGetModels.VT_TRANSACTION transaction) { try { ServicePointManager.SecurityProtocol = (SecurityProtocolType)3072; //tls protocol override com.collectorsolutions.stage.ProcessingGateway ws = new com.collectorsolutions.stage.ProcessingGateway(); //The web service XmlDocument xmlRequest = new XmlDocument(); XMLObjectSerializer obj = new XMLObjectSerializer(); //stub any optional/required parameters here that are not in the view// xmlRequest.LoadXml(obj.objectXMLConverter <VirtualTerminalTransactionGetModels.VT_TRANSACTION>(transaction)); //post/receive response// var reader = new StringReader(ws.VT_Transaction_GET(xmlRequest).OuterXml); var serializer = new XmlSerializer(typeof(VirtualTerminalTransactionGetResponseModels.VT_TRANSACTION)); var response = (VirtualTerminalTransactionGetResponseModels.VT_TRANSACTION)serializer.Deserialize(reader); //send data to partial view so it can be displayed// TempData["VTGetResponse"] = response; //VirtualTerminal/{clientid}/{transactionid} return(View()); } catch (Exception e) { return(View("Error")); } }
public ActionResult ProcessTransactionEncrypted(ProcessTransactionEncryptedModels.TRANSACTION transaction) { try { com.collectorsolutions.secure.legacy.ProcessingGateway ws = new com.collectorsolutions.secure.legacy.ProcessingGateway(); //The web service //Gregg test client key//CIID 9873rfrf5673mjkmnhyu675tr498iu78 XmlDocument xmlRequest = new XmlDocument(); XMLObjectSerializer obj = new XMLObjectSerializer(); var xml = String.Empty; //transaction.URLSILENTPOST = @"https://actweb.acttax.com/act_webdev/common/JavaSecure/CollectorSolutions/realtimeNotification.jsp?transID=" + transaction.TRANSACTIONID + "&status=2"; //transaction.URLSILENTPOST = @"https://actweb.acttax.com/act_webdev/common/JavaSecure/CollectorSolutions/realtimeNotification.jsp"; XmlSerializer xsSubmit = new XmlSerializer(typeof(ProcessTransactionEncryptedModels.TRANSACTION)); xmlRequest.LoadXml(obj.objectXMLConverter <ProcessTransactionModels.TRANSACTION>(transaction)); var reader = new StringReader(ws.VT_Transaction_POST(xmlRequest).OuterXml); var serializer = new XmlSerializer(typeof(ProcessTransactionEncryptedModels.TRANSACTION)); var instance = (ProcessTransactionEncryptedModels.TRANSACTION)serializer.Deserialize(reader); //TempData["CalculateFeeResponse"] = instance; return(RedirectToAction("ProcessTransaction")); } catch { return(View()); } }
public void LoadHighScoreXML() { path = Application.dataPath + "/HighScore.xml"; bestScore = XMLObjectSerializer.Deserialize <HighScore> (path); DebrySpawn.highScore = bestScore.highScore; }
void Start() { BrickXml Brick = XMLObjectSerializer.Deserialize <BrickXml> (Application.dataPath + "/brick.xml"); Debug.Log(Brick.brickNumber); }
// Use this for initialization void Start() { path = Application.dataPath + "/HighScore.xml"; bestScore = XMLObjectSerializer.Deserialize <HighScore> (path); }
public void SaveMapToXmlFile() { XMLObjectSerializer.Serialize(brickXml, path); }
public void deserializeObjectXMLTest() { DataContext dataCtx = XMLObjectSerializer <DataContext> .Deserialize(FILENAME); }