• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# IChatService类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中IChatService的典型用法代码示例。如果您正苦于以下问题:C# IChatService类的具体用法?C# IChatService怎么用?C# IChatService使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



IChatService类属于命名空间,在下文中一共展示了IChatService类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: ViewViewModel

        public ViewViewModel()
        {
            chatService = ServiceLocator.Current.GetInstance<IChatService>();
            parentViewModel = ServiceLocator.Current.GetInstance<PhotosViewModel>();
            timer = new Timer(new TimerCallback((c) => {
                DispatcherHelper.CheckBeginInvokeOnUI(() =>
                {
                    App.RootFrame.Navigate(new Uri("/View/PhotosPage.xaml", UriKind.RelativeOrAbsolute));
                });
            }),
            null,
            Timeout.Infinite,
            Timeout.Infinite);

            HideCommand = new RelayCommand(async () =>

            {
                timer.Change(TimeSpan.FromSeconds(6), TimeSpan.FromMilliseconds(-1));
                var contentList = await chatService.ReadPhotoContentAsync(
                    parentViewModel.SelectedPhoto.PhotoContentSecretId);
                var content = contentList.FirstOrDefault();
                if (content != null)
                {
                    Uri = chatService.ReadPhotoAsUri(content.Uri);
                    Stream = chatService.ReadPhotoAsStream(content.Uri);
                }
                else
                {
                    Uri = null;
                    Stream = null;
                }

            });
        }
开发者ID:yeenfei,项目名称:samples,代码行数:34,代码来源:ViewViewModel.cs


示例2: InCallMessagingViewModel

 public InCallMessagingViewModel(IChatService chatMng, IContactsService contactsMng)
     : base(chatMng, contactsMng)
 {
     Init();
     _chatsManager.RttReceived += OnRttReceived;
     _chatsManager.ConversationUpdated += OnChatRoomUpdated;
 }
开发者ID:VTCSecureLLC,项目名称:ace-windows,代码行数:7,代码来源:InCallMessagingViewModel.cs


示例3: ChatApiController

 public ChatApiController(IUserService service, IChatService service2, ICommentService service3, ILiveChat service4)
 {
     this._userService = service;
     this._chatService = service2;
     this._commentService = service3;
     this._LiveChat = service4;
 }
开发者ID:thedevhunter,项目名称:MiDinero-MiFuturo,代码行数:7,代码来源:ChatApiController.cs


示例4: SimpleMessagingViewModel

 public SimpleMessagingViewModel(IChatService chatMng, IContactsService contactsMng)
     : base(chatMng, contactsMng)
 {
     Init();
     _chatsManager.ConversationUnReadStateChanged += OnUnreadStateChanged;
     _chatsManager.ConversationDeclineMessageReceived += OnDeclineMessageReceived;
 }
开发者ID:shareefalis,项目名称:ace-windows-old,代码行数:7,代码来源:SimpleMessagingViewModel.cs


示例5: Chat

 public Chat(IApplicationSettings settings, IResourceProcessor resourceProcessor, IChatService service, IJabbrRepository repository)
 {
     _settings = settings;
     _resourceProcessor = resourceProcessor;
     _service = service;
     _repository = repository;
 }
开发者ID:BDDCloud,项目名称:JabbR,代码行数:7,代码来源:Chat.cs


示例6: Chat

 public Chat(IResourceProcessor resourceProcessor, IChatService service, IJabbrRepository repository, ICache cache)
 {
     _resourceProcessor = resourceProcessor;
     _service = service;
     _repository = repository;
     _cache = cache;
 }
开发者ID:codeprogression,项目名称:JabbR,代码行数:7,代码来源:Chat.cs


示例7: MainViewModel

        /// <summary>
        ///     Initializes a new instance of the MainViewModel class.
        /// </summary>
        public MainViewModel(IDataService dataService)
        {
            _dataService = dataService;
            _dataService.GetData(
                (item, error) =>
                {
                    if (error != null)
                    {
                        // Report error here
                        return;
                    }

                    WelcomeTitle = item.Title;
                });
            ConnectCommand = new RelayCommand(OnConnect, IsNeedConnect);
            SendCommand = new RelayCommand(OnSend, CanSendMessage);
            DisConnectCommand = new RelayCommand(OnDisConnect, IsNeedDisConnect);
            var instanceContext = new InstanceContext(this);
            var channel = new DuplexChannelFactory<IChatService>(instanceContext, "chartService");
            _chatService = channel.CreateChannel();
            Nickname = "frank";
            MessageText = "Hello!";

            RaiseCommandChanged();
        }
