/// <summary> /// Initializes the message queues, read and write thread /// </summary> public IrcConnection() { #if LOG4NET Logger.Init(); Logger.Main.Debug("IrcConnection created"); #endif _SendBuffer[Priority.High] = Queue.Synchronized(new Queue()); _SendBuffer[Priority.AboveMedium] = Queue.Synchronized(new Queue()); _SendBuffer[Priority.Medium] = Queue.Synchronized(new Queue()); _SendBuffer[Priority.BelowMedium] = Queue.Synchronized(new Queue()); _SendBuffer[Priority.Low] = Queue.Synchronized(new Queue()); // setup own callbacks OnReadLine += new ReadLineEventHandler(_SimpleParser); OnConnectionError += new EventHandler(_OnConnectionError); _ReadThread = new ReadThread(this); _WriteThread = new WriteThread(this); _IdleWorkerThread = new IdleWorkerThread(this); Assembly assm = Assembly.GetAssembly(this.GetType()); AssemblyName assm_name = assm.GetName(false); AssemblyProductAttribute pr = (AssemblyProductAttribute)assm.GetCustomAttributes(typeof(AssemblyProductAttribute), false)[0]; _VersionNumber = assm_name.Version.ToString(); _VersionString = pr.Product + " " + _VersionNumber; }
private void HighlightLine(object sender, int line, bool collision) { //This catches the event call and invokes it instead, from the current thread //Necessary because, WinForm components cannot be accessed outside the UI thread if (InvokeRequired) { ReadLineEventHandler cb = new ReadLineEventHandler(HighlightLine); Invoke(cb, new object[] { sender, line, collision }); return; } //Get index char from the first index of specified line //Textbox uses a continuous index, because new line is just another char. read_line = line - 1; toolStripLastRead.Text = line.ToString(); //Highlights Line in Box - OFF if (highlight_line) { lGCodeView.Items[read_line].Selected = true; lGCodeView.EnsureVisible(read_line); } //Add value to collisions list if (collision) { //Variable to store the collision lines collision_lines.Add(read_line); collisionLabel.Text = "Collisions " + collision_lines.Count; if (collisionsBox != null) { collisionsBox.AddCollision(read_line); } } }
/// <summary> /// Initializes the message queues, read and write thread /// </summary> public IrcConnection() { #if LOG4NET Logger.Init(); Logger.Main.Debug("IrcConnection created"); #endif _SendBuffer[Priority.High] = Queue.Synchronized(new Queue()); _SendBuffer[Priority.AboveMedium] = Queue.Synchronized(new Queue()); _SendBuffer[Priority.Medium] = Queue.Synchronized(new Queue()); _SendBuffer[Priority.BelowMedium] = Queue.Synchronized(new Queue()); _SendBuffer[Priority.Low] = Queue.Synchronized(new Queue()); // setup own callbacks OnReadLine += new ReadLineEventHandler(_SimpleParser); OnConnectionError += new EventHandler(_OnConnectionError); _ReadThread = new ReadThread(this); _WriteThread = new WriteThread(this); _IdleWorkerThread = new IdleWorkerThread(this); Assembly assm = Assembly.GetAssembly(this.GetType()); AssemblyName assm_name = assm.GetName(false); AssemblyProductAttribute pr = (AssemblyProductAttribute)assm.GetCustomAttributes(typeof(AssemblyProductAttribute), false)[0]; _VersionNumber = assm_name.Version.ToString(); _VersionString = pr.Product+" "+_VersionNumber; }
/// <summary> /// Initializes the message queues, read and write thread /// </summary> public IrcConnection() { #if LOG4NET Logger.Main.Debug("IrcConnection created"); #endif // setup own callbacks OnReadLine += new ReadLineEventHandler(_SimpleParser); OnConnectionError += new EventHandler(_OnConnectionError); _ReadThread = new ReadThread(this); _WriteThread = new WriteThread(this); _IdleWorkerThread = new IdleWorkerThread(this); Assembly assm = Assembly.GetAssembly(this.GetType()); AssemblyName assm_name = assm.GetName(false); AssemblyProductAttribute pr = (AssemblyProductAttribute)assm.GetCustomAttributes(typeof(AssemblyProductAttribute), false)[0]; _VersionNumber = assm_name.Version.ToString(); _VersionString = pr.Product+" "+_VersionNumber; }
/// <summary> /// This class manages the connection server and provides access to all the objects needed to send and receive messages. /// </summary> public IrcClient() { #if LOG4NET Logger.Main.Debug("IrcClient created"); #endif OnReadLine += new ReadLineEventHandler(_Worker); OnDisconnected += new EventHandler(_OnDisconnected); OnConnectionError += new EventHandler(_OnConnectionError); }