コード例 #1
0
        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();
            }
        }
コード例 #2
0
 void client_OnDisconnected(object sender)
 {
     Warning("Disconnected");
     State = ConnectionState.Disconnected;
     Channels.Clear();
     IsBusy = false;
 }
コード例 #3
0
        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);
            }
        }
コード例 #4
0
        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ı.";
            }
        }
コード例 #5
0
ファイル: IrcClient.cs プロジェクト: MShaffar19/irc
 /// <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();
         }
     }
 }
コード例 #6
0
 public DeploymentActionResource ClearAllConditions()
 {
     Channels.Clear();
     Environments.Clear();
     TenantTags.Clear();
     return(this);
 }
コード例 #7
0
        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);
            });
        }
コード例 #8
0
ファイル: TiM561.cs プロジェクト: Metrilus/MetriCam2
 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));
 }
コード例 #9
0
ファイル: Window.cs プロジェクト: Luciano-0/2048-Demo
        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();
        }
コード例 #10
0
        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();
            }
        }
コード例 #11
0
        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)));
            }
        }
コード例 #12
0
        /// <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();
        }
コード例 #13
0
ファイル: Hikvision.cs プロジェクト: Metrilus/MetriCam2
        protected override void LoadAllAvailableChannels()
        {
            ChannelRegistry cr = ChannelRegistry.Instance;

            Channels.Clear();

            Channels.Add(cr.RegisterChannel(ChannelNames.Color));
        }
コード例 #14
0
 public void Reset()
 {
     Channels.Clear();
     Clients.Clear();
     Groups.Clear();
     OwnClient = ClientId.Null;
     Server    = new Server();
 }
コード例 #15
0
 /// <summary>
 ///  停止订阅
 /// </summary>
 public void Stop()
 {
     foreach (var c in Channels)
     {
         c.Stop();
     }
     Channels.Clear();
     Started = false;
 }
コード例 #16
0
 internal void Detach()
 {
     Player.Current.StatusChanged   -= Current_StatusChanged;
     Player.Current.PositionUpdated -= Current_PositionUpdated;
     Palette?.Clear();
     Palette = null;
     Channels?.Clear();
     Channels = null;
 }
コード例 #17
0
ファイル: TcpService.cs プロジェクト: zjccwboy/NET.Popo
        public override void Dispose()
        {
            var values = Channels.Values;

            foreach (var channel in values)
            {
                channel.Close();
            }
            Channels.Clear();
        }
コード例 #18
0
        /// <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)));
        }
コード例 #19
0
        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));
            }
        }
コード例 #20
0
        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));
        }
コード例 #21
0
 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;
 }
コード例 #22
0
ファイル: Ru101Station.cs プロジェクト: drdax/Radio
 private void settings_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
 {
     if (e.PropertyName == "Channels")
     {
         Channels.Clear();
         SetChannels();
         ChannelsChanged();
     }
     hasSettingsChanges = true;
 }
コード例 #23
0
        public void CancelOperation()
        {
            IsInserting = false;
            IsListed    = false;
            IsSaved     = false;

            InsertingStatus = "İçe aktarmak için JSON dosyasını seçiniz...";

            Channels.Clear();
        }
コード例 #24
0
        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);
        }
コード例 #25
0
ファイル: VisionaryT.cs プロジェクト: btlorch/MetriCam2
        /// <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));
        }
コード例 #26
0
        private void UpdateChannels()
        {
            TimeInterval timeInterval = null;

            Channels.Clear();
            foreach (var channel in _model.GetChannels(out timeInterval))
            {
                channel.CheckedChanged += OnChannelCheckedChanged;
                Channels.Add(channel);
            }

            NotifyPropertyChanged("SelectedPath");
        }
コード例 #27
0
 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));
     }
 }
コード例 #28
0
        /// <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();
        }
コード例 #29
0
        /// <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)));
        }
コード例 #30
0
ファイル: MQServiceBase.cs プロジェクト: windygu/Cyf.NetCore
 /// <summary>
 ///  停止订阅
 /// </summary>
 public void Stop()
 {
     if (_started)
     {
         foreach (var c in Channels)
         {
             c.Stop();
         }
         Channels.Clear();
         _started = false;
         Log.Information("mq服务结束");
     }
 }