本文整理汇总了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;
}
});
}
示例2: InCallMessagingViewModel
public InCallMessagingViewModel(IChatService chatMng, IContactsService contactsMng)
: base(chatMng, contactsMng)
{
Init();
_chatsManager.RttReceived += OnRttReceived;
_chatsManager.ConversationUpdated += OnChatRoomUpdated;
}
示例3: ChatApiController
public ChatApiController(IUserService service, IChatService service2, ICommentService service3, ILiveChat service4)
{
this._userService = service;
this._chatService = service2;
this._commentService = service3;
this._LiveChat = service4;
}
示例4: SimpleMessagingViewModel
public SimpleMessagingViewModel(IChatService chatMng, IContactsService contactsMng)
: base(chatMng, contactsMng)
{
Init();
_chatsManager.ConversationUnReadStateChanged += OnUnreadStateChanged;
_chatsManager.ConversationDeclineMessageReceived += OnDeclineMessageReceived;
}
示例5: Chat
public Chat(IApplicationSettings settings, IResourceProcessor resourceProcessor, IChatService service, IJabbrRepository repository)
{
_settings = settings;
_resourceProcessor = resourceProcessor;
_service = service;
_repository = repository;
}
示例6: Chat
public Chat(IResourceProcessor resourceProcessor, IChatService service, IJabbrRepository repository, ICache cache)
{
_resourceProcessor = resourceProcessor;
_service = service;
_repository = repository;
_cache = cache;
}
示例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();
}
示例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);
}
}
});
}
示例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);
}
示例10: ClientViewModel
public ClientViewModel()
{
var channelFactory = new DuplexChannelFactory<IChatService>(new ClientService(), "IChatEndpoint");
_server = channelFactory.CreateChannel();
_this = this;
CreateCommands();
}
示例11: ChatHub
public ChatHub(IChatService chatService)
{
if (chatService == null)
{
throw new ArgumentNullException("chatService");
}
this.chatService = chatService;
}
示例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);
}
示例13: CommandManager
public CommandManager(string clientId,
string userId,
string roomName,
IChatService service,
IJabbrRepository repository,
INotificationService notificationService)
: this(clientId, null, userId, roomName, service, repository, notificationService)
{
}
示例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);
}
示例15: UploadCallbackHandler
public UploadCallbackHandler(UploadProcessor processor,
ContentProviderProcessor resourceProcessor,
IConnectionManager connectionManager,
IChatService service)
{
_processor = processor;
_resourceProcessor = resourceProcessor;
_hubContext = connectionManager.GetHubContext<Chat>();
_service = service;
}