Beispiel #1
0
        static void SendParamters(MolecularWeightServiceParametersDto param)
        {
            using (NamedPipeClientStream pipeClient =
                       new NamedPipeClientStream(".", "ParameterPipe", PipeDirection.Out))
                using (StreamWriter sw = new StreamWriter(pipeClient))
                {
                    pipeClient.Connect();

                    string serializedData = string.Empty;               // The string variable that will hold the serialized data

                    XmlSerializer serializer = new XmlSerializer(param.GetType());
                    using (StringWriter strw = new StringWriter())
                    {
                        serializer.Serialize(strw, param);
                        serializedData = strw.ToString();
                    }



                    // Read user input and send that to the client process.

                    // {
                    sw.AutoFlush = true;
                    // Console.Write("Enter text: ");
                    sw.WriteLine(serializedData);
                }
        }