private void Publish(TopicList topicList, ProviderSession session)
        {
            List <MyStream> myStreams = new List <MyStream>();

            for (int i = 0; i < topicList.Size; ++i)
            {
                if (topicList.StatusAt(i) == TopicList.TopicStatus.CREATED)
                {
                    Message  message = topicList.MessageAt(i);
                    Topic    topic   = session.GetTopic(message);
                    MyStream stream  = (MyStream)topicList.CorrelationIdAt(i).Object;
                    stream.setTopic(topic);
                    myStreams.Add(stream);
                    Console.WriteLine("Topic created: " + stream.getId());
                }
            }

            Service pubService = session.GetService(d_service);

            if (pubService == null)
            {
                Console.Error.WriteLine("service unavailable");
                return;
            }

            // Now we will start publishing
            Event          eventObj       = pubService.CreatePublishEvent();
            EventFormatter eventFormatter = new EventFormatter(eventObj);

            for (int index = 0; index < myStreams.Count; index++)
            {
                MyStream stream = (MyStream)myStreams[index];

                eventFormatter.AppendRecapMessage(stream.getTopic(), null);
                eventFormatter.SetElement("numRows", 25);
                eventFormatter.SetElement("numCols", 80);
                eventFormatter.PushElement("rowUpdate");
                for (int i = 1; i <= 5; ++i)
                {
                    eventFormatter.AppendElement();
                    eventFormatter.SetElement("rowNum", i);
                    eventFormatter.PushElement("spanUpdate");
                    eventFormatter.AppendElement();
                    eventFormatter.SetElement("startCol", 1);
                    eventFormatter.SetElement("length", 10);
                    eventFormatter.SetElement("text", "INITIAL");
                    eventFormatter.SetElement("fgColor", "RED");
                    eventFormatter.PushElement("attr");
                    eventFormatter.AppendValue("UNDERLINE");
                    eventFormatter.AppendValue("BLINK");
                    eventFormatter.PopElement();
                    eventFormatter.PopElement();
                    eventFormatter.PopElement();
                    eventFormatter.PopElement();
                }
                eventFormatter.PopElement();
            }
            if (d_verbose > 0)
            {
                PrintMessage(eventObj);
            }
            session.Publish(eventObj);

            while (d_running)
            {
                eventObj       = pubService.CreatePublishEvent();
                eventFormatter = new EventFormatter(eventObj);

                for (int index = 0; index < myStreams.Count; index++)
                {
                    MyStream stream = (MyStream)myStreams[index];
                    eventFormatter.AppendMessage("RowUpdate", stream.getTopic());
                    eventFormatter.SetElement("rowNum", 1);
                    eventFormatter.PushElement("spanUpdate");
                    eventFormatter.AppendElement();
                    eventFormatter.SetElement("startCol", 1);
                    String text = System.DateTime.Now.ToString();
                    eventFormatter.SetElement("length", text.Length);
                    eventFormatter.SetElement("text", text);
                    eventFormatter.PopElement();
                    eventFormatter.AppendElement();
                    eventFormatter.SetElement("startCol", text.Length + 10);
                    text = System.DateTime.Now.ToString();
                    eventFormatter.SetElement("length", text.Length);
                    eventFormatter.SetElement("text", text);
                    eventFormatter.PopElement();
                    eventFormatter.PopElement();
                }

                if (d_verbose > 0)
                {
                    PrintMessage(eventObj);
                }
                session.Publish(eventObj);
                Thread.Sleep(10 * 1000);
            }
        }