Skip to content

Commit

Permalink
Finishing touches.
Browse files Browse the repository at this point in the history
  • Loading branch information
RoqueDeicide committed Feb 19, 2016
1 parent 719e6a2 commit bac3876
Show file tree
Hide file tree
Showing 33 changed files with 885 additions and 849 deletions.
2 changes: 1 addition & 1 deletion Launcher/App.config
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
</configuration>
4 changes: 2 additions & 2 deletions Launcher/App.xaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Application
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:System="clr-namespace:System;assembly=mscorlib" x:Class="Launcher.App"
x:Class="Launcher.App"
StartupUri="MainWindow.xaml" Startup="StartUp">
<Application.Resources>
<Style x:Key="RefreshButtonStyle" TargetType="{x:Type Button}">
Expand All @@ -10,4 +10,4 @@
<Setter Property="Content" Value="P" />
</Style>
</Application.Resources>
</Application>
</Application>
6 changes: 1 addition & 5 deletions Launcher/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;
using Launcher.Logging;

Expand Down Expand Up @@ -44,4 +40,4 @@ private void StartUp(object sender, StartupEventArgs e)
};
}
}
}
}
5 changes: 2 additions & 3 deletions Launcher/CommandLineWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Test Command Line" Height="300" Width="300">
<Grid>
<TextBox x:Name="CommandLineTextBox" Margin="10" TextWrapping="Wrap"/>

<TextBox x:Name="CommandLineTextBox" Margin="10" TextWrapping="Wrap" />
</Grid>
</Window>
</Window>
13 changes: 1 addition & 12 deletions Launcher/CommandLineWindow.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,16 +1,5 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace Launcher
{
Expand All @@ -29,4 +18,4 @@ public CommandLineWindow(string line)
this.CommandLineTextBox.Text = line;
}
}
}
}
1 change: 1 addition & 0 deletions Launcher/Configs/ILaunchConfiguration.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using System.Linq;

