private void CreateSpinXElement(XElement element) { if (!string.IsNullOrEmpty(Type)) { element.SetAttributeValue("type", Type); } if (TransactionId != 0) { element.SetAttributeValue("tid", Convert.ToString(TransactionId)); } if (null != CollapsePosition && !CollapsePosition.Any()) { element.SetAttributeValue("finish", "true"); } element.SetAttributeValue( "bet", SpinBet == null ? 0m.ToCustomString() : SpinBet.LineBet.ToCustomString()); element.SetAttributeValue("lines", SpinBet == null ? "0" : Convert.ToString(SpinBet.Lines)); element.SetAttributeValue( "multiplier", SpinBet == null ? "0" : Convert.ToString(SpinBet.Multiplier)); element.SetAttributeValue( "totalbet", SpinBet == null ? 0m.ToCustomString() : SpinBet.TotalBet.ToCustomString()); element.SetAttributeValue("ts", DateTimeUtc.ToUnixTimeStamp()); }
private void WriteSpinElement(XmlWriter writer) { if (!string.IsNullOrEmpty(Type)) { writer.WriteAttributeString("type", Type); } if (TransactionId != 0) { writer.WriteAttributeString("tid", Convert.ToString(TransactionId)); } if (null != CollapsePosition && !CollapsePosition.Any()) { writer.WriteAttributeString("finish", "true"); } writer.WriteAttributeString( "bet", SpinBet == null ? 0m.ToCustomString() : SpinBet.LineBet.ToCustomString()); writer.WriteAttributeString("lines", SpinBet == null ? "0" : Convert.ToString(SpinBet.Lines)); writer.WriteAttributeString( "multiplier", SpinBet == null ? "0" : Convert.ToString(SpinBet.Multiplier)); writer.WriteAttributeString( "totalbet", SpinBet == null ? 0m.ToCustomString() : SpinBet.TotalBet.ToCustomString()); writer.WriteAttributeString("ts", Convert.ToString(DateTimeUtc.ToUnixTimeStamp())); }