public CallingWindow(string conversationPartner, BitmapImage image, bool isGroup) { InitializeComponent(); ConversationPartner = conversationPartner; ResizeMode = ResizeMode.CanMinimize; audioCallback = new AudioCallback(); DuplexChannelFactory <IAudio> channelAudioService = new DuplexChannelFactory <IAudio>(audioCallback, new NetTcpBinding(SecurityMode.None), new EndpointAddress("net.tcp://" + ClientInformation.IPAdressServer + ":4444/AudioService")); audioService = channelAudioService.CreateChannel(); audioService.Subscribe(ClientInformation.Username); avatarImage.Fill = new ImageBrush(image); IsGroup = isGroup; Title = conversationPartner; Init(); }
public AnswerWindow(string sender, bool isGroup) { InitializeComponent(); IsGroup = isGroup; ResizeMode = ResizeMode.CanMinimize; textBlock.TextAlignment = TextAlignment.Center; ConversationPartner = sender; textBlock.Text = sender + " is calling you."; audioCallback = new AudioCallback(); DuplexChannelFactory <IAudio> channelAudioService = new DuplexChannelFactory <IAudio>(audioCallback, new NetTcpBinding(SecurityMode.None), new EndpointAddress("net.tcp://" + ClientInformation.IPAdressServer + ":4444/AudioService")); audioService = channelAudioService.CreateChannel(); audioService.Subscribe(ClientInformation.Username); buttonClose.Visibility = Visibility.Hidden; ImageBrush brush = new ImageBrush(ClientInformation.MainWindow.GetImageFromFriendList(sender)); avatarImage.Fill = brush; Title = sender; }