Skip to content

Commit

Permalink
fixing stuff
Browse files Browse the repository at this point in the history
White border when in fullscreen #1
rework of subtitle online search
adding dependency msvcr110.dll
various minot fixes
  • Loading branch information
msimic committed Feb 7, 2014
1 parent 462975e commit d656993
Show file tree
Hide file tree
Showing 69 changed files with 1,313 additions and 309 deletions.
Binary file added Libs/x86/msvcr110.dll
Binary file not shown.
80 changes: 40 additions & 40 deletions MediaPoint.sln
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,10 @@ Global
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{93795BD8-0E1B-4D6C-B5F4-B49533E8C7E8}.Debug|x64.ActiveCfg = Debug|x64
{93795BD8-0E1B-4D6C-B5F4-B49533E8C7E8}.Debug|x64.Build.0 = Debug|x64
{93795BD8-0E1B-4D6C-B5F4-B49533E8C7E8}.Debug|x86.ActiveCfg = Debug|Win32
{93795BD8-0E1B-4D6C-B5F4-B49533E8C7E8}.Debug|x86.Build.0 = Debug|Win32
{93795BD8-0E1B-4D6C-B5F4-B49533E8C7E8}.Debug|x64.ActiveCfg = Release|x64
{93795BD8-0E1B-4D6C-B5F4-B49533E8C7E8}.Debug|x64.Build.0 = Release|x64
{93795BD8-0E1B-4D6C-B5F4-B49533E8C7E8}.Debug|x86.ActiveCfg = Release|Win32
{93795BD8-0E1B-4D6C-B5F4-B49533E8C7E8}.Debug|x86.Build.0 = Release|Win32
{93795BD8-0E1B-4D6C-B5F4-B49533E8C7E8}.Installer|x64.ActiveCfg = Release|x64
{93795BD8-0E1B-4D6C-B5F4-B49533E8C7E8}.Installer|x64.Build.0 = Release|x64
{93795BD8-0E1B-4D6C-B5F4-B49533E8C7E8}.Installer|x86.ActiveCfg = Release|Win32
Expand Down Expand Up @@ -198,10 +198,10 @@ Global
{61695006-241A-4FAC-AFC6-93F810642A1E}.Installer|x86.Build.0 = SingleImage
{61695006-241A-4FAC-AFC6-93F810642A1E}.Release|x64.ActiveCfg = SingleImage
{61695006-241A-4FAC-AFC6-93F810642A1E}.Release|x86.ActiveCfg = SingleImage
{F558E2B6-62CF-4D1D-A6EA-448D159E5675}.Debug|x64.ActiveCfg = Debug|x64
{F558E2B6-62CF-4D1D-A6EA-448D159E5675}.Debug|x64.Build.0 = Debug|x64
{F558E2B6-62CF-4D1D-A6EA-448D159E5675}.Debug|x86.ActiveCfg = Debug|Win32
{F558E2B6-62CF-4D1D-A6EA-448D159E5675}.Debug|x86.Build.0 = Debug|Win32
{F558E2B6-62CF-4D1D-A6EA-448D159E5675}.Debug|x64.ActiveCfg = Release|x64
{F558E2B6-62CF-4D1D-A6EA-448D159E5675}.Debug|x64.Build.0 = Release|x64
{F558E2B6-62CF-4D1D-A6EA-448D159E5675}.Debug|x86.ActiveCfg = Release|Win32
{F558E2B6-62CF-4D1D-A6EA-448D159E5675}.Debug|x86.Build.0 = Release|Win32
{F558E2B6-62CF-4D1D-A6EA-448D159E5675}.Installer|x64.ActiveCfg = Release|x64
{F558E2B6-62CF-4D1D-A6EA-448D159E5675}.Installer|x64.Build.0 = Release|x64
{F558E2B6-62CF-4D1D-A6EA-448D159E5675}.Installer|x86.ActiveCfg = Release|Win32
Expand All @@ -210,10 +210,10 @@ Global
{F558E2B6-62CF-4D1D-A6EA-448D159E5675}.Release|x64.Build.0 = Release|x64
{F558E2B6-62CF-4D1D-A6EA-448D159E5675}.Release|x86.ActiveCfg = Release|Win32
{F558E2B6-62CF-4D1D-A6EA-448D159E5675}.Release|x86.Build.0 = Release|Win32
{54DDA60F-E528-4D07-A152-960A1E818680}.Debug|x64.ActiveCfg = Debug|x64
{54DDA60F-E528-4D07-A152-960A1E818680}.Debug|x64.Build.0 = Debug|x64
{54DDA60F-E528-4D07-A152-960A1E818680}.Debug|x86.ActiveCfg = Debug|Win32
{54DDA60F-E528-4D07-A152-960A1E818680}.Debug|x86.Build.0 = Debug|Win32
{54DDA60F-E528-4D07-A152-960A1E818680}.Debug|x64.ActiveCfg = Release|x64
{54DDA60F-E528-4D07-A152-960A1E818680}.Debug|x64.Build.0 = Release|x64
{54DDA60F-E528-4D07-A152-960A1E818680}.Debug|x86.ActiveCfg = Release|Win32
{54DDA60F-E528-4D07-A152-960A1E818680}.Debug|x86.Build.0 = Release|Win32
{54DDA60F-E528-4D07-A152-960A1E818680}.Installer|x64.ActiveCfg = Release|x64
{54DDA60F-E528-4D07-A152-960A1E818680}.Installer|x64.Build.0 = Release|x64
{54DDA60F-E528-4D07-A152-960A1E818680}.Installer|x86.ActiveCfg = Release|Win32
Expand All @@ -222,10 +222,10 @@ Global
{54DDA60F-E528-4D07-A152-960A1E818680}.Release|x64.Build.0 = Release|x64
{54DDA60F-E528-4D07-A152-960A1E818680}.Release|x86.ActiveCfg = Release|Win32
{54DDA60F-E528-4D07-A152-960A1E818680}.Release|x86.Build.0 = Release|Win32
{FC70988B-1AE5-4381-866D-4F405E28AC42}.Debug|x64.ActiveCfg = Debug|x64
{FC70988B-1AE5-4381-866D-4F405E28AC42}.Debug|x64.Build.0 = Debug|x64
{FC70988B-1AE5-4381-866D-4F405E28AC42}.Debug|x86.ActiveCfg = Debug|Win32
{FC70988B-1AE5-4381-866D-4F405E28AC42}.Debug|x86.Build.0 = Debug|Win32
{FC70988B-1AE5-4381-866D-4F405E28AC42}.Debug|x64.ActiveCfg = Release|x64
{FC70988B-1AE5-4381-866D-4F405E28AC42}.Debug|x64.Build.0 = Release|x64
{FC70988B-1AE5-4381-866D-4F405E28AC42}.Debug|x86.ActiveCfg = Release|Win32
{FC70988B-1AE5-4381-866D-4F405E28AC42}.Debug|x86.Build.0 = Release|Win32
{FC70988B-1AE5-4381-866D-4F405E28AC42}.Installer|x64.ActiveCfg = Release|x64
{FC70988B-1AE5-4381-866D-4F405E28AC42}.Installer|x64.Build.0 = Release|x64
{FC70988B-1AE5-4381-866D-4F405E28AC42}.Installer|x86.ActiveCfg = Release|Win32
Expand All @@ -234,10 +234,10 @@ Global
{FC70988B-1AE5-4381-866D-4F405E28AC42}.Release|x64.Build.0 = Release|x64
{FC70988B-1AE5-4381-866D-4F405E28AC42}.Release|x86.ActiveCfg = Release|Win32
{FC70988B-1AE5-4381-866D-4F405E28AC42}.Release|x86.Build.0 = Release|Win32
{0D252872-7542-4232-8D02-53F9182AEE15}.Debug|x64.ActiveCfg = Debug|x64
{0D252872-7542-4232-8D02-53F9182AEE15}.Debug|x64.Build.0 = Debug|x64
{0D252872-7542-4232-8D02-53F9182AEE15}.Debug|x86.ActiveCfg = Debug|Win32
{0D252872-7542-4232-8D02-53F9182AEE15}.Debug|x86.Build.0 = Debug|Win32
{0D252872-7542-4232-8D02-53F9182AEE15}.Debug|x64.ActiveCfg = Release|x64
{0D252872-7542-4232-8D02-53F9182AEE15}.Debug|x64.Build.0 = Release|x64
{0D252872-7542-4232-8D02-53F9182AEE15}.Debug|x86.ActiveCfg = Release|Win32
{0D252872-7542-4232-8D02-53F9182AEE15}.Debug|x86.Build.0 = Release|Win32
{0D252872-7542-4232-8D02-53F9182AEE15}.Installer|x64.ActiveCfg = Release|x64
{0D252872-7542-4232-8D02-53F9182AEE15}.Installer|x64.Build.0 = Release|x64
{0D252872-7542-4232-8D02-53F9182AEE15}.Installer|x86.ActiveCfg = Release|Win32
Expand All @@ -246,10 +246,10 @@ Global
{0D252872-7542-4232-8D02-53F9182AEE15}.Release|x64.Build.0 = Release|x64
{0D252872-7542-4232-8D02-53F9182AEE15}.Release|x86.ActiveCfg = Release|Win32
{0D252872-7542-4232-8D02-53F9182AEE15}.Release|x86.Build.0 = Release|Win32
{DD9D2D92-2241-408A-859E-B85D444B7E3C}.Debug|x64.ActiveCfg = Debug|x64
{DD9D2D92-2241-408A-859E-B85D444B7E3C}.Debug|x64.Build.0 = Debug|x64
{DD9D2D92-2241-408A-859E-B85D444B7E3C}.Debug|x86.ActiveCfg = Debug|Win32
{DD9D2D92-2241-408A-859E-B85D444B7E3C}.Debug|x86.Build.0 = Debug|Win32
{DD9D2D92-2241-408A-859E-B85D444B7E3C}.Debug|x64.ActiveCfg = Release|x64
{DD9D2D92-2241-408A-859E-B85D444B7E3C}.Debug|x64.Build.0 = Release|x64
{DD9D2D92-2241-408A-859E-B85D444B7E3C}.Debug|x86.ActiveCfg = Release|Win32
{DD9D2D92-2241-408A-859E-B85D444B7E3C}.Debug|x86.Build.0 = Release|Win32
{DD9D2D92-2241-408A-859E-B85D444B7E3C}.Installer|x64.ActiveCfg = Release|x64
{DD9D2D92-2241-408A-859E-B85D444B7E3C}.Installer|x64.Build.0 = Release|x64
{DD9D2D92-2241-408A-859E-B85D444B7E3C}.Installer|x86.ActiveCfg = Release|Win32
Expand All @@ -258,10 +258,10 @@ Global
{DD9D2D92-2241-408A-859E-B85D444B7E3C}.Release|x64.Build.0 = Release|x64
{DD9D2D92-2241-408A-859E-B85D444B7E3C}.Release|x86.ActiveCfg = Release|Win32
{DD9D2D92-2241-408A-859E-B85D444B7E3C}.Release|x86.Build.0 = Release|Win32
{D514EA4D-EAFB-47A9-A437-A582CA571251}.Debug|x64.ActiveCfg = Debug|x64
{D514EA4D-EAFB-47A9-A437-A582CA571251}.Debug|x64.Build.0 = Debug|x64
{D514EA4D-EAFB-47A9-A437-A582CA571251}.Debug|x86.ActiveCfg = Debug|Win32
{D514EA4D-EAFB-47A9-A437-A582CA571251}.Debug|x86.Build.0 = Debug|Win32
{D514EA4D-EAFB-47A9-A437-A582CA571251}.Debug|x64.ActiveCfg = Release|x64
{D514EA4D-EAFB-47A9-A437-A582CA571251}.Debug|x64.Build.0 = Release|x64
{D514EA4D-EAFB-47A9-A437-A582CA571251}.Debug|x86.ActiveCfg = Release|Win32
{D514EA4D-EAFB-47A9-A437-A582CA571251}.Debug|x86.Build.0 = Release|Win32
{D514EA4D-EAFB-47A9-A437-A582CA571251}.Installer|x64.ActiveCfg = Release|x64
{D514EA4D-EAFB-47A9-A437-A582CA571251}.Installer|x64.Build.0 = Release|x64
{D514EA4D-EAFB-47A9-A437-A582CA571251}.Installer|x86.ActiveCfg = Release|Win32
Expand All @@ -270,10 +270,10 @@ Global
{D514EA4D-EAFB-47A9-A437-A582CA571251}.Release|x64.Build.0 = Release|x64
{D514EA4D-EAFB-47A9-A437-A582CA571251}.Release|x86.ActiveCfg = Release|Win32
{D514EA4D-EAFB-47A9-A437-A582CA571251}.Release|x86.Build.0 = Release|Win32
{5E56335F-0FB1-4EEA-B240-D8DC5E0608E4}.Debug|x64.ActiveCfg = Debug|x64
{5E56335F-0FB1-4EEA-B240-D8DC5E0608E4}.Debug|x64.Build.0 = Debug|x64
{5E56335F-0FB1-4EEA-B240-D8DC5E0608E4}.Debug|x86.ActiveCfg = Debug|Win32
{5E56335F-0FB1-4EEA-B240-D8DC5E0608E4}.Debug|x86.Build.0 = Debug|Win32
{5E56335F-0FB1-4EEA-B240-D8DC5E0608E4}.Debug|x64.ActiveCfg = Release|x64
{5E56335F-0FB1-4EEA-B240-D8DC5E0608E4}.Debug|x64.Build.0 = Release|x64
{5E56335F-0FB1-4EEA-B240-D8DC5E0608E4}.Debug|x86.ActiveCfg = Release|Win32
{5E56335F-0FB1-4EEA-B240-D8DC5E0608E4}.Debug|x86.Build.0 = Release|Win32
{5E56335F-0FB1-4EEA-B240-D8DC5E0608E4}.Installer|x64.ActiveCfg = Release|x64
{5E56335F-0FB1-4EEA-B240-D8DC5E0608E4}.Installer|x64.Build.0 = Release|x64
{5E56335F-0FB1-4EEA-B240-D8DC5E0608E4}.Installer|x86.ActiveCfg = Release|Win32
Expand All @@ -282,10 +282,10 @@ Global
{5E56335F-0FB1-4EEA-B240-D8DC5E0608E4}.Release|x64.Build.0 = Release|x64
{5E56335F-0FB1-4EEA-B240-D8DC5E0608E4}.Release|x86.ActiveCfg = Release|Win32
{5E56335F-0FB1-4EEA-B240-D8DC5E0608E4}.Release|x86.Build.0 = Release|Win32
{C2082189-3ECB-4079-91FA-89D3C8A305C0}.Debug|x64.ActiveCfg = Debug|x64
{C2082189-3ECB-4079-91FA-89D3C8A305C0}.Debug|x64.Build.0 = Debug|x64
{C2082189-3ECB-4079-91FA-89D3C8A305C0}.Debug|x86.ActiveCfg = Debug|Win32
{C2082189-3ECB-4079-91FA-89D3C8A305C0}.Debug|x86.Build.0 = Debug|Win32
{C2082189-3ECB-4079-91FA-89D3C8A305C0}.Debug|x64.ActiveCfg = Release|x64
{C2082189-3ECB-4079-91FA-89D3C8A305C0}.Debug|x64.Build.0 = Release|x64
{C2082189-3ECB-4079-91FA-89D3C8A305C0}.Debug|x86.ActiveCfg = Release|Win32
{C2082189-3ECB-4079-91FA-89D3C8A305C0}.Debug|x86.Build.0 = Release|Win32
{C2082189-3ECB-4079-91FA-89D3C8A305C0}.Installer|x64.ActiveCfg = Release|x64
{C2082189-3ECB-4079-91FA-89D3C8A305C0}.Installer|x64.Build.0 = Release|x64
{C2082189-3ECB-4079-91FA-89D3C8A305C0}.Installer|x86.ActiveCfg = Release|Win32
Expand All @@ -294,10 +294,10 @@ Global
{C2082189-3ECB-4079-91FA-89D3C8A305C0}.Release|x64.Build.0 = Release|x64
{C2082189-3ECB-4079-91FA-89D3C8A305C0}.Release|x86.ActiveCfg = Release|Win32
{C2082189-3ECB-4079-91FA-89D3C8A305C0}.Release|x86.Build.0 = Release|Win32
{530890F8-CBCB-4DAB-BEDF-9FB667D0AFEE}.Debug|x64.ActiveCfg = Debug|x64
{530890F8-CBCB-4DAB-BEDF-9FB667D0AFEE}.Debug|x64.Build.0 = Debug|x64
{530890F8-CBCB-4DAB-BEDF-9FB667D0AFEE}.Debug|x86.ActiveCfg = Debug|Win32
{530890F8-CBCB-4DAB-BEDF-9FB667D0AFEE}.Debug|x86.Build.0 = Debug|Win32
{530890F8-CBCB-4DAB-BEDF-9FB667D0AFEE}.Debug|x64.ActiveCfg = Release|x64
{530890F8-CBCB-4DAB-BEDF-9FB667D0AFEE}.Debug|x64.Build.0 = Release|x64
{530890F8-CBCB-4DAB-BEDF-9FB667D0AFEE}.Debug|x86.ActiveCfg = Release|Win32
{530890F8-CBCB-4DAB-BEDF-9FB667D0AFEE}.Debug|x86.Build.0 = Release|Win32
{530890F8-CBCB-4DAB-BEDF-9FB667D0AFEE}.Installer|x64.ActiveCfg = Release|x64
{530890F8-CBCB-4DAB-BEDF-9FB667D0AFEE}.Installer|x64.Build.0 = Release|x64
{530890F8-CBCB-4DAB-BEDF-9FB667D0AFEE}.Installer|x86.ActiveCfg = Release|Win32
Expand Down
2 changes: 2 additions & 0 deletions MediaPoint_App/App.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
<converters:ExtendedBooleanToVisibility x:Key="ExtraBoolToVisibilityConverter"></converters:ExtendedBooleanToVisibility>
<converters:StringNotEmptyToVisibilityConverter x:Key="StringNotEmptyToVisibilityConverter"></converters:StringNotEmptyToVisibilityConverter>
<converters:IntegerBiggerThanToVisibilityConverter x:Key="IntegerBiggerThanToVisibilityConverter"></converters:IntegerBiggerThanToVisibilityConverter>
<converters:FullscreenPaddingConverter x:Key="FullscreenPaddingConverter"/>
<converters:LanguageToFlagConverter x:Key="LanguageToFlagConverter"/>
<converters:MultiplyWithConverter x:Key="MultiplyWithConverter"/>
</ResourceDictionary>
<ResourceDictionary Source="/Themes/default/style.xaml"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Input;

