Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Upgraded to use v 1.0.1.17 of nuget
Upgraded to use v 1.0.1.17 of nuget
this version can communicate with the web version of the sdk
  • Loading branch information
GSiry committed Sep 17, 2018
1 parent a135002 commit 55ff276
Show file tree
Hide file tree
Showing 16 changed files with 500 additions and 207 deletions.
Binary file modified .vs/AppRTCDemo/v15/.suo
Binary file not shown.
18 changes: 14 additions & 4 deletions App.config
@@ -1,18 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<section name="AppRTCDemo.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
</sectionGroup>
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
</startup>
<appSettings>
<add key="SignalingUrl" value="192.3.24.139:8080/" />
<add key="SignalingUrl" value="https://rtc-signaling-service.herokuapp.com:443/" />

</appSettings>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="CefSharp" publicKeyToken="40c4b6fc221f4138" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-53.0.1.0" newVersion="53.0.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="CefSharp.Core" publicKeyToken="40c4b6fc221f4138" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-53.0.1.0" newVersion="53.0.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="ICSharpCode.SharpZipLib" publicKeyToken="1b03e6acf1164f73" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-0.86.0.518" newVersion="0.86.0.518" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
8 changes: 4 additions & 4 deletions AppRTCDemo.csproj
Expand Up @@ -96,11 +96,11 @@
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="iConfRTCWPF, Version=1.0.6575.31360, Culture=neutral, PublicKeyToken=4300bc540bfb680e, processorArchitecture=x86">
<HintPath>packages\iConfRTC.WPF.X86.1.0.1.13\lib\iConfRTCWPF.dll</HintPath>
<Reference Include="iConfRTCWPF, Version=1.0.1.18, Culture=neutral, PublicKeyToken=4300bc540bfb680e, processorArchitecture=x86">
<HintPath>packages\iConfRTC.WPF.X86.1.0.1.17\lib\iConfRTCWPF.dll</HintPath>
</Reference>
<Reference Include="RTC, Version=1.0.1.13, Culture=neutral, PublicKeyToken=4300bc540bfb680e, processorArchitecture=x86">
<HintPath>packages\iConfRTC.WPF.X86.1.0.1.13\lib\RTC.dll</HintPath>
<Reference Include="RTC, Version=1.0.1.18, Culture=neutral, PublicKeyToken=4300bc540bfb680e, processorArchitecture=x86">
<HintPath>packages\iConfRTC.WPF.X86.1.0.1.17\lib\RTC.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.configuration" />
Expand Down
13 changes: 13 additions & 0 deletions Const.cs

Large diffs are not rendered by default.

30 changes: 30 additions & 0 deletions Converters.cs
@@ -0,0 +1,30 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Data;

namespace AppRTCDemo
{
public class InvertVisibilityConverter : IValueConverter
{

public Object Convert(Object value, Type targetType, Object parameter, CultureInfo culture)
{
if (targetType == typeof(Visibility))
{
Visibility vis = (Visibility)value;
return vis == Visibility.Collapsed ? Visibility.Visible : Visibility.Collapsed;
}
throw new InvalidOperationException("Converter can only convert to value of type Visibility.");
}

public Object ConvertBack(Object value, Type targetType, Object parameter, CultureInfo culture)
{
throw new Exception("Invalid call - one way only");
}
}
}
160 changes: 160 additions & 0 deletions CustomAdorner.cs
@@ -0,0 +1,160 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Documents;
using System.Windows;
using System.Windows.Media;
using System.Threading;

/// cool Adorner helper class provided by https://marlongrech.wordpress.com/2008/02/28/wpf-overlays-or-better-adorner/