开发者ID:huoxudong125,项目名称:HQF.Tutorial.WCF,代码行数:28,代码来源:MainViewModel.cs


示例8: ChatViewModel

        public ChatViewModel(IChatService chatService)
        {
            this.contacts = new ObservableCollection<Contact>();
            this.contactsView = new CollectionView(this.contacts);
            this.sendMessageRequest = new InteractionRequest<SendMessageViewModel>();
            this.showReceivedMessageRequest = new InteractionRequest<ReceivedMessage>();
            this.showDetailsCommand = new DelegateCommand<bool?>(this.ExecuteShowDetails, this.CanExecuteShowDetails);

            this.contactsView.CurrentChanged += this.OnCurrentContactChanged;

            this.chatService = chatService;
            this.chatService.Connected = true;
            this.chatService.ConnectionStatusChanged += (s, e) => this.OnPropertyChanged(() => this.ConnectionStatus);
            this.chatService.MessageReceived += this.OnMessageReceived;

            this.chatService.GetContacts(
                result =>
                {
                    if (result.Error == null)
                    {
                        foreach (var item in result.Result)
                        {
                            this.contacts.Add(item);
                        }
                    }
                });
        }
开发者ID:grandtiger,项目名称:Prism,代码行数:27,代码来源:ChatViewModel.cs


示例9: ChatViewModel

        public ChatViewModel(IChatService chatService)
        {
            _contacts = new ObservableCollection<Contact>();
            _contactsView = new CollectionView(_contacts);
            _sendMessageRequest = new InteractionRequest<SendMessageViewModel>();
            _showReceivedMessageRequest = new InteractionRequest<ReceivedMessage>();
            _showDetailsCommand = new ShowDetailsCommandImplementation(this);

            _contactsView.CurrentChanged += OnCurrentContactChanged;

            _chatService = chatService;
            _chatService.Connected = true;
            _chatService.ConnectionStatusChanged += (s, e) => RaisePropertyChanged(() => CurrentConnectionState);
            _chatService.MessageReceived += OnMessageReceived;

            _chatService.GetContacts(
                result =>
                    {
                        if (result.Error != null) return;
                        foreach (var item in result.Result)
                        {
                            _contacts.Add(item);
                        }
                    });
            RaisePropertyChanged(() => CurrentConnectionState);
        }
开发者ID:Slesa,项目名称:Poseidon,代码行数:26,代码来源:ChatViewModel.cs


示例10: ClientViewModel

        public ClientViewModel()
        {
            var channelFactory = new DuplexChannelFactory<IChatService>(new ClientService(), "IChatEndpoint");

            _server = channelFactory.CreateChannel();
            _this = this;
            CreateCommands();
        }
开发者ID:DavidNemeth,项目名称:DesktopApps,代码行数:8,代码来源:ClientViewModel.cs


示例11: ChatHub

 public ChatHub(IChatService chatService)
 {
     if (chatService == null)
     {
         throw new ArgumentNullException("chatService");
     }
     this.chatService = chatService;
 }
开发者ID:alana1,项目名称:NancySamples,代码行数:8,代码来源:ChatHub.cs


示例12: ChatViewModel

 /// <summary>
 /// Initializes a new instance of the <see cref="XamarinChat.ChatViewModel"/> class.
 /// </summary>
 /// <param name="chatService">Chat service.</param>
 public ChatViewModel(IChatService chatService)
 {
     ChatService = chatService;
     Messages = new ObservableCollection<string>();
     SendCommand = new Command( async nothing => {
         await ChatService.Send(new XamarinChat.Models.ClientMessage{ Client = new XamarinChat.Models.Client { Name = Name }, Message = Message });
         Message = string.Empty;
     }, nothing => CanSend);
 }
开发者ID:emcconnell,项目名称:XamarinChat,代码行数:13,代码来源:ChatViewModel.cs


示例13: CommandManager

 public CommandManager(string clientId,
                       string userId,
                       string roomName,
                       IChatService service,
                       IJabbrRepository repository,
                       INotificationService notificationService)
     : this(clientId, null, userId, roomName, service, repository, notificationService)
 {
 }
