fixing namespaces to c# style of coding

This commit is contained in:
abenedykt
2014-08-08 20:56:26 +02:00
parent 084ee2fd4e
commit 452cb40bd3
16 changed files with 32 additions and 52 deletions

View File

@@ -1,7 +1,6 @@
using System;
using System.Linq;
namespace S7
namespace S7.Net
{
public static class Conversion
{

View File

@@ -1,4 +1,4 @@
namespace S7
namespace S7.Net
{
public enum CpuType
{

View File

@@ -1,9 +1,10 @@
using System;
using System.Net;
using System.Net.Sockets;
using System.Net.NetworkInformation;
using System.Net.Sockets;
using S7.Net.Interfaces;
namespace S7
namespace S7.Net
{
public class Plc : IPlc
{

View File

@@ -10,7 +10,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>S7.Net</RootNamespace>
<AssemblyName>S7.Net</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<FileUpgradeFlags>
</FileUpgradeFlags>
@@ -32,6 +32,7 @@
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
@@ -41,6 +42,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
@@ -49,6 +51,7 @@
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />

View File

@@ -1,8 +1,6 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace S7.Types
namespace S7.Net.Types
{
public static class Boolean
{

View File

@@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace S7.Types
namespace S7.Net.Types
{
public static class Byte
{

View File

@@ -1,6 +1,6 @@
using System.Collections.Generic;
namespace S7.Types
namespace S7.Net.Types
{
class ByteArray
{

View File

@@ -1,8 +1,6 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace S7.Types
namespace S7.Net.Types
{
public static class Counter
{

View File

@@ -1,6 +1,6 @@
using System;
namespace S7.Types
namespace S7.Net.Types
{
public static class DInt
{

View File

@@ -1,8 +1,6 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace S7.Types
namespace S7.Net.Types
{
public static class DWord
{

View File

@@ -1,9 +1,6 @@
using System;
using System.Collections.Generic;
using System.Text;
using S7;
namespace S7.Types
namespace S7.Net.Types
{
public static class Double
{
@@ -48,14 +45,14 @@ namespace S7.Types
#region FromDWord
public static double FromDWord(Int32 value)
{
byte[] b = S7.Types.DInt.ToByteArray(value);
byte[] b = DInt.ToByteArray(value);
double d = FromByteArray(b);
return d;
}
public static double FromDWord(UInt32 value)
{
byte[] b = S7.Types.DWord.ToByteArray(value);
byte[] b = DWord.ToByteArray(value);
double d = FromByteArray(b);
return d;
}

View File

@@ -1,6 +1,6 @@
using System;
namespace S7.Types
namespace S7.Net.Types
{
public static class Int
{

View File

@@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace S7.Types
namespace S7.Net.Types
{
public static class String
{

View File

@@ -1,8 +1,6 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace S7.Types
namespace S7.Net.Types
{
public static class Struct
{
@@ -99,7 +97,7 @@ namespace S7.Types
if ((numBytes / 2 - Math.Floor(numBytes / 2.0)) > 0)
numBytes++;
// hier auswerten
info.SetValue(structValue, S7.Types.Word.FromBytes(bytes[(int)numBytes + 1],
info.SetValue(structValue, Word.FromBytes(bytes[(int)numBytes + 1],
bytes[(int)numBytes]));
numBytes += 2;
break;
@@ -109,7 +107,7 @@ namespace S7.Types
if ((numBytes / 2 - Math.Floor(numBytes / 2.0)) > 0)
numBytes++;
// hier auswerten
info.SetValue(structValue, S7.Types.DWord.FromBytes(bytes[(int)numBytes],
info.SetValue(structValue, DWord.FromBytes(bytes[(int)numBytes],
bytes[(int)numBytes + 1],
bytes[(int)numBytes + 2],
bytes[(int)numBytes + 3]));
@@ -120,7 +118,7 @@ namespace S7.Types
if ((numBytes / 2 - Math.Floor(numBytes / 2.0)) > 0)
numBytes++;
// hier auswerten
info.SetValue(structValue, S7.Types.Double.FromByteArray(new byte[] { bytes[(int)numBytes],
info.SetValue(structValue, Double.FromByteArray(new byte[] { bytes[(int)numBytes],
bytes[(int)numBytes + 1],
bytes[(int)numBytes + 2],
bytes[(int)numBytes + 3] }));
@@ -140,7 +138,7 @@ namespace S7.Types
{
Type type = structValue.GetType();
int size = S7.Types.Struct.GetStructSize(type);
int size = Struct.GetStructSize(type);
byte[] bytes = new byte[size];
byte[] bytes2 = null;
@@ -171,19 +169,19 @@ namespace S7.Types
numBytes++;
break;
case "Int16":
bytes2 = S7.Types.Int.ToByteArray((Int16)info.GetValue(structValue));
bytes2 = Int.ToByteArray((Int16)info.GetValue(structValue));
break;
case "UInt16":
bytes2 = S7.Types.Word.ToByteArray((UInt16)info.GetValue(structValue));
bytes2 = Word.ToByteArray((UInt16)info.GetValue(structValue));
break;
case "Int32":
bytes2 = S7.Types.DInt.ToByteArray((Int32)info.GetValue(structValue));
bytes2 = DInt.ToByteArray((Int32)info.GetValue(structValue));
break;
case "UInt32":
bytes2 = S7.Types.DWord.ToByteArray((UInt32)info.GetValue(structValue));
bytes2 = DWord.ToByteArray((UInt32)info.GetValue(structValue));
break;
case "Double":
bytes2 = S7.Types.Double.ToByteArray((double)info.GetValue(structValue));
bytes2 = Double.ToByteArray((double)info.GetValue(structValue));
break;
}
if (bytes2 != null)

View File

@@ -1,8 +1,6 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace S7.Types
namespace S7.Net.Types
{
public static class Timer
{

View File

@@ -1,8 +1,6 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace S7.Types
namespace S7.Net.Types
{
public static class Word
{