public string ToXml <Data1, T>() where Data1 : IEnumerable <T>, Data { string xml = ""; XElement xmlElement = new XElement("element"); xmlElement.Add(new XElement("name", name)); xmlElement.Add(new XElement("descr", descr)); xmlElement.Add(new XElement("timestamp", timeStamp)); XElement childrenX = new XElement("children"); if (children.Count > 0) { foreach (Key child in children) { childrenX.Add(new XElement("key", child.ToString())); } } xmlElement.Add(childrenX); XElement payloadX = new XElement("payload"); Data1 payload1 = (Data1)payload; foreach (T item in payload1) { payloadX.Add(new XElement("item", payload1.ToString())); } xmlElement.Add(payloadX); xml = xmlElement.ToString(); return(xml); }
public override object GetData() { return(new Collection( Data0.ToString(CultureInfo.InvariantCulture), new Collection(Data1.ToString(CultureInfo.InvariantCulture), Data2.ToString(CultureInfo.InvariantCulture), FileName), "\"" + Name + "\"", Synonym.GetData(), "\"" + Comment + "\"" )); }
public override string ToString() { string str = Data1.ToString("X8") + '-' + Data2.ToString("X4") + '-' + Data3.ToString("X4") + '-'; for (int i = 0; i < 2; i++) { str += Data4[i].ToString("X2"); } str += '-'; for (int i = 2; i < 8; i++) { str += Data4[i].ToString("X2"); } return(str); }
public string OperatorToString() => Data1.ToString() + " " + Data2.ToString() + " " + Data3.ToString() + " " + Data4.ToString() + " " + Data5.ToString();
public override string ToString() { return(Command.ToString() + " - " + MidiChannel.ToString() + " - " + Data1.ToString() + " - " + Data2.ToString()); }
public override string ToString() { return("Devices:" + mDevices0 + " Command:" + X10Command.ToString() + " Brightness (scale 22):" + mBrightness.ToString() + " Data1:" + Data1.ToString() + " Data2:" + Data2.ToString()); }
public override string ToString() { return(Data1 == null ? " " : Data1.ToString() + "->" + Data2 == null ? " " : Data2.ToString()); }