开发者ID:larrybeall,项目名称:JabbR,代码行数:9,代码来源:CommandManager.cs


示例14: ConnectViewModel

 /// <summary>
 /// Initializes a new instance of the <see cref="XamarinChat.ConnectViewModel"/> class.
 /// </summary>
 /// <param name="chatService">Chat service.</param>
 public ConnectViewModel(IChatService chatService)
 {
     ChatService = chatService;
     ConnectCommand = new Command(async nothing => {
         await ChatService.Connect();
         await ChatService.NewClient(new XamarinChat.Models.Client { Name = Name });
         OnConnected();
     }, nothing => CanConnect);
 }
开发者ID:emcconnell,项目名称:XamarinChat,代码行数:13,代码来源:ConnectViewModel.cs


示例15: UploadCallbackHandler

 public UploadCallbackHandler(UploadProcessor processor,
                              ContentProviderProcessor resourceProcessor,
                              IConnectionManager connectionManager,
                              IChatService service)
 {
     _processor = processor;
     _resourceProcessor = resourceProcessor;
     _hubContext = connectionManager.GetHubContext<Chat>();
     _service = service;
 }
开发者ID:phillip-haydon,项目名称:JabbR,代码行数:10,代码来源:UploadCallbackHandler.cs


示例16: Chat

 public Chat(ContentProviderProcessor resourceProcessor,
             IChatService service,
             IJabbrRepository repository,
             ICache cache,
             ILogger logger)
 {
     _resourceProcessor = resourceProcessor;
     _service = service;
     _repository = repository;
     _cache = cache;
     _logger = logger;
 }
开发者ID:QuickenLoans,项目名称:JabbR,代码行数:12,代码来源:Chat.cs


示例17: MessagingViewModel

 public MessagingViewModel(IChatService chatMng, IContactsService contactsMng)
     : this()
 {
     this._chatsManager = chatMng;
     this._contactsManager = contactsMng;
     this._chatsManager.ConversationUpdated += OnConversationUpdated;
     this._chatsManager.NewConversationCreated += OnNewConversationCreated;
     this._chatsManager.ConversationClosed += OnConversationClosed;
     this._chatsManager.ContactsChanged += OnContactsChanged;
     this._chatsManager.ContactAdded += OnChatContactAdded;
     this._chatsManager.ContactRemoved += OnChatContactRemoved;
     this._contactsManager.LoggedInContactUpdated += OnLoggedContactUpdated;
 }
开发者ID:shareefalis,项目名称:ace-windows-old,代码行数:13,代码来源:MessagingViewModel.cs


示例18: CommandManager

 public CommandManager(string clientId,
                       string userId,
                       string roomName,
                       IChatService service,
                       IJabbrRepository repository,
                       INotificationService notificationService)
 {
     _clientId = clientId;
     _userId = userId;
     _roomName = roomName;
     _chatService = service;
     _repository = repository;
     _notificationService = notificationService;
 }
开发者ID:kiliman,项目名称:JabbR,代码行数:14,代码来源:CommandManager.cs


示例19: PhotosViewModel

        public PhotosViewModel()
        {
            chatService = ServiceLocator.Current.GetInstance<IChatService>();

            RefreshCommand = new RelayCommand(async () =>
            {
                Photos = await chatService.ReadPhotoRecordsAsync(App.CurrentUser.UserId);
            });

            ViewPhoto = new RelayCommand(() =>
            {
                App.RootFrame.Navigate(new Uri("/View/ViewPage.xaml", UriKind.RelativeOrAbsolute));
            });
        }
开发者ID:yeenfei,项目名称:samples,代码行数:14,代码来源:PhotosViewModel.cs


示例20: Chat

 public Chat(ContentProviderProcessor resourceProcessor,
             IChatService service,
             IRecentMessageCache recentMessageCache,
             IJabbrRepository repository,
             ICache cache,
             ILogger logger,
             ApplicationSettings settings)
 {
     _resourceProcessor = resourceProcessor;
     _service = service;
     _recentMessageCache = recentMessageCache;
     _repository = repository;
     _cache = cache;
     _logger = logger;
     _settings = settings;
 }
开发者ID:renangrativol,项目名称:JabbR,代码行数:16,代码来源:Chat.cs



注:本文中的IChatService类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# ICheckoutAttributeParser类代码示例发布时间:2022-05-24
下一篇:
C# ICharacter类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap