Exemplo n.º 1
0
        public void SendStompImage(string uri, string username, string password, string topic, string url, string text, string link)
        {
            if (!topic.EndsWith("/"))
                topic = topic + "/";

            var newThread = new Thread(SendToStompThread);
            var param = new StompParameters()
            {
                Uri = uri,
                Topic = topic + "image",
                Text = text,
                Link = link,
                Showparam = "SHOW " + url,
                Username = username,
                Password = password
            };
            newThread.Start(param);

            if (!string.IsNullOrEmpty(text))
            {
                // Send Text Message as well if any text
                var newThread2 = new Thread(SendToStompThread);
                var param2 = new StompParameters()
                {
                    Uri = uri,
                    Topic = topic + "text",
                    Text = text,
                    Link = link,
                    Showparam = "TEXT " + text,
                    Username = username,
                    Password = password
                };
                newThread2.Start(param2);
            }
        }
Exemplo n.º 2
0
        public void SendStompImage(string uri, string username, string password, string topic, string url, string text, string link)
        {
            if (!topic.EndsWith("/"))
            {
                topic = topic + "/";
            }

            var newThread = new Thread(SendToStompThread);
            var param     = new StompParameters()
            {
                Uri       = uri,
                Topic     = topic + "image",
                Text      = text,
                Link      = link,
                Showparam = "SHOW " + url,
                Username  = username,
                Password  = password
            };

            newThread.Start(param);

            if (!string.IsNullOrEmpty(text))
            {
                // Send Text Message as well if any text
                var newThread2 = new Thread(SendToStompThread);
                var param2     = new StompParameters()
                {
                    Uri       = uri,
                    Topic     = topic + "text",
                    Text      = text,
                    Link      = link,
                    Showparam = "TEXT " + text,
                    Username  = username,
                    Password  = password
                };
                newThread2.Start(param2);
            }
        }
Exemplo n.º 3
0
        private void SendToStompThread(object s)
        {
            StompParameters stomp = (StompParameters)s;

            sendToStomp(stomp.Uri, stomp.Topic, stomp.Text, stomp.Link, stomp.Showparam, stomp.Username, stomp.Password);
        }