namespace AppRTCDemo
{
/// <summary>
/// Adorner that disables all controls that fall under it
/// </summary>
public class CustomAdorner : Adorner
{
public UIElement el;
#region Properties

/// <summary>
/// Gets or sets the color to paint
/// </summary>
public Brush Color
{
get { return (Brush)GetValue(ColorProperty); }
set { SetValue(ColorProperty, value); }
}

/// <summary>
/// Gets or sets the color to paint
/// </summary>
public static readonly DependencyProperty ColorProperty =
DependencyProperty.Register("Color", typeof(Brush), typeof(CustomAdorner),
new PropertyMetadata((Brush)new BrushConverter().ConvertFromString("#7F4047F7")));


/// <summary>
/// Gets or sets the border
/// </summary>
public Pen Border
{
get { return (Pen)GetValue(BorderProperty); }
set { SetValue(BorderProperty, value); }
}

/// <summary>
/// Gets or sets the border
/// </summary>
public static readonly DependencyProperty BorderProperty =
DependencyProperty.Register("Border", typeof(Pen), typeof(CustomAdorner),
new UIPropertyMetadata(new Pen(Brushes.Gray, 1)));

//the start point where to start drawing
private static readonly Point startPoint =
new Point(0, 0);

/// <summary>
/// Gets or sets the text to display
/// </summary>
public string OverlayedText
{
get { return (string)GetValue(OverlayedTextProperty); }
set { SetValue(OverlayedTextProperty, value); }
}

/// <summary>
/// Gets or sets the text to display
/// </summary>
public static readonly DependencyProperty OverlayedTextProperty =
DependencyProperty.Register("OverlayedText", typeof(string), typeof(CustomAdorner), new UIPropertyMetadata(""));

/// <summary>
/// Gets or sets the foreground to use for the text
/// </summary>
public Brush ForeGround
{
get { return (Brush)GetValue(ForeGroundProperty); }
set { SetValue(ForeGroundProperty, value); }
}

/// <summary>
/// Gets or sets the foreground to use for the text
/// </summary>
public static readonly DependencyProperty ForeGroundProperty =
DependencyProperty.Register("ForeGround", typeof(Brush), typeof(CustomAdorner),
new UIPropertyMetadata(Brushes.Aquamarine));


/// <summary>
/// Gets or sets the font size for the text
/// </summary>
public double FontSize
{
get { return (double)GetValue(FontSizeProperty); }
set { SetValue(FontSizeProperty, value); }
}

/// <summary>
/// Gets or sets the font size for the text
/// </summary>
public static readonly DependencyProperty FontSizeProperty =
DependencyProperty.Register("FontSize", typeof(double), typeof(CustomAdorner), new UIPropertyMetadata(10.0));


/// <summary>
/// Gets or sets the Typeface for the text
/// </summary>
public Typeface Typeface
{
get { return (Typeface)GetValue(TypefaceProperty); }
set { SetValue(TypefaceProperty, value); }
}

/// <summary>
/// Gets or sets the Typeface for the text
/// </summary>
public static readonly DependencyProperty TypefaceProperty =
DependencyProperty.Register("Typeface", typeof(Typeface), typeof(CustomAdorner),
new UIPropertyMetadata(new Typeface("Verdana")));



#endregion

/// <summary>
/// Constructor for the adorner
/// </summary>
/// <param name="adornerElement">The element to be adorned</param>
public CustomAdorner(UIElement adornerElement)
: base(adornerElement)
{
el = adornerElement;
}


/// <summary>
/// Called to draw on screen
/// </summary>
/// <param name="drawingContext">The drawind context in which we can draw</param>
protected override void OnRender(System.Windows.Media.DrawingContext drawingContext)
{
FormattedText text = new FormattedText(OverlayedText, Thread.CurrentThread.CurrentUICulture,
FlowDirection.LeftToRight, Typeface, FontSize, ForeGround);

// Find the center of the client area.
double xmid = el.RenderSize.Width / 2;
double ymid = el.RenderSize.Height;
Point center =
new Point(xmid, ymid - text.Height);


drawingContext.DrawText(text, center);

//drawingContext.DrawRectangle(Color, Border, new Rect(startPoint, DesiredSize));
base.OnRender(drawingContext);
}
}
}
29 changes: 29 additions & 0 deletions ErrorCollectionToVisibility.cs
@@ -0,0 +1,29 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;

namespace AppRTCDemo
{
class ErrorCollectionToVisibility : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
var collection = value as ReadOnlyCollection<ValidationError>;
if (collection != null && collection.Count > 0)
return Visibility.Visible;
else
return Visibility.Collapsed;
}

