private async Task RefreshChannels(bool force = false) { if (!force && Channels.Any()) { return; } if (BusyStart != null) { BusyStart(); } Channels.Clear(); var channels = await _slackClient.GetChannels(new ChannelQuery { IncludeArchived = false, MyChannelsOnly = true }); foreach (var c in channels) { Channels.Add( new SlackItem(c.id, "#{0}".FormatWith(c.name), c.purpose.value, "#{0}".FormatWith(c.name))); } if (BusyStop != null) { BusyStop(); } }
void client_OnDisconnected(object sender) { Warning("Disconnected"); State = ConnectionState.Disconnected; Channels.Clear(); IsBusy = false; }
public void Close() { if (Channels != null) { Channels.Clear(); } if (channelLookup != null) { channelLookup.Clear(); } if (_groupRepository != null) { _groupRepository.Close(); } if (_userRepository != null) { _userRepository.Close(); } if (Client != null) { Client.Close(null); } }
public void SaveChannels() { if (Channels.Count > 0) { using var db = new AppDbContext(); foreach (var channel in Channels) { if (db.Channels.Any(x => x.Name == channel.Name && x.Country == SelectedCountry.Alpha3code)) { db.Channels.Update(channel); } else { channel.Country = SelectedCountry.Alpha3code; db.Channels.Add(channel); } db.SaveChanges(); } IsInserting = false; IsListed = false; IsSaved = true; Channels.Clear(); InsertingStatus = $"{Channels.Count} tane kanal eklendi ve güncellendi."; } else { InsertingStatus = "Eklenecek veya güncellenecek bir kanal bulunamadı."; } }
/// <summary> /// Part an IRC channel. /// </summary> /// <param name="channel">IRC channel. If null, the user parts from all channels.</param> /// <param name="message">Part message. Can be null.</param> public void PartChannel(IrcChannel channel, string message) { /* PART <channel> *( "," <channel> ) [ <Part Message> ] */ if (channel != null) { SendMessage(new IrcMessage(IRC.PART, String.Format("#{0}{1}", channel.Name, message != null ? String.Format(" :{0}", message) : ""))); channels.Remove(channel); } else { string channelList = null; foreach (IrcChannel myChannel in Channels) { if (channelList == null) { channelList = ""; } else { channelList += ","; } channelList += myChannel.Name; } if (channelList != null) { SendMessage(new IrcMessage(IRC.PART, String.Format("#{0}{1}", channelList, message != null ? String.Format(" :{0}", message) : ""))); Channels.Clear(); } } }
public DeploymentActionResource ClearAllConditions() { Channels.Clear(); Environments.Clear(); TenantTags.Clear(); return(this); }
private async Task InitializeCoreAsync() { if (!ObjectProvider.SupportChannels) { Initialized = false; return; } await Parent.ExecuteAsync(() => { Channels.Clear(); ((ChannelListStatusInfo)StatusInfoViewModel).ConnectionInformation = QM.ConnectionInfo; var cInfos = new List <ChannelInfo>(); Initialized = Parent.ExecuteGuarded(() => { foreach (var c in ObjectProvider.GetChannels()) { cInfos.Add(new ChannelInfo(c, Parent.App.UserSettings)); } }); InitCollectionView(cInfos); }); }
protected override void LoadAllAvailableChannels() { // The 2D Laser Scanner only yields a single channel of equally-spaced distance values Channels.Clear(); Channels.Add(ChannelRegistry.Instance.RegisterChannel(ChannelNames.Distance)); Channels.Add(ChannelRegistry.Instance.RegisterChannel(ChannelNames.Point3DImage)); }
public static void OnLoggedOut() { loggedIn = false; loginSession = null; currentUserId = null; socketConnected = false; Users.Clear(); ReadStates.Clear(); Messages.Clear(); Channels.Clear(); Members.Clear(); Groups.Clear(); HasMoreMembers.Clear(); DiscoverChannels.Clear(); if (_instance != null) { using (_instance.window.getScope()) { HomePage.currentState.Clear(); } } _client.Close(); UpdateWindowCanvas(); }
protected virtual void OnStart(object sender, ProtocolEventArgs <Start> e) { TaskRunner = new TaskRunner(e.Message.MaxMessageRate) { OnExecute = StreamChannelData, OnError = LogStreamingError }; if (Client.Handler <IChannelStreamingProducer>().IsSimpleStreamer) { var channelMetadata = Simulator.GetChannelMetadata(e.Header) .Cast <ChannelMetadataRecord>() .ToList(); Channels.Clear(); Channels.AddRange(channelMetadata); Client.Handler <IChannelStreamingProducer>() .ChannelMetadata(e.Header, channelMetadata); foreach (var channel in channelMetadata.Select(ToChannelStreamingInfo)) { ChannelStreamingInfo.Add(channel); } TaskRunner.Start(); } }
private void LoadData() { Channels.Clear(); var service = Proxy.CreateProxy(); this.ShowCCPK = string.Compare(service.GetParameterValue(eGlobalParameter.Menu_CCPK_Visible), "true", true) == 0; OnPropertyChanged("ShowCCPK"); var list = service.GetAllChannels(); foreach (var c in list) { var cvm = new ChannelItemViewModel(c); cvm.PropertyChanged += ChannelVM_PropertyChanged; Channels.Add(cvm); } this.AllContacts = new List <KeyValuePair <int?, string> >(); this.AllContacts.Add(new KeyValuePair <int?, string>(null, string.Empty)); foreach (var item in service.GetAllContacts()) { this.AllContacts.Add(new KeyValuePair <int?, string>(item.PhoneNumberId, string.Format("{0}-{1}{2}", item.UnitName, item.AreaCode, item.Number))); } }
/// <summary> /// Called when the <see cref="OpenSession" /> message is recieved. /// </summary> /// <param name="e">The <see cref="ProtocolEventArgs{OpenSession}" /> instance containing the event data.</param> public void OnSessionOpened(ProtocolEventArgs <OpenSession> e) { if (e.Message.SupportedProtocols.All(x => x.Protocol != (int)Protocols.ChannelStreaming)) { return; } var protocol = e.Message.SupportedProtocols .First(x => x.Protocol == (int)Protocols.ChannelStreaming); IsSimpleStreamer = protocol.ProtocolCapabilities .Where(x => x.Key.EqualsIgnoreCase(ChannelStreamingProducerHandler.SimpleStreamer)) .Select(x => x.Value.Item) .OfType <bool>() .FirstOrDefault(); var handler = Parent.Client.Handler <IChannelStreamingConsumer>(); handler.OnChannelMetadata += OnChannelMetadata; handler.OnChannelData += OnChannelData; CanStart = true; CanStopStreaming = false; UpdateCanDescribe(); Channels.Clear(); ChannelStreamingInfos.Clear(); }
protected override void LoadAllAvailableChannels() { ChannelRegistry cr = ChannelRegistry.Instance; Channels.Clear(); Channels.Add(cr.RegisterChannel(ChannelNames.Color)); }
public void Reset() { Channels.Clear(); Clients.Clear(); Groups.Clear(); OwnClient = ClientId.Null; Server = new Server(); }
/// <summary> /// 停止订阅 /// </summary> public void Stop() { foreach (var c in Channels) { c.Stop(); } Channels.Clear(); Started = false; }
internal void Detach() { Player.Current.StatusChanged -= Current_StatusChanged; Player.Current.PositionUpdated -= Current_PositionUpdated; Palette?.Clear(); Palette = null; Channels?.Clear(); Channels = null; }
public override void Dispose() { var values = Channels.Values; foreach (var channel in values) { channel.Close(); } Channels.Clear(); }
/// <summary> /// Resets list of available channels (<see cref="Channels"/>) to union of all cameras supported by the implementing class. /// </summary> protected override void LoadAllAvailableChannels() { ChannelRegistry cr = ChannelRegistry.Instance; Channels.Clear(); log.Warn(Name + ": TODO: Implement LoadAllAvailableChannels()."); Channels.Add(cr.RegisterChannel(ChannelNames.Intensity)); Channels.Add(cr.RegisterCustomChannel(CustomChannelNames.DummyNoiseChannel, typeof(FloatCameraImage))); }
public void LoadChannels() { Channels.Clear(); List <RadioChannel> channelList = RadioChannelListMapper.DeserializeRadioChannelList(Path.Combine(SavePathsHelper.PathBase, "RadioChannels.rcs")); foreach (RadioChannel rc in channelList) { Add(new RadioChannelViewModel(rc)); } }
protected override void LoadAllAvailableChannels() { ChannelRegistry cr = ChannelRegistry.Instance; Channels.Clear(); Channels.Add(cr.RegisterChannel(ChannelNames.Intensity)); Channels.Add(cr.RegisterChannel(ChannelNames.Distance)); Channels.Add(cr.RegisterChannel(ChannelNames.Point3DImage)); }
internal void Detach() { PlaybackEngine.PlaybackEngine.Current.ItemsChanged -= Current_StatusChanged; PlaybackEngine.PlaybackEngine.Current.PositionUpdated -= Current_PositionUpdated; PlaybackEngine.PlaybackEngine.Current.PlaybackStatusChanged -= Current_PlaybackStatusChanged; Palette?.Clear(); Palette = null; Channels?.Clear(); Channels = null; }
private void settings_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e) { if (e.PropertyName == "Channels") { Channels.Clear(); SetChannels(); ChannelsChanged(); } hasSettingsChanges = true; }
public void CancelOperation() { IsInserting = false; IsListed = false; IsSaved = false; InsertingStatus = "İçe aktarmak için JSON dosyasını seçiniz..."; Channels.Clear(); }
public Task Connect(InterceptionMode mode, string socketPath = Defaults.FullSocketPath, CancellationToken cancellationToken = default) { Mode = mode; Channels.Clear(); Channels.AddRange(Enum.GetValues(typeof(CodeChannel)).Cast<CodeChannel>()); Filters.Clear(); PriortyCodes = false; InterceptInitMessage initMessage = new InterceptInitMessage { InterceptionMode = mode }; return Connect(initMessage, socketPath, cancellationToken); }
/// <summary> /// Resets list of available channels (<see cref="Channels"/>) to union of all cameras supported by the implementing class. /// Channels are: Intensity, Distance, Confidence and 3D /// </summary> protected override void LoadAllAvailableChannels() { ChannelRegistry cr = ChannelRegistry.Instance; Channels.Clear(); Channels.Add(cr.RegisterChannel(ChannelNames.Intensity)); Channels.Add(cr.RegisterChannel(ChannelNames.Distance)); Channels.Add(cr.RegisterChannel(ChannelNames.ConfidenceMap)); Channels.Add(cr.RegisterCustomChannel(ChannelNames.RawConfidenceMap, typeof(UShortCameraImage))); Channels.Add(cr.RegisterChannel(ChannelNames.Point3DImage)); }
private void UpdateChannels() { TimeInterval timeInterval = null; Channels.Clear(); foreach (var channel in _model.GetChannels(out timeInterval)) { channel.CheckedChanged += OnChannelCheckedChanged; Channels.Add(channel); } NotifyPropertyChanged("SelectedPath"); }
private void OnReloadChannels() { try { Channels?.Clear(); Channels = TvHeadend.GetChannels(); EventAggregator.GetEvent <StatusChangedEvent>().Publish(new StatusInfo($"{Channels.Count} Channels.")); } catch (System.Exception ex) { EventAggregator.GetEvent <StatusChangedEvent>().Publish(new StatusInfo(ex.Message)); } }
/// <summary> /// Called when the OpenSession message is recieved. /// </summary> /// <param name="supportedProtocols">The supported protocols.</param> public virtual void OnSessionOpened(IList <ISupportedProtocol> supportedProtocols) { if (supportedProtocols.All(x => x.Protocol != Parent.EtpExtender.Protocols.ChannelStreaming)) { return; } Parent.EtpExtender.Register( onChannelMetadata: OnChannelMetadata, onChannelData: OnChannelData); Channels.Clear(); }
/// <summary> /// Resets list of available channels (<see cref="Channels"/>) to union of all cameras supported by the implementing class. /// </summary> protected override void LoadAllAvailableChannels() { ChannelRegistry cr = ChannelRegistry.Instance; Channels.Clear(); Channels.Add(cr.RegisterChannel(ChannelNames.Amplitude)); Channels.Add(cr.RegisterChannel(ChannelNames.Distance)); Channels.Add(cr.RegisterChannel(ChannelNames.Color)); Channels.Add(cr.RegisterChannel(ChannelNames.Point3DImage)); Channels.Add(cr.RegisterCustomChannel(CustomChannelNames.LongExposureIR, typeof(FloatCameraImage))); Channels.Add(cr.RegisterCustomChannel(CustomChannelNames.BodyIndex, typeof(FloatCameraImage))); }
/// <summary> /// 停止订阅 /// </summary> public void Stop() { if (_started) { foreach (var c in Channels) { c.Stop(); } Channels.Clear(); _started = false; Log.Information("mq服务结束"); } }