namespace MediaPoint.App.AttachedProperties
{
public class InputBindingCommandSetter
{
public static readonly DependencyProperty CommandProperty =
DependencyProperty.RegisterAttached("Command",
typeof(ICommand), typeof(InputBindingCommandSetter), new PropertyMetadata(new PropertyChangedCallback(CommandChanged)));

private static void CommandChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
SetCommand(d as InputBinding, (ICommand)e.NewValue);
}

public static ICommand GetCommand(InputBinding element)
{
return (ICommand)element.GetValue(CommandProperty);
}

public static void SetCommand(InputBinding element, ICommand value)
{
element.SetValue(CommandProperty, value);
element.Command = value;
}
}

public class ItemsControlDoubleClickMouseInputBinding : DependencyObject
{
public ItemsControlDoubleClickMouseInputBinding() { }

public static readonly DependencyProperty EnabledProperty =
DependencyProperty.RegisterAttached("Enabled",
typeof(bool), typeof(ItemsControlDoubleClickMouseInputBinding), new PropertyMetadata(new PropertyChangedCallback(EnabledChanged)));

private static void EnabledChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
SetEnabled(d as ItemsControl, (bool)e.NewValue);
}

public static bool GetEnabled(ItemsControl element)
{
return (bool)element.GetValue(EnabledProperty);
}

