C mit Scharf -Test

Mat

Aktives Mitglied
Clang-Format-Ignore Test

(wegen der Formatierungsprobleme in https://dev-community.de/threads/serializer-gesucht.413/ )

Input:
using OSGeo.GDAL;
using OSGeo.OGR;
using System.IO;

using System.Runtime.Serialization;

namespace MyProj {
    public class Shapefile {
        public string sFilename;
        public int firstLayer = 0;
        public Boolean Loaded = false;
        public DataSource ds;
        public Layer Layer;
  // Irgendwelcher Mist
}


public class Program {
  static async Task Main(string[] args) {
    Shapefile TestShapeFile = new Shapefile();
    TestShapeFile.sFilename = "C:/Temp/MyShape.shp";
    Boolean LoadSuccess = TestShapeFile.LoadShapeFile(TestShapeFile.sFilename);
    Console.WriteLine("Shapefile loaded successfully: {0}", LoadSuccess);
    DataContractSerializer ser = new DataContractSerializer(typeof(Shapefile)) FileStream writer = new FileStream("C:/Temp/Test.dta", FileMode.Create);
    ser.WriteObject(writer, TestShapeFile);
  }
    //...
}


Ohne Ignore:
using OSGeo.GDAL;
using OSGeo.OGR;

using System.IO;
using System.Runtime.Serialization;

namespace MyProj {
public
class Shapefile {
public
  string sFilename;
public
  int firstLayer = 0;
public
  Boolean Loaded = false;
public
  DataSource ds;
public
  Layer Layer;
  // Irgendwelcher Mist
}

public class Program {
  static async Task Main(string[] args) {
    Shapefile TestShapeFile = new Shapefile();
    TestShapeFile.sFilename = "C:/Temp/MyShape.shp";
    Boolean LoadSuccess = TestShapeFile.LoadShapeFile(TestShapeFile.sFilename);

    Console.WriteLine("Shapefile loaded successfully: {0}", LoadSuccess);

    DataContractSerializer ser = new DataContractSerializer(typeof(Shapefile)) FileStream writer = new FileStream("C:/Temp/Test.dta", FileMode.Create);
    ser.WriteObject(writer, TestShapeFile);
  }
  //...
}

Mit Ignore:
// clang-format off
using OSGeo.GDAL;
using OSGeo.OGR;
using System.IO;

using System.Runtime.Serialization;

namespace MyProj {
    public class Shapefile {
        public string sFilename;
        public int firstLayer = 0;
        public Boolean Loaded = false;
        public DataSource ds;
        public Layer Layer;
  // Irgendwelcher Mist
}


public class Program {
  static async Task Main(string[] args) {
    Shapefile TestShapeFile = new Shapefile();
    TestShapeFile.sFilename = "C:/Temp/MyShape.shp";
    Boolean LoadSuccess = TestShapeFile.LoadShapeFile(TestShapeFile.sFilename);
    Console.WriteLine("Shapefile loaded successfully: {0}", LoadSuccess);
    DataContractSerializer ser = new DataContractSerializer(typeof(Shapefile)) FileStream writer = new FileStream("C:/Temp/Test.dta", FileMode.Create);
    ser.WriteObject(writer, TestShapeFile);
  }
    //...
}

Mit Teil-Ignore:
using OSGeo.GDAL;
using OSGeo.OGR;
using System.IO;

using System.Runtime.Serialization;
// clang-format off
namespace MyProj {
    public class Shapefile {
        public string sFilename;
        public int firstLayer = 0;
        public Boolean Loaded = false;
        public DataSource ds;
        public Layer Layer;
  // Irgendwelcher Mist
}

// clang-format on
public class Program {
  static async Task Main(string[] args) {
    Shapefile TestShapeFile = new Shapefile();
    TestShapeFile.sFilename = "C:/Temp/MyShape.shp";
    Boolean LoadSuccess = TestShapeFile.LoadShapeFile(TestShapeFile.sFilename);
    Console.WriteLine("Shapefile loaded successfully: {0}", LoadSuccess);
    DataContractSerializer ser = new DataContractSerializer(typeof(Shapefile)) FileStream writer = new FileStream("C:/Temp/Test.dta", FileMode.Create);
    ser.WriteObject(writer, TestShapeFile);
  }
  //...
}
 
Zurück
Oben Unten