public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
return new object();
}
}
}
31 changes: 31 additions & 0 deletions Helper.cs
@@ -0,0 +1,31 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AppRTCDemo
{
public static class Helper
{
private static readonly Random _rng = new Random();
private const string _chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";

/// <summary>
/// generate random string
/// </summary>
/// <param name="size">size of generated string</param>
/// <returns></returns>
public static string RandomString(int size)
{
char[] buffer = new char[size];

for (int i = 0; i < size; i++)
{
buffer[i] = _chars[_rng.Next(_chars.Length)];
}
return new string(buffer);
}
}

}
8 changes: 4 additions & 4 deletions MainWindow.xaml
Expand Up @@ -4,7 +4,7 @@
xmlns:local="clr-namespace:AppRTCDemo"
xmlns:properties="clr-namespace:AppRTCDemo.Properties"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" x:Name="MainWindow1" mc:Ignorable="d" x:Class="AppRTCDemo.MainWindow"
Title="{Binding AppTitle}" Height="708.209" Width="830.97" Icon="resources/1437903597_integrated_webcam.png" Closing="MainWindow_Closing">
Title="AVSPEED iConfRTC Demo" Height="708.209" Width="1024" Icon="resources/1437903597_integrated_webcam.png" Closing="MainWindow1_Closing">

<Window.Resources>
<BooleanToVisibilityConverter x:Key="BoolToVis" />
Expand Down Expand Up @@ -47,13 +47,13 @@
</Grid.Style>
</Grid>

<Grid x:Name="gridChat" Visibility="{Binding ShowChat, Converter={StaticResource BoolToVis}}" Panel.ZIndex="999999" HorizontalAlignment="Left" Height="214" Margin="30,285,0,0" VerticalAlignment="Top" Width="247" >
<Grid x:Name="gridChat" Visibility="{Binding ShowChat, Converter={StaticResource BoolToVis}}" Panel.ZIndex="999999" HorizontalAlignment="Left" Height="214" Margin="30,285,0,0" VerticalAlignment="Bottom" Width="247" >
<Grid.RenderTransform>
<TranslateTransform x:Name="tt"/>
</Grid.RenderTransform>
<DockPanel LastChildFill="True">
<TextBox Name="chatText" Height="26" TextWrapping="Wrap" Text="Type here" DockPanel.Dock="Bottom" VerticalAlignment="Top" BorderThickness="2" GotFocus="chatText_GotFocus" LostFocus="chatText_LostFocus" KeyUp="chatText_KeyUp"/>
<TextBox x:Name="chatLog" VerticalScrollBarVisibility="Auto" TextWrapping="Wrap" AcceptsReturn="True" Text="" Background="#FFF3F3F3" BorderThickness="2" IsReadOnly="True"/>
<TextBox x:Name="chatLog" VerticalScrollBarVisibility="Auto" TextWrapping="Wrap" AcceptsReturn="True" Text="" Background="White" BorderThickness="2" IsReadOnly="True" Margin="0,-40,0,-0.2"/>
</DockPanel>
</Grid>
</Grid>
Expand Down Expand Up @@ -135,7 +135,7 @@

<Grid HorizontalAlignment="Stretch" Height="59" VerticalAlignment="Top" Background="#FF214B87" Name="gridHead">
<Label Content="AVSPEED iConfRTC Demo" VerticalAlignment="Top" FontSize="29.333" Foreground="White" HorizontalAlignment="Center"/>
<Image x:Name="imgSettings" Margin="0,0,14,7" Source="resources/settings2.png" Stretch="Fill" HorizontalAlignment="Right" VerticalAlignment="Center" Height="32" RenderTransformOrigin="-0.512,0" Width="32" Cursor="Hand" Visibility="Hidden"/>
<Image x:Name="imgSettings" Margin="0,0,14,7" Source="resources/settings2.png" Stretch="Fill" HorizontalAlignment="Right" VerticalAlignment="Center" Height="32" RenderTransformOrigin="-0.512,0" Width="32" Cursor="Hand"/>
</Grid>
<Grid HorizontalAlignment="Stretch" Panel.ZIndex="999999999" Height="59" VerticalAlignment="Top" Background="#FF36992C" x:Name="gridMessage" Visibility="Hidden">
<Label Name="lblMessage" Content="&#xD;&#xA;" VerticalAlignment="Top" FontSize="29.333" Foreground="White" HorizontalAlignment="Center"/>
Expand Down

0 comments on commit 55ff276

Please sign in to comment.