public static void SetEnabled(ItemsControl element, bool value)
{
element.SetValue(EnabledProperty, value);

if (value)
{
element.PreviewMouseDoubleClick += element_PreviewMouseDoubleClick;
}
else
{
element.PreviewMouseDoubleClick -= element_PreviewMouseDoubleClick;
}
}

public static readonly DependencyProperty RestrictToProperty =
DependencyProperty.RegisterAttached("RestrictTo",
typeof(string), typeof(ItemsControlDoubleClickMouseInputBinding));

public static string GetRestrictTo(ItemsControl element)
{
return (string)element.GetValue(RestrictToProperty);
}

public static void SetRestrictTo(ItemsControl element, string value)
{
element.SetValue(RestrictToProperty, value);
}

static void element_PreviewMouseDoubleClick(object sender, MouseButtonEventArgs e)
{
ItemsControl control = sender as ItemsControl;

foreach (InputBinding b in control.InputBindings)
{
if (!(b is MouseBinding))
{
continue;
}

if (b.Gesture != null
&& b.Gesture is MouseGesture
&& ((MouseGesture)b.Gesture).MouseAction == MouseAction.LeftDoubleClick
&& b.Command.CanExecute(null))
{
b.Command.Execute(b.CommandParameter);
e.Handled = true;
}
}
}

}
}
10 changes: 10 additions & 0 deletions MediaPoint_App/Behaviors/FullScreenBehavior.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
using System.Windows.Interop;
using System.Windows.Media;
using MediaPoint.App.Extensions;
using MediaPoint.VM;

