public VanillaChannel(IRemoteChannel remoteInstance) { this.remoteInstance = remoteInstance; }
public BytestreamChannel(IRemoteChannel remoteInstance) { this.remoteInstance = remoteInstance; }
public void Accept(RemoteTask remoteTask, IDictionary <string, string> attributes, XmlReader reader, IRemoteChannel remoteChannel) { attributes.Remove("path"); try { var attributesString = string.Empty; if (attributes != null) { attributesString = " " + attributes.Select(pair => pair.Key + "=\"" + pair.Value + "\"").Join(" "); } var xmldoc = new XmlDocument(); xmldoc.LoadXml(string.Format(remoteTask != null ? "<{0}{1}><task/></{0}>" : "<{0}{1}/>", PacketName, attributesString)); var task = (XmlElement)xmldoc.DocumentElement.FirstChild; remoteTask.ToXml(task); string xml; bool state; #pragma warning disable 665 while (!string.IsNullOrEmpty(xml = (state = reader.IsStartElement()) ? reader.ReadOuterXml() : reader.ReadString())) #pragma warning restore 665 { if (state) { var doc = new XmlDocument(); doc.LoadXml(xml); var message = doc.DocumentElement; if (message != null) { xmldoc.DocumentElement.AppendChild(xmldoc.ImportNode(message, true)); } } else { xmldoc.DocumentElement.AppendChild(xmldoc.CreateTextNode(xml)); } } listener.Output.WriteLine(xmldoc.OuterXml); } catch { // Ignore } }
public void Accept(RemoteTask remoteTask, IDictionary<string, string> attributes, XmlReader reader, IRemoteChannel remoteChannel) { attributes.Remove("path"); try { var attributesString = string.Empty; if (attributes != null) attributesString = " " + attributes.Select(pair => pair.Key + "=\"" + pair.Value + "\"").Join(" "); var xmldoc = new XmlDocument(); xmldoc.LoadXml(string.Format(remoteTask != null ? "<{0}{1}><task/></{0}>" : "<{0}{1}/>", PacketName, attributesString)); var task = (XmlElement)xmldoc.DocumentElement.FirstChild; remoteTask.ToXml(task); string xml; bool state; #pragma warning disable 665 while (!string.IsNullOrEmpty(xml = (state = reader.IsStartElement()) ? reader.ReadOuterXml() : reader.ReadString())) #pragma warning restore 665 { if (state) { var doc = new XmlDocument(); doc.LoadXml(xml); var message = doc.DocumentElement; if (message != null) xmldoc.DocumentElement.AppendChild(xmldoc.ImportNode(message, true)); } else { xmldoc.DocumentElement.AppendChild(xmldoc.CreateTextNode(xml)); } } listener.Output.WriteLine(xmldoc.OuterXml); } catch { // Ignore } }