コード例 #1
0
 public VanillaChannel(IRemoteChannel remoteInstance)
 {
     this.remoteInstance = remoteInstance;
 }
コード例 #2
0
 public BytestreamChannel(IRemoteChannel remoteInstance)
 {
     this.remoteInstance = remoteInstance;
 }
コード例 #3
0
            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
                }
            }
コード例 #4
0
            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
                }
            }
コード例 #5
0
 public VanillaChannel(IRemoteChannel remoteInstance)
 {
     this.remoteInstance = remoteInstance;
 }