/// <summary> /// Sends an ember/glow tree to the remote host. /// </summary> /// <param name="root">The root of the tree to send.</param> public void Write(EmberLib.Glow.GlowContainer root) { lock (_sync) { var tcpClient = _tcpClient; if (tcpClient != null && tcpClient.Connected) { var stream = tcpClient.GetStream(); var output = CreateFramingOutput((_, e) => stream.Write(e.FramedPackage, 0, e.FramedPackageLength)); using (output) { root.Encode(output); output.Finish(); } } } }
public GlowRootReadyArgs(EmberLib.Glow.GlowContainer root) { Root = root; }