InitializeComponent
Speichert Single- und Multi-Group XML-Dateien
This commit is contained in:
commit
414fff12b5
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
0
.vs/SaveXMLFile.git/FileContentIndex/read.lock
Normal file
0
.vs/SaveXMLFile.git/FileContentIndex/read.lock
Normal file
BIN
.vs/SaveXMLFile.git/v17/.suo
Normal file
BIN
.vs/SaveXMLFile.git/v17/.suo
Normal file
Binary file not shown.
10
Daten/Test.xml
Normal file
10
Daten/Test.xml
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<NX-Portal xmlns="https://www.engelglobal.com/de/at/index.html">
|
||||||
|
<NX Id="1" Version="NX 1953" Standard="no" />
|
||||||
|
<NX Id="2" Version="NX 2206" Standard="yes" />
|
||||||
|
<NX Id="3" Version="NX 2212" Standard="no" />
|
||||||
|
<Management Id="1" Method="Nativ" Standard="no" />
|
||||||
|
<Management Id="2" Method="TeamCenter Prod" Standard="yes" />
|
||||||
|
<Management Id="3" Method="TeamCenter Qua" Standard="no" />
|
||||||
|
<Management Id="4" Method="TeamCenter Dev" Standard="no" />
|
||||||
|
</NX-Portal>
|
||||||
10
Daten/Test.xml_orig
Normal file
10
Daten/Test.xml_orig
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<NX-Portal xmlns="https://www.engelglobal.com/de/at/index.html">
|
||||||
|
<NX Id="1" Version="NX 1953" Standard="no" />
|
||||||
|
<NX Id="2" Version="NX 2206" Standard="yes" />
|
||||||
|
<NX Id="3" Version="NX 2212" Standard="no" />
|
||||||
|
<Management Id="1" Method="Nativ" Standard="no" />
|
||||||
|
<Management Id="2" Method="TeamCenter Prod" Standard="yes" />
|
||||||
|
<Management Id="3" Method="TeamCenter Qua" Standard="no" />
|
||||||
|
<Management Id="4" Method="TeamCenter Dev" Standard="no" />
|
||||||
|
</NX-Portal>
|
||||||
31
SaveXMLFile.git.sln
Normal file
31
SaveXMLFile.git.sln
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
|
||||||
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
|
# Visual Studio Version 17
|
||||||
|
VisualStudioVersion = 17.4.33122.133
|
||||||
|
MinimumVisualStudioVersion = 10.0.40219.1
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SaveXMLFile", "SaveXMLFile\SaveXMLFile.csproj", "{875729B3-8DE0-40CE-9FE0-BD98F1DBA463}"
|
||||||
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Test_SaveXMLFile", "Test_SaveXMLFile\Test_SaveXMLFile.csproj", "{34DCA2B4-1B0F-461F-A937-47713C0481B6}"
|
||||||
|
EndProject
|
||||||
|
Global
|
||||||
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
|
Debug|Any CPU = Debug|Any CPU
|
||||||
|
Release|Any CPU = Release|Any CPU
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
|
{875729B3-8DE0-40CE-9FE0-BD98F1DBA463}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{875729B3-8DE0-40CE-9FE0-BD98F1DBA463}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{875729B3-8DE0-40CE-9FE0-BD98F1DBA463}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{875729B3-8DE0-40CE-9FE0-BD98F1DBA463}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{34DCA2B4-1B0F-461F-A937-47713C0481B6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{34DCA2B4-1B0F-461F-A937-47713C0481B6}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{34DCA2B4-1B0F-461F-A937-47713C0481B6}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{34DCA2B4-1B0F-461F-A937-47713C0481B6}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
|
HideSolutionNode = FALSE
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||||
|
SolutionGuid = {A82CA882-C32E-4FB7-AC15-3B40D68A5C57}
|
||||||
|
EndGlobalSection
|
||||||
|
EndGlobal
|
||||||
81
SaveXMLFile/Properties/AppResources.Designer.cs
generated
Normal file
81
SaveXMLFile/Properties/AppResources.Designer.cs
generated
Normal file
@ -0,0 +1,81 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// Dieser Code wurde von einem Tool generiert.
|
||||||
|
// Laufzeitversion:4.0.30319.42000
|
||||||
|
//
|
||||||
|
// Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn
|
||||||
|
// der Code erneut generiert wird.
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace Eugen.ESystem.IO.Properties {
|
||||||
|
using System;
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw.
|
||||||
|
/// </summary>
|
||||||
|
// Diese Klasse wurde von der StronglyTypedResourceBuilder automatisch generiert
|
||||||
|
// -Klasse über ein Tool wie ResGen oder Visual Studio automatisch generiert.
|
||||||
|
// Um einen Member hinzuzufügen oder zu entfernen, bearbeiten Sie die .ResX-Datei und führen dann ResGen
|
||||||
|
// mit der /str-Option erneut aus, oder Sie erstellen Ihr VS-Projekt neu.
|
||||||
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
|
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||||
|
internal class AppResources {
|
||||||
|
|
||||||
|
private static global::System.Resources.ResourceManager resourceMan;
|
||||||
|
|
||||||
|
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||||
|
|
||||||
|
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||||
|
internal AppResources() {
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird.
|
||||||
|
/// </summary>
|
||||||
|
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||||
|
internal static global::System.Resources.ResourceManager ResourceManager {
|
||||||
|
get {
|
||||||
|
if (object.ReferenceEquals(resourceMan, null)) {
|
||||||
|
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Eugen.ESystem.IO.Properties.AppResources", typeof(AppResources).Assembly);
|
||||||
|
resourceMan = temp;
|
||||||
|
}
|
||||||
|
return resourceMan;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle
|
||||||
|
/// Ressourcenzuordnungen, die diese stark typisierte Ressourcenklasse verwenden.
|
||||||
|
/// </summary>
|
||||||
|
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||||
|
internal static global::System.Globalization.CultureInfo Culture {
|
||||||
|
get {
|
||||||
|
return resourceCulture;
|
||||||
|
}
|
||||||
|
set {
|
||||||
|
resourceCulture = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Sucht eine lokalisierte Zeichenfolge, die Information ähnelt.
|
||||||
|
/// </summary>
|
||||||
|
internal static string msgBoxCapt001 {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("msgBoxCapt001", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Sucht eine lokalisierte Zeichenfolge, die The file was saved successfully. ähnelt.
|
||||||
|
/// </summary>
|
||||||
|
internal static string msgBoxTxt001 {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("msgBoxTxt001", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
126
SaveXMLFile/Properties/AppResources.de.resx
Normal file
126
SaveXMLFile/Properties/AppResources.de.resx
Normal file
@ -0,0 +1,126 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<root>
|
||||||
|
<!--
|
||||||
|
Microsoft ResX Schema
|
||||||
|
|
||||||
|
Version 2.0
|
||||||
|
|
||||||
|
The primary goals of this format is to allow a simple XML format
|
||||||
|
that is mostly human readable. The generation and parsing of the
|
||||||
|
various data types are done through the TypeConverter classes
|
||||||
|
associated with the data types.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
... ado.net/XML headers & schema ...
|
||||||
|
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||||
|
<resheader name="version">2.0</resheader>
|
||||||
|
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||||
|
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||||
|
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||||
|
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||||
|
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||||
|
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||||
|
</data>
|
||||||
|
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
|
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||||
|
<comment>This is a comment</comment>
|
||||||
|
</data>
|
||||||
|
|
||||||
|
There are any number of "resheader" rows that contain simple
|
||||||
|
name/value pairs.
|
||||||
|
|
||||||
|
Each data row contains a name, and value. The row also contains a
|
||||||
|
type or mimetype. Type corresponds to a .NET class that support
|
||||||
|
text/value conversion through the TypeConverter architecture.
|
||||||
|
Classes that don't support this are serialized and stored with the
|
||||||
|
mimetype set.
|
||||||
|
|
||||||
|
The mimetype is used for serialized objects, and tells the
|
||||||
|
ResXResourceReader how to depersist the object. This is currently not
|
||||||
|
extensible. For a given mimetype the value must be set accordingly:
|
||||||
|
|
||||||
|
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||||
|
that the ResXResourceWriter will generate, however the reader can
|
||||||
|
read any of the formats listed below.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.binary.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.soap.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||||
|
value : The object must be serialized into a byte array
|
||||||
|
: using a System.ComponentModel.TypeConverter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
-->
|
||||||
|
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
|
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||||
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:choice maxOccurs="unbounded">
|
||||||
|
<xsd:element name="metadata">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="assembly">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:attribute name="alias" type="xsd:string" />
|
||||||
|
<xsd:attribute name="name" type="xsd:string" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="data">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="resheader">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:choice>
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:schema>
|
||||||
|
<resheader name="resmimetype">
|
||||||
|
<value>text/microsoft-resx</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="version">
|
||||||
|
<value>2.0</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="reader">
|
||||||
|
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="writer">
|
||||||
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<data name="msgBoxCapt001" xml:space="preserve">
|
||||||
|
<value>Information</value>
|
||||||
|
</data>
|
||||||
|
<data name="msgBoxTxt001" xml:space="preserve">
|
||||||
|
<value>Die Datei wurde erfolgreich gespeichert.</value>
|
||||||
|
</data>
|
||||||
|
</root>
|
||||||
126
SaveXMLFile/Properties/AppResources.en.resx
Normal file
126
SaveXMLFile/Properties/AppResources.en.resx
Normal file
@ -0,0 +1,126 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<root>
|
||||||
|
<!--
|
||||||
|
Microsoft ResX Schema
|
||||||
|
|
||||||
|
Version 2.0
|
||||||
|
|
||||||
|
The primary goals of this format is to allow a simple XML format
|
||||||
|
that is mostly human readable. The generation and parsing of the
|
||||||
|
various data types are done through the TypeConverter classes
|
||||||
|
associated with the data types.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
... ado.net/XML headers & schema ...
|
||||||
|
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||||
|
<resheader name="version">2.0</resheader>
|
||||||
|
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||||
|
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||||
|
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||||
|
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||||
|
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||||
|
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||||
|
</data>
|
||||||
|
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
|
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||||
|
<comment>This is a comment</comment>
|
||||||
|
</data>
|
||||||
|
|
||||||
|
There are any number of "resheader" rows that contain simple
|
||||||
|
name/value pairs.
|
||||||
|
|
||||||
|
Each data row contains a name, and value. The row also contains a
|
||||||
|
type or mimetype. Type corresponds to a .NET class that support
|
||||||
|
text/value conversion through the TypeConverter architecture.
|
||||||
|
Classes that don't support this are serialized and stored with the
|
||||||
|
mimetype set.
|
||||||
|
|
||||||
|
The mimetype is used for serialized objects, and tells the
|
||||||
|
ResXResourceReader how to depersist the object. This is currently not
|
||||||
|
extensible. For a given mimetype the value must be set accordingly:
|
||||||
|
|
||||||
|
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||||
|
that the ResXResourceWriter will generate, however the reader can
|
||||||
|
read any of the formats listed below.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.binary.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.soap.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||||
|
value : The object must be serialized into a byte array
|
||||||
|
: using a System.ComponentModel.TypeConverter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
-->
|
||||||
|
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
|
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||||
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:choice maxOccurs="unbounded">
|
||||||
|
<xsd:element name="metadata">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="assembly">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:attribute name="alias" type="xsd:string" />
|
||||||
|
<xsd:attribute name="name" type="xsd:string" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="data">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="resheader">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:choice>
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:schema>
|
||||||
|
<resheader name="resmimetype">
|
||||||
|
<value>text/microsoft-resx</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="version">
|
||||||
|
<value>2.0</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="reader">
|
||||||
|
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="writer">
|
||||||
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<data name="msgBoxCapt001" xml:space="preserve">
|
||||||
|
<value>Information</value>
|
||||||
|
</data>
|
||||||
|
<data name="msgBoxTxt001" xml:space="preserve">
|
||||||
|
<value>The file was saved successfully.</value>
|
||||||
|
</data>
|
||||||
|
</root>
|
||||||
126
SaveXMLFile/Properties/AppResources.resx
Normal file
126
SaveXMLFile/Properties/AppResources.resx
Normal file
@ -0,0 +1,126 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<root>
|
||||||
|
<!--
|
||||||
|
Microsoft ResX Schema
|
||||||
|
|
||||||
|
Version 2.0
|
||||||
|
|
||||||
|
The primary goals of this format is to allow a simple XML format
|
||||||
|
that is mostly human readable. The generation and parsing of the
|
||||||
|
various data types are done through the TypeConverter classes
|
||||||
|
associated with the data types.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
... ado.net/XML headers & schema ...
|
||||||
|
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||||
|
<resheader name="version">2.0</resheader>
|
||||||
|
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||||
|
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||||
|
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||||
|
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||||
|
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||||
|
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||||
|
</data>
|
||||||
|
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
|
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||||
|
<comment>This is a comment</comment>
|
||||||
|
</data>
|
||||||
|
|
||||||
|
There are any number of "resheader" rows that contain simple
|
||||||
|
name/value pairs.
|
||||||
|
|
||||||
|
Each data row contains a name, and value. The row also contains a
|
||||||
|
type or mimetype. Type corresponds to a .NET class that support
|
||||||
|
text/value conversion through the TypeConverter architecture.
|
||||||
|
Classes that don't support this are serialized and stored with the
|
||||||
|
mimetype set.
|
||||||
|
|
||||||
|
The mimetype is used for serialized objects, and tells the
|
||||||
|
ResXResourceReader how to depersist the object. This is currently not
|
||||||
|
extensible. For a given mimetype the value must be set accordingly:
|
||||||
|
|
||||||
|
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||||
|
that the ResXResourceWriter will generate, however the reader can
|
||||||
|
read any of the formats listed below.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.binary.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.soap.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||||
|
value : The object must be serialized into a byte array
|
||||||
|
: using a System.ComponentModel.TypeConverter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
-->
|
||||||
|
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
|
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||||
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:choice maxOccurs="unbounded">
|
||||||
|
<xsd:element name="metadata">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="assembly">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:attribute name="alias" type="xsd:string" />
|
||||||
|
<xsd:attribute name="name" type="xsd:string" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="data">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="resheader">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:choice>
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:schema>
|
||||||
|
<resheader name="resmimetype">
|
||||||
|
<value>text/microsoft-resx</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="version">
|
||||||
|
<value>2.0</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="reader">
|
||||||
|
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="writer">
|
||||||
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<data name="msgBoxCapt001" xml:space="preserve">
|
||||||
|
<value>Information</value>
|
||||||
|
</data>
|
||||||
|
<data name="msgBoxTxt001" xml:space="preserve">
|
||||||
|
<value>The file was saved successfully.</value>
|
||||||
|
</data>
|
||||||
|
</root>
|
||||||
36
SaveXMLFile/Properties/AssemblyInfo.cs
Normal file
36
SaveXMLFile/Properties/AssemblyInfo.cs
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
using System.Reflection;
|
||||||
|
using System.Runtime.CompilerServices;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
|
// Allgemeine Informationen über eine Assembly werden über die folgenden
|
||||||
|
// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern,
|
||||||
|
// die einer Assembly zugeordnet sind.
|
||||||
|
[assembly: AssemblyTitle("SaveXMLFile")]
|
||||||
|
[assembly: AssemblyDescription("Saves elements in a XML file")]
|
||||||
|
[assembly: AssemblyConfiguration("")]
|
||||||
|
[assembly: AssemblyCompany("")]
|
||||||
|
[assembly: AssemblyProduct("SaveXMLFile")]
|
||||||
|
[assembly: AssemblyCopyright("Copyright © 2022 by Eugen Höglinger")]
|
||||||
|
[assembly: AssemblyTrademark("")]
|
||||||
|
[assembly: AssemblyCulture("")]
|
||||||
|
|
||||||
|
// Durch Festlegen von ComVisible auf FALSE werden die Typen in dieser Assembly
|
||||||
|
// für COM-Komponenten unsichtbar. Wenn Sie auf einen Typ in dieser Assembly von
|
||||||
|
// COM aus zugreifen müssen, sollten Sie das ComVisible-Attribut für diesen Typ auf "True" festlegen.
|
||||||
|
[assembly: ComVisible(false)]
|
||||||
|
|
||||||
|
// Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird
|
||||||
|
[assembly: Guid("875729b3-8de0-40ce-9fe0-bd98f1dba463")]
|
||||||
|
|
||||||
|
// Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten:
|
||||||
|
//
|
||||||
|
// Hauptversion
|
||||||
|
// Nebenversion
|
||||||
|
// Buildnummer
|
||||||
|
// Revision
|
||||||
|
//
|
||||||
|
// Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden,
|
||||||
|
// indem Sie "*" wie unten gezeigt eingeben:
|
||||||
|
// [assembly: AssemblyVersion("1.0.*")]
|
||||||
|
[assembly: AssemblyVersion("1.0.*")]
|
||||||
|
//[assembly: AssemblyFileVersion("1.0.0.0")] //Wenn auskommentiert, dann gleich wie AssemblyVersion!
|
||||||
366
SaveXMLFile/SaveXMLFile.cs
Normal file
366
SaveXMLFile/SaveXMLFile.cs
Normal file
@ -0,0 +1,366 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Reflection;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
using System.Xml.Linq;
|
||||||
|
using AppRes = Eugen.ESystem.IO.Properties.AppResources;
|
||||||
|
|
||||||
|
namespace Eugen.ESystem.IO
|
||||||
|
{
|
||||||
|
public class SaveXMLFile
|
||||||
|
{
|
||||||
|
#region Version und Copyright
|
||||||
|
// Version und Copyright
|
||||||
|
static string dllName = Path.GetFileNameWithoutExtension(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase); //Den Programmnamen auslesen
|
||||||
|
static string dllVersion = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString();
|
||||||
|
static object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCopyrightAttribute), false);
|
||||||
|
static string copyright = GenerateCopyright();
|
||||||
|
|
||||||
|
//Assembly Datum und Zeit
|
||||||
|
static DateTime value = AssemblyDateTime();
|
||||||
|
static string date = value.ToShortDateString();
|
||||||
|
static string time = value.ToLongTimeString();
|
||||||
|
|
||||||
|
private static DateTime AssemblyDateTime()
|
||||||
|
{
|
||||||
|
var version = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version;
|
||||||
|
var buildDateTime = new DateTime(2000, 1, 1).Add(new TimeSpan(TimeSpan.TicksPerDay * version.Build + TimeSpan.TicksPerSecond * 2 * version.Revision));
|
||||||
|
//Tage seit dem 1. Januar 2000 und Sekunden seit Mitternacht, (multiplizier mit 2 ergibt das Original)
|
||||||
|
return buildDateTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static string CurrentYear()
|
||||||
|
{
|
||||||
|
DateTime dtn = DateTime.Now;
|
||||||
|
return dtn.Year.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
private static string StartYear()
|
||||||
|
{
|
||||||
|
string startYear = "";
|
||||||
|
if (((AssemblyCopyrightAttribute)attributes[0]).Copyright.Contains("Copyright © "))
|
||||||
|
{
|
||||||
|
startYear = ((AssemblyCopyrightAttribute)attributes[0]).Copyright.Replace("Copyright © ", "");
|
||||||
|
while (startYear.StartsWith(" "))
|
||||||
|
{
|
||||||
|
startYear = startYear.Remove(0, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (startYear.Contains("-"))
|
||||||
|
{
|
||||||
|
startYear = startYear.Remove(startYear.IndexOf("-"));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
startYear = startYear.Remove(startYear.IndexOf(" "));
|
||||||
|
}
|
||||||
|
return startYear;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
DateTime dtn = DateTime.Now;
|
||||||
|
return dtn.Year.ToString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static string GenerateCopyright()
|
||||||
|
{
|
||||||
|
string startYear = StartYear();
|
||||||
|
string currentYear = CurrentYear();
|
||||||
|
|
||||||
|
if (startYear == currentYear)
|
||||||
|
{
|
||||||
|
return ((AssemblyCopyrightAttribute)attributes[0]).Copyright;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
string temp = ((AssemblyCopyrightAttribute)attributes[0]).Copyright;
|
||||||
|
string start = temp.Remove(temp.IndexOf(startYear) - 1);
|
||||||
|
string end = (temp.Remove(0, temp.IndexOf(" by")));
|
||||||
|
|
||||||
|
return String.Concat(start, " ", startYear, "-", currentYear, end);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region DLL-Info
|
||||||
|
/// <summary>
|
||||||
|
/// Contains the name of the dll file.
|
||||||
|
/// </summary>
|
||||||
|
public static string DllName { private set; get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Contains the version of the dll file.
|
||||||
|
/// </summary>
|
||||||
|
public static string DllVersion { private set; get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Contains the copyright notice.
|
||||||
|
/// </summary>
|
||||||
|
public static string Copyright { private set; get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Contains the name-, version- and copyright-information of the dll file.
|
||||||
|
/// </summary>
|
||||||
|
public static string[] DllInfo { private set; get; }
|
||||||
|
|
||||||
|
private static void SetDllInfo()
|
||||||
|
{
|
||||||
|
//Name, Version und Copyright setzen
|
||||||
|
DllName = dllName;
|
||||||
|
DllVersion = dllVersion;
|
||||||
|
Copyright = copyright;
|
||||||
|
|
||||||
|
string[] dllInfo = new string[3];
|
||||||
|
dllInfo[0] = dllName;
|
||||||
|
dllInfo[1] = dllVersion;
|
||||||
|
dllInfo[2] = copyright;
|
||||||
|
DllInfo = dllInfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected string ProgramName { private set; get; }
|
||||||
|
protected string ProgramVersion { private set; get; }
|
||||||
|
protected string ProgramCopyright { private set; get; }
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
static SaveXMLFile()
|
||||||
|
{
|
||||||
|
SetDllInfo();
|
||||||
|
}
|
||||||
|
|
||||||
|
public SaveXMLFile()
|
||||||
|
{
|
||||||
|
SetDllInfo();
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum multigroupFile
|
||||||
|
{
|
||||||
|
No,
|
||||||
|
Yes
|
||||||
|
}
|
||||||
|
|
||||||
|
public string FileName { get; set; }
|
||||||
|
public multigroupFile MultiGroupFile { get; set; }
|
||||||
|
public string Topic = ""; //z.B. "NX-Portal"
|
||||||
|
public string Group { get; set; } //z.B. "NX"
|
||||||
|
public string Key { get; set; } //z.B. "Key"
|
||||||
|
public string[] Values { get; set; } //z.B. "NX 1953"
|
||||||
|
public string[] Standard { get; set; } //"yes" oder "no"
|
||||||
|
public int StandardNr { get; set; } //z.B. "2"
|
||||||
|
|
||||||
|
private void SaveSingleGroupFile()
|
||||||
|
{
|
||||||
|
//Namensraum definieren
|
||||||
|
XNamespace ns = "https://www.engelglobal.com/de/at/index.html";
|
||||||
|
|
||||||
|
//Wurzelelement erzeugen
|
||||||
|
XElement rootElement = new XElement(ns + Topic);
|
||||||
|
|
||||||
|
//Namensraum als Attribut angeben
|
||||||
|
rootElement.Add(new XAttribute("xmlns", ns));
|
||||||
|
|
||||||
|
//Der Wert
|
||||||
|
for (int id = 0; id < Values.Length; id++)
|
||||||
|
{
|
||||||
|
XElement groupElement = new XElement(ns + Group);
|
||||||
|
groupElement.Add(new XAttribute("Id", id + 1));
|
||||||
|
groupElement.Add(new XAttribute(Key, Values[id]));
|
||||||
|
if (StandardNr == id + 1)
|
||||||
|
{
|
||||||
|
groupElement.Add(new XAttribute("Standard", "yes"));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
groupElement.Add(new XAttribute("Standard", "no"));
|
||||||
|
}
|
||||||
|
|
||||||
|
rootElement.Add(groupElement);
|
||||||
|
}
|
||||||
|
|
||||||
|
rootElement.Save(FileName);
|
||||||
|
|
||||||
|
MessageBox.Show(AppRes.msgBoxTxt001, AppRes.msgBoxCapt001, MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void SaveMultiGroupFile(string[,] values)
|
||||||
|
{
|
||||||
|
//Namensraum definieren
|
||||||
|
XNamespace ns = "https://www.engelglobal.com/de/at/index.html";
|
||||||
|
|
||||||
|
//Wurzelelement erzeugen
|
||||||
|
XElement rootElement = new XElement(ns + Topic);
|
||||||
|
|
||||||
|
//Namensraum als Attribut angeben
|
||||||
|
rootElement.Add(new XAttribute("xmlns", ns));
|
||||||
|
|
||||||
|
//Der Wert
|
||||||
|
for (int id = 0; id < values.Length / 5; id++)
|
||||||
|
{
|
||||||
|
XElement groupElement = new XElement(ns + values[id, 0]);
|
||||||
|
groupElement.Add(new XAttribute("Id", values[id, 1]));
|
||||||
|
groupElement.Add(new XAttribute(values[id, 2], values[id, 3]));
|
||||||
|
groupElement.Add(new XAttribute("Standard", values[id, 4]));
|
||||||
|
|
||||||
|
rootElement.Add(groupElement);
|
||||||
|
}
|
||||||
|
|
||||||
|
rootElement.Save(FileName);
|
||||||
|
|
||||||
|
MessageBox.Show(AppRes.msgBoxTxt001, AppRes.msgBoxCapt001, MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Save()
|
||||||
|
{
|
||||||
|
if (MultiGroupFile == multigroupFile.Yes)
|
||||||
|
{
|
||||||
|
//XML in collecton laden
|
||||||
|
var loadXML = new LoadXMLFile();
|
||||||
|
loadXML.FileName = FileName;
|
||||||
|
loadXML.Topic = Topic;
|
||||||
|
loadXML.Group = Group;
|
||||||
|
loadXML.Key = Key;
|
||||||
|
loadXML.LoadAllValues = LoadXMLFile.LoadAll.Yes;
|
||||||
|
loadXML.Load();
|
||||||
|
string[,] collection = loadXML.Values;
|
||||||
|
|
||||||
|
bool exist = false;
|
||||||
|
if (loadXML.Values != null)
|
||||||
|
{
|
||||||
|
List<List<string>> lafter = new List<List<string>>();
|
||||||
|
List<List<string>> lmiddle = new List<List<string>>();
|
||||||
|
List<List<string>> lbefore = new List<List<string>>();
|
||||||
|
|
||||||
|
for (int i = 0; i < loadXML.Values.Length / 5; i++)
|
||||||
|
{
|
||||||
|
if (loadXML.Values[i, 0] == Group)
|
||||||
|
{
|
||||||
|
exist = true;
|
||||||
|
//Die alten Werte igrorieren, weil diese durch die neuen Werte ersetzt und nachher in die 'Gruppe_mitte' aufgenommen werden
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (exist)
|
||||||
|
{
|
||||||
|
//Die Werte in die 'Gruppe_danach' aufnehmen
|
||||||
|
List<string> iafter = new List<string>();
|
||||||
|
|
||||||
|
iafter.Add(loadXML.Values[i, 0]);
|
||||||
|
iafter.Add(loadXML.Values[i, 1]);
|
||||||
|
iafter.Add(loadXML.Values[i, 2]);
|
||||||
|
iafter.Add(loadXML.Values[i, 3]);
|
||||||
|
iafter.Add(loadXML.Values[i, 4]);
|
||||||
|
|
||||||
|
lafter.Add(iafter);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//Die Werte in die 'Gruppe_davor' aufnehmen
|
||||||
|
List<string> ibefore = new List<string>();
|
||||||
|
|
||||||
|
ibefore.Add(loadXML.Values[i, 0]);
|
||||||
|
ibefore.Add(loadXML.Values[i, 1]);
|
||||||
|
ibefore.Add(loadXML.Values[i, 2]);
|
||||||
|
ibefore.Add(loadXML.Values[i, 3]);
|
||||||
|
ibefore.Add(loadXML.Values[i, 4]);
|
||||||
|
|
||||||
|
lbefore.Add(ibefore);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//Die Werte in die 'Gruppe_mitte' aufnehmen
|
||||||
|
for (int j = 0; j < Values.Length; j++)
|
||||||
|
{
|
||||||
|
List<string> imiddle = new List<string>();
|
||||||
|
|
||||||
|
imiddle.Add(Group); //z.B.: 'NX'
|
||||||
|
imiddle.Add((j + 1).ToString()); //Id, z.B.: '2'
|
||||||
|
imiddle.Add(Key); //z.B.: 'Version'
|
||||||
|
imiddle.Add(Values[j]); //z.B.: 'NX 2312'
|
||||||
|
imiddle.Add(Standard[j]); //Standard, z.B.: 'yes'
|
||||||
|
|
||||||
|
lmiddle.Add(imiddle);
|
||||||
|
}
|
||||||
|
|
||||||
|
//Gruppe_davor + Gruppe_mitte + Gruppe_danach
|
||||||
|
|
||||||
|
//Gesamtlänge ermitteln
|
||||||
|
int cbefore = lbefore.Count;
|
||||||
|
int cmiddle = lmiddle.Count;
|
||||||
|
int cafter = lafter.Count;
|
||||||
|
string[,] values = new string[lbefore.Count + cmiddle + lafter.Count, 5];
|
||||||
|
|
||||||
|
//'Gruppe_davor' einfügen
|
||||||
|
if (lbefore.Count > 0)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < lbefore.Count; i++)
|
||||||
|
{
|
||||||
|
int j = 0;
|
||||||
|
foreach (var item in lbefore[i])
|
||||||
|
{
|
||||||
|
values[i, j] = item;
|
||||||
|
j++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//TODO:
|
||||||
|
//'Gruppe_mitte' einfügen
|
||||||
|
if (cmiddle > 0)
|
||||||
|
{
|
||||||
|
for (int i = lbefore.Count; i < lbefore.Count + cmiddle; i++)
|
||||||
|
{
|
||||||
|
int j = 0;
|
||||||
|
foreach (var item in lmiddle[i])
|
||||||
|
{
|
||||||
|
values[i, j] = item;
|
||||||
|
j++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//'Gruppe_danach' einfügen
|
||||||
|
if (lafter.Count > 0)
|
||||||
|
{
|
||||||
|
int i = lbefore.Count + cmiddle;
|
||||||
|
foreach (var itema in lafter)
|
||||||
|
{
|
||||||
|
int j = 0;
|
||||||
|
foreach (var item in itema)
|
||||||
|
{
|
||||||
|
values[i, j] = item;
|
||||||
|
j++;
|
||||||
|
}
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//Speichern
|
||||||
|
SaveMultiGroupFile(values);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//Speichern
|
||||||
|
SaveSingleGroupFile();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private string[,] LoadXML()
|
||||||
|
{
|
||||||
|
var load = new LoadXMLFile();
|
||||||
|
load.FileName = FileName;
|
||||||
|
load.Topic = Topic;
|
||||||
|
load.Group = Group;
|
||||||
|
load.Key = Key;
|
||||||
|
load.LoadAllValues = LoadXMLFile.LoadAll.Yes; //Es werden alle Elemente geladen
|
||||||
|
load.Load();
|
||||||
|
|
||||||
|
return load.Values;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
66
SaveXMLFile/SaveXMLFile.csproj
Normal file
66
SaveXMLFile/SaveXMLFile.csproj
Normal file
@ -0,0 +1,66 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||||
|
<PropertyGroup>
|
||||||
|
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||||
|
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||||
|
<ProjectGuid>{875729B3-8DE0-40CE-9FE0-BD98F1DBA463}</ProjectGuid>
|
||||||
|
<OutputType>Library</OutputType>
|
||||||
|
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||||
|
<RootNamespace>Eugen.ESystem.IO</RootNamespace>
|
||||||
|
<AssemblyName>hesaxmlf</AssemblyName>
|
||||||
|
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
|
||||||
|
<FileAlignment>512</FileAlignment>
|
||||||
|
<Deterministic>false</Deterministic>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||||
|
<DebugSymbols>true</DebugSymbols>
|
||||||
|
<DebugType>full</DebugType>
|
||||||
|
<Optimize>false</Optimize>
|
||||||
|
<OutputPath>bin\Debug\</OutputPath>
|
||||||
|
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<WarningLevel>4</WarningLevel>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||||
|
<DebugType>pdbonly</DebugType>
|
||||||
|
<Optimize>true</Optimize>
|
||||||
|
<OutputPath>bin\Release\</OutputPath>
|
||||||
|
<DefineConstants>TRACE</DefineConstants>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<WarningLevel>4</WarningLevel>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Reference Include="heloxmlf, Version=1.0.8382.23282, Culture=neutral, processorArchitecture=MSIL">
|
||||||
|
<SpecificVersion>False</SpecificVersion>
|
||||||
|
<HintPath>..\..\LoadXMLFile.git\LoadXMLFile\bin\Debug\heloxmlf.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="System" />
|
||||||
|
<Reference Include="System.Core" />
|
||||||
|
<Reference Include="System.Windows.Forms" />
|
||||||
|
<Reference Include="System.Xml.Linq" />
|
||||||
|
<Reference Include="System.Data.DataSetExtensions" />
|
||||||
|
<Reference Include="Microsoft.CSharp" />
|
||||||
|
<Reference Include="System.Data" />
|
||||||
|
<Reference Include="System.Net.Http" />
|
||||||
|
<Reference Include="System.Xml" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Compile Include="Properties\AppResources.Designer.cs">
|
||||||
|
<AutoGen>True</AutoGen>
|
||||||
|
<DesignTime>True</DesignTime>
|
||||||
|
<DependentUpon>AppResources.resx</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="SaveXMLFile.cs" />
|
||||||
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<EmbeddedResource Include="Properties\AppResources.de.resx" />
|
||||||
|
<EmbeddedResource Include="Properties\AppResources.en.resx" />
|
||||||
|
<EmbeddedResource Include="Properties\AppResources.resx">
|
||||||
|
<Generator>ResXFileCodeGenerator</Generator>
|
||||||
|
<LastGenOutput>AppResources.Designer.cs</LastGenOutput>
|
||||||
|
</EmbeddedResource>
|
||||||
|
</ItemGroup>
|
||||||
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
|
</Project>
|
||||||
BIN
SaveXMLFile/bin/Debug/de/hesaxmlf.resources.dll
Normal file
BIN
SaveXMLFile/bin/Debug/de/hesaxmlf.resources.dll
Normal file
Binary file not shown.
BIN
SaveXMLFile/bin/Debug/en/hesaxmlf.resources.dll
Normal file
BIN
SaveXMLFile/bin/Debug/en/hesaxmlf.resources.dll
Normal file
Binary file not shown.
BIN
SaveXMLFile/bin/Debug/heloxmlf.dll
Normal file
BIN
SaveXMLFile/bin/Debug/heloxmlf.dll
Normal file
Binary file not shown.
6
SaveXMLFile/bin/Debug/heloxmlf.dll.config
Normal file
6
SaveXMLFile/bin/Debug/heloxmlf.dll.config
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<configuration>
|
||||||
|
<startup>
|
||||||
|
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
|
||||||
|
</startup>
|
||||||
|
</configuration>
|
||||||
BIN
SaveXMLFile/bin/Debug/heloxmlf.pdb
Normal file
BIN
SaveXMLFile/bin/Debug/heloxmlf.pdb
Normal file
Binary file not shown.
BIN
SaveXMLFile/bin/Debug/hesaxmlf.dll
Normal file
BIN
SaveXMLFile/bin/Debug/hesaxmlf.dll
Normal file
Binary file not shown.
BIN
SaveXMLFile/bin/Debug/hesaxmlf.pdb
Normal file
BIN
SaveXMLFile/bin/Debug/hesaxmlf.pdb
Normal file
Binary file not shown.
@ -0,0 +1,4 @@
|
|||||||
|
// <autogenerated />
|
||||||
|
using System;
|
||||||
|
using System.Reflection;
|
||||||
|
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
|
||||||
BIN
SaveXMLFile/obj/Debug/DesignTimeResolveAssemblyReferences.cache
Normal file
BIN
SaveXMLFile/obj/Debug/DesignTimeResolveAssemblyReferences.cache
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
SaveXMLFile/obj/Debug/SaveXMLFile.csproj.AssemblyReference.cache
Normal file
BIN
SaveXMLFile/obj/Debug/SaveXMLFile.csproj.AssemblyReference.cache
Normal file
Binary file not shown.
@ -0,0 +1 @@
|
|||||||
|
06a02b4b6148b9e1414dee0cd453bb4aeeb79a4a
|
||||||
@ -0,0 +1,18 @@
|
|||||||
|
H:\Programmieren\Git-WorkRepository\VisualStudio\_DLL\SaveXMLFile.git\SaveXMLFile\bin\Debug\hesaxmlf.dll
|
||||||
|
H:\Programmieren\Git-WorkRepository\VisualStudio\_DLL\SaveXMLFile.git\SaveXMLFile\bin\Debug\hesaxmlf.pdb
|
||||||
|
H:\Programmieren\Git-WorkRepository\VisualStudio\_DLL\SaveXMLFile.git\SaveXMLFile\bin\Debug\de\hesaxmlf.resources.dll
|
||||||
|
H:\Programmieren\Git-WorkRepository\VisualStudio\_DLL\SaveXMLFile.git\SaveXMLFile\bin\Debug\en\hesaxmlf.resources.dll
|
||||||
|
H:\Programmieren\Git-WorkRepository\VisualStudio\_DLL\SaveXMLFile.git\SaveXMLFile\bin\Debug\heloxmlf.dll
|
||||||
|
H:\Programmieren\Git-WorkRepository\VisualStudio\_DLL\SaveXMLFile.git\SaveXMLFile\bin\Debug\heloxmlf.pdb
|
||||||
|
H:\Programmieren\Git-WorkRepository\VisualStudio\_DLL\SaveXMLFile.git\SaveXMLFile\bin\Debug\heloxmlf.dll.config
|
||||||
|
H:\Programmieren\Git-WorkRepository\VisualStudio\_DLL\SaveXMLFile.git\SaveXMLFile\obj\Debug\SaveXMLFile.csproj.AssemblyReference.cache
|
||||||
|
H:\Programmieren\Git-WorkRepository\VisualStudio\_DLL\SaveXMLFile.git\SaveXMLFile\obj\Debug\Eugen.ESystem.IO.Properties.AppResources.resources
|
||||||
|
H:\Programmieren\Git-WorkRepository\VisualStudio\_DLL\SaveXMLFile.git\SaveXMLFile\obj\Debug\Eugen.ESystem.IO.Properties.AppResources.de.resources
|
||||||
|
H:\Programmieren\Git-WorkRepository\VisualStudio\_DLL\SaveXMLFile.git\SaveXMLFile\obj\Debug\Eugen.ESystem.IO.Properties.AppResources.en.resources
|
||||||
|
H:\Programmieren\Git-WorkRepository\VisualStudio\_DLL\SaveXMLFile.git\SaveXMLFile\obj\Debug\SaveXMLFile.csproj.GenerateResource.cache
|
||||||
|
H:\Programmieren\Git-WorkRepository\VisualStudio\_DLL\SaveXMLFile.git\SaveXMLFile\obj\Debug\SaveXMLFile.csproj.CoreCompileInputs.cache
|
||||||
|
H:\Programmieren\Git-WorkRepository\VisualStudio\_DLL\SaveXMLFile.git\SaveXMLFile\obj\Debug\de\hesaxmlf.resources.dll
|
||||||
|
H:\Programmieren\Git-WorkRepository\VisualStudio\_DLL\SaveXMLFile.git\SaveXMLFile\obj\Debug\en\hesaxmlf.resources.dll
|
||||||
|
H:\Programmieren\Git-WorkRepository\VisualStudio\_DLL\SaveXMLFile.git\SaveXMLFile\obj\Debug\SaveXMLFile.csproj.CopyComplete
|
||||||
|
H:\Programmieren\Git-WorkRepository\VisualStudio\_DLL\SaveXMLFile.git\SaveXMLFile\obj\Debug\hesaxmlf.dll
|
||||||
|
H:\Programmieren\Git-WorkRepository\VisualStudio\_DLL\SaveXMLFile.git\SaveXMLFile\obj\Debug\hesaxmlf.pdb
|
||||||
BIN
SaveXMLFile/obj/Debug/SaveXMLFile.csproj.GenerateResource.cache
Normal file
BIN
SaveXMLFile/obj/Debug/SaveXMLFile.csproj.GenerateResource.cache
Normal file
Binary file not shown.
Binary file not shown.
1
SaveXMLFile/obj/Debug/_IsIncrementalBuild
Normal file
1
SaveXMLFile/obj/Debug/_IsIncrementalBuild
Normal file
@ -0,0 +1 @@
|
|||||||
|
obj\Debug\\_IsIncrementalBuild
|
||||||
BIN
SaveXMLFile/obj/Debug/de/hesaxmlf.resources.dll
Normal file
BIN
SaveXMLFile/obj/Debug/de/hesaxmlf.resources.dll
Normal file
Binary file not shown.
BIN
SaveXMLFile/obj/Debug/en/hesaxmlf.resources.dll
Normal file
BIN
SaveXMLFile/obj/Debug/en/hesaxmlf.resources.dll
Normal file
Binary file not shown.
BIN
SaveXMLFile/obj/Debug/hesaxmlf.dll
Normal file
BIN
SaveXMLFile/obj/Debug/hesaxmlf.dll
Normal file
Binary file not shown.
BIN
SaveXMLFile/obj/Debug/hesaxmlf.pdb
Normal file
BIN
SaveXMLFile/obj/Debug/hesaxmlf.pdb
Normal file
Binary file not shown.
6
Test_SaveXMLFile/App.config
Normal file
6
Test_SaveXMLFile/App.config
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<configuration>
|
||||||
|
<startup>
|
||||||
|
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2"/>
|
||||||
|
</startup>
|
||||||
|
</configuration>
|
||||||
118
Test_SaveXMLFile/Form1.Designer.cs
generated
Normal file
118
Test_SaveXMLFile/Form1.Designer.cs
generated
Normal file
@ -0,0 +1,118 @@
|
|||||||
|
namespace Test_SaveXMLFile
|
||||||
|
{
|
||||||
|
partial class Form1
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Erforderliche Designervariable.
|
||||||
|
/// </summary>
|
||||||
|
private System.ComponentModel.IContainer components = null;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Verwendete Ressourcen bereinigen.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="disposing">True, wenn verwaltete Ressourcen gelöscht werden sollen; andernfalls False.</param>
|
||||||
|
protected override void Dispose(bool disposing)
|
||||||
|
{
|
||||||
|
if (disposing && (components != null))
|
||||||
|
{
|
||||||
|
components.Dispose();
|
||||||
|
}
|
||||||
|
base.Dispose(disposing);
|
||||||
|
}
|
||||||
|
|
||||||
|
#region Vom Windows Form-Designer generierter Code
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Erforderliche Methode für die Designerunterstützung.
|
||||||
|
/// Der Inhalt der Methode darf nicht mit dem Code-Editor geändert werden.
|
||||||
|
/// </summary>
|
||||||
|
private void InitializeComponent()
|
||||||
|
{
|
||||||
|
this.buttonShowInfo = new System.Windows.Forms.Button();
|
||||||
|
this.groupBoxProgramInfo = new System.Windows.Forms.GroupBox();
|
||||||
|
this.labelProgramInfo = new System.Windows.Forms.Label();
|
||||||
|
this.groupBoxDLLInfo = new System.Windows.Forms.GroupBox();
|
||||||
|
this.labelDLLInfo = new System.Windows.Forms.Label();
|
||||||
|
this.groupBoxProgramInfo.SuspendLayout();
|
||||||
|
this.groupBoxDLLInfo.SuspendLayout();
|
||||||
|
this.SuspendLayout();
|
||||||
|
//
|
||||||
|
// buttonShowInfo
|
||||||
|
//
|
||||||
|
this.buttonShowInfo.Location = new System.Drawing.Point(12, 287);
|
||||||
|
this.buttonShowInfo.Name = "buttonShowInfo";
|
||||||
|
this.buttonShowInfo.Size = new System.Drawing.Size(776, 23);
|
||||||
|
this.buttonShowInfo.TabIndex = 0;
|
||||||
|
this.buttonShowInfo.Text = "Start";
|
||||||
|
this.buttonShowInfo.UseVisualStyleBackColor = true;
|
||||||
|
this.buttonShowInfo.Click += new System.EventHandler(this.buttonShowInfo_Click);
|
||||||
|
//
|
||||||
|
// groupBoxProgramInfo
|
||||||
|
//
|
||||||
|
this.groupBoxProgramInfo.Controls.Add(this.labelProgramInfo);
|
||||||
|
this.groupBoxProgramInfo.Location = new System.Drawing.Point(12, 372);
|
||||||
|
this.groupBoxProgramInfo.Name = "groupBoxProgramInfo";
|
||||||
|
this.groupBoxProgramInfo.Size = new System.Drawing.Size(385, 66);
|
||||||
|
this.groupBoxProgramInfo.TabIndex = 11;
|
||||||
|
this.groupBoxProgramInfo.TabStop = false;
|
||||||
|
this.groupBoxProgramInfo.Text = "Programm Information";
|
||||||
|
//
|
||||||
|
// labelProgramInfo
|
||||||
|
//
|
||||||
|
this.labelProgramInfo.AutoSize = true;
|
||||||
|
this.labelProgramInfo.ImeMode = System.Windows.Forms.ImeMode.NoControl;
|
||||||
|
this.labelProgramInfo.Location = new System.Drawing.Point(7, 20);
|
||||||
|
this.labelProgramInfo.Name = "labelProgramInfo";
|
||||||
|
this.labelProgramInfo.Size = new System.Drawing.Size(16, 13);
|
||||||
|
this.labelProgramInfo.TabIndex = 0;
|
||||||
|
this.labelProgramInfo.Text = "...";
|
||||||
|
//
|
||||||
|
// groupBoxDLLInfo
|
||||||
|
//
|
||||||
|
this.groupBoxDLLInfo.Controls.Add(this.labelDLLInfo);
|
||||||
|
this.groupBoxDLLInfo.Location = new System.Drawing.Point(403, 372);
|
||||||
|
this.groupBoxDLLInfo.Name = "groupBoxDLLInfo";
|
||||||
|
this.groupBoxDLLInfo.Size = new System.Drawing.Size(385, 66);
|
||||||
|
this.groupBoxDLLInfo.TabIndex = 12;
|
||||||
|
this.groupBoxDLLInfo.TabStop = false;
|
||||||
|
this.groupBoxDLLInfo.Text = "DLL Information";
|
||||||
|
//
|
||||||
|
// labelDLLInfo
|
||||||
|
//
|
||||||
|
this.labelDLLInfo.AutoSize = true;
|
||||||
|
this.labelDLLInfo.ImeMode = System.Windows.Forms.ImeMode.NoControl;
|
||||||
|
this.labelDLLInfo.Location = new System.Drawing.Point(7, 20);
|
||||||
|
this.labelDLLInfo.Name = "labelDLLInfo";
|
||||||
|
this.labelDLLInfo.Size = new System.Drawing.Size(16, 13);
|
||||||
|
this.labelDLLInfo.TabIndex = 0;
|
||||||
|
this.labelDLLInfo.Text = "...";
|
||||||
|
//
|
||||||
|
// Form1
|
||||||
|
//
|
||||||
|
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||||
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||||
|
this.ClientSize = new System.Drawing.Size(800, 450);
|
||||||
|
this.Controls.Add(this.groupBoxProgramInfo);
|
||||||
|
this.Controls.Add(this.groupBoxDLLInfo);
|
||||||
|
this.Controls.Add(this.buttonShowInfo);
|
||||||
|
this.Name = "Form1";
|
||||||
|
this.Text = "Test_InfoBox";
|
||||||
|
this.Load += new System.EventHandler(this.Form1_Load);
|
||||||
|
this.groupBoxProgramInfo.ResumeLayout(false);
|
||||||
|
this.groupBoxProgramInfo.PerformLayout();
|
||||||
|
this.groupBoxDLLInfo.ResumeLayout(false);
|
||||||
|
this.groupBoxDLLInfo.PerformLayout();
|
||||||
|
this.ResumeLayout(false);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
private System.Windows.Forms.Button buttonShowInfo;
|
||||||
|
private System.Windows.Forms.GroupBox groupBoxProgramInfo;
|
||||||
|
private System.Windows.Forms.Label labelProgramInfo;
|
||||||
|
private System.Windows.Forms.GroupBox groupBoxDLLInfo;
|
||||||
|
private System.Windows.Forms.Label labelDLLInfo;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
152
Test_SaveXMLFile/Form1.cs
Normal file
152
Test_SaveXMLFile/Form1.cs
Normal file
@ -0,0 +1,152 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel;
|
||||||
|
using System.Data;
|
||||||
|
using System.Drawing;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Reflection;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
using Eugen.ESystem.IO;
|
||||||
|
using static System.Net.Mime.MediaTypeNames;
|
||||||
|
|
||||||
|
namespace Test_SaveXMLFile
|
||||||
|
{
|
||||||
|
public partial class Form1 : Form
|
||||||
|
{
|
||||||
|
#region Version und Copyright
|
||||||
|
// Version und Copyright
|
||||||
|
string programName = Path.GetFileNameWithoutExtension(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase); //Den Programmnamen auslesen
|
||||||
|
string programVersion = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString();
|
||||||
|
static object[] attributes = System.Reflection.Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCopyrightAttribute), false);
|
||||||
|
string copyright = GenerateCopyright();
|
||||||
|
string icon = System.Windows.Forms.Application.StartupPath + "\\Info.bmp";
|
||||||
|
//Assembly Datum und Zeit
|
||||||
|
static DateTime value = AssemblyDateTime();
|
||||||
|
string date = value.ToShortDateString();
|
||||||
|
string time = value.ToLongTimeString();
|
||||||
|
private static DateTime AssemblyDateTime()
|
||||||
|
{
|
||||||
|
var version = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version;
|
||||||
|
var buildDateTime = new DateTime(2000, 1, 1).Add(new TimeSpan(TimeSpan.TicksPerDay * version.Build + TimeSpan.TicksPerSecond * 2 * version.Revision));
|
||||||
|
//Tage seit dem 1. Januar 2000 und Sekunden seit Mitternacht, (multiplizier mit 2 ergibt das Original)
|
||||||
|
return buildDateTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static string CurrentYear()
|
||||||
|
{
|
||||||
|
DateTime dtn = DateTime.Now;
|
||||||
|
return dtn.Year.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
private static string StartYear()
|
||||||
|
{
|
||||||
|
//string startYear = ((AssemblyCopyrightAttribute)attributes[0]).Copyright;
|
||||||
|
//return startYear.Remove(0, startYear.LastIndexOf(" ") + 1);
|
||||||
|
string startYear = "";
|
||||||
|
if (((AssemblyCopyrightAttribute)attributes[0]).Copyright.Contains("Copyright © "))
|
||||||
|
{
|
||||||
|
startYear = ((AssemblyCopyrightAttribute)attributes[0]).Copyright.Replace("Copyright © ", "");
|
||||||
|
while (startYear.StartsWith(" "))
|
||||||
|
{
|
||||||
|
startYear = startYear.Remove(0, 1);
|
||||||
|
}
|
||||||
|
startYear = startYear.Remove(startYear.IndexOf(" "));
|
||||||
|
return startYear;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
DateTime dtn = DateTime.Now;
|
||||||
|
return dtn.Year.ToString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static string GenerateCopyright()
|
||||||
|
{
|
||||||
|
string startYear = StartYear();
|
||||||
|
string currentYear = CurrentYear();
|
||||||
|
|
||||||
|
if (startYear == currentYear)
|
||||||
|
{
|
||||||
|
return ((AssemblyCopyrightAttribute)attributes[0]).Copyright;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//return String.Concat(((AssemblyCopyrightAttribute)attributes[0]).Copyright, "-", currentYear);
|
||||||
|
return ((AssemblyCopyrightAttribute)attributes[0]).Copyright.Replace(startYear, String.Concat(startYear, "-", currentYear));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Programm-Info
|
||||||
|
/// <summary>
|
||||||
|
/// Contains the name of the program file
|
||||||
|
/// </summary>
|
||||||
|
public static string ProgramName { set; get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Contains the version of the program file
|
||||||
|
/// </summary>
|
||||||
|
public static string ProgramVersion { set; get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Contains the copyright notice
|
||||||
|
/// </summary>
|
||||||
|
public static string Copyright { set; get; }
|
||||||
|
|
||||||
|
private void SetProgramInfo()
|
||||||
|
{
|
||||||
|
//Name, Version und Copyright setzen
|
||||||
|
ProgramName = programName;
|
||||||
|
ProgramVersion = programVersion;
|
||||||
|
Copyright = copyright;
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
public Form1()
|
||||||
|
{
|
||||||
|
SetProgramInfo();
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Form1_Load(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
labelProgramInfo.Text = String.Concat(ProgramName, "\r\n", ProgramVersion, "\r\n", Copyright); // Zeigt die Programm-Information an
|
||||||
|
|
||||||
|
labelDLLInfo.Text = String.Concat(SaveXMLFile.DllName, "\r\n", SaveXMLFile.DllVersion, "\r\n", SaveXMLFile.Copyright); // Zeigt die DLL-Information an
|
||||||
|
}
|
||||||
|
|
||||||
|
private void buttonShowInfo_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
// Diese Zeilen gehört in das Programm kopiert
|
||||||
|
//
|
||||||
|
//
|
||||||
|
string[,] newValues = new string[,] { { "NX 2306", "yes" }, { "NX 2312", "no" } }; //Die Werte die neu dazukommen oder ersetzt werden sollen
|
||||||
|
|
||||||
|
var sxmlf = new SaveXMLFile();
|
||||||
|
//Die Werte übergeben
|
||||||
|
sxmlf.FileName = @"H:\Programmieren\Git-WorkRepository\VisualStudio\_DLL\SaveXMLFile.git\Daten\Test.xml";
|
||||||
|
sxmlf.MultiGroupFile = SaveXMLFile.multigroupFile.Yes;
|
||||||
|
sxmlf.Topic = "NX-Portal";
|
||||||
|
sxmlf.Group = "NX";
|
||||||
|
sxmlf.Key = "Version";
|
||||||
|
string[] tempValue = new string[newValues.Length / 2];
|
||||||
|
string[] tempStandard = new string[newValues.Length / 2];
|
||||||
|
for (int i = 0; i < newValues.Length / 2; i++)
|
||||||
|
{
|
||||||
|
tempValue[i] = newValues[i, 0];
|
||||||
|
tempStandard[i] = newValues[i, 1];
|
||||||
|
}
|
||||||
|
sxmlf.Values = tempValue;
|
||||||
|
sxmlf.Standard = tempStandard;
|
||||||
|
sxmlf.StandardNr = 1;
|
||||||
|
|
||||||
|
sxmlf.Save(); //Speichern
|
||||||
|
//
|
||||||
|
//
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
120
Test_SaveXMLFile/Form1.resx
Normal file
120
Test_SaveXMLFile/Form1.resx
Normal file
@ -0,0 +1,120 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<root>
|
||||||
|
<!--
|
||||||
|
Microsoft ResX Schema
|
||||||
|
|
||||||
|
Version 2.0
|
||||||
|
|
||||||
|
The primary goals of this format is to allow a simple XML format
|
||||||
|
that is mostly human readable. The generation and parsing of the
|
||||||
|
various data types are done through the TypeConverter classes
|
||||||
|
associated with the data types.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
... ado.net/XML headers & schema ...
|
||||||
|
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||||
|
<resheader name="version">2.0</resheader>
|
||||||
|
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||||
|
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||||
|
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||||
|
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||||
|
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||||
|
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||||
|
</data>
|
||||||
|
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
|
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||||
|
<comment>This is a comment</comment>
|
||||||
|
</data>
|
||||||
|
|
||||||
|
There are any number of "resheader" rows that contain simple
|
||||||
|
name/value pairs.
|
||||||
|
|
||||||
|
Each data row contains a name, and value. The row also contains a
|
||||||
|
type or mimetype. Type corresponds to a .NET class that support
|
||||||
|
text/value conversion through the TypeConverter architecture.
|
||||||
|
Classes that don't support this are serialized and stored with the
|
||||||
|
mimetype set.
|
||||||
|
|
||||||
|
The mimetype is used for serialized objects, and tells the
|
||||||
|
ResXResourceReader how to depersist the object. This is currently not
|
||||||
|
extensible. For a given mimetype the value must be set accordingly:
|
||||||
|
|
||||||
|
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||||
|
that the ResXResourceWriter will generate, however the reader can
|
||||||
|
read any of the formats listed below.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.binary.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.soap.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||||
|
value : The object must be serialized into a byte array
|
||||||
|
: using a System.ComponentModel.TypeConverter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
-->
|
||||||
|
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
|
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||||
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:choice maxOccurs="unbounded">
|
||||||
|
<xsd:element name="metadata">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="assembly">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:attribute name="alias" type="xsd:string" />
|
||||||
|
<xsd:attribute name="name" type="xsd:string" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="data">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="resheader">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:choice>
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:schema>
|
||||||
|
<resheader name="resmimetype">
|
||||||
|
<value>text/microsoft-resx</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="version">
|
||||||
|
<value>2.0</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="reader">
|
||||||
|
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="writer">
|
||||||
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
</root>
|
||||||
22
Test_SaveXMLFile/Program.cs
Normal file
22
Test_SaveXMLFile/Program.cs
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
|
||||||
|
namespace Test_SaveXMLFile
|
||||||
|
{
|
||||||
|
internal static class Program
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Der Haupteinstiegspunkt für die Anwendung.
|
||||||
|
/// </summary>
|
||||||
|
[STAThread]
|
||||||
|
static void Main()
|
||||||
|
{
|
||||||
|
Application.EnableVisualStyles();
|
||||||
|
Application.SetCompatibleTextRenderingDefault(false);
|
||||||
|
Application.Run(new Form1());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
36
Test_SaveXMLFile/Properties/AssemblyInfo.cs
Normal file
36
Test_SaveXMLFile/Properties/AssemblyInfo.cs
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
using System.Reflection;
|
||||||
|
using System.Runtime.CompilerServices;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
|
// Allgemeine Informationen über eine Assembly werden über die folgenden
|
||||||
|
// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern,
|
||||||
|
// die einer Assembly zugeordnet sind.
|
||||||
|
[assembly: AssemblyTitle("Test_SaveXMLFile")]
|
||||||
|
[assembly: AssemblyDescription("")]
|
||||||
|
[assembly: AssemblyConfiguration("")]
|
||||||
|
[assembly: AssemblyCompany("")]
|
||||||
|
[assembly: AssemblyProduct("Test_SaveXMLFile")]
|
||||||
|
[assembly: AssemblyCopyright("Copyright © 2022 by Eugen Höglinger")]
|
||||||
|
[assembly: AssemblyTrademark("")]
|
||||||
|
[assembly: AssemblyCulture("")]
|
||||||
|
|
||||||
|
// Durch Festlegen von ComVisible auf FALSE werden die Typen in dieser Assembly
|
||||||
|
// für COM-Komponenten unsichtbar. Wenn Sie auf einen Typ in dieser Assembly von
|
||||||
|
// COM aus zugreifen müssen, sollten Sie das ComVisible-Attribut für diesen Typ auf "True" festlegen.
|
||||||
|
[assembly: ComVisible(false)]
|
||||||
|
|
||||||
|
// Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird
|
||||||
|
[assembly: Guid("34dca2b4-1b0f-461f-a937-47713c0481b6")]
|
||||||
|
|
||||||
|
// Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten:
|
||||||
|
//
|
||||||
|
// Hauptversion
|
||||||
|
// Nebenversion
|
||||||
|
// Buildnummer
|
||||||
|
// Revision
|
||||||
|
//
|
||||||
|
// Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden,
|
||||||
|
// übernehmen, indem Sie "*" eingeben:
|
||||||
|
// [assembly: AssemblyVersion("1.0.*")]
|
||||||
|
[assembly: AssemblyVersion("1.0.*")]
|
||||||
|
//[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||||
63
Test_SaveXMLFile/Properties/Resources.Designer.cs
generated
Normal file
63
Test_SaveXMLFile/Properties/Resources.Designer.cs
generated
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// Dieser Code wurde von einem Tool generiert.
|
||||||
|
// Laufzeitversion:4.0.30319.42000
|
||||||
|
//
|
||||||
|
// Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn
|
||||||
|
// der Code erneut generiert wird.
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace Test_SaveXMLFile.Properties {
|
||||||
|
using System;
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw.
|
||||||
|
/// </summary>
|
||||||
|
// Diese Klasse wurde von der StronglyTypedResourceBuilder automatisch generiert
|
||||||
|
// -Klasse über ein Tool wie ResGen oder Visual Studio automatisch generiert.
|
||||||
|
// Um einen Member hinzuzufügen oder zu entfernen, bearbeiten Sie die .ResX-Datei und führen dann ResGen
|
||||||
|
// mit der /str-Option erneut aus, oder Sie erstellen Ihr VS-Projekt neu.
|
||||||
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
|
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||||
|
internal class Resources {
|
||||||
|
|
||||||
|
private static global::System.Resources.ResourceManager resourceMan;
|
||||||
|
|
||||||
|
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||||
|
|
||||||
|
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||||
|
internal Resources() {
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird.
|
||||||
|
/// </summary>
|
||||||
|
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||||
|
internal static global::System.Resources.ResourceManager ResourceManager {
|
||||||
|
get {
|
||||||
|
if (object.ReferenceEquals(resourceMan, null)) {
|
||||||
|
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Test_SaveXMLFile.Properties.Resources", typeof(Resources).Assembly);
|
||||||
|
resourceMan = temp;
|
||||||
|
}
|
||||||
|
return resourceMan;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle
|
||||||
|
/// Ressourcenzuordnungen, die diese stark typisierte Ressourcenklasse verwenden.
|
||||||
|
/// </summary>
|
||||||
|
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||||
|
internal static global::System.Globalization.CultureInfo Culture {
|
||||||
|
get {
|
||||||
|
return resourceCulture;
|
||||||
|
}
|
||||||
|
set {
|
||||||
|
resourceCulture = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
117
Test_SaveXMLFile/Properties/Resources.resx
Normal file
117
Test_SaveXMLFile/Properties/Resources.resx
Normal file
@ -0,0 +1,117 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<root>
|
||||||
|
<!--
|
||||||
|
Microsoft ResX Schema
|
||||||
|
|
||||||
|
Version 2.0
|
||||||
|
|
||||||
|
The primary goals of this format is to allow a simple XML format
|
||||||
|
that is mostly human readable. The generation and parsing of the
|
||||||
|
various data types are done through the TypeConverter classes
|
||||||
|
associated with the data types.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
... ado.net/XML headers & schema ...
|
||||||
|
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||||
|
<resheader name="version">2.0</resheader>
|
||||||
|
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||||
|
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||||
|
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||||
|
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||||
|
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||||
|
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||||
|
</data>
|
||||||
|
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
|
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||||
|
<comment>This is a comment</comment>
|
||||||
|
</data>
|
||||||
|
|
||||||
|
There are any number of "resheader" rows that contain simple
|
||||||
|
name/value pairs.
|
||||||
|
|
||||||
|
Each data row contains a name, and value. The row also contains a
|
||||||
|
type or mimetype. Type corresponds to a .NET class that support
|
||||||
|
text/value conversion through the TypeConverter architecture.
|
||||||
|
Classes that don't support this are serialized and stored with the
|
||||||
|
mimetype set.
|
||||||
|
|
||||||
|
The mimetype is used for serialized objects, and tells the
|
||||||
|
ResXResourceReader how to depersist the object. This is currently not
|
||||||
|
extensible. For a given mimetype the value must be set accordingly:
|
||||||
|
|
||||||
|
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||||
|
that the ResXResourceWriter will generate, however the reader can
|
||||||
|
read any of the formats listed below.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.binary.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Serialization.Formatters.Binary.BinaryFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.soap.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||||
|
value : The object must be serialized into a byte array
|
||||||
|
: using a System.ComponentModel.TypeConverter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
-->
|
||||||
|
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:choice maxOccurs="unbounded">
|
||||||
|
<xsd:element name="metadata">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="assembly">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:attribute name="alias" type="xsd:string" />
|
||||||
|
<xsd:attribute name="name" type="xsd:string" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="data">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="resheader">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:choice>
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:schema>
|
||||||
|
<resheader name="resmimetype">
|
||||||
|
<value>text/microsoft-resx</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="version">
|
||||||
|
<value>2.0</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="reader">
|
||||||
|
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="writer">
|
||||||
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
</root>
|
||||||
26
Test_SaveXMLFile/Properties/Settings.Designer.cs
generated
Normal file
26
Test_SaveXMLFile/Properties/Settings.Designer.cs
generated
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// Dieser Code wurde von einem Tool generiert.
|
||||||
|
// Laufzeitversion:4.0.30319.42000
|
||||||
|
//
|
||||||
|
// Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn
|
||||||
|
// der Code erneut generiert wird.
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace Test_SaveXMLFile.Properties {
|
||||||
|
|
||||||
|
|
||||||
|
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||||
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.4.0.0")]
|
||||||
|
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
|
||||||
|
|
||||||
|
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||||
|
|
||||||
|
public static Settings Default {
|
||||||
|
get {
|
||||||
|
return defaultInstance;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
7
Test_SaveXMLFile/Properties/Settings.settings
Normal file
7
Test_SaveXMLFile/Properties/Settings.settings
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
<?xml version='1.0' encoding='utf-8'?>
|
||||||
|
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
|
||||||
|
<Profiles>
|
||||||
|
<Profile Name="(Default)" />
|
||||||
|
</Profiles>
|
||||||
|
<Settings />
|
||||||
|
</SettingsFile>
|
||||||
89
Test_SaveXMLFile/Test_SaveXMLFile.csproj
Normal file
89
Test_SaveXMLFile/Test_SaveXMLFile.csproj
Normal file
@ -0,0 +1,89 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||||
|
<PropertyGroup>
|
||||||
|
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||||
|
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||||
|
<ProjectGuid>{34DCA2B4-1B0F-461F-A937-47713C0481B6}</ProjectGuid>
|
||||||
|
<OutputType>WinExe</OutputType>
|
||||||
|
<RootNamespace>Test_SaveXMLFile</RootNamespace>
|
||||||
|
<AssemblyName>Test_SaveXMLFile</AssemblyName>
|
||||||
|
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
|
||||||
|
<FileAlignment>512</FileAlignment>
|
||||||
|
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||||
|
<Deterministic>false</Deterministic>
|
||||||
|
<TargetFrameworkProfile />
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||||
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||||
|
<DebugSymbols>true</DebugSymbols>
|
||||||
|
<DebugType>full</DebugType>
|
||||||
|
<Optimize>false</Optimize>
|
||||||
|
<OutputPath>bin\Debug\</OutputPath>
|
||||||
|
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<WarningLevel>4</WarningLevel>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||||
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||||
|
<DebugType>pdbonly</DebugType>
|
||||||
|
<Optimize>true</Optimize>
|
||||||
|
<OutputPath>bin\Release\</OutputPath>
|
||||||
|
<DefineConstants>TRACE</DefineConstants>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<WarningLevel>4</WarningLevel>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Reference Include="hesaxmlf, Version=1.0.8383.16082, Culture=neutral, processorArchitecture=MSIL">
|
||||||
|
<SpecificVersion>False</SpecificVersion>
|
||||||
|
<HintPath>..\SaveXMLFile\bin\Debug\hesaxmlf.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="System" />
|
||||||
|
<Reference Include="System.Core" />
|
||||||
|
<Reference Include="System.Xml.Linq" />
|
||||||
|
<Reference Include="System.Data.DataSetExtensions" />
|
||||||
|
<Reference Include="Microsoft.CSharp" />
|
||||||
|
<Reference Include="System.Data" />
|
||||||
|
<Reference Include="System.Deployment" />
|
||||||
|
<Reference Include="System.Drawing" />
|
||||||
|
<Reference Include="System.Net.Http" />
|
||||||
|
<Reference Include="System.Windows.Forms" />
|
||||||
|
<Reference Include="System.Xml" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Compile Include="Form1.cs">
|
||||||
|
<SubType>Form</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="Form1.Designer.cs">
|
||||||
|
<DependentUpon>Form1.cs</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="Program.cs" />
|
||||||
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
|
<EmbeddedResource Include="Form1.resx">
|
||||||
|
<DependentUpon>Form1.cs</DependentUpon>
|
||||||
|
</EmbeddedResource>
|
||||||
|
<EmbeddedResource Include="Properties\Resources.resx">
|
||||||
|
<Generator>ResXFileCodeGenerator</Generator>
|
||||||
|
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
</EmbeddedResource>
|
||||||
|
<Compile Include="Properties\Resources.Designer.cs">
|
||||||
|
<AutoGen>True</AutoGen>
|
||||||
|
<DependentUpon>Resources.resx</DependentUpon>
|
||||||
|
<DesignTime>True</DesignTime>
|
||||||
|
</Compile>
|
||||||
|
<None Include="Properties\Settings.settings">
|
||||||
|
<Generator>SettingsSingleFileGenerator</Generator>
|
||||||
|
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||||
|
</None>
|
||||||
|
<Compile Include="Properties\Settings.Designer.cs">
|
||||||
|
<AutoGen>True</AutoGen>
|
||||||
|
<DependentUpon>Settings.settings</DependentUpon>
|
||||||
|
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||||
|
</Compile>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<None Include="App.config" />
|
||||||
|
</ItemGroup>
|
||||||
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
|
</Project>
|
||||||
BIN
Test_SaveXMLFile/bin/Debug/Test_SaveXMLFile.exe
Normal file
BIN
Test_SaveXMLFile/bin/Debug/Test_SaveXMLFile.exe
Normal file
Binary file not shown.
6
Test_SaveXMLFile/bin/Debug/Test_SaveXMLFile.exe.config
Normal file
6
Test_SaveXMLFile/bin/Debug/Test_SaveXMLFile.exe.config
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<configuration>
|
||||||
|
<startup>
|
||||||
|
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2"/>
|
||||||
|
</startup>
|
||||||
|
</configuration>
|
||||||
BIN
Test_SaveXMLFile/bin/Debug/Test_SaveXMLFile.pdb
Normal file
BIN
Test_SaveXMLFile/bin/Debug/Test_SaveXMLFile.pdb
Normal file
Binary file not shown.
BIN
Test_SaveXMLFile/bin/Debug/de/hesaxmlf.resources.dll
Normal file
BIN
Test_SaveXMLFile/bin/Debug/de/hesaxmlf.resources.dll
Normal file
Binary file not shown.
BIN
Test_SaveXMLFile/bin/Debug/en/hesaxmlf.resources.dll
Normal file
BIN
Test_SaveXMLFile/bin/Debug/en/hesaxmlf.resources.dll
Normal file
Binary file not shown.
BIN
Test_SaveXMLFile/bin/Debug/heloxmlf.dll
Normal file
BIN
Test_SaveXMLFile/bin/Debug/heloxmlf.dll
Normal file
Binary file not shown.
6
Test_SaveXMLFile/bin/Debug/heloxmlf.dll.config
Normal file
6
Test_SaveXMLFile/bin/Debug/heloxmlf.dll.config
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<configuration>
|
||||||
|
<startup>
|
||||||
|
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
|
||||||
|
</startup>
|
||||||
|
</configuration>
|
||||||
BIN
Test_SaveXMLFile/bin/Debug/heloxmlf.pdb
Normal file
BIN
Test_SaveXMLFile/bin/Debug/heloxmlf.pdb
Normal file
Binary file not shown.
BIN
Test_SaveXMLFile/bin/Debug/hesaxmlf.dll
Normal file
BIN
Test_SaveXMLFile/bin/Debug/hesaxmlf.dll
Normal file
Binary file not shown.
BIN
Test_SaveXMLFile/bin/Debug/hesaxmlf.pdb
Normal file
BIN
Test_SaveXMLFile/bin/Debug/hesaxmlf.pdb
Normal file
Binary file not shown.
@ -0,0 +1,4 @@
|
|||||||
|
// <autogenerated />
|
||||||
|
using System;
|
||||||
|
using System.Reflection;
|
||||||
|
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Test_SaveXMLFile/obj/Debug/Test_SaveXMLFile.Form1.resources
Normal file
BIN
Test_SaveXMLFile/obj/Debug/Test_SaveXMLFile.Form1.resources
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1 @@
|
|||||||
|
60ee57f9c6fbd377b8c16bc587932cb490f0cd22
|
||||||
@ -0,0 +1,19 @@
|
|||||||
|
H:\Programmieren\Git-WorkRepository\VisualStudio\_DLL\SaveXMLFile.git\Test_SaveXMLFile\obj\Debug\Test_SaveXMLFile.csproj.AssemblyReference.cache
|
||||||
|
H:\Programmieren\Git-WorkRepository\VisualStudio\_DLL\SaveXMLFile.git\Test_SaveXMLFile\obj\Debug\Test_SaveXMLFile.csproj.SuggestedBindingRedirects.cache
|
||||||
|
H:\Programmieren\Git-WorkRepository\VisualStudio\_DLL\SaveXMLFile.git\Test_SaveXMLFile\obj\Debug\Test_SaveXMLFile.Form1.resources
|
||||||
|
H:\Programmieren\Git-WorkRepository\VisualStudio\_DLL\SaveXMLFile.git\Test_SaveXMLFile\obj\Debug\Test_SaveXMLFile.Properties.Resources.resources
|
||||||
|
H:\Programmieren\Git-WorkRepository\VisualStudio\_DLL\SaveXMLFile.git\Test_SaveXMLFile\obj\Debug\Test_SaveXMLFile.csproj.GenerateResource.cache
|
||||||
|
H:\Programmieren\Git-WorkRepository\VisualStudio\_DLL\SaveXMLFile.git\Test_SaveXMLFile\obj\Debug\Test_SaveXMLFile.csproj.CoreCompileInputs.cache
|
||||||
|
H:\Programmieren\Git-WorkRepository\VisualStudio\_DLL\SaveXMLFile.git\Test_SaveXMLFile\bin\Debug\Test_SaveXMLFile.exe.config
|
||||||
|
H:\Programmieren\Git-WorkRepository\VisualStudio\_DLL\SaveXMLFile.git\Test_SaveXMLFile\bin\Debug\Test_SaveXMLFile.exe
|
||||||
|
H:\Programmieren\Git-WorkRepository\VisualStudio\_DLL\SaveXMLFile.git\Test_SaveXMLFile\bin\Debug\Test_SaveXMLFile.pdb
|
||||||
|
H:\Programmieren\Git-WorkRepository\VisualStudio\_DLL\SaveXMLFile.git\Test_SaveXMLFile\bin\Debug\hesaxmlf.pdb
|
||||||
|
H:\Programmieren\Git-WorkRepository\VisualStudio\_DLL\SaveXMLFile.git\Test_SaveXMLFile\bin\Debug\de\hesaxmlf.resources.dll
|
||||||
|
H:\Programmieren\Git-WorkRepository\VisualStudio\_DLL\SaveXMLFile.git\Test_SaveXMLFile\bin\Debug\en\hesaxmlf.resources.dll
|
||||||
|
H:\Programmieren\Git-WorkRepository\VisualStudio\_DLL\SaveXMLFile.git\Test_SaveXMLFile\obj\Debug\Test_SaveXMLFile.csproj.CopyComplete
|
||||||
|
H:\Programmieren\Git-WorkRepository\VisualStudio\_DLL\SaveXMLFile.git\Test_SaveXMLFile\obj\Debug\Test_SaveXMLFile.exe
|
||||||
|
H:\Programmieren\Git-WorkRepository\VisualStudio\_DLL\SaveXMLFile.git\Test_SaveXMLFile\obj\Debug\Test_SaveXMLFile.pdb
|
||||||
|
H:\Programmieren\Git-WorkRepository\VisualStudio\_DLL\SaveXMLFile.git\Test_SaveXMLFile\bin\Debug\heloxmlf.dll
|
||||||
|
H:\Programmieren\Git-WorkRepository\VisualStudio\_DLL\SaveXMLFile.git\Test_SaveXMLFile\bin\Debug\heloxmlf.pdb
|
||||||
|
H:\Programmieren\Git-WorkRepository\VisualStudio\_DLL\SaveXMLFile.git\Test_SaveXMLFile\bin\Debug\heloxmlf.dll.config
|
||||||
|
H:\Programmieren\Git-WorkRepository\VisualStudio\_DLL\SaveXMLFile.git\Test_SaveXMLFile\bin\Debug\hesaxmlf.dll
|
||||||
Binary file not shown.
BIN
Test_SaveXMLFile/obj/Debug/Test_SaveXMLFile.exe
Normal file
BIN
Test_SaveXMLFile/obj/Debug/Test_SaveXMLFile.exe
Normal file
Binary file not shown.
BIN
Test_SaveXMLFile/obj/Debug/Test_SaveXMLFile.pdb
Normal file
BIN
Test_SaveXMLFile/obj/Debug/Test_SaveXMLFile.pdb
Normal file
Binary file not shown.
1
Test_SaveXMLFile/obj/Debug/_IsIncrementalBuild
Normal file
1
Test_SaveXMLFile/obj/Debug/_IsIncrementalBuild
Normal file
@ -0,0 +1 @@
|
|||||||
|
obj\Debug\\_IsIncrementalBuild
|
||||||
Loading…
Reference in New Issue
Block a user