Skip to content

Commit

Permalink
Remove System namespace for extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
osjimenez committed May 17, 2024
1 parent 28457e1 commit 3c7f02f
Show file tree
Hide file tree
Showing 32 changed files with 56 additions and 25 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
namespace Fuxion.Test.Collections.Generic;
using Fuxion.Collections.Generic;

namespace Fuxion.Test.Collections.Generic;

public class IEnumerableExtensionsTest : BaseTest<IEnumerableExtensionsTest>
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
namespace Fuxion.Test.Collections.Generic;
using Fuxion.Collections.Generic;

namespace Fuxion.Test.Collections.Generic;

public class IListExtensionsTest : BaseTest<IListExtensionsTest>
{
Expand Down
3 changes: 2 additions & 1 deletion src/Core.test/Fuxion/System-extensions.test.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Fuxion.Resources;
using Fuxion.Collections.Generic;
using Fuxion.Resources;

namespace Fuxion.Test;

Expand Down
1 change: 1 addition & 0 deletions src/Core.test/Fuxion/Threading/Tasks/TaskManager.test.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System.Collections;
using System.Diagnostics;
using System.Reflection;
using Fuxion.Reflection;
using Fuxion.Threading.Tasks;

namespace Fuxion.Test.Threading.Tasks;
Expand Down
1 change: 1 addition & 0 deletions src/Core.test/Identity/Dao/Discriminator.dao.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.ComponentModel.DataAnnotations.Schema;
using Fuxion.Collections.Generic;

namespace Fuxion.Identity.Test.Dao;

Expand Down
4 changes: 3 additions & 1 deletion src/Core.test/Identity/Dto/Discriminator.dto.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
namespace Fuxion.Identity.Test.Dto;
using Fuxion.Collections.Generic;

namespace Fuxion.Identity.Test.Dto;

public abstract class DiscriminatorDto : BaseDto, IDiscriminator<string, string>
{
Expand Down
4 changes: 3 additions & 1 deletion src/Core.test/Identity/Dvo/Discriminator.dvo.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
namespace Fuxion.Identity.Test.Dvo;
using Fuxion.Collections.Generic;

namespace Fuxion.Identity.Test.Dvo;

public abstract class DiscriminatorDvo<TDiscriminator> : BaseDvo<TDiscriminator>, IDiscriminator<string, string> where TDiscriminator : DiscriminatorDvo<TDiscriminator>
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Reflection;
using Fuxion;
using Fuxion.EntityFrameworkCore;

namespace Microsoft.Extensions.DependencyInjection;
Expand Down
1 change: 1 addition & 0 deletions src/Infrastructure/Windows/Data/GenericConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Reflection;
using System.Windows;
using System.Windows.Data;
using Fuxion.Reflection;

namespace Fuxion.Windows.Data;

Expand Down
1 change: 1 addition & 0 deletions src/Infrastructure/Windows/Data/GenericMultiConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Reflection;
using System.Windows;
using System.Windows.Data;
using Fuxion.Reflection;

namespace Fuxion.Windows.Data;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System.Globalization;
using System.Windows;
using Fuxion.Collections.Generic;

namespace Fuxion.Windows.Data;

Expand Down
1 change: 1 addition & 0 deletions src/Infrastructure/Windows/Data/PipeConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using System.Reflection;
using System.Windows.Data;
using System.Windows.Markup;
using Fuxion.Reflection;

namespace Fuxion.Windows.Data;

Expand Down
1 change: 1 addition & 0 deletions src/Infrastructure/Windows/Markup/DisplayExtension.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using System.Reflection;
using System.Windows;
using System.Windows.Markup;
using Fuxion.Reflection;

namespace Fuxion.Windows.Markup;

Expand Down
1 change: 1 addition & 0 deletions src/core/Fuxion/AverageTimeProvider.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Security.Cryptography;
using Fuxion.Collections.Generic;
using Fuxion.Threading.Tasks;

namespace Fuxion;
Expand Down
8 changes: 4 additions & 4 deletions src/core/Fuxion/Collections/Generic/System.ext.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System.Security.Cryptography;
using System.Security.Cryptography;

namespace System.Collections.Generic;
namespace Fuxion.Collections.Generic;

public static class Extensions
{
Expand Down Expand Up @@ -135,7 +135,7 @@ public static IEnumerable<(double Percentage, int Rounded, double Exact)> Distri
var ordered = percentages.OrderBy(_ => _);
var quantities = ordered.Select(value => new {
Percentage = value,
Rounded = (int)Math.Floor(amountOfItems * (value / 100d)),
Rounded = (int)System.Math.Floor(amountOfItems * (value / 100d)),
Exact = amountOfItems * (value / 100d)
}).ToList();
quantities = quantities.Select(_ => _ with {
Expand Down Expand Up @@ -167,7 +167,7 @@ public static IEnumerable<(double Percentage, int Rounded, double Exact)> Distri
{
value.Label,
value.Percentage,
Rounded = (int)Math.Floor(amountOfItems * (value.Percentage / 100d)),
Rounded = (int)System.Math.Floor(amountOfItems * (value.Percentage / 100d)),
Exact = amountOfItems * (value.Percentage / 100d)
}).ToList();
quantities = quantities.Select(x => x with
Expand Down
5 changes: 3 additions & 2 deletions src/core/Fuxion/ComponentModel/System-Extensions.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;

namespace System.ComponentModel;
namespace Fuxion.ComponentModel;

public static class PropertyDescriptorExtensions
{
Expand Down
5 changes: 3 additions & 2 deletions src/core/Fuxion/Linq/Expressions/System-Extensions.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System.Reflection;
using System.Linq.Expressions;
using System.Reflection;

namespace System.Linq.Expressions;
namespace Fuxion.Linq.Expressions;

public static class ExpressionExtensions
{
Expand Down
2 changes: 1 addition & 1 deletion src/core/Fuxion/Printer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using System.Runtime.CompilerServices;
using System.Text;
using Fuxion.Threading;
using Extensions = System.Extensions;
using Extensions = Fuxion.Extensions;

namespace Fuxion;

Expand Down
4 changes: 2 additions & 2 deletions src/core/Fuxion/Reflection/System-Extensions.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
using System.Diagnostics.CodeAnalysis;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Text;
using Fuxion.Reflection;

namespace System.Reflection;
namespace Fuxion.Reflection;

public static class MemberInfoExtensions
{
Expand Down
1 change: 1 addition & 0 deletions src/core/Fuxion/Singleton.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Reflection;
using Fuxion.Reflection;
using Fuxion.Threading;

namespace Fuxion;
Expand Down
8 changes: 4 additions & 4 deletions src/core/Fuxion/System.ext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
using Fuxion.Json;
using Fuxion.Resources;

namespace System;
namespace Fuxion;

public static class Extensions
{
Expand Down Expand Up @@ -306,9 +306,9 @@ public static void SetPrivateFieldValue(this object obj, string propName, object
#endregion

#region Math
public static double Pow(this double me, double power) => Math.Pow(me, power);
public static long Pow(this long me, long power) => (long)Math.Pow(me, power);
public static int Pow(this int me, int power) => (int)Math.Pow(me, power);
public static double Pow(this double me, double power) => System.Math.Pow(me, power);
public static long Pow(this long me, long power) => (long)System.Math.Pow(me, power);
public static int Pow(this int me, int power) => (int)System.Math.Pow(me, power);
public static (long Quotient, long Remainder) Division(this long me, long dividend) => (me / dividend, me % dividend);
public static (long Quotient, long Remainder) DivisionByPowerOfTwo(this long me, ushort numberOfBits) => me.Division(2.Pow(numberOfBits));
public static (long Quotient, long Remainder) DivisionByPowerOfTwo(this byte[] me, ushort numberOfBits)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System.Collections;
using System.Reflection;
using Fuxion;
using Fuxion.Reflection;

namespace System.Text.Json.Serialization;

Expand Down
4 changes: 1 addition & 3 deletions src/core/Fuxion/Threading/Tasks/System-Extensions.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using Fuxion.Threading.Tasks;

namespace System.Threading.Tasks;
namespace Fuxion.Threading.Tasks;

public static class Extensions
{
Expand Down
1 change: 1 addition & 0 deletions src/core/Fuxion/UriKey.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System.Text;
using System.Text.Json.Serialization;
using System.Web;
using Fuxion.Collections.Generic;

namespace Fuxion;
/*
Expand Down
1 change: 1 addition & 0 deletions src/core/Fuxion/UriKeyExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Text;
using System.Web;
using Fuxion;
using Fuxion.Collections.Generic;
using Fuxion.Reflection;

public static class UriKeyExtensions
Expand Down
1 change: 1 addition & 0 deletions src/core/Fuxion/Web/Patchable.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Text.Json.Serialization;
using Fuxion.Linq.Expressions;
using Microsoft.CSharp.RuntimeBinder;
using Binder = Microsoft.CSharp.RuntimeBinder.Binder;

Expand Down
2 changes: 1 addition & 1 deletion src/core/Fuxion/Xml/XElementExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using System.Xml.Linq;
using System.Xml.Serialization;

namespace System.Xml;
namespace Fuxion.Xml;

public static class XElementExtensions
{
Expand Down
1 change: 1 addition & 0 deletions src/core/Identity/IDiscriminator.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Reflection;
using Fuxion.Collections.Generic;
using Fuxion.Identity.Helpers;

namespace Fuxion.Identity;
Expand Down
3 changes: 3 additions & 0 deletions src/core/Identity/IdentityExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
using System.Linq.Expressions;
using System.Reflection;
using System.Runtime.CompilerServices;
using Fuxion.Collections.Generic;
using Fuxion.Linq.Expressions;
using Fuxion.Reflection;
using Comparer = Fuxion.Identity.Helpers.Comparer;

namespace Fuxion.Identity;
Expand Down
3 changes: 2 additions & 1 deletion src/core/Identity/PermissionExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Fuxion.Identity.Helpers;
using Fuxion.Collections.Generic;
using Fuxion.Identity.Helpers;

namespace Fuxion.Identity;

Expand Down
2 changes: 2 additions & 0 deletions src/core/Identity/TypeDiscriminatorFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Reflection;
using Fuxion.Collections.Generic;
using Fuxion.Reflection;

namespace Fuxion.Identity;

Expand Down
1 change: 1 addition & 0 deletions src/sketches/DemoConsole/Program.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Text.Json.Serialization;
using Fuxion;
using Fuxion.Licensing;
using Xunit;

Expand Down

0 comments on commit 3c7f02f

Please sign in to comment.