namespace MediaPoint.App.Behaviors
{
Expand Down Expand Up @@ -162,12 +163,20 @@ private static void OnIsFullScreenChanged(DependencyObject sender, DependencyPro
window.MaxHeight = Int32.MaxValue;
window.MaxWidth = Int32.MaxValue;
window.WindowState = WindowState.Maximized;
if (window.DataContext is Main)
{
(window.DataContext as Main).IsMaximized = true;
}
} // if
else
{
window.Topmost = false;
window.WindowStyle = (WindowStyle)window.Tag; //WindowStyle.SingleBorderWindow;
window.WindowState = WindowState.Normal;
if (window.DataContext is Main)
{
(window.DataContext as Main).IsMaximized = false;
}
} // else

} // if
Expand Down Expand Up @@ -316,6 +325,7 @@ private void Window_MouseDoubleClick(object sender, MouseButtonEventArgs e)
if (e.Handled == false)
{
var ics = (e.OriginalSource as UIElement).TryFindParent<DependencyObject>(typeof (ICommandSource));
if (ics == null) ics = (e.OriginalSource as UIElement).TryFindParent<DependencyObject>(typeof(System.Windows.Controls.Primitives.Selector));
if (FullScreenOnDoubleClick && ics == null)
{
bool current = GetIsFullScreen(_wnd);
Expand Down
7 changes: 7 additions & 0 deletions MediaPoint_App/Behaviors/HyperlinkOpenAction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@ protected override void Invoke(object parameter)
{
RequestNavigateEventArgs e = (RequestNavigateEventArgs)parameter;
Uri u = (AssociatedObject as Hyperlink).NavigateUri;

var w = Window.GetWindow(AssociatedObject as Hyperlink) as Window1;
if (FullScreenBehavior.GetIsFullScreen(w))
{
FullScreenBehavior.SetIsFullScreen(w, false);
}

Process.Start(new ProcessStartInfo(u.AbsoluteUri));
e.Handled = true;
}
Expand Down
40 changes: 40 additions & 0 deletions MediaPoint_App/Converters/FullscreenPaddingConverter.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Data;
using System.Windows.Media;
using MediaPoint.Controls.Extensions;

namespace MediaPoint.Converters
{
public class FullscreenPaddingConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
var w = value as Window;

if (w == null) return 0;

Size actual = new Size(w.ActualWidth, w.ActualHeight);
var source = PresentationSource.FromVisual(w);
Matrix transformFromDevice = source.CompositionTarget.TransformFromDevice;
Size monitor = MediaPoint.Controls.Extensions.WindowExtensions.MonitorSize(ref w, transformFromDevice);
//w.Visibility = Visibility.Collapsed;
//w.Dispatcher.BeginInvoke((Action)(() =>
//{

//}), System.Windows.Threading.DispatcherPriority.ContextIdle);
var s = actual.Difference(monitor);
//var ret2 = new Thickness(s.Width / 2, s.Height / 2, s.Width / 2, s.Height / 2);
//System.Diagnostics.Debug.WriteLine(ret2.ToString());
return s.Width / 2;
}

public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
return !(bool)value;
}
}
}
26 changes: 26 additions & 0 deletions MediaPoint_App/Converters/LanguageToFlagConverter.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Data;
using System.Windows.Media;
using System.Windows.Media.Imaging;

namespace MediaPoint.Converters
{
public class LanguageToFlagConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
if (value == null) return null;

var uri = new Uri("pack://application:,,,/MediaPoint;component/Images/countryflags/" + value.ToString() + ".gif", UriKind.RelativeOrAbsolute);
return new BitmapImage(uri);
}

public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
return null;
}
}
}
Binary file added MediaPoint_App/Images/countryflags/alb.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MediaPoint_App/Images/countryflags/ara.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MediaPoint_App/Images/countryflags/bel.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MediaPoint_App/Images/countryflags/bos.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MediaPoint_App/Images/countryflags/bul.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MediaPoint_App/Images/countryflags/cat.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MediaPoint_App/Images/countryflags/chi.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MediaPoint_App/Images/countryflags/cze.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MediaPoint_App/Images/countryflags/dan.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MediaPoint_App/Images/countryflags/dut.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MediaPoint_App/Images/countryflags/eng.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MediaPoint_App/Images/countryflags/est.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MediaPoint_App/Images/countryflags/fin.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MediaPoint_App/Images/countryflags/fre.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MediaPoint_App/Images/countryflags/ger.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MediaPoint_App/Images/countryflags/gle.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MediaPoint_App/Images/countryflags/gre.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MediaPoint_App/Images/countryflags/heb.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MediaPoint_App/Images/countryflags/hin.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MediaPoint_App/Images/countryflags/hrv.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MediaPoint_App/Images/countryflags/hun.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MediaPoint_App/Images/countryflags/ice.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MediaPoint_App/Images/countryflags/ind.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MediaPoint_App/Images/countryflags/ita.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MediaPoint_App/Images/countryflags/jpn.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MediaPoint_App/Images/countryflags/kor.gif
Binary file added MediaPoint_App/Images/countryflags/lav.gif
Binary file added MediaPoint_App/Images/countryflags/lit.gif
Binary file added MediaPoint_App/Images/countryflags/mac.gif
Binary file added MediaPoint_App/Images/countryflags/nor.gif
Binary file added MediaPoint_App/Images/countryflags/per.gif
Binary file added MediaPoint_App/Images/countryflags/pol.gif
Binary file added MediaPoint_App/Images/countryflags/por.gif
Binary file added MediaPoint_App/Images/countryflags/rum.gif
Binary file added MediaPoint_App/Images/countryflags/rus.gif
Binary file added MediaPoint_App/Images/countryflags/slo.gif
Binary file added MediaPoint_App/Images/countryflags/slv.gif
Binary file added MediaPoint_App/Images/countryflags/spa.gif
Binary file added MediaPoint_App/Images/countryflags/srp.gif
Binary file added MediaPoint_App/Images/countryflags/swe.gif
Binary file added MediaPoint_App/Images/countryflags/tha.gif
Binary file added MediaPoint_App/Images/countryflags/tur.gif
Binary file added MediaPoint_App/Images/countryflags/ukr.gif
Binary file added MediaPoint_App/Images/countryflags/vie.gif
Loading

0 comments on commit d656993

Please sign in to comment.