/// <summary> /// Creates a new instance /// </summary> /// <param name="_s"></param> public Buffer(ProtocolSv _s) { Root = Core.PermanentTemp + "buffer_" + _s.Server + Path.DirectorySeparatorChar; protocol = _s; }
private void insertService(ProtocolSv service) { string tx = "Root window of services [port: " + service.Port.ToString() + " Encrypted: " + service.SSL.ToString() + "]"; TreeIter text = Values.AppendValues(service.Server, service, ItemType.Services, service.SystemWindow, tx, Configuration.CurrentSkin.Icon_ExclamationMark); lock (ServiceList) { ServiceList.Add(service, text); } }
/// <summary> /// This function insert a service to a list, thread safe /// </summary> /// <param name="service">Service</param> public void InsertSv(ProtocolSv service) { lock (queueProtocol) { queueProtocol.Add(service); } Updated = true; }
/// <summary> /// This function removes object, it is being called only by destructor of quassel core /// </summary> /// <param name="protocol">Quassel core</param> public bool RemoveServ(ProtocolSv protocol) { lock (queueProtocol) { if (queueProtocol.Contains(protocol)) { queueProtocol.Remove(protocol); } } lock (ServiceList) { if (ServiceList.ContainsKey(protocol)) { KeyValuePair<TreeIter, bool> result = getIter(protocol); if (result.Value) { TreeIter tree = result.Key; Values.Remove(ref tree); } else { Core.DebugLog("Can't remove from sidebar because reference isn't present: " + protocol.Server); } ServiceList.Remove(protocol); return true; } } return false; }
/// <summary> /// insert network to lv (thread safe) /// </summary> /// <param name="network"></param> /// <param name="ParentSv"></param> public void InsertNetwork(Network network, ProtocolSv ParentSv = null) { if (queueNetwork.Contains(network)) return; lock (queueNetwork) { network.ParentSv = ParentSv; queueNetwork.Add(network); Updated = true; } }