diff --git a/PSPSync/App.config b/PSPSync/App.config index 8324aa6..4bfa005 100644 --- a/PSPSync/App.config +++ b/PSPSync/App.config @@ -1,6 +1,6 @@ - + - + - \ No newline at end of file + diff --git a/PSPSync/PSPSync.csproj b/PSPSync/PSPSync.csproj index b85b0b7..2aab301 100644 --- a/PSPSync/PSPSync.csproj +++ b/PSPSync/PSPSync.csproj @@ -8,12 +8,13 @@ WinExe PSPSync PSPSync - v4.6 + v4.8 512 {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 4 true true + AnyCPU diff --git a/PSPSync/Properties/Resources.Designer.cs b/PSPSync/Properties/Resources.Designer.cs index 052405a..8987a30 100644 --- a/PSPSync/Properties/Resources.Designer.cs +++ b/PSPSync/Properties/Resources.Designer.cs @@ -1,69 +1,61 @@ //------------------------------------------------------------------------------ // -// Ten kod został wygenerowany przez narzędzie. -// Wersja środowiska uruchomieniowego: 4.0.30319.42000 +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 // -// Modyfikacje tego pliku mogą spowodować niewłaściwe zachowanie i zostaną utracone -// w przypadku ponownego wygenerowania kodu. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. // //------------------------------------------------------------------------------ -namespace PSPSync.Properties -{ - - +namespace PSPSync.Properties { + using System; + + /// - /// Silnie typizowana klasa zasobów do wyszukiwania zlokalizowanych ciągów itd. + /// A strongly-typed resource class, for looking up localized strings, etc. /// - // Ta klasa została automatycznie wygenerowana za pomocą klasy StronglyTypedResourceBuilder - // przez narzędzie, takie jak ResGen lub Visual Studio. - // Aby dodać lub usunąć składowe, edytuj plik ResX, a następnie ponownie uruchom narzędzie ResGen - // z opcją /str lub ponownie skompiluj projekt programu VS. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Resources - { - + internal class Resources { + private static global::System.Resources.ResourceManager resourceMan; - + private static global::System.Globalization.CultureInfo resourceCulture; - + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal Resources() - { + internal Resources() { } - + /// - /// Zwraca buforowane wystąpienie składnika ResourceManager używane przez tę klasę. + /// Returns the cached ResourceManager instance used by this class. /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager - { - get - { - if ((resourceMan == null)) - { + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("PSPSync.Properties.Resources", typeof(Resources).Assembly); resourceMan = temp; } return resourceMan; } } - + /// - /// Przesłania właściwość CurrentUICulture bieżącego wątku dla wszystkich - /// przypadków przeszukiwania zasobów za pomocą tej silnie typizowanej klasy zasobów. + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture - { - get - { + internal static global::System.Globalization.CultureInfo Culture { + get { return resourceCulture; } - set - { + set { resourceCulture = value; } } diff --git a/PSPSync/Properties/Settings.Designer.cs b/PSPSync/Properties/Settings.Designer.cs index cbf710d..704f00f 100644 --- a/PSPSync/Properties/Settings.Designer.cs +++ b/PSPSync/Properties/Settings.Designer.cs @@ -8,21 +8,17 @@ // //------------------------------------------------------------------------------ -namespace PSPSync.Properties -{ - - +namespace PSPSync.Properties { + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] - internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase - { - + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.7.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); - - public static Settings Default - { - get - { + + public static Settings Default { + get { return defaultInstance; } } diff --git a/PSPSync/SDs/PSPSaveDir.cs b/PSPSync/SDs/PSPSaveDir.cs index ca98e90..194d2c2 100644 --- a/PSPSync/SDs/PSPSaveDir.cs +++ b/PSPSync/SDs/PSPSaveDir.cs @@ -111,21 +111,23 @@ public NamedStream[] ReadSave(string directory) { public void WriteSave(string directoryName, NamedStream[] files) { - string dr = mainDir + "/" + directoryName; + const int BUFFER_SIZE = int.MaxValue; + string dr = mainDir + directoryName; if (!Directory.Exists(dr)) { Directory.CreateDirectory(dr); } - foreach (NamedStream stm in files) { - FileStream a = File.Create(dr + "/" + stm.name); - long rem = stm.stream.Length; + foreach (NamedStream file in files) { + FileStream a = File.Create(dr + "/" + file.name); int offset = 0; - byte[] read = new byte[1000000]; - while (rem > 0) { - stm.stream.Read(read, offset, (int)Math.Min(rem, 1000000)); - a.Write(read, offset, (int)Math.Min(rem, 1000000)); - rem -= Math.Min(rem, 1000000); - offset += 1000000; + long bytesRemaining = file.stream.Length; + byte[] readBuffer = new byte[Math.Min(bytesRemaining, BUFFER_SIZE)]; + while (bytesRemaining > 0) + { + int bytesRed = file.stream.Read(readBuffer, offset, (int)Math.Min(bytesRemaining, BUFFER_SIZE)); + a.Write(readBuffer, offset, bytesRed); + bytesRemaining -= bytesRed; + offset += bytesRed; } a.Close(); }