当前位置: 首页>>代码示例>>C#>>正文


C# IChatService类代码示例

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


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


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