1
0
mirror of https://github.com/chylex/TweetDuck.git synced 2025-05-08 11:34:05 +02:00

More refactoring (seal classes, fix names and comments)

This commit is contained in:
chylex 2017-07-07 16:15:10 +02:00
parent 5a21d2cb10
commit c63e6a1e49
14 changed files with 15 additions and 16 deletions

View File

@ -1,7 +1,6 @@
using System;
using System.Drawing;
using System.IO;
using System.Linq;
using TweetDuck.Core;
using TweetDuck.Core.Controls;
using TweetDuck.Core.Notification;

View File

@ -4,7 +4,7 @@
using TweetDuck.Core.Utils;
namespace TweetDuck.Data{
class CombinedFileStream : IDisposable{
sealed class CombinedFileStream : IDisposable{
public const char KeySeparator = '|';
private readonly Stream stream;

View File

@ -2,7 +2,7 @@
using System.Text;
namespace TweetDuck.Data{
class CommandLineArgs{
sealed class CommandLineArgs{
public static CommandLineArgs FromStringArray(char entryChar, string[] array){
CommandLineArgs args = new CommandLineArgs();
ReadStringArray(entryChar, array, args);

View File

@ -1,7 +1,7 @@
using System;
namespace TweetDuck.Data{
class InjectedHTML{
sealed class InjectedHTML{
public enum Position{
Before, After
}

View File

@ -6,11 +6,11 @@
using System.Runtime.Serialization;
namespace TweetDuck.Data.Serialization{
class FileSerializer<T> where T : ISerializedObject{
sealed class FileSerializer<T> where T : ISerializedObject{
private const string NewLineReal = "\r\n";
private const string NewLineCustom = "\r~\n";
private static readonly ITypeConverter BasicSerializerObj = new BasicSerializer();
private static readonly ITypeConverter BasicSerializerObj = new BasicTypeConverter();
private readonly Dictionary<string, PropertyInfo> props;
private readonly Dictionary<Type, ITypeConverter> converters;
@ -82,7 +82,7 @@ public void Read(string file, T obj){
}
}
private class BasicSerializer : ITypeConverter{
private class BasicTypeConverter : ITypeConverter{
bool ITypeConverter.TryWriteType(Type type, object value, out string converted){
switch(Type.GetTypeCode(type)){
case TypeCode.Boolean:

View File

@ -1,7 +1,7 @@
using System;
namespace TweetDuck.Data.Serialization{
class SingleTypeConverter<T> : ITypeConverter{
sealed class SingleTypeConverter<T> : ITypeConverter{
public delegate string FuncConvertToString<U>(U value);
public delegate U FuncConvertToObject<U>(string value);

View File

@ -2,7 +2,7 @@
using System.Linq;
namespace TweetDuck.Data{
class TwoKeyDictionary<K1, K2, V>{
sealed class TwoKeyDictionary<K1, K2, V>{
private readonly Dictionary<K1, Dictionary<K2, V>> dict;
private readonly int innerCapacity;

View File

@ -7,7 +7,7 @@
namespace TweetDuck.Data{
[Serializable] // TODO remove attribute with UserConfigLegacy
class WindowState{
sealed class WindowState{
private Rectangle rect;
private bool isMaximized;

View File

@ -6,7 +6,7 @@
using TweetDuck.Plugins.Enums;
namespace TweetDuck.Plugins{
class Plugin{
sealed class Plugin{
public string Identifier { get; }
public PluginGroup Group { get; }
public PluginEnvironment Environments { get; private set; }

View File

@ -7,7 +7,7 @@
using TweetDuck.Plugins.Events;
namespace TweetDuck.Plugins{
class PluginBridge{
sealed class PluginBridge{
private static string SanitizeCacheKey(string key){
return key.Replace('\\', '/').Trim();
}

View File

@ -19,7 +19,7 @@ public static string GeneratePlugin(string pluginIdentifier, string pluginConten
/* PluginGen
(function(%params, $i, $d){
(function(%params, $d){
let tmp = {
id: '%id',
obj: new class extends PluginBase{%contents}

View File

@ -8,7 +8,7 @@
using TweetDuck.Core.Other;
namespace TweetDuck{
class Reporter{
sealed class Reporter{
private readonly string logFile;
public Reporter(string logFile){

View File

@ -4,7 +4,7 @@
using TweetDuck.Core.Utils;
namespace TweetDuck.Updates{
class UpdateInfo{
sealed class UpdateInfo{
public string VersionTag { get; }
public string InstallerPath { get; }

View File

@ -1,5 +1,5 @@
namespace TweetDuck.Updates{
class UpdaterSettings{
sealed class UpdaterSettings{
public bool AllowPreReleases { get; set; }
public string DismissedUpdate { get; set; }
public string InstallerDownloadFolder { get; set; }