public StreamEventArgs(StreamData streamData)
 {
     StreamData = streamData;
 }
        private void QueryHitboxForQueuedStream()
        {
            if (_streamsToCheck.Count == 0)
                    return;
                if (StreamStarted == null)
                {
                    return;
                }
                var stream = _streamsToCheck.Dequeue();

                var result = CheckStreamOnlineStatus(stream);

                if (result == null || result.livestream.Count != 1)
                    return;
                if (result.livestream[0].media_is_live == "1")
                {
                    if (!_streamData.ContainsKey(stream))
                    {

                        var hitboxStreamData = new HitboxStreamData
                        {
                            Started = DateTime.Now,
                            Stream = result.livestream[0]
                        };
                        bool globalancounce = false;
                        if (_streamData.Keys.Contains(stream))
                        {
                            globalancounce = true;
                        }
                        var bTryAddResult = _streamData.TryAdd(stream,
                                                               hitboxStreamData);

                        if (bTryAddResult)
                        {
                            var stream1 = new Stream
                            {
                                Channel = hitboxStreamData.Stream.media_user_name,
                                Game =
                                    hitboxStreamData.Stream.category_name ??
                                    "<no game>",
                                Message = hitboxStreamData.Stream.media_status,
                            };

                            var streamData = new StreamData
                            {
                                Started = DateTime.Now,
                                Stream = stream1,
                                StreamProvider = this
                            };
                            xmlprovider.AddStreamLivedata(hitboxStreamData.Stream.media_user_name, "http://www.hitbox.tv/" + hitboxStreamData.Stream.media_user_name.ToString(),hitboxStreamData.Stream.category_name);

                            var streamEventArgs = new StreamEventArgs(streamData);
                            StreamStarted(this, streamEventArgs);
                            StreamGlobalNotification(this, streamEventArgs);
                        }
                        if (!bTryAddResult && globalancounce)
                        {

                            var stream1 = new Stream
                            {
                                Channel = hitboxStreamData.Stream.media_user_name,
                                Game =
                                    hitboxStreamData.Stream.category_name ??
                                    "<no game>",
                                Message = hitboxStreamData.Stream.media_status,
                            };

                            var streamData = new StreamData
                            {
                                Started = DateTime.Now,
                                Stream = stream1,
                                StreamProvider = this
                            };

                            var streamEventArgs = new StreamEventArgs(streamData);
                            StreamGlobalNotification(this, streamEventArgs);
                        }
                    }
                    else
                    {
                        var hitboxStreamData = new HitboxStreamData
                        {
                            Started = DateTime.Now,
                            Stream = result.livestream[0]
                        };
                        bool globalancounce = false;
                        if (_streamData.Keys.Contains(stream))
                        {
                            globalancounce = true;
                        }
                        var bTryAddResult = _streamData.TryAdd(stream,
                                                               hitboxStreamData);
                        if (!bTryAddResult && globalancounce)
                        {
                            var stream1 = new Stream
                            {
                                Channel = hitboxStreamData.Stream.media_user_name,
                                Game =
                                    hitboxStreamData.Stream.category_name ??
                                    "<no game>",
                                Message = hitboxStreamData.Stream.media_status,
                            };

                            var streamData = new StreamData
                            {
                                Started = DateTime.Now,
                                Stream = stream1,
                                StreamProvider = this
                            };

                            var streamEventArgs = new StreamEventArgs(streamData);
                            StreamGlobalNotification(this, streamEventArgs);
                        }
                    }
                    //WriteStreamDataToFile();
                }
                else
                {
                    if (_streamData.ContainsKey(stream))
                    {
                        HitboxStreamData hitboxStreamData;

                        var bTryRemoveResult = _streamData.TryRemove(stream,
                                                                     out
                                                                     hitboxStreamData);
                        if (bTryRemoveResult && StreamStopped != null)
                        {
                            var stream1 = new Stream
                            {
                                Channel = hitboxStreamData.Stream.media_user_name,
                                Game = hitboxStreamData.Stream.category_name,
                                Message = hitboxStreamData.Stream.media_status
                            };

                            var streamData = new StreamData
                            {
                                Started = DateTime.Now,
                                Stream = stream1,
                                StreamProvider = this
                            };

                            var streamEventArgs = new StreamEventArgs(streamData);

                            StreamStopped(this, streamEventArgs);
                        }
                    }
                }
        }