Projektdateien hinzufügen.

master
Trivernis 7 years ago
parent 07c2117fd1
commit aa54d7af87

@ -0,0 +1,22 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.26403.7
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Gaia", "Gaia\Gaia.csproj", "{0E9767EC-BD0D-4251-8A81-CA79B3A3DC58}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{0E9767EC-BD0D-4251-8A81-CA79B3A3DC58}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0E9767EC-BD0D-4251-8A81-CA79B3A3DC58}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0E9767EC-BD0D-4251-8A81-CA79B3A3DC58}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0E9767EC-BD0D-4251-8A81-CA79B3A3DC58}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

@ -0,0 +1,430 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
using System.Xml;
namespace GAIA
{
public class Files
{
//A File to save dictionaries
public class DictionaryFile
{
private const string extension = ".dic";
private FileInfo file;
private Dictionary<string, string> dictA;
public DictionaryFile(string name)
{
dictA = new Dictionary<string, string>();
createDictionaryFile(name, "Data");
}
public DictionaryFile(string name, string directory)
{
dictA = new Dictionary<string, string>();
createDictionaryFile(name, directory);
}
private void createDictionaryFile(string name, string directory)
{
//saving in standard directory 'Data'
if (!Directory.Exists(directory))
{
Directory.CreateDirectory(directory);
}
var fn = directory + "/" + name;
//adding the extension .list if not existing
if (!name.Contains(extension))
{
fn += extension;
}
file = new FileInfo(fn);
//reading the file if existent
if (file.Exists)
{
readFile();
}
else
{
using (StreamWriter sw = file.CreateText())
{
}
}
}
private void readFile()
{
foreach (var line in File.ReadAllLines(file.FullName))
{
try
{
var l = line.Split('|');
dictA.Add(l[0], l[1]);
}
catch { }
}
}
public void add(string key, string value)
{
dictA.Add(key, value);
using (StreamWriter sw = file.AppendText())
{
sw.WriteLine(key + "|" + value);
}
}
public void remove(string key)
{
//removing the item by key
dictA.Remove(key);
var lines = File.ReadAllLines(file.FullName);
using (StreamWriter sw = file.CreateText())
{
foreach(var line in lines)
{
if(!line.Split('|')[0].Equals(key))
{
sw.WriteLine(line);
}
}
}
}
public void clear()
{
dictA.Clear();
//Clearing the file
using (StreamWriter sw = file.CreateText())
{
}
}
public Dictionary<string, string> getDictionary()
{
return dictA;
}
public void Delete()
{
file.Delete();
}
public void MoveTo(string path)
{
file.MoveTo(path);
}
public void CopyTo(string path)
{
file.CopyTo(path);
}
}
//A File to save lists
public class ListFile
{
//a file to store some lists in
private FileInfo file;
private List<string> listA;
private const string extension = ".lst";
public ListFile(string name)
{
listA = new List<string>();
createListFile(name, "Data");
}
public ListFile(string name, string directory)
{
listA = new List<string>();
createListFile(name, directory);
}
private void createListFile(string name, string directory)
{
//saving in standard directory 'Data'
if (!Directory.Exists(directory))
{
Directory.CreateDirectory(directory);
}
var fn = directory + "/" + name;
//adding the extension .list if not existing
if (!name.Contains(extension))
{
fn += extension;
}
file = new FileInfo(fn);
//reading the file if existent
if (file.Exists)
{
readFile();
}
else
{
using (StreamWriter sw = file.CreateText())
{
}
}
}
public void readFile()
{
//clearing the list to prevent doubled items
listA.Clear();
//reading the file line by line to list
foreach (var line in File.ReadAllLines(file.FullName))
{
listA.Add(line);
}
}
public void add(string item)
{
//first appending item to list, then writing it to file
listA.Add(item);
using (StreamWriter sw = file.AppendText())
{
sw.WriteLine(item);
}
}
public void remove(int id)
{
listA.RemoveAt(id);
var cId = 0;
//getting the lines of the file
var lines = File.ReadAllLines(file.FullName);
//writing and skipping the line with the named id
using (StreamWriter sw = file.AppendText())
{
foreach (var line in lines)
{
if (cId != id)
{
sw.WriteLine(line);
}
cId++;
}
}
}
public void clear()
{
//clearing list and overwriting file
listA.Clear();
using (StreamWriter sw = file.CreateText())
{
}
}
public List<string> getList()
{
return listA;
}
public void Delete()
{
file.Delete();
}
public void MoveTo(string destFileName)
{
file.MoveTo(destFileName);
}
public void CopyTo(string destFileName)
{
file.CopyTo(destFileName);
}
}
//The standard Logfile
public class LogFile
{
public FileInfo logfile;
public bool withTime = true;
public string timestring = "HH:mm:ss";
string executable;
public LogFile()
{
//choosing the name of the current executable as logfilename
executable = System.AppDomain.CurrentDomain.FriendlyName;
logfile = new FileInfo(executable.Replace(".exe", "") + ".log");
}
public LogFile(string path)
{
//logfile with chosen path
logfile = new FileInfo(path);
}
private void writeLogStart()
{
//creating or overwriting the logfile and writing the head
using (StreamWriter sw = logfile.CreateText())
{
sw.WriteLine("Started logging at " + DateTime.Now.ToString(@"YYYY/MM/DD_HH:mm:ss") + " with executable " + executable);
}
}
public void log(string data)
{
//the user decides whether he wants a the datetimestring or not
using (StreamWriter sw = logfile.AppendText())
{
if (withTime)
{
sw.WriteLine(DateTime.Now.ToString(timestring) + ": " + data);
}
else
{
sw.WriteLine(data);
}
}
}
public void dump(string path)
{
//storing the file in the given path
try
{
logfile.MoveTo(path);
}
catch { log("{Gaia.Logging} [!!] Failed moving this file"); }
}
public void dump()
{
//storing the file in directory Logs
if (!Directory.Exists("Logs"))
{
Directory.CreateDirectory("Logs");
}
int count = 1;
string filename = "Logs/" + DateTime.Now.ToString("YY-MM-DD");
//counting in the filename while the file would overwrite an older one
while (File.Exists(filename + ".log"))
{
filename.Replace("_" + count, "");
count++;
filename += "_" + count;
}
try
{
logfile.MoveTo(filename + ".log");
}
catch { log("{Gaia.Logging} [!!] Failed moving this file"); }
}
}
public class XMLDictionaryFile
{
private XmlDocument document;
private FileInfo file;
const string extension = ".dix";
public XMLDictionaryFile(string name)
{
createFile(name, "Data/");
}
public XMLDictionaryFile(string name, string directory)
{
createFile(name, directory);
}
private void createFile(string name, string directory)
{
document = new XmlDocument();
if(!Directory.Exists(directory))
{
Directory.CreateDirectory(directory);
}
if (!name.Contains(".dix"))
{
name += extension;
}
name = directory+"/" + name;
file = new FileInfo(name);
if (file.Exists)
{
document.Load(file.FullName);
}
else
{
XmlElement meta = document.CreateElement("meta");
meta.SetAttribute("creator", AppDomain.CurrentDomain.FriendlyName);
meta.SetAttribute("creationtime", DateTime.Now.ToString());
}
save();
}
private void save()
{
document.Save(file.FullName);
}
public void append(string key,string value)
{
XmlElement keyElement = document.CreateElement(key);
keyElement.InnerText = value;
save();
}
public void append(string key, XmlElement value)
{
document.CreateElement(key).InnerXml = value.OuterXml;
save();
}
public void append(string key, string value, Dictionary<string,string> attributes)
{
var keyElement = document.CreateElement(key);
keyElement.InnerText = value;
foreach(var attribute in attributes)
{
keyElement.SetAttribute(attribute.Key,attribute.Value);
}
save();
}
}
}
}

@ -0,0 +1,61 @@
<?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>{0E9767EC-BD0D-4251-8A81-CA79B3A3DC58}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>GAIA</RootNamespace>
<AssemblyName>G.A.I.A</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</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>
<PropertyGroup>
<SignAssembly>false</SignAssembly>
</PropertyGroup>
<ItemGroup>
<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.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Files.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

@ -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("G.A.I.A")]
[assembly: AssemblyDescription("Generally Advanced IO Additions")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Trivernis Software")]
[assembly: AssemblyProduct("G.A.I.A.")]
[assembly: AssemblyCopyright("Copyright © 2017")]
[assembly: AssemblyTrademark("Trivernis Software")]
[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("0e9767ec-bd0d-4251-8a81-ca79b3a3dc58")]
// 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.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

@ -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 GAIA.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", "4.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("GAIA.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;
}
}
}
}

@ -0,0 +1,101 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 1.3
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">1.3</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1">this is my long string</data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
[base64 mime encoded serialized .NET Framework object]
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
[base64 mime encoded string representing a byte array form of the .NET Framework object]
</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="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>1.3</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
Loading…
Cancel
Save