namespace Launcher.Configs
{
Expand Down
4 changes: 2 additions & 2 deletions Launcher/Configs/LaunchConfiguration.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System;
using System.Collections.Generic;
using System.Diagnostics.Contracts;
using System.Globalization;
using System.IO;
using System.Linq;
Expand Down Expand Up @@ -405,7 +404,8 @@ public LaunchConfiguration()
}
#endregion
#region Utilities
// Creates a string that represents a path to the file that is properly recognized by the command line interpreter.
// Creates a string that represents a path to the file that is properly recognized by the command
// line interpreter.
private static string GetValidPath(string file, bool shorten)
{
var path = shorten ? Path.GetFileName(file) : file;
Expand Down
7 changes: 4 additions & 3 deletions Launcher/Databases/ContentTypes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;
using System.Xml;
using System.Xml.XPath;
Expand Down Expand Up @@ -46,7 +47,7 @@ public TextContent(string text)
/// Writes binary representation of this content to the stream.
/// </summary>
/// <param name="bw"><see cref="BinaryWriter"/> object that provides access to the stream.</param>
/// <exception cref="IOException">An I/O error occurs. </exception>
/// <exception cref="IOException">An I/O error occurs.</exception>
public override void ToBinary(BinaryWriter bw)
{
bw.WriteLongString(this.Text, Encoding.UTF8);
Expand All @@ -55,8 +56,8 @@ public override void ToBinary(BinaryWriter bw)
/// Reads binary data from the stream and converts it to format of this content.
/// </summary>
/// <param name="br"><see cref="BinaryReader"/> object that provides access to the stream.</param>
/// <exception cref="EndOfStreamException">The end of the stream is reached. </exception>
/// <exception cref="IOException">An I/O error occurs. </exception>
/// <exception cref="EndOfStreamException">The end of the stream is reached.</exception>
/// <exception cref="IOException">An I/O error occurs.</exception>
public override void FromBinary(BinaryReader br)
{
br.ReadLongString(Encoding.UTF8);
Expand Down
2 changes: 0 additions & 2 deletions Launcher/Databases/Database.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ public class Database : IEnumerable<string>, IEnumerable<DatabaseEntry>
private readonly SortedList<string, DatabaseEntry> TopLevelEntries;
#endregion
#region Properties

/// <summary>
/// Gets or sets the name of this database.
/// </summary>
Expand Down Expand Up @@ -113,7 +112,6 @@ public int Count
{
get { return this.TopLevelEntries.Count; }
}

#endregion
#region Events
#endregion
Expand Down
25 changes: 11 additions & 14 deletions Launcher/Extensions/BinaryIOExtension.cs
Original file line number Diff line number Diff line change
@@ -1,31 +1,30 @@
using System;
using System.IO;
using System.Linq;
using System.Text;

namespace Launcher.Extensions
{
/// <summary>
/// Provides extension methods for classes <see cref="BinaryWriter"/> and
/// <see cref="BinaryReader"/>
/// Provides extension methods for classes <see cref="BinaryWriter"/> and <see cref="BinaryReader"/>
/// </summary>
public static class BinaryIoExtension
{
/// <summary>
/// Writes a text to binary stream.
/// </summary>
/// <remarks>
/// This method writes 64-bit signed integer that represents a number of bytes
/// that represent the text. Text encoded in given encoding is written write after
/// the number.
/// This method writes 64-bit signed integer that represents a number of bytes that represent the
/// text. Text encoded in given encoding is written write after the number.
/// </remarks>
/// <param name="writer">
/// <see cref="BinaryWriter"/> object from which name this method is called.
/// </param>
/// <param name="s"> Text to write.</param>
/// <param name="encoding">Encoding to use.</param>
/// <returns>A number of written bytes.</returns>
/// <exception cref="IOException">An I/O error occurs. </exception>
/// <exception cref="ObjectDisposedException">The stream is closed. </exception>
/// <exception cref="IOException">An I/O error occurs.</exception>
/// <exception cref="ObjectDisposedException">The stream is closed.</exception>
public static long WriteLongString(this BinaryWriter writer, string s, Encoding encoding)
{
byte[] bytesOfText = encoding.GetBytes(s);
Expand All @@ -39,13 +38,11 @@ public static long WriteLongString(this BinaryWriter writer, string s, Encoding
/// <param name="reader">
/// <see cref="BinaryReader"/> object from which name this method is called.
/// </param>
/// <param name="s">
/// <see cref="string"/> object that will contain read text.
/// </param>
/// <param name="s"> <see cref="string"/> object that will contain read text.</param>
/// <param name="encoding">Encoding to use to parse bytes.</param>
/// <returns>Number of read bytes.</returns>
/// <exception cref="EndOfStreamException">The end of the stream is reached. </exception>
/// <exception cref="IOException">An I/O error occurs. </exception>
/// <exception cref="EndOfStreamException">The end of the stream is reached.</exception>
/// <exception cref="IOException">An I/O error occurs.</exception>
public static long ReadLongString(this BinaryReader reader, out string s, Encoding encoding)
{
long numberOfBytes = reader.ReadInt64();
Expand All @@ -65,8 +62,8 @@ public static long ReadLongString(this BinaryReader reader, out string s, Encodi
/// </param>
/// <param name="encoding">Encoding to use to parse bytes.</param>
/// <returns>Read text.</returns>
/// <exception cref="EndOfStreamException">The end of the stream is reached. </exception>
/// <exception cref="IOException">An I/O error occurs. </exception>
/// <exception cref="EndOfStreamException">The end of the stream is reached.</exception>
/// <exception cref="IOException">An I/O error occurs.</exception>
public static string ReadLongString(this BinaryReader reader, Encoding encoding)
{
long numberOfBytes = reader.ReadInt64();
Expand Down
12 changes: 6 additions & 6 deletions Launcher/ExtraControls/ExtraFilesSelectionBox.Buttons.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;
using System.Diagnostics;
using System.Linq;
using System.Windows;
using System.Windows.Controls;
Expand Down Expand Up @@ -61,7 +60,8 @@ private void ToggleFileSelection(object sender, RoutedEventArgs routedEventArgs)
// Remove the elements.
if (file.MoveButtons == null)
{
// This is another case of the button getting pressed with the file not being selected.
// This is another case of the button getting pressed with the file not being
// selected.
return;
}

Expand All @@ -72,8 +72,8 @@ private void ToggleFileSelection(object sender, RoutedEventArgs routedEventArgs)

var files = this.SelectedFiles;

// routedEventArgs is only null, if this method was called not via Click event, but when
// clearing the selection when selection list is already clear.
// routedEventArgs is only null, if this method was called not via Click event, but
// when clearing the selection when selection list is already clear.
if (files != null && routedEventArgs != null)
{
files.RemoveAt(selectionRowIndex);
Expand Down Expand Up @@ -232,8 +232,8 @@ where Grid.GetRow(child) == lowerRowIndex
private void UpdateTopBottomSpinners()
{
foreach (var topButton in from UIElement child in this.FilesSelectionGrid.Children
where child is SpinnerButtons
select child as SpinnerButtons)
where child is SpinnerButtons
select child as SpinnerButtons)
{
int position = Grid.GetRow(topButton);
topButton.AtTop = position == 0;
Expand Down
20 changes: 10 additions & 10 deletions Launcher/ExtraControls/ExtraFilesSelectionBox.xaml
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
<UserControl x:Name="userControl" x:Class="Launcher.ExtraFilesSelectionBox"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d" d:DesignWidth="300" Height="500">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="54*"/>
<RowDefinition Height="2*"/>
<RowDefinition Height="34*"/>
<RowDefinition Height="54*" />
<RowDefinition Height="2*" />
<RowDefinition Height="34*" />
</Grid.RowDefinitions>
<Border Grid.Row="0" BorderThickness="1" BorderBrush="{Binding BorderBrush, ElementName=userControl}">
<ScrollViewer HorizontalScrollBarVisibility="Visible">
<Grid x:Name="ExtraFilesGrid" Background="{DynamicResource {x:Static SystemColors.ControlBrushKey}}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="20"/>
<ColumnDefinition/>
<ColumnDefinition Width="20" />
<ColumnDefinition />
</Grid.ColumnDefinitions>
</Grid>
</ScrollViewer>
Expand All @@ -24,11 +24,11 @@
<ScrollViewer HorizontalScrollBarVisibility="Visible">
<Grid x:Name="FilesSelectionGrid" Background="{DynamicResource {x:Static SystemColors.ControlBrushKey}}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="20"/>
<ColumnDefinition Width="266*"/>
<ColumnDefinition Width="20" />
<ColumnDefinition Width="266*" />
</Grid.ColumnDefinitions>
</Grid>
</ScrollViewer>
</Border>
</Grid>
</UserControl>
</UserControl>
3 changes: 2 additions & 1 deletion Launcher/ExtraControls/LoadableFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ public TextBlock MainListText
set { this.mainListText = value; }
}
/// <summary>
/// Gets or sets an object that represents a set of 2 buttons that are used to move this file up and down the selection list.
/// Gets or sets an object that represents a set of 2 buttons that are used to move this file up
/// and down the selection list.
/// </summary>
[CanBeNull]
public SpinnerButtons MoveButtons
Expand Down
9 changes: 5 additions & 4 deletions Launcher/ExtraControls/NumericUpDown.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,12 @@ public class NumericUpDown : Control
DependencyProperty.Register("RestartPosition", typeof(int?), typeof(NumericUpDown),
new PropertyMetadata(default(int?)));
/// <summary>
/// A dependency property that represents the factor <see cref="Step"/> is multiplied by when incrementing/decrementing the <see cref="Value"/> while Shift key is pressed.
/// A dependency property that represents the factor <see cref="Step"/> is multiplied by when
/// incrementing/decrementing the <see cref="Value"/> while Shift key is pressed.
/// </summary>
public static readonly DependencyProperty ShiftStepMultiplierProperty =
DependencyProperty.Register("ShiftStepMultiplier", typeof(uint), typeof(NumericUpDown),
new PropertyMetadata(default(uint)));
new PropertyMetadata(default(uint)));
#endregion
private bool valueIsCommited;
private TextBox valueBox;
Expand Down Expand Up @@ -192,7 +193,8 @@ public int? RestartPosition
set { this.SetValue(RestartPositionProperty, value); }
}
/// <summary>
/// Gets or sets the factor <see cref="Step"/> is multiplied by when incrementing/decrementing the <see cref="Value"/> while Shift key is pressed.
/// Gets or sets the factor <see cref="Step"/> is multiplied by when incrementing/decrementing the
/// <see cref="Value"/> while Shift key is pressed.
/// </summary>
public uint ShiftStepMultiplier
{
Expand Down Expand Up @@ -357,7 +359,6 @@ private void AddValue(int value)
valueToCommit = (int)(currentValue + value * (shiftDown ? this.ShiftStepMultiplier : 1));
}


this.CommitNumber(valueToCommit);
}
private void CommitNumber(int value)
Expand Down
2 changes: 0 additions & 2 deletions Launcher/ExtraControls/SpinnerButton.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
using System;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
using System.Windows.Shapes;

namespace Launcher
{
Expand Down
11 changes: 1 addition & 10 deletions Launcher/ExtraControls/SpinnerButtons.cs
Original file line number Diff line number Diff line change
@@ -1,17 +1,8 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace Launcher
{
Expand Down Expand Up @@ -162,4 +153,4 @@ protected virtual void OnClickDown(RoutedEventArgs e)
}
#endregion
}
}
}
12 changes: 1 addition & 11 deletions Launcher/ExtraControls/TextBoxButton.cs
Original file line number Diff line number Diff line change
@@ -1,17 +1,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace Launcher
{
Expand All @@ -25,4 +15,4 @@ static TextBoxButton()
DefaultStyleKeyProperty.OverrideMetadata(typeof(TextBoxButton), new FrameworkPropertyMetadata(typeof(TextBoxButton)));
}
}
}
}
Loading

0 comments on commit bac3876

Please sign in to comment.