Skip to content

Commit

Permalink
Formatted code
Browse files Browse the repository at this point in the history
  • Loading branch information
DaanV2 committed Jul 9, 2022
1 parent 551e8da commit efb96a6
Show file tree
Hide file tree
Showing 45 changed files with 420 additions and 212 deletions.
9 changes: 6 additions & 3 deletions Debugger/Debugger.Net4.8/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@
using System.Text;
using System.Threading.Tasks;

namespace Debugger.Net4._8 {
class Program {
static void Main(string[] args) {
namespace Debugger.Net4._8
{
class Program
{
static void Main(string[] args)
{
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,14 @@ MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.*/

namespace DaanV2.Config {
namespace DaanV2.Config
{
///<summary>A class that handles the config property and making sure it sets the value</summary>
public abstract partial class BaseConfig<ConfigType> {
public abstract partial class BaseConfig<ConfigType>
{
/// <summary>Creates a new instance of <see cref="BaseConfig{ConfigType}"/></summary>
public BaseConfig() {
public BaseConfig()
{
this.Config = ConfigMapper.Get<ConfigType>();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,14 @@ MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.*/
using System.Runtime.Serialization;

namespace DaanV2.Config {
public abstract partial class BaseConfig<ConfigType> {
namespace DaanV2.Config
{
public abstract partial class BaseConfig<ConfigType>
{
/// <summary>Gets or sets the config object</summary>
[DataMember]
public ConfigType Config {
public ConfigType Config
{
get => this._Config;
set => this._Config = value;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@ MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.*/

namespace DaanV2.Config {
public abstract partial class BaseConfig<ConfigType> {
namespace DaanV2.Config
{
public abstract partial class BaseConfig<ConfigType>
{
/// <summary>The field for the config object behind the property</summary>
private ConfigType _Config;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,13 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.*/
using System;
using System.Runtime.Serialization;

namespace DaanV2.Config {
namespace DaanV2.Config
{
/// <summary>The attribute responsible for giving the system its information</summary>
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Interface | AttributeTargets.Struct, AllowMultiple = false, Inherited = false)]
[Serializable, DataContract]
public partial class ConfigAttribute : Attribute {
public partial class ConfigAttribute : Attribute
{
/// <summary>Creates a new instance of <see cref="ConfigAttribute"/></summary>
public ConfigAttribute() : this(String.Empty, String.Empty, String.Empty) { }

Expand All @@ -40,7 +42,8 @@ public ConfigAttribute(String Name, String Category) : this(Name, Category, Cate
/// <param name="Category">The catergory this config objects fall under, use \ for sub categories</param>
/// <param name="SubFolder">The subfolder the config loader needs to save/load from.
/// relative fromt the config folder, use \ to create even deeper folder structures</param>
public ConfigAttribute(String Name, String Category, String SubFolder) {
public ConfigAttribute(String Name, String Category, String SubFolder)
{
this.Category = Category;
this.Name = Name;
this.SubFolder = SubFolder;
Expand Down
15 changes: 10 additions & 5 deletions Source/Classes/Config Attribute/Config Attribute - Properties.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,27 @@ MERCHANTABILITY AND FITNESS.IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.*/
using System;

namespace DaanV2.Config {
public partial class ConfigAttribute {
namespace DaanV2.Config
{
public partial class ConfigAttribute
{
/// <summary>Gets or sets the name of this object</summary>
public String Name {
public String Name
{
get => this._Name;
set => this._Name = value;
}

/// <summary>Gets or sets the category of this object</summary>
public String Category {
public String Category
{
get => this._Category;
set => this._Category = value;
}

/// <summary>Gets or sets the subfolder for this config</summary>
public String SubFolder {
public String SubFolder
{
get => this._SubFolder;
set => this._SubFolder = value;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@ MERCHANTABILITY AND FITNESS.IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.*/
using System;

namespace DaanV2.Config {
public partial class ConfigAttribute {
namespace DaanV2.Config
{
public partial class ConfigAttribute
{
/// <summary>Gets or sets the name of this object</summary>
private String _Name;

Expand Down
6 changes: 4 additions & 2 deletions Source/Interfaces/INewConfig/INewConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@ MERCHANTABILITY AND FITNESS.IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.*/

namespace DaanV2.Config {
namespace DaanV2.Config
{
/// <summary>The interface responsible for setting default values when the config file is missing</summary>
public interface INewConfig {
public interface INewConfig
{
/// <summary>Fills this object with the given default values for the config save file</summary>
void SetNewInformation();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@ MERCHANTABILITY AND FITNESS.IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.*/
using System;

namespace DaanV2.Config.Serialization {
public partial class JSONSerializerFactory : IConfigSerializerFactory {
namespace DaanV2.Config.Serialization
{
public partial class JSONSerializerFactory : IConfigSerializerFactory
{
/// <summary>The name of this Json serializing factory</summary>
private readonly String _Name = "json";

Expand All @@ -27,29 +29,33 @@ public partial class JSONSerializerFactory : IConfigSerializerFactory {
/// <summary>Returns a serializer that is capable of deserializing the given object type</summary>
/// <typeparam name="TOut">The object type to deserialize</typeparam>
/// <returns>Returns a serializer that is capable of deserializing the given object type</returns>
public IConfigDeserializer<TOut> GetDeserializer<TOut>() {
public IConfigDeserializer<TOut> GetDeserializer<TOut>()
{
return new JSONSerializer<TOut>();
}

/// <summary>Returns a serializer that is capable of deserializing the given object type</summary>
/// <param name="ForType">The object type to serialize</param>
/// <returns>Returns a serializer that is capable of deserializing the given object type</returns>
public IConfigDeserializer<Object> GetDeserializer(Type ForType) {
public IConfigDeserializer<Object> GetDeserializer(Type ForType)
{
return new JSONSerializer<Object>(ForType);
}


/// <summary>Returns a serializer that is capable of serializing the given object type</summary>
/// <typeparam name="TIn">The object type to serialize</typeparam>
/// <returns>Returns a serializer that is capable of serializing the given object type</returns>
public IConfigSerializer<TIn> GetSerializer<TIn>() {
public IConfigSerializer<TIn> GetSerializer<TIn>()
{
return new JSONSerializer<TIn>();
}

/// <summary>Returns a serializer that is capable of serializing the given object type</summary>
/// <param name="ForType">The object type to serialize</param>
/// <returns>Returns a serializer that is capable of serializing the given object type</returns>
public IConfigSerializer<Object> GetSerializer(Type ForType) {
public IConfigSerializer<Object> GetSerializer(Type ForType)
{
return new JSONSerializer<Object>(ForType);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,14 @@ MERCHANTABILITY AND FITNESS.IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.*/

namespace DaanV2.Config.Serialization {
namespace DaanV2.Config.Serialization
{
/// <summary>The factory responsible for providing serializer/deserializer for the given object</summary>
public partial class JSONSerializerFactory {
public partial class JSONSerializerFactory
{
/// <summary>Creates a new instance of <see cref="JSONSerializerFactory"/></summary>
public JSONSerializerFactory() {
public JSONSerializerFactory()
{

}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,15 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.*/
using System.Runtime.Serialization.Json;
#endif

namespace DaanV2.Config.Serialization {
public partial class JSONSerializer<T> : IConfigDeserializer<T> {
namespace DaanV2.Config.Serialization
{
public partial class JSONSerializer<T> : IConfigDeserializer<T>
{
/// <summary>Deserializes the given stream into the specified object</summary>
/// <param name="Reader">The stream to reader from</param>
/// <returns>Deserializes the given stream into the specified object</returns>
public T Deserialize(Stream Reader) {
public T Deserialize(Stream Reader)
{
#if NETCORE
var Options = new JsonSerializerOptions();
ValueTask<Object> VTask = JsonSerializer.DeserializeAsync(Reader, this._ForType, Options);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,15 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.*/
#endif


namespace DaanV2.Config.Serialization {
public partial class JSONSerializer<T> : IConfigSerializer<T> {
namespace DaanV2.Config.Serialization
{
public partial class JSONSerializer<T> : IConfigSerializer<T>
{
/// <summary>Serializes the given object into the given stream</summary>
/// <param name="O">The given object to serialize</param>
/// <param name="Writer">The given stream to write in</param>
public void Serialize(T O, Stream Writer) {
public void Serialize(T O, Stream Writer)
{
#if NETCORE
var Options = new JsonSerializerOptions();
JsonSerializer.Serialize(new Utf8JsonWriter(Writer), O, this._ForType, Options);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,21 @@ MERCHANTABILITY AND FITNESS.IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.*/
using System;

namespace DaanV2.Config.Serialization {
namespace DaanV2.Config.Serialization
{
/// <summary>The class responsible for forming the contract between the interface and the json serializer</summary>
public partial class JSONSerializer<T> {
public partial class JSONSerializer<T>
{
/// <summary>Creates a new instance of <see cref="JSONSerializer{T}"/></summary>
public JSONSerializer() {
public JSONSerializer()
{
this._ForType = typeof(T);
}

/// <summary>Creates a new instance of <see cref="JSONSerializer{T}"/></summary>
/// <param name="ForceType">Force the serializer to use this type instead of its generic type</param>
public JSONSerializer(Type ForceType) {
public JSONSerializer(Type ForceType)
{
this._ForType = ForceType;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@ MERCHANTABILITY AND FITNESS.IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.*/
using System;

namespace DaanV2.Config.Serialization {
public partial class JSONSerializer<T> {
namespace DaanV2.Config.Serialization
{
public partial class JSONSerializer<T>
{
/// <summary>Gets or sets the type used to serialize</summary>
private readonly Type _ForType;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@ MERCHANTABILITY AND FITNESS.IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.*/
using System;

namespace DaanV2.Config.Serialization {
public partial class XmlSerializerFactory : IConfigSerializerFactory {
namespace DaanV2.Config.Serialization
{
public partial class XmlSerializerFactory : IConfigSerializerFactory
{
/// <summary>The name used for identifying this factory</summary>
private readonly String _Name = "Xml";

Expand All @@ -27,29 +29,33 @@ public partial class XmlSerializerFactory : IConfigSerializerFactory {
/// <summary>Returns a serializer that is capable of deserializing the given object type</summary>
/// <typeparam name="TOut">The object type to deserialize</typeparam>
/// <returns>Returns a serializer that is capable of deserializing the given object type</returns>
public IConfigDeserializer<TOut> GetDeserializer<TOut>() {
public IConfigDeserializer<TOut> GetDeserializer<TOut>()
{
return new XmlSerializer<TOut>();
}

/// <summary>Returns a serializer that is capable of deserializing the given object type</summary>
/// <param name="ForType">The object type to serialize</param>
/// <returns>Returns a serializer that is capable of deserializing the given object type</returns>
public IConfigDeserializer<Object> GetDeserializer(Type ForType) {
public IConfigDeserializer<Object> GetDeserializer(Type ForType)
{
return new XmlSerializer<Object>(ForType);
}


/// <summary>Returns a serializer that is capable of serializing the given object type</summary>
/// <typeparam name="TIn">The object type to serialize</typeparam>
/// <returns>Returns a serializer that is capable of serializing the given object type/></returns>
public IConfigSerializer<TIn> GetSerializer<TIn>() {
public IConfigSerializer<TIn> GetSerializer<TIn>()
{
return new XmlSerializer<TIn>();
}

/// <summary>Returns a serializer that is capable of serializing the given object type</summary>
/// <param name="ForType">The object type to serialize</param>
/// <returns>Returns a serializer that is capable of serializing the given object type/></returns>
public IConfigSerializer<Object> GetSerializer(Type ForType) {
public IConfigSerializer<Object> GetSerializer(Type ForType)
{
return new XmlSerializer<Object>(ForType);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,14 @@ MERCHANTABILITY AND FITNESS.IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.*/

namespace DaanV2.Config.Serialization {
namespace DaanV2.Config.Serialization
{
/// <summary>The class that is reponsible for creating serializers/deserializers</summary>
public partial class XmlSerializerFactory {
public partial class XmlSerializerFactory
{
/// <summary>Creates a new instance of <see cref="XmlSerializerFactory"/></summary>
public XmlSerializerFactory() {
public XmlSerializerFactory()
{

}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,15 @@ MERCHANTABILITY AND FITNESS.IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.*/
using System.IO;

namespace DaanV2.Config.Serialization {
public partial class XmlSerializer<T> : IConfigSerializer<T> {
namespace DaanV2.Config.Serialization
{
public partial class XmlSerializer<T> : IConfigSerializer<T>
{
/// <summary>Serializes the given object into the given stream</summary>
/// <param name="O">The object to serialize</param>
/// <param name="Writer">The stream to write to</param>
public void Serialize(T O, Stream Writer) {
public void Serialize(T O, Stream Writer)
{
base.Serialize(Writer, O);
}
}
Expand Down
Loading

0 comments on commit efb96a6

Please sign in to comment.