Code cleanup

This commit is contained in:
Gustave Monce
2019-12-22 12:25:48 +01:00
parent 0e6f905809
commit a2a1c2302b
149 changed files with 3980 additions and 4088 deletions
+2 -2
View File
@@ -19,10 +19,10 @@
// DEALINGS IN THE SOFTWARE.
using System;
using System.Linq;
using System.Windows;
using System.IO;
using System.Linq;
using System.Threading;
using System.Windows;
namespace WPinternals
{
-2
View File
@@ -22,9 +22,7 @@
namespace DiscUtils
{
using System;
using System.Collections.Generic;
using System.Text;
internal class BlockCache<T>
where T : Block, new()
@@ -22,10 +22,10 @@
namespace DiscUtils.BootConfig
{
using DiscUtils.Registry;
using System;
using System.Collections.Generic;
using System.Globalization;
using DiscUtils.Registry;
internal class DiscUtilsRegistryStorage : BaseStorage
{
-1
View File
@@ -23,7 +23,6 @@
namespace DiscUtils.BootConfig
{
using System;
using System.Globalization;
/// <summary>
/// The value of an element.
-4
View File
@@ -22,10 +22,6 @@
namespace DiscUtils.BootConfig
{
using System;
using System.Collections.Generic;
using System.Text;
/// <summary>
/// Indicates the type of objects that can inherit from an object.
/// </summary>
+1 -1
View File
@@ -22,9 +22,9 @@
namespace DiscUtils.BootConfig
{
using DiscUtils.Registry;
using System;
using System.Collections.Generic;
using DiscUtils.Registry;
/// <summary>
/// Represents a Boot Configuration Database store (i.e. a BCD file).
-2
View File
@@ -22,9 +22,7 @@
namespace DiscUtils
{
using System;
using System.Collections.Generic;
using System.Text;
internal class BuilderSparseStreamExtent : BuilderExtent
{
-1
View File
@@ -24,7 +24,6 @@ namespace DiscUtils
{
using System;
using System.Collections.Generic;
using System.Text;
/// <summary>
/// Enumeration of possible cluster roles.
-1
View File
@@ -24,7 +24,6 @@ namespace DiscUtils.Fat
{
using System;
using System.IO;
using System.Text;
internal class DirectoryEntry
{
-1
View File
@@ -22,7 +22,6 @@
namespace DiscUtils.Fat
{
using System;
using System.IO;
internal class FileAllocationTable
+1 -1
View File
@@ -22,8 +22,8 @@
namespace DiscUtils.Fat
{
using System.IO;
using DiscUtils.Vfs;
using System.IO;
[VfsFileSystemFactory]
internal class FileSystemFactory : VfsFileSystemFactory
+1 -1
View File
@@ -22,9 +22,9 @@
namespace DiscUtils.LogicalDiskManager
{
using DiscUtils.Partitions;
using System;
using System.IO;
using DiscUtils.Partitions;
internal class DynamicDisk : IDiagnosticTraceable
{
@@ -22,11 +22,11 @@
namespace DiscUtils.LogicalDiskManager
{
using DiscUtils.Partitions;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using DiscUtils.Partitions;
internal class DynamicDiskGroup : IDiagnosticTraceable
{
@@ -22,9 +22,9 @@
namespace DiscUtils.LogicalDiskManager
{
using DiscUtils.Partitions;
using System.Collections.Generic;
using System.IO;
using DiscUtils.Partitions;
/// <summary>
/// A class that understands Windows LDM structures, mapping physical volumes to logical volumes.
-2
View File
@@ -22,8 +22,6 @@
namespace DiscUtils.LogicalDiskManager
{
using System;
internal class TocBlock
{
public string Signature; // TOCBLOCK
-1
View File
@@ -22,7 +22,6 @@
namespace DiscUtils
{
using System;
using System.Collections.Generic;
using System.IO;
+1 -1
View File
@@ -22,10 +22,10 @@
namespace DiscUtils.Ntfs
{
using DiscUtils.Compression;
using System;
using System.Collections.Generic;
using System.IO;
using DiscUtils.Compression;
internal sealed class CompressedClusterStream : ClusterStream
{
-1
View File
@@ -23,7 +23,6 @@
namespace DiscUtils.Ntfs
{
using System;
using System.Collections.Generic;
internal class CookedDataRun
{
-1
View File
@@ -23,7 +23,6 @@
namespace DiscUtils.Ntfs
{
using System.Globalization;
using System.IO;
internal class DataRun
{
-1
View File
@@ -24,7 +24,6 @@ namespace DiscUtils.Ntfs
{
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.IO;
[Flags]
+1 -1
View File
@@ -22,8 +22,8 @@
namespace DiscUtils.Ntfs
{
using System.IO;
using DiscUtils.Vfs;
using System.IO;
[VfsFileSystemFactory]
internal class FileSystemFactory : VfsFileSystemFactory
-1
View File
@@ -22,7 +22,6 @@
namespace DiscUtils.Ntfs
{
using System;
using System.IO;
internal abstract class FixupRecordBase
-1
View File
@@ -23,7 +23,6 @@
namespace DiscUtils.Ntfs
{
using System;
using System.Collections.Generic;
using System.IO;
internal class IndexBlock : FixupRecordBase
@@ -1,9 +1,5 @@
namespace DiscUtils.Ntfs.Internals
{
using System;
using System.Collections.Generic;
using System.Text;
public sealed class MasterFileTableAttribute
{
}
@@ -22,10 +22,6 @@
namespace DiscUtils.Ntfs.Internals
{
using System.Collections;
using System.Collections.Generic;
using System.IO;
public sealed class MasterFileTableRecord
{
private FileRecord _fileRecord;
@@ -22,8 +22,6 @@
namespace DiscUtils.Ntfs.Internals
{
using System;
/// <summary>
/// The known NTFS namespaces.
/// </summary>
+1 -1
View File
@@ -30,8 +30,8 @@
namespace DiscUtils.Ntfs
{
using System;
using DiscUtils.Compression;
using System;
/// <summary>
/// Implementation of the LZNT1 algorithm used for compressing NTFS files.
-1
View File
@@ -25,7 +25,6 @@ namespace DiscUtils.Ntfs
using System;
using System.Collections.Generic;
using System.IO;
using DiscUtils.Compression;
internal class NonResidentDataBuffer : DiscUtils.Buffer, IMappedBuffer
{
-1
View File
@@ -22,7 +22,6 @@
namespace DiscUtils.Ntfs
{
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
-1
View File
@@ -22,7 +22,6 @@
namespace DiscUtils.Ntfs
{
using System;
using System.Collections.Generic;
using System.IO;
-2
View File
@@ -23,8 +23,6 @@
namespace DiscUtils.Ntfs
{
using System;
using System.Collections.Generic;
using System.Text;
internal sealed class NtfsTransaction : IDisposable
{
+1 -1
View File
@@ -22,11 +22,11 @@
namespace DiscUtils.Ntfs
{
using DiscUtils;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using DiscUtils;
/// <summary>
/// Low-level non-resident attribute operations.
-2
View File
@@ -22,10 +22,8 @@
namespace DiscUtils.Ntfs
{
using System;
using System.IO;
using System.Security.AccessControl;
using System.Security.Principal;
internal sealed class SecurityDescriptor : IByteArraySerializable, IDiagnosticTraceable
{
-4
View File
@@ -22,10 +22,6 @@
namespace DiscUtils.Ntfs
{
using System;
using System.Collections.Generic;
using System.Text;
/// <summary>
/// Controls whether short file names are created automatically.
/// </summary>
-1
View File
@@ -22,7 +22,6 @@
namespace DiscUtils.Ntfs
{
using System;
using System.IO;
internal sealed class VolumeInformation : IByteArraySerializable, IDiagnosticTraceable
-1
View File
@@ -22,7 +22,6 @@
namespace DiscUtils.Ntfs
{
using System;
using System.IO;
using System.Text;
-1
View File
@@ -23,7 +23,6 @@
namespace DiscUtils
{
using System;
using System.Collections;
using System.Collections.Generic;
/// <summary>
-4
View File
@@ -22,10 +22,6 @@
namespace DiscUtils
{
using System;
using System.Collections.Generic;
using System.Text;
/// <summary>
/// Enumeration used to indicate transfer of disposable objects.
/// </summary>
@@ -23,7 +23,6 @@
namespace DiscUtils.Partitions
{
using System;
using System.IO;
/// <summary>
/// Provides access to partition records in a BIOS (MBR) partition table.
@@ -24,7 +24,6 @@ namespace DiscUtils.Partitions
{
using System;
using System.Collections.Generic;
using System.IO;
/// <summary>
/// Builds a stream with the contents of a BIOS partitioned disk.
@@ -23,7 +23,6 @@
namespace DiscUtils.Partitions
{
using System;
using System.IO;
/// <summary>
/// Provides access to partition records in a GUID partition table.
-1
View File
@@ -24,7 +24,6 @@ namespace DiscUtils.Partitions
{
using System;
using System.Globalization;
using System.IO;
/// <summary>
/// Base class representing a disk partition.
+1 -1
View File
@@ -22,9 +22,9 @@
namespace DiscUtils
{
using DiscUtils.Partitions;
using System;
using System.Globalization;
using DiscUtils.Partitions;
/// <summary>
/// Enumeration of possible types of physical volume.
-1
View File
@@ -24,7 +24,6 @@ namespace DiscUtils
{
using System;
using System.Collections.Generic;
using System.Text;
/// <summary>
/// Represents a range of values.
-1
View File
@@ -23,7 +23,6 @@
namespace DiscUtils.Raw
{
using System;
using System.Collections.Generic;
using System.IO;
[VirtualDiskFactory("RAW", ".img,.ima,.vfd,.flp,.bif")]
+1 -1
View File
@@ -22,9 +22,9 @@
namespace DiscUtils.Raw
{
using DiscUtils.Partitions;
using System;
using System.IO;
using DiscUtils.Partitions;
/// <summary>
/// Represents a single raw disk image file.
-1
View File
@@ -22,7 +22,6 @@
namespace DiscUtils.Registry
{
using System;
using System.IO;
internal sealed class BinHeader : IByteArraySerializable
-1
View File
@@ -22,7 +22,6 @@
namespace DiscUtils
{
using System.Collections.Generic;
using System.IO;
/// <summary>
-2
View File
@@ -22,8 +22,6 @@
namespace DiscUtils
{
using System;
internal abstract class Tuple
{
public abstract object this[int i]
-2
View File
@@ -22,8 +22,6 @@
namespace DiscUtils
{
using System;
/// <summary>
/// Standard Unix-style file type.
/// </summary>
@@ -23,8 +23,6 @@
namespace DiscUtils.Vfs
{
using System;
using System.Collections.Generic;
using System.Text;
/// <summary>
/// Attribute identifying file system factory classes.
+1 -1
View File
@@ -22,11 +22,11 @@
namespace DiscUtils
{
using DiscUtils.Partitions;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using DiscUtils.Partitions;
/// <summary>
/// Base class representing virtual hard disks.
+1 -1
View File
@@ -22,11 +22,11 @@
namespace DiscUtils
{
using DiscUtils.Partitions;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using DiscUtils.Partitions;
/// <summary>
/// VolumeManager interprets partitions and other on-disk structures (possibly combining multiple disks).
+6 -7
View File
@@ -22,25 +22,24 @@
// Where possible the original authors are referenced.
using System;
using System.IO;
using System.Collections;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.IO.Compression;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading;
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.Animation;
using System.Windows.Media.Imaging;
using System.Threading;
using System.Windows.Input;
using System.Windows.Threading;
using System.IO.Compression;
using System.Collections;
using System.Reflection;
using System.Net;
namespace WPinternals
{
+5 -5
View File
@@ -20,15 +20,15 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Runtime.Serialization;
using System.Runtime.Serialization.Json;
using System.Net;
using System.Net.Http;
using System.Net.Http.Headers;
using System.IO;
using System.Runtime.Serialization;
using System.Runtime.Serialization.Json;
using System.Text;
using System.Threading.Tasks;
using System.Xml;
using System.Xml.Serialization;
+3 -3
View File
@@ -18,10 +18,10 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System;
using System.Runtime.InteropServices;
using System.Runtime.ConstrainedExecution;
using Microsoft.Win32.SafeHandles;
using System;
using System.Runtime.ConstrainedExecution;
using System.Runtime.InteropServices;
using System.Security;
namespace WPinternals
+2 -2
View File
@@ -21,15 +21,15 @@
using System;
using System.Collections.Specialized;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.ConstrainedExecution;
using System.Runtime.InteropServices;
using System.Threading;
namespace WPinternals
{
using Luid = NativeMethods.LUID;
using Win32Exception = System.ComponentModel.Win32Exception;
using PrivilegeNotHeldException = System.Security.AccessControl.PrivilegeNotHeldException;
using Win32Exception = System.ComponentModel.Win32Exception;
internal delegate void PrivilegedCallback(object state);
-2
View File
@@ -1,6 +1,4 @@
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Windows;
+2 -1
View File
@@ -111,7 +111,8 @@ namespace WPinternals
catch (Exception Ex)
{
IsSwitchingInterface = false;
ActivateSubContext(new MessageViewModel(Ex.Message, () => {
ActivateSubContext(new MessageViewModel(Ex.Message, () =>
{
Callback();
Refresh();
}));
+2 -1
View File
@@ -82,7 +82,8 @@ namespace WPinternals
}
catch (Exception Ex)
{
ActivateSubContext(new MessageViewModel(Ex.Message, () => {
ActivateSubContext(new MessageViewModel(Ex.Message, () =>
{
Callback();
ActivateSubContext(null);
}));
-2
View File
@@ -18,8 +18,6 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System.Threading;
namespace WPinternals
{
internal class NokiaMassStorageViewModel : ContextViewModel
-4
View File
@@ -19,11 +19,7 @@
// DEALINGS IN THE SOFTWARE.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace WPinternals
{
@@ -19,7 +19,6 @@
// DEALINGS IN THE SOFTWARE.
using System;
using System.Collections.Generic;
namespace WPinternals
{
+4 -2
View File
@@ -256,7 +256,8 @@ namespace WPinternals
// It is not possible to invoke COM objects from a WndProc.
// MassStorage uses ManagementObjectSearcher, which is a COM object.
// Therefore we use a new thread.
ThreadPool.QueueUserWorkItem(s => {
ThreadPool.QueueUserWorkItem(s =>
{
lock (ModelLock)
{
if (!(CurrentModel is MassStorage))
@@ -392,7 +393,8 @@ namespace WPinternals
(e.DevicePath.IndexOf("VID_05C6&PID_9008", StringComparison.OrdinalIgnoreCase) >= 0) ||
(e.DevicePath.IndexOf(@"disk&ven_qualcomm&prod_mmc_storage", StringComparison.OrdinalIgnoreCase) >= 0) ||
(e.DevicePath.IndexOf(@"DISK&VEN_MSFT&PROD_PHONE_MMC_STOR", StringComparison.OrdinalIgnoreCase) >= 0)
) {
)
{
if (CurrentInterface != null)
LastInterface = CurrentInterface;
CurrentInterface = null;
+2 -1
View File
@@ -149,7 +149,8 @@ namespace WPinternals
}
else
{
UIContext.Post(s => {
UIContext.Post(s =>
{
ModeSwitchProgress(Message, SubMessage);
SetWorkingStatus(Message, SubMessage);
}, null);
+1 -2
View File
@@ -22,9 +22,8 @@ using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Xml.Serialization;
using System.Security.Cryptography;
using System.Windows;
using System.Xml.Serialization;
namespace WPinternals
{
+1 -4
View File
@@ -6,11 +6,8 @@
*/
using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime;
using System.Runtime.InteropServices;
using System.ComponentModel;
using System.Runtime.InteropServices;
namespace MadWizard.WinUSBNet.API
-5
View File
@@ -5,11 +5,6 @@
* http://www.opensource.org/licenses/mit-license.php
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace MadWizard.WinUSBNet.API
{
internal struct DeviceDetails
+1 -1
View File
@@ -10,8 +10,8 @@
*/
using System;
using System.Runtime.InteropServices;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using System.Text.RegularExpressions;
namespace MadWizard.WinUSBNet.API
+1 -1
View File
@@ -9,8 +9,8 @@
* See http://www.lvr.com/winusb.htm for more information
*/
using System;
using Microsoft.Win32.SafeHandles;
using System;
using System.Runtime.InteropServices;
namespace MadWizard.WinUSBNet.API
+2 -3
View File
@@ -9,12 +9,11 @@
* See http://www.lvr.com/winusb.htm for more information
*/
using System;
using Microsoft.Win32.SafeHandles;
using System.Runtime.InteropServices;
using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using System.Threading;
using System.ComponentModel;
namespace MadWizard.WinUSBNet.API
{
+1 -1
View File
@@ -9,8 +9,8 @@
* See http://www.lvr.com/winusb.htm for more information
*/
using System;
using Microsoft.Win32.SafeHandles;
using System;
using System.Runtime.InteropServices;
using System.Threading;
-3
View File
@@ -6,9 +6,6 @@
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Interop;
-3
View File
@@ -5,9 +5,6 @@
* http://www.opensource.org/licenses/mit-license.php
*/
using System;
namespace MadWizard.WinUSBNet
{
/// <summary>
-3
View File
@@ -6,9 +6,6 @@
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
namespace MadWizard.WinUSBNet
{
-1
View File
@@ -7,7 +7,6 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace MadWizard.WinUSBNet
{
-2
View File
@@ -6,8 +6,6 @@
*/
using System;
using System.Collections.Generic;
using System.Text;
namespace MadWizard.WinUSBNet
{
-5
View File
@@ -5,11 +5,6 @@
* http://www.opensource.org/licenses/mit-license.php
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace MadWizard.WinUSBNet
{
/// <summary>
-2
View File
@@ -6,8 +6,6 @@
*/
using System;
using System.Collections.Generic;
using System.Text;
namespace MadWizard.WinUSBNet
{
-2
View File
@@ -6,8 +6,6 @@
*/
using System;
using System.Collections.Generic;
using System.Text;
namespace MadWizard.WinUSBNet
{
-1
View File
@@ -6,7 +6,6 @@
*/
using System;
using System.Text;
using System.Collections;
using System.Collections.Generic;
-3
View File
@@ -6,9 +6,6 @@
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace MadWizard.WinUSBNet
{
-2
View File
@@ -6,8 +6,6 @@
*/
using System;
using System.Collections.Generic;
using System.Text;
namespace MadWizard.WinUSBNet
{
-1
View File
@@ -6,7 +6,6 @@
*/
using System;
using System.Text;
using System.Collections;
using System.Collections.Generic;
-3
View File
@@ -6,9 +6,6 @@
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace MadWizard.WinUSBNet
{