Skip to content

Commit

Permalink
fix dotnet formatting (eclipse-aaspe#263)
Browse files Browse the repository at this point in the history
No Change just style adaption to be valid with dotnet format
  • Loading branch information
Freezor authored Jun 7, 2024
1 parent da8fbbe commit ab5eec0
Show file tree
Hide file tree
Showing 58 changed files with 2,311 additions and 2,093 deletions.
44 changes: 22 additions & 22 deletions src/AasCore.Aas3_0/AasCore.Aas3_0.csproj
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
<Configurations>Debug;Release;DebugSlow</Configurations>
<Platforms>AnyCPU</Platforms>
<LangVersion>8</LangVersion>
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
<Configurations>Debug;Release;DebugSlow</Configurations>
<Platforms>AnyCPU</Platforms>
<LangVersion>8</LangVersion>

<PackageId>AasCore.Aas3_0</PackageId>
<Version>1.0.0-rc1</Version>
<Authors>Marko Ristin</Authors>
<Description>
An SDK for manipulating, verifying and de/serializing Asset Administration Shells.
</Description>
<RepositoryUrl>https://github.com/aas-core-works/aas-core3.0-csharp.git</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<Copyright>Copyright (c) 2023 Marko Ristin</Copyright>
<PackageLicenseUrl>https://raw.githubusercontent.com/aas-core-works/aas-core3.0-csharp/main/LICENSE</PackageLicenseUrl>
<PackageProjectUrl>https://github.com/aas-core-works/aas-core3.0-csharp</PackageProjectUrl>
<PackageTags>aas;asset administration shell;iiot;industry internet of things;industrie 4.0;i4.0</PackageTags>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
</ItemGroup>
<PackageId>AasCore.Aas3_0</PackageId>
<Version>1.0.0-rc1</Version>
<Authors>Marko Ristin</Authors>
<Description>
An SDK for manipulating, verifying and de/serializing Asset Administration Shells.
</Description>
<RepositoryUrl>https://github.com/aas-core-works/aas-core3.0-csharp.git</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<Copyright>Copyright (c) 2023 Marko Ristin</Copyright>
<PackageLicenseUrl>https://raw.githubusercontent.com/aas-core-works/aas-core3.0-csharp/main/LICENSE</PackageLicenseUrl>
<PackageProjectUrl>https://github.com/aas-core-works/aas-core3.0-csharp</PackageProjectUrl>
<PackageTags>aas;asset administration shell;iiot;industry internet of things;industrie 4.0;i4.0</PackageTags>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.3"/>
</ItemGroup>
</Project>
22 changes: 11 additions & 11 deletions src/AasSecurity/AasSecurity.csproj
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<Using Include="AasCore.Aas3_0" />
</ItemGroup>
<ItemGroup>
<Using Include="AasCore.Aas3_0"/>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\AasxServerStandardBib\AasxServerStandardBib.csproj" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\AasxServerStandardBib\AasxServerStandardBib.csproj"/>
</ItemGroup>

</Project>
40 changes: 20 additions & 20 deletions src/AasSecurity/SecurityService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ public AuthenticationTicket AuthenticateRequest(HttpContext context, string rout
if (user.Contains('@'))
{
string[] split = user.Split('@');
domain = split[1];
domain = split[ 1 ];
}

if (domain != null && domain.Equals(securityRight.Name))
Expand Down Expand Up @@ -241,25 +241,25 @@ public AuthenticationTicket AuthenticateRequest(HttpContext context, string rout
{
case "authorization":
{
var token = headers[key];
var token = headers[ key ];
if (token != null)
{
string[] split = token.Split(new Char[] {' ', '\t'});
if (split[0].ToLower().Equals("bearer"))
if (split[ 0 ].ToLower().Equals("bearer"))
{
_logger.LogDebug($"Received bearer token {split[1]}");
bearerToken = split[1];
_logger.LogDebug($"Received bearer token {split[ 1 ]}");
bearerToken = split[ 1 ];
}
else if (split[0].ToLower().Equals("basic") && bearerToken == null)
else if (split[ 0 ].ToLower().Equals("basic") && bearerToken == null)
{
try
{
if (Program.secretStringAPI != null)
{
var credentialBytes = Convert.FromBase64String(split[1]);
var credentialBytes = Convert.FromBase64String(split[ 1 ]);
var credentials = Encoding.UTF8.GetString(credentialBytes).Split(new[] {':'}, 2);
string u = credentials[0];
string p = credentials[1];
string u = credentials[ 0 ];
string p = credentials[ 1 ];
Console.WriteLine("Received username+password http header = " + u + " : " + p);

if (u == "secret")
Expand All @@ -275,7 +275,7 @@ public AuthenticationTicket AuthenticateRequest(HttpContext context, string rout
}
}

string username = CheckUserPW(split[1]);
string username = CheckUserPW(split[ 1 ]);
if (username != null)
{
user = username;
Expand All @@ -292,7 +292,7 @@ public AuthenticationTicket AuthenticateRequest(HttpContext context, string rout
}
case "email":
{
var token = headers[key];
var token = headers[ key ];
if (token != null)
{
_logger.LogDebug($"Received email token from header: {token}");
Expand All @@ -312,7 +312,7 @@ public AuthenticationTicket AuthenticateRequest(HttpContext context, string rout
{
case "s":
{
string secretQuery = queries["s"]!;
string secretQuery = queries[ "s" ]!;
if (!secretQuery.IsNullOrEmpty())
{
_logger.LogDebug($"Received token of type s: {secretQuery}");
Expand All @@ -329,7 +329,7 @@ public AuthenticationTicket AuthenticateRequest(HttpContext context, string rout
}
case "bearer":
{
var token = queries[key];
var token = queries[ key ];
if (token != null)
{
_logger.LogDebug($"Received token of type bear {token}");
Expand All @@ -340,7 +340,7 @@ public AuthenticationTicket AuthenticateRequest(HttpContext context, string rout
}
case "email":
{
var token = queries[key];
var token = queries[ key ];
if (token != null)
{
_logger.LogDebug($"Received token of type email {token}");
Expand All @@ -352,7 +352,7 @@ public AuthenticationTicket AuthenticateRequest(HttpContext context, string rout
}
case "_up":
{
var token = queries[key];
var token = queries[ key ];
if (token != null)
{
_logger.LogDebug($"Received token of type username-password {token}");
Expand Down Expand Up @@ -382,8 +382,8 @@ private string CheckUserPW(string userPW64)
{
var credentialBytes = Convert.FromBase64String(userPW64);
var credentials = Encoding.UTF8.GetString(credentialBytes).Split(new[] {':'}, 2);
string username = credentials[0];
string password = credentials[1];
string username = credentials[ 0 ];
string password = credentials[ 1 ];

var found = GlobalSecurityVariables.SecurityUsernamePassword.TryGetValue(username, out string storedPassword);
if (found)
Expand Down Expand Up @@ -675,7 +675,7 @@ private static bool CheckAccessLevelForOperation(string currentRole, string oper
{
if (securityRole.SemanticId == "*" || (submodel.SemanticId != null && submodel.SemanticId.Keys != null && submodel.SemanticId.Keys.Count != 0))
{
if (securityRole.SemanticId == "*" || (securityRole.SemanticId.ToLower() == submodel.SemanticId?.Keys?[0].Value.ToLower()))
if (securityRole.SemanticId == "*" || (securityRole.SemanticId.ToLower() == submodel.SemanticId?.Keys?[ 0 ].Value.ToLower()))
{
if (securityRole.Kind == KindOfPermissionEnum.Allow)
{
Expand Down Expand Up @@ -814,11 +814,11 @@ private static bool MatchApiOperation(string apiOperation, string operation)
{
for (int i = 0; i < apiOpSplit.Length; i++)
{
if (apiOpSplit[i].Equals(opSplit[i]))
if (apiOpSplit[ i ].Equals(opSplit[ i ]))
{
match = true;
}
else if (apiOpSplit[i].StartsWith("{"))
else if (apiOpSplit[ i ].StartsWith("{"))
{
continue;
}
Expand Down
98 changes: 49 additions & 49 deletions src/AasxCsharpLibrary/AasxCsharpLibrary.csproj
Original file line number Diff line number Diff line change
@@ -1,51 +1,51 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<OutputType>Library</OutputType>
<RootNamespace>AdminShellNS</RootNamespace>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
</PropertyGroup>
<PropertyGroup>
<ErrorOnDuplicatePublishOutputFiles>false</ErrorOnDuplicatePublishOutputFiles>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DefineConstants>TRACE;UseAasxCompatibilityModels</DefineConstants>
</PropertyGroup>
<PropertyGroup>
<ErrorOnDuplicatePublishOutputFiles>false</ErrorOnDuplicatePublishOutputFiles>
</PropertyGroup>
<ItemGroup>
<Using Include="AasCore.Aas3_0" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="LICENSE.txt">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Resources\schemaV201\AAS.xsd">
<SubType>Designer</SubType>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</EmbeddedResource>
<EmbeddedResource Include="Resources\schemaV201\AAS_ABAC.xsd">
<SubType>Designer</SubType>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</EmbeddedResource>
<EmbeddedResource Include="Resources\schemaV201\IEC61360.xsd">
<SubType>Designer</SubType>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</EmbeddedResource>
<EmbeddedResource Include="Resources\schemaV201\aas.json" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="JetBrains.Annotations" Version="2022.1.0" />
<PackageReference Include="Namotion.Reflection" Version="2.1.1" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="NJsonSchema" Version="10.8.0" />
<PackageReference Include="System.ComponentModel.Composition" Version="6.0.0" />
<PackageReference Include="System.IO.Packaging" Version="6.0.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\AasCore.Aas3_0\AasCore.Aas3_0.csproj" />
</ItemGroup>
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<OutputType>Library</OutputType>
<RootNamespace>AdminShellNS</RootNamespace>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
</PropertyGroup>
<PropertyGroup>
<ErrorOnDuplicatePublishOutputFiles>false</ErrorOnDuplicatePublishOutputFiles>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DefineConstants>TRACE;UseAasxCompatibilityModels</DefineConstants>
</PropertyGroup>
<PropertyGroup>
<ErrorOnDuplicatePublishOutputFiles>false</ErrorOnDuplicatePublishOutputFiles>
</PropertyGroup>
<ItemGroup>
<Using Include="AasCore.Aas3_0"/>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="LICENSE.txt">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Resources\schemaV201\AAS.xsd">
<SubType>Designer</SubType>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</EmbeddedResource>
<EmbeddedResource Include="Resources\schemaV201\AAS_ABAC.xsd">
<SubType>Designer</SubType>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</EmbeddedResource>
<EmbeddedResource Include="Resources\schemaV201\IEC61360.xsd">
<SubType>Designer</SubType>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</EmbeddedResource>
<EmbeddedResource Include="Resources\schemaV201\aas.json"/>
</ItemGroup>
<ItemGroup>
<PackageReference Include="JetBrains.Annotations" Version="2022.1.0"/>
<PackageReference Include="Namotion.Reflection" Version="2.1.1"/>
<PackageReference Include="Newtonsoft.Json" Version="13.0.3"/>
<PackageReference Include="NJsonSchema" Version="10.8.0"/>
<PackageReference Include="System.ComponentModel.Composition" Version="6.0.0"/>
<PackageReference Include="System.IO.Packaging" Version="6.0.0"/>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\AasCore.Aas3_0\AasCore.Aas3_0.csproj"/>
</ItemGroup>
</Project>
4 changes: 2 additions & 2 deletions src/AasxCsharpLibrary/AdminShellPackageEnv.cs
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,7 @@ private void AssignDefaultThumbnailPath()
{
if (_aasEnv.AssetAdministrationShells.Count > 0)
{
_aasEnv.AssetAdministrationShells[0].AssetInformation.DefaultThumbnail = new Resource(thumbUri.OriginalString);
_aasEnv.AssetAdministrationShells[ 0 ].AssetInformation.DefaultThumbnail = new Resource(thumbUri.OriginalString);
}
}
}
Expand Down Expand Up @@ -980,7 +980,7 @@ public bool SaveAs(string fn, bool writeFreshly = false, SerializationFormat pre
// create, as not existing
var frn = "aasenv-with-no-id";
if (_aasEnv.AssetAdministrationShells.Count > 0)
frn = _aasEnv.AssetAdministrationShells[0].GetFriendlyName() ?? frn;
frn = _aasEnv.AssetAdministrationShells[ 0 ].GetFriendlyName() ?? frn;
var aas_spec_fn = "/aasx/#/#.aas";
if (prefFmt == SerializationFormat.Json)
aas_spec_fn += ".json";
Expand Down
4 changes: 1 addition & 3 deletions src/AasxCsharpLibrary/Extensions/ExtendConceptDescription.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@ public static EmbeddedDataSpecification SetIEC61360Spec(this ConceptDescription
string[] definition = null
)
{
var eds = new EmbeddedDataSpecification(
new Reference(ReferenceTypes.ExternalReference,
new List<IKey> {ExtendIDataSpecificationContent.GetKeyForIec61360()}),
var eds = new EmbeddedDataSpecification(new Reference(ReferenceTypes.ExternalReference, new List<IKey> {ExtendIDataSpecificationContent.GetKeyForIec61360()}),
new DataSpecificationIec61360(
ExtendLangStringSet.CreateManyPreferredNamesFromStringArray(preferredNames),
new List<ILangStringShortNameTypeIec61360> {new LangStringShortNameTypeIec61360("EN?", shortName)},
Expand Down
2 changes: 1 addition & 1 deletion src/AasxCsharpLibrary/Extensions/ExtendIReferable.cs
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,7 @@ public static void MigrateV20QualifiersToExtensions(this IReferable rf)
// now move these
for (int i = 0; i < toMove.Count; i++)
{
var q = toMove[i];
var q = toMove[ i ];
var ext = new Extension(
name: q.Type, semanticId: q.SemanticId,
valueType: q.ValueType, value: q.Value);
Expand Down
2 changes: 1 addition & 1 deletion src/AasxCsharpLibrary/Extensions/ExtendISubmodelElement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,7 @@ public static IReferable FindReferableByReference(

// over all wrappers
foreach (var smw in submodelElements)
if (smw != null && smw.IdShort.Equals(keys[keyIndex].Value, StringComparison.OrdinalIgnoreCase))
if (smw != null && smw.IdShort.Equals(keys[ keyIndex ].Value, StringComparison.OrdinalIgnoreCase))
{
// match on this level. Did we find a leaf element?
if ((keyIndex + 1) >= keys.Count)
Expand Down
Loading

0 comments on commit ab5eec0

Please sign in to comment.