/// The number property.\r
/// </summary>\r
public static readonly DependencyProperty NumberProperty = DependencyProperty.Register(\r
- "Number", typeof(int), typeof(TimeSpanBox), new PropertyMetadata(OnNumberChanged));\r
+ "Number", typeof(long), typeof(TimeSpanBox), new PropertyMetadata(OnNumberChanged));\r
\r
/// <summary>\r
/// The show time span property.\r
/// <summary>\r
/// Gets or sets the number.\r
/// </summary>\r
- public int Number\r
+ public long Number\r
{\r
get\r
{\r
- return (int)this.GetValue(NumberProperty);\r
+ return (long)this.GetValue(NumberProperty);\r
}\r
\r
set\r
/// </summary>\r
private void DecrementNumber()\r
{\r
- int newNumber;\r
+ long newNumber;\r
if (this.AllowEmpty && this.Number == 0)\r
{\r
newNumber = Math.Min(this.Maximum, -this.Increment);\r
/// </summary>\r
private void IncrementNumber()\r
{\r
- int newNumber;\r
+ long newNumber;\r
if (this.AllowEmpty && this.Number == 0)\r
{\r
newNumber = Math.Max(this.Minimum, this.Increment);\r
--- /dev/null
+// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="LongToIntConverter.cs" company="HandBrake Project (http://handbrake.fr)">
+// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.
+// </copyright>
+// <summary>
+// Defines the FullPathToFileNameConverter type.
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrakeWPF.Converters
+{
+ using System;
+ using System.Globalization;
+ using System.Windows.Data;
+
+ public class LongToIntConverter : IValueConverter
+ {
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ if (value != null && value is long && (long)value <= int.MaxValue)
+ {
+ long result = (long)value;
+ return (int)result;
+ }
+
+ return (int)0;
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ throw new NotImplementedException();
+ }
+ }
+}
<Compile Include="Converters\Filters\DenoisePresetConverter.cs" />\r
<Compile Include="Converters\Filters\SharpenTuneConverter.cs" />\r
<Compile Include="Converters\Filters\SharpenPresetConverter.cs" />\r
+ <Compile Include="Converters\LongToIntConverter.cs" />\r
<Compile Include="Converters\Options\FileSizeConverter.cs" />\r
<Compile Include="Converters\Options\LogLevelConverter.cs" />\r
<Compile Include="Converters\OptionTabConverter.cs" />\r
/// <summary>
/// Gets or sets StartPoint.
/// </summary>
- public int StartPoint { get; set; }
+ public long StartPoint { get; set; }
/// <summary>
/// Gets or sets EndPoint.
/// </summary>
- public int EndPoint { get; set; }
+ public long EndPoint { get; set; }
#endregion
/// <param name="startPoint">The Start Point (Chapters)</param>
/// <param name="endPoint">The End Point (Chapters)</param>
/// <returns>A Timespan</returns>
- public TimeSpan CalculateDuration(int startPoint, int endPoint)
+ public TimeSpan CalculateDuration(long startPoint, long endPoint)
{
IEnumerable<Chapter> chapers =
this.Chapters.Where(c => c.ChapterNumber >= startPoint && c.ChapterNumber <= endPoint);
{\r
get\r
{\r
- return this.CurrentTask.StartPoint;\r
+ return this.CurrentTask.Angle;\r
}\r
\r
set\r
/// <summary>\r
/// Gets or sets SelectedStartPoint.\r
/// </summary>\r
- public int SelectedStartPoint\r
+ public long SelectedStartPoint\r
{\r
get\r
{\r
return this.CurrentTask.StartPoint;\r
}\r
+\r
set\r
{\r
this.CurrentTask.StartPoint = value;\r
/// <summary>\r
/// Gets or sets SelectedEndPoint.\r
/// </summary>\r
- public int SelectedEndPoint\r
+ public long SelectedEndPoint\r
{\r
get\r
{\r
return this.CurrentTask.EndPoint;\r
}\r
+\r
set\r
{\r
this.CurrentTask.EndPoint = value;\r
// Update the Main Window\r
this.NotifyOfPropertyChange(() => this.Destination);\r
this.SelectedAngle = this.CurrentTask.Angle;\r
- int start = this.CurrentTask.StartPoint;\r
- int end = this.CurrentTask.EndPoint;\r
+ long start = this.CurrentTask.StartPoint;\r
+ long end = this.CurrentTask.EndPoint;\r
this.SelectedPointToPoint = this.CurrentTask.PointToPointMode; // Force reset.\r
this.SelectedStartPoint = start;\r
this.SelectedEndPoint = end;\r
<UserControl.Resources>\r
<Converters:BooleanConverter x:Key="booleanConverter" />\r
<Converters:PresetsMenuConverter x:Key="presetsMenuConverter"/>\r
+ <Converters:LongToIntConverter x:Key="longToIntConverter" />\r
\r
<Style TargetType="Button">\r
<Setter Property="Padding" Value="8,2" />\r
MinWidth="60"\r
Margin="5,0,0,0"\r
ItemsSource="{Binding StartEndRangeItems}"\r
- SelectedItem="{Binding SelectedStartPoint}"\r
+ SelectedItem="{Binding SelectedStartPoint, Converter={StaticResource longToIntConverter}}"\r
ToolTip="{x:Static Properties:ResourcesTooltips.MainView_StartPoint}"\r
Visibility="{Binding ShowTextEntryForPointToPointMode,\r
Converter={StaticResource boolToVisConverter},\r
MinWidth="60"\r
Margin="4,0,0,0"\r
ItemsSource="{Binding StartEndRangeItems}"\r
- SelectedItem="{Binding SelectedEndPoint}"\r
+ SelectedItem="{Binding SelectedEndPoint, Converter={StaticResource longToIntConverter}}"\r
ToolTip="{x:Static Properties:ResourcesTooltips.MainView_EndPoint}"\r
Visibility="{Binding ShowTextEntryForPointToPointMode,\r
Converter={StaticResource boolToVisConverter},\r