convert Pilz.IO to C# & Add EmbeddedFilesContainer
This commit is contained in:
129
Pilz.IO/EmbeddedFilesContainer.cs
Normal file
129
Pilz.IO/EmbeddedFilesContainer.cs
Normal file
@@ -0,0 +1,129 @@
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.IO.Compression;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Pilz.IO
|
||||
{
|
||||
public class EmbeddedFilesContainer
|
||||
{
|
||||
[JsonProperty("CompressedFiles")]
|
||||
private readonly Dictionary<string, byte[]> compressedFiles = new Dictionary<string, byte[]>();
|
||||
|
||||
[JsonIgnore]
|
||||
public IEnumerable<string> AllFileNames
|
||||
{
|
||||
get => compressedFiles.Keys;
|
||||
}
|
||||
|
||||
public Task<bool> AddFileAsync(string fileName, string filePath)
|
||||
{
|
||||
return Task.Run(() => AddFile(fileName, filePath));
|
||||
}
|
||||
|
||||
public bool AddFile(string fileName, string filePath)
|
||||
{
|
||||
bool success;
|
||||
FileStream fs = null;
|
||||
MemoryStream compressed = null;
|
||||
|
||||
#if !DEBUG
|
||||
try
|
||||
{
|
||||
#endif
|
||||
fs = new FileStream(filePath, FileMode.Open, FileAccess.Read);
|
||||
compressed = new MemoryStream();
|
||||
using (var compressor = new DeflateStream(compressed, CompressionLevel.Optimal, true))
|
||||
fs.CopyTo(compressor);
|
||||
success = true;
|
||||
#if !DEBUG
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
success = false;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (success)
|
||||
{
|
||||
var compressedBytes = compressed.ToArray();
|
||||
if (compressedFiles.ContainsKey(fileName))
|
||||
compressedFiles[fileName] = compressedBytes;
|
||||
else
|
||||
compressedFiles.Add(fileName, compressedBytes);
|
||||
}
|
||||
|
||||
compressed?.Close();
|
||||
fs?.Close();
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
public void RemoveFile(string fileName)
|
||||
{
|
||||
if (compressedFiles.ContainsKey(fileName))
|
||||
compressedFiles.Remove(fileName);
|
||||
}
|
||||
|
||||
public bool HasFile(string fileName)
|
||||
{
|
||||
return compressedFiles.ContainsKey(fileName);
|
||||
}
|
||||
|
||||
public Task<Stream> GetStreamAsync(string fileName)
|
||||
{
|
||||
return Task.Run(() => GetStream(fileName));
|
||||
}
|
||||
|
||||
public Stream GetStream(string fileName)
|
||||
{
|
||||
Stream decompressed = null;
|
||||
|
||||
if (compressedFiles.ContainsKey(fileName))
|
||||
{
|
||||
decompressed = new MemoryStream();
|
||||
DecompressToStream(decompressed, compressedFiles[fileName]);
|
||||
}
|
||||
|
||||
return decompressed;
|
||||
}
|
||||
|
||||
public Task<string> GetLocalFilePathAsync(string fileName)
|
||||
{
|
||||
return Task.Run(() => GetLocalFilePath(fileName));
|
||||
}
|
||||
|
||||
public string GetLocalFilePath(string fileName)
|
||||
{
|
||||
string filePath = string.Empty;
|
||||
|
||||
if (compressedFiles.ContainsKey(fileName))
|
||||
{
|
||||
filePath = Path.GetTempFileName();
|
||||
|
||||
if (Path.HasExtension(fileName))
|
||||
filePath = Path.ChangeExtension(filePath, Path.GetExtension(fileName));
|
||||
|
||||
var decompressed = new FileStream(filePath, FileMode.Create, FileAccess.ReadWrite);
|
||||
DecompressToStream(decompressed, compressedFiles[fileName]);
|
||||
decompressed.Flush();
|
||||
decompressed.Close();
|
||||
}
|
||||
|
||||
return filePath;
|
||||
}
|
||||
|
||||
private void DecompressToStream(Stream decompressed, byte[] compressedData)
|
||||
{
|
||||
var compressed = new MemoryStream(compressedData);
|
||||
var decompressor = new DeflateStream(compressed, CompressionMode.Decompress, true);
|
||||
decompressor.CopyTo(decompressed);
|
||||
decompressor.Close();
|
||||
compressed.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
14
Pilz.IO/EventArgs/DataEventargs.cs
Normal file
14
Pilz.IO/EventArgs/DataEventargs.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
|
||||
namespace Pilz.IO
|
||||
{
|
||||
public class DataEventArgs : EventArgs
|
||||
{
|
||||
public readonly byte[] Data;
|
||||
|
||||
public DataEventArgs(byte[] bytes) : base()
|
||||
{
|
||||
Data = bytes;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
Public Class DataEventArgs : Inherits EventArgs
|
||||
|
||||
Public ReadOnly Data As Byte()
|
||||
|
||||
Public Sub New(bytes As Byte())
|
||||
MyBase.New()
|
||||
Data = bytes
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
67
Pilz.IO/ManagedPipes/ManagedPipe.cs
Normal file
67
Pilz.IO/ManagedPipes/ManagedPipe.cs
Normal file
@@ -0,0 +1,67 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Pilz.IO
|
||||
{
|
||||
/// <summary>
|
||||
/// stellt den Erben "Server" und "Client" 2 verschiedene
|
||||
/// Message-Events zur Verfügung, und ein Event-Raisendes Dispose
|
||||
/// </summary>
|
||||
public abstract class ManagedPipe : IDisposable
|
||||
{
|
||||
public delegate void EventHandlerWithOneArgument<T0>(T0 Sender);
|
||||
|
||||
/// <summary>
|
||||
/// Zur Ausgabe chat-verwaltungstechnischer Status-Informationen
|
||||
/// </summary>
|
||||
public event EventHandler<DataEventArgs> StatusMessage;
|
||||
/// <summary>Zur Ausgabe von Chat-Messages</summary>
|
||||
public event EventHandler<DataEventArgs> RetriveData;
|
||||
public event EventHandlerWithOneArgument<ManagedPipe> Disposed;
|
||||
|
||||
private bool _IsDisposed = false;
|
||||
|
||||
protected abstract void Dispose(bool disposing);
|
||||
public abstract void Send(byte[] bytes);
|
||||
public abstract Task SendAsnyc(byte[] bytes);
|
||||
|
||||
protected void OnStatusMessage(DataEventArgs e)
|
||||
{
|
||||
StatusMessage?.Invoke(this, e);
|
||||
}
|
||||
|
||||
protected void OnRetriveData(DataEventArgs e)
|
||||
{
|
||||
RetriveData?.Invoke(this, e);
|
||||
}
|
||||
|
||||
public void RemoveFrom<T>(ICollection<T> Coll) where T : ManagedPipe
|
||||
{
|
||||
Coll.Remove((T)this);
|
||||
}
|
||||
|
||||
public bool IsDisposed
|
||||
{
|
||||
get
|
||||
{
|
||||
return _IsDisposed;
|
||||
}
|
||||
}
|
||||
|
||||
public void AddTo<T>(ICollection<T> Coll) where T : ManagedPipe
|
||||
{
|
||||
Coll.Add((T)this);
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
if (_IsDisposed)
|
||||
return;
|
||||
_IsDisposed = true;
|
||||
Dispose(true); // rufe die erzwungenen Überschreibungen von Sub Dispose(Boolean)
|
||||
Disposed?.Invoke(this);
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,53 +0,0 @@
|
||||
''' <summary>
|
||||
''' stellt den Erben "Server" und "Client" 2 verschiedene
|
||||
''' Message-Events zur Verfügung, und ein Event-Raisendes Dispose
|
||||
''' </summary>
|
||||
Public MustInherit Class ManagedPipe : Implements IDisposable
|
||||
|
||||
Public Delegate Sub EventHandlerWithOneArgument(Of T0)(Sender As T0)
|
||||
|
||||
''' <summary>
|
||||
''' Zur Ausgabe chat-verwaltungstechnischer Status-Informationen
|
||||
''' </summary>
|
||||
Public Event StatusMessage As EventHandler(Of DataEventArgs)
|
||||
''' <summary>Zur Ausgabe von Chat-Messages</summary>
|
||||
Public Event RetriveData As EventHandler(Of DataEventArgs)
|
||||
Public Event Disposed As EventHandlerWithOneArgument(Of ManagedPipe)
|
||||
|
||||
Private _IsDisposed As Boolean = False
|
||||
|
||||
Protected MustOverride Sub Dispose(disposing As Boolean)
|
||||
Public MustOverride Sub Send(bytes As Byte())
|
||||
Public MustOverride Function SendAsnyc(bytes As Byte()) As Task
|
||||
|
||||
Protected Sub OnStatusMessage(ByVal e As DataEventArgs)
|
||||
RaiseEvent StatusMessage(Me, e)
|
||||
End Sub
|
||||
|
||||
Protected Sub OnRetriveData(ByVal e As DataEventArgs)
|
||||
RaiseEvent RetriveData(Me, e)
|
||||
End Sub
|
||||
|
||||
Public Sub RemoveFrom(Of T As ManagedPipe)(ByVal Coll As ICollection(Of T))
|
||||
Coll.Remove(DirectCast(Me, T))
|
||||
End Sub
|
||||
|
||||
Public ReadOnly Property IsDisposed() As Boolean
|
||||
Get
|
||||
Return _IsDisposed
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Sub AddTo(Of T As ManagedPipe)(ByVal Coll As ICollection(Of T))
|
||||
Coll.Add(Me)
|
||||
End Sub
|
||||
|
||||
Public Sub Dispose() Implements IDisposable.Dispose
|
||||
If _IsDisposed Then Return
|
||||
_IsDisposed = True
|
||||
Dispose(True) ' rufe die erzwungenen Überschreibungen von Sub Dispose(Boolean)
|
||||
RaiseEvent Disposed(Me)
|
||||
GC.SuppressFinalize(Me)
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
108
Pilz.IO/ManagedPipes/ManagedPipeClient.cs
Normal file
108
Pilz.IO/ManagedPipes/ManagedPipeClient.cs
Normal file
@@ -0,0 +1,108 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using global::System.IO.Pipes;
|
||||
using System.Threading.Tasks;
|
||||
using global::Pilz.Threading;
|
||||
|
||||
namespace Pilz.IO
|
||||
{
|
||||
public class ManagedPipeClient : ManagedPipe
|
||||
{
|
||||
private PipeStream pipeStream;
|
||||
private byte[] _Buf = new byte[1024];
|
||||
|
||||
public bool RaiseEventsGui { get; set; } = true;
|
||||
|
||||
public ManagedPipeClient(string pipeName) : this(pipeName, ".")
|
||||
{
|
||||
}
|
||||
|
||||
public ManagedPipeClient(string pipeName, string serverName) : this(pipeName, serverName, -1)
|
||||
{
|
||||
}
|
||||
|
||||
public ManagedPipeClient(string pipeName, int connectionTimeout) : this(pipeName, ".", connectionTimeout)
|
||||
{
|
||||
}
|
||||
|
||||
public ManagedPipeClient(string pipeName, string serverName, int connectionTimeout)
|
||||
{
|
||||
var clnt = new NamedPipeClientStream(serverName, pipeName, PipeDirection.InOut, PipeOptions.Asynchronous);
|
||||
clnt.Connect(connectionTimeout);
|
||||
if (!clnt.IsConnected)
|
||||
{
|
||||
throw new TimeoutException("Connection timeout!");
|
||||
}
|
||||
|
||||
SetPipe(clnt);
|
||||
}
|
||||
|
||||
public ManagedPipeClient(PipeStream pipe)
|
||||
{
|
||||
SetPipe(pipe);
|
||||
}
|
||||
|
||||
private void SetPipe(PipeStream pipe)
|
||||
{
|
||||
pipeStream = pipe;
|
||||
pipeStream.BeginRead(_Buf, 0, _Buf.Length, EndRead, null);
|
||||
}
|
||||
|
||||
private void EndRead(IAsyncResult ar)
|
||||
{
|
||||
if (IsDisposed)
|
||||
return;
|
||||
int bytesCount = pipeStream.EndRead(ar);
|
||||
if (bytesCount == 0) // leere Datenübermittlung signalisiert Verbindungsabbruch
|
||||
{
|
||||
if (RaiseEventsGui)
|
||||
{
|
||||
CrossThreadsInvokeing.RunGui(Dispose);
|
||||
}
|
||||
else
|
||||
{
|
||||
Dispose();
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
var list = new List<byte>();
|
||||
for (int i = 0, loopTo = bytesCount - 1; i <= loopTo; i++)
|
||||
list.Add(_Buf[i]);
|
||||
while (bytesCount == _Buf.Length)
|
||||
{
|
||||
bytesCount = pipeStream.Read(_Buf, 0, _Buf.Length);
|
||||
for (int i = 0, loopTo1 = bytesCount - 1; i <= loopTo1; i++)
|
||||
list.Add(_Buf[i]);
|
||||
}
|
||||
|
||||
var deargs = new DataEventArgs(list.ToArray());
|
||||
if (RaiseEventsGui)
|
||||
{
|
||||
CrossThreadsInvokeing.RunGui(OnRetriveData, deargs);
|
||||
}
|
||||
else
|
||||
{
|
||||
OnRetriveData(deargs);
|
||||
}
|
||||
|
||||
pipeStream.BeginRead(_Buf, 0, _Buf.Length, EndRead, null);
|
||||
}
|
||||
|
||||
public override Task SendAsnyc(byte[] bytes)
|
||||
{
|
||||
return Task.Run(() => Send(bytes));
|
||||
}
|
||||
|
||||
public override void Send(byte[] data)
|
||||
{
|
||||
pipeStream.Write(data, 0, data.Length);
|
||||
}
|
||||
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
pipeStream.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,91 +0,0 @@
|
||||
Imports System.Net
|
||||
Imports System.Text
|
||||
Imports System.IO.Pipes
|
||||
Imports Pilz.Threading
|
||||
|
||||
Public Class ManagedPipeClient : Inherits ManagedPipe
|
||||
|
||||
Private pipeStream As PipeStream
|
||||
Private _Buf(&H400 - 1) As Byte
|
||||
|
||||
Public Property RaiseEventsGui As Boolean = True
|
||||
|
||||
Public Sub New(pipeName As String)
|
||||
Me.New(pipeName, ".")
|
||||
End Sub
|
||||
|
||||
Public Sub New(pipeName As String, serverName As String)
|
||||
Me.New(pipeName, serverName, -1)
|
||||
End Sub
|
||||
|
||||
Public Sub New(pipeName As String, connectionTimeout As Integer)
|
||||
Me.New(pipeName, ".", connectionTimeout)
|
||||
End Sub
|
||||
|
||||
Public Sub New(pipeName As String, serverName As String, connectionTimeout As Integer)
|
||||
Dim clnt As New NamedPipeClientStream(serverName, pipeName, PipeDirection.InOut, PipeOptions.Asynchronous)
|
||||
clnt.Connect(connectionTimeout)
|
||||
If Not clnt.IsConnected Then
|
||||
Throw New TimeoutException("Connection timeout!")
|
||||
End If
|
||||
SetPipe(clnt)
|
||||
End Sub
|
||||
|
||||
Public Sub New(pipe As PipeStream)
|
||||
SetPipe(pipe)
|
||||
End Sub
|
||||
|
||||
Private Sub SetPipe(pipe As PipeStream)
|
||||
pipeStream = pipe
|
||||
pipeStream.BeginRead(_Buf, 0, _Buf.Length, AddressOf EndRead, Nothing)
|
||||
End Sub
|
||||
|
||||
Private Sub EndRead(ar As IAsyncResult)
|
||||
If IsDisposed Then Return
|
||||
|
||||
Dim bytesCount As Integer = pipeStream.EndRead(ar)
|
||||
If bytesCount = 0 Then 'leere Datenübermittlung signalisiert Verbindungsabbruch
|
||||
If RaiseEventsGui Then
|
||||
CrossThreadsInvokeing.RunGui(AddressOf Dispose)
|
||||
Else
|
||||
Dispose()
|
||||
End If
|
||||
Return
|
||||
End If
|
||||
|
||||
Dim list As New List(Of Byte)
|
||||
|
||||
For i As Integer = 0 To bytesCount - 1
|
||||
list.Add(_Buf(i))
|
||||
Next
|
||||
|
||||
Do While bytesCount = _Buf.Length
|
||||
bytesCount = pipeStream.Read(_Buf, 0, _Buf.Length)
|
||||
For i As Integer = 0 To bytesCount - 1
|
||||
list.Add(_Buf(i))
|
||||
Next
|
||||
Loop
|
||||
|
||||
Dim deargs As New DataEventArgs(list.ToArray)
|
||||
If RaiseEventsGui Then
|
||||
CrossThreadsInvokeing.RunGui(AddressOf OnRetriveData, deargs)
|
||||
Else
|
||||
OnRetriveData(deargs)
|
||||
End If
|
||||
|
||||
pipeStream.BeginRead(_Buf, 0, _Buf.Length, AddressOf EndRead, Nothing)
|
||||
End Sub
|
||||
|
||||
Public Overrides Function SendAsnyc(bytes() As Byte) As Task
|
||||
Return Task.Run(Sub() Send(bytes))
|
||||
End Function
|
||||
|
||||
Public Overrides Sub Send(data As Byte())
|
||||
pipeStream.Write(data, 0, data.Length)
|
||||
End Sub
|
||||
|
||||
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
|
||||
pipeStream.Dispose()
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
108
Pilz.IO/ManagedPipes/ManagedPipeServer.cs
Normal file
108
Pilz.IO/ManagedPipes/ManagedPipeServer.cs
Normal file
@@ -0,0 +1,108 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using global::System.IO.Pipes;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Pilz.IO
|
||||
{
|
||||
public class ManagedPipeServer : ManagedPipe
|
||||
{
|
||||
|
||||
// Pro Verbindung (Anfrage) wird ein Client-Objekt generiert, das den Datenaustausch dieser Verbindung abwickelt
|
||||
public List<ManagedPipeClient> Clients { get; private set; } = new List<ManagedPipeClient>();
|
||||
|
||||
private readonly string pipeName = "";
|
||||
private readonly int maxNumbersOfServerInstances;
|
||||
private int numberOfStartedServerInstances = 0;
|
||||
|
||||
public ManagedPipeServer(string pipeName) : this(pipeName, 1)
|
||||
{
|
||||
}
|
||||
|
||||
public ManagedPipeServer(string pipeName, int maxNumbersOfServerInstances)
|
||||
{
|
||||
this.pipeName = pipeName;
|
||||
this.maxNumbersOfServerInstances = maxNumbersOfServerInstances;
|
||||
CreateWaitingStream();
|
||||
}
|
||||
|
||||
private void CreateWaitingStream()
|
||||
{
|
||||
if (numberOfStartedServerInstances < maxNumbersOfServerInstances)
|
||||
{
|
||||
var strm = new NamedPipeServerStream(pipeName, PipeDirection.InOut, maxNumbersOfServerInstances, PipeTransmissionMode.Byte, PipeOptions.Asynchronous);
|
||||
numberOfStartedServerInstances += 1;
|
||||
strm.BeginWaitForConnection(EndAccept, strm);
|
||||
}
|
||||
}
|
||||
|
||||
private void EndAccept(IAsyncResult ar)
|
||||
{
|
||||
NamedPipeServerStream strm = (NamedPipeServerStream)ar.AsyncState;
|
||||
strm.EndWaitForConnection(ar);
|
||||
if (IsDisposed)
|
||||
{
|
||||
strm.Dispose();
|
||||
return;
|
||||
}
|
||||
|
||||
{
|
||||
var withBlock = new ManagedPipeClient(strm);
|
||||
withBlock.RetriveData += Client_RetriveData;
|
||||
withBlock.StatusMessage += Client_StatusMessage;
|
||||
withBlock.Disposed += Client_Disposed;
|
||||
withBlock.AddTo(Clients);
|
||||
}
|
||||
|
||||
CreateWaitingStream();
|
||||
}
|
||||
|
||||
/* TODO ERROR: Skipped RegionDirectiveTrivia */
|
||||
private void Client_Disposed(ManagedPipe Sender)
|
||||
{
|
||||
// den Client für die beendete Verbindung entfernen
|
||||
Sender.RemoveFrom(Clients);
|
||||
numberOfStartedServerInstances -= 1;
|
||||
CreateWaitingStream();
|
||||
}
|
||||
|
||||
private void Client_RetriveData(object sender, DataEventArgs e)
|
||||
{
|
||||
// einkommende ChatMessages anzeigen, und an alle versenden
|
||||
OnRetriveData(e);
|
||||
}
|
||||
|
||||
private void Client_StatusMessage(object sender, DataEventArgs e)
|
||||
{
|
||||
// einkommende StatusMessages durchreichen (zur Anzeige)
|
||||
OnStatusMessage(e);
|
||||
}
|
||||
|
||||
/* TODO ERROR: Skipped EndRegionDirectiveTrivia */
|
||||
public override Task SendAsnyc(byte[] bytes)
|
||||
{
|
||||
return Task.Run(() => Send(bytes));
|
||||
}
|
||||
|
||||
public override void Send(byte[] data)
|
||||
{
|
||||
foreach (ManagedPipeClient client in Clients) // an alle versenden
|
||||
client.Send(data);
|
||||
}
|
||||
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (numberOfStartedServerInstances < maxNumbersOfServerInstances)
|
||||
{
|
||||
using (var clnt = new NamedPipeClientStream(pipeName))
|
||||
{
|
||||
// Herstellen einer Dummi-Verbindung, damit der ServerStream aus dem Wartezustand herauskommt.
|
||||
clnt.Connect();
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = Clients.Count - 1; i >= 0; i -= 1)
|
||||
Clients[i].Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,95 +0,0 @@
|
||||
Imports System.Net
|
||||
Imports System.IO.Pipes
|
||||
Imports Pilz.Threading
|
||||
|
||||
Public Class ManagedPipeServer : Inherits ManagedPipe
|
||||
|
||||
'Pro Verbindung (Anfrage) wird ein Client-Objekt generiert, das den Datenaustausch dieser Verbindung abwickelt
|
||||
Public ReadOnly Property Clients As New List(Of ManagedPipeClient)
|
||||
Private ReadOnly pipeName As String = ""
|
||||
Private ReadOnly maxNumbersOfServerInstances As Integer
|
||||
Private numberOfStartedServerInstances As Integer = 0
|
||||
|
||||
Public Sub New(ByVal pipeName As String)
|
||||
Me.New(pipeName, 1)
|
||||
End Sub
|
||||
|
||||
Public Sub New(pipeName As String, maxNumbersOfServerInstances As Integer)
|
||||
Me.pipeName = pipeName
|
||||
Me.maxNumbersOfServerInstances = maxNumbersOfServerInstances
|
||||
CreateWaitingStream()
|
||||
End Sub
|
||||
|
||||
Private Sub CreateWaitingStream()
|
||||
If numberOfStartedServerInstances < maxNumbersOfServerInstances Then
|
||||
Dim strm = New NamedPipeServerStream(pipeName, PipeDirection.InOut, maxNumbersOfServerInstances, PipeTransmissionMode.Byte, PipeOptions.Asynchronous)
|
||||
numberOfStartedServerInstances += 1
|
||||
strm.BeginWaitForConnection(AddressOf EndAccept, strm)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub EndAccept(ByVal ar As IAsyncResult)
|
||||
Dim strm = DirectCast(ar.AsyncState, NamedPipeServerStream)
|
||||
|
||||
strm.EndWaitForConnection(ar)
|
||||
|
||||
If IsDisposed Then
|
||||
strm.Dispose()
|
||||
Return
|
||||
End If
|
||||
|
||||
With New ManagedPipeClient(strm)
|
||||
AddHandler .RetriveData, AddressOf Client_RetriveData
|
||||
AddHandler .StatusMessage, AddressOf Client_StatusMessage
|
||||
AddHandler .Disposed, AddressOf Client_Disposed
|
||||
.AddTo(_Clients)
|
||||
End With
|
||||
|
||||
CreateWaitingStream()
|
||||
End Sub
|
||||
|
||||
#Region "_Clients-Ereignisverarbeitung"
|
||||
|
||||
Private Sub Client_Disposed(ByVal Sender As ManagedPipe)
|
||||
'den Client für die beendete Verbindung entfernen
|
||||
Sender.RemoveFrom(_Clients)
|
||||
numberOfStartedServerInstances -= 1
|
||||
CreateWaitingStream()
|
||||
End Sub
|
||||
|
||||
Private Sub Client_RetriveData(ByVal sender As Object, ByVal e As DataEventArgs)
|
||||
'einkommende ChatMessages anzeigen, und an alle versenden
|
||||
OnRetriveData(e)
|
||||
End Sub
|
||||
|
||||
Private Sub Client_StatusMessage(ByVal sender As Object, ByVal e As DataEventArgs)
|
||||
'einkommende StatusMessages durchreichen (zur Anzeige)
|
||||
OnStatusMessage(e)
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
Public Overrides Function SendAsnyc(bytes() As Byte) As Task
|
||||
Return Task.Run(Sub() Send(bytes))
|
||||
End Function
|
||||
|
||||
Public Overrides Sub Send(data As Byte())
|
||||
For Each client As ManagedPipeClient In _Clients 'an alle versenden
|
||||
client.Send(data)
|
||||
Next
|
||||
End Sub
|
||||
|
||||
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
|
||||
If numberOfStartedServerInstances < maxNumbersOfServerInstances Then
|
||||
Using clnt As New NamedPipeClientStream(pipeName)
|
||||
'Herstellen einer Dummi-Verbindung, damit der ServerStream aus dem Wartezustand herauskommt.
|
||||
clnt.Connect()
|
||||
End Using
|
||||
End If
|
||||
|
||||
For i As Integer = _Clients.Count - 1 To 0 Step -1
|
||||
_Clients(i).Dispose()
|
||||
Next
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
11
Pilz.IO/My Project/Application.Designer.cs
generated
Normal file
11
Pilz.IO/My Project/Application.Designer.cs
generated
Normal file
@@ -0,0 +1,11 @@
|
||||
// ------------------------------------------------------------------------------
|
||||
// <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>
|
||||
// ------------------------------------------------------------------------------
|
||||
|
||||
|
||||
13
Pilz.IO/My Project/Application.Designer.vb
generated
13
Pilz.IO/My Project/Application.Designer.vb
generated
@@ -1,13 +0,0 @@
|
||||
'------------------------------------------------------------------------------
|
||||
' <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>
|
||||
'------------------------------------------------------------------------------
|
||||
|
||||
Option Strict On
|
||||
Option Explicit On
|
||||
|
||||
@@ -1,35 +0,0 @@
|
||||
Imports System
|
||||
Imports System.Reflection
|
||||
Imports 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.
|
||||
|
||||
' Werte der Assemblyattribute überprüfen
|
||||
|
||||
<Assembly: AssemblyTitle("NamedPipeManaging")>
|
||||
<Assembly: AssemblyDescription("")>
|
||||
<Assembly: AssemblyCompany("Dr. Schneider Kunststoffwerke GmbH")>
|
||||
<Assembly: AssemblyProduct("NamedPipeManaging")>
|
||||
<Assembly: AssemblyCopyright("Copyright © Pascal Schedel 2017 - 2018")>
|
||||
<Assembly: AssemblyTrademark("")>
|
||||
|
||||
<Assembly: ComVisible(False)>
|
||||
|
||||
'Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird.
|
||||
<Assembly: Guid("42b8af67-22bf-4d8f-8a95-84fcaecffec6")>
|
||||
|
||||
' 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.0.0")>
|
||||
<Assembly: AssemblyFileVersion("1.0.0.0")>
|
||||
192
Pilz.IO/My Project/MyNamespace.Static.1.Designer.cs
generated
Normal file
192
Pilz.IO/My Project/MyNamespace.Static.1.Designer.cs
generated
Normal file
@@ -0,0 +1,192 @@
|
||||
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using Microsoft.VisualBasic;
|
||||
|
||||
/* TODO ERROR: Skipped IfDirectiveTrivia *//* TODO ERROR: Skipped DisabledTextTrivia *//* TODO ERROR: Skipped EndIfDirectiveTrivia */
|
||||
/* TODO ERROR: Skipped IfDirectiveTrivia *//* TODO ERROR: Skipped DisabledTextTrivia *//* TODO ERROR: Skipped ElifDirectiveTrivia *//* TODO ERROR: Skipped DisabledTextTrivia *//* TODO ERROR: Skipped ElifDirectiveTrivia */
|
||||
/* TODO ERROR: Skipped DefineDirectiveTrivia *//* TODO ERROR: Skipped DefineDirectiveTrivia *//* TODO ERROR: Skipped DefineDirectiveTrivia *//* TODO ERROR: Skipped DefineDirectiveTrivia */
|
||||
/* TODO ERROR: Skipped ElifDirectiveTrivia *//* TODO ERROR: Skipped DisabledTextTrivia *//* TODO ERROR: Skipped ElifDirectiveTrivia *//* TODO ERROR: Skipped DisabledTextTrivia *//* TODO ERROR: Skipped ElifDirectiveTrivia *//* TODO ERROR: Skipped DisabledTextTrivia *//* TODO ERROR: Skipped ElifDirectiveTrivia *//* TODO ERROR: Skipped DisabledTextTrivia *//* TODO ERROR: Skipped ElifDirectiveTrivia *//* TODO ERROR: Skipped DisabledTextTrivia *//* TODO ERROR: Skipped EndIfDirectiveTrivia */
|
||||
/* TODO ERROR: Skipped IfDirectiveTrivia */
|
||||
namespace Pilz.IO.My
|
||||
{
|
||||
|
||||
/* TODO ERROR: Skipped IfDirectiveTrivia */
|
||||
[System.CodeDom.Compiler.GeneratedCode("MyTemplate", "11.0.0.0")]
|
||||
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
|
||||
|
||||
/* TODO ERROR: Skipped IfDirectiveTrivia *//* TODO ERROR: Skipped DisabledTextTrivia *//* TODO ERROR: Skipped ElifDirectiveTrivia */
|
||||
internal partial class MyApplication : Microsoft.VisualBasic.ApplicationServices.ApplicationBase
|
||||
{
|
||||
/* TODO ERROR: Skipped ElifDirectiveTrivia *//* TODO ERROR: Skipped DisabledTextTrivia *//* TODO ERROR: Skipped EndIfDirectiveTrivia */
|
||||
}
|
||||
|
||||
/* TODO ERROR: Skipped EndIfDirectiveTrivia */
|
||||
/* TODO ERROR: Skipped IfDirectiveTrivia */
|
||||
[System.CodeDom.Compiler.GeneratedCode("MyTemplate", "11.0.0.0")]
|
||||
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
|
||||
|
||||
/* TODO ERROR: Skipped IfDirectiveTrivia */
|
||||
internal partial class MyComputer : Microsoft.VisualBasic.Devices.Computer
|
||||
{
|
||||
/* TODO ERROR: Skipped ElifDirectiveTrivia *//* TODO ERROR: Skipped DisabledTextTrivia *//* TODO ERROR: Skipped EndIfDirectiveTrivia */
|
||||
[DebuggerHidden()]
|
||||
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
|
||||
public MyComputer() : base()
|
||||
{
|
||||
}
|
||||
}
|
||||
/* TODO ERROR: Skipped EndIfDirectiveTrivia */
|
||||
[HideModuleName()]
|
||||
[System.CodeDom.Compiler.GeneratedCode("MyTemplate", "11.0.0.0")]
|
||||
internal static class MyProject
|
||||
{
|
||||
|
||||
/* TODO ERROR: Skipped IfDirectiveTrivia */
|
||||
[System.ComponentModel.Design.HelpKeyword("My.Computer")]
|
||||
internal static MyComputer Computer
|
||||
{
|
||||
[DebuggerHidden()]
|
||||
get
|
||||
{
|
||||
return m_ComputerObjectProvider.GetInstance;
|
||||
}
|
||||
}
|
||||
|
||||
private readonly static ThreadSafeObjectProvider<MyComputer> m_ComputerObjectProvider = new ThreadSafeObjectProvider<MyComputer>();
|
||||
/* TODO ERROR: Skipped EndIfDirectiveTrivia */
|
||||
/* TODO ERROR: Skipped IfDirectiveTrivia */
|
||||
[System.ComponentModel.Design.HelpKeyword("My.Application")]
|
||||
internal static MyApplication Application
|
||||
{
|
||||
[DebuggerHidden()]
|
||||
get
|
||||
{
|
||||
return m_AppObjectProvider.GetInstance;
|
||||
}
|
||||
}
|
||||
|
||||
private readonly static ThreadSafeObjectProvider<MyApplication> m_AppObjectProvider = new ThreadSafeObjectProvider<MyApplication>();
|
||||
/* TODO ERROR: Skipped EndIfDirectiveTrivia */
|
||||
/* TODO ERROR: Skipped IfDirectiveTrivia */
|
||||
[System.ComponentModel.Design.HelpKeyword("My.User")]
|
||||
internal static Microsoft.VisualBasic.ApplicationServices.User User
|
||||
{
|
||||
[DebuggerHidden()]
|
||||
get
|
||||
{
|
||||
return m_UserObjectProvider.GetInstance;
|
||||
}
|
||||
}
|
||||
|
||||
private readonly static ThreadSafeObjectProvider<Microsoft.VisualBasic.ApplicationServices.User> m_UserObjectProvider = new ThreadSafeObjectProvider<Microsoft.VisualBasic.ApplicationServices.User>();
|
||||
/* TODO ERROR: Skipped ElifDirectiveTrivia *//* TODO ERROR: Skipped DisabledTextTrivia *//* TODO ERROR: Skipped EndIfDirectiveTrivia */
|
||||
/* TODO ERROR: Skipped IfDirectiveTrivia *//* TODO ERROR: Skipped DisabledTextTrivia *//* TODO ERROR: Skipped EndIfDirectiveTrivia */
|
||||
/* TODO ERROR: Skipped IfDirectiveTrivia */
|
||||
[System.ComponentModel.Design.HelpKeyword("My.WebServices")]
|
||||
internal static MyWebServices WebServices
|
||||
{
|
||||
[DebuggerHidden()]
|
||||
get
|
||||
{
|
||||
return m_MyWebServicesObjectProvider.GetInstance;
|
||||
}
|
||||
}
|
||||
|
||||
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
|
||||
[MyGroupCollection("System.Web.Services.Protocols.SoapHttpClientProtocol", "Create__Instance__", "Dispose__Instance__", "")]
|
||||
internal sealed class MyWebServices
|
||||
{
|
||||
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
|
||||
[DebuggerHidden()]
|
||||
public override bool Equals(object o)
|
||||
{
|
||||
return base.Equals(o);
|
||||
}
|
||||
|
||||
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
|
||||
[DebuggerHidden()]
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return base.GetHashCode();
|
||||
}
|
||||
|
||||
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
|
||||
[DebuggerHidden()]
|
||||
internal new Type GetType()
|
||||
{
|
||||
return typeof(MyWebServices);
|
||||
}
|
||||
|
||||
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
|
||||
[DebuggerHidden()]
|
||||
public override string ToString()
|
||||
{
|
||||
return base.ToString();
|
||||
}
|
||||
|
||||
[DebuggerHidden()]
|
||||
private static T Create__Instance__<T>(T instance) where T : new()
|
||||
{
|
||||
if (instance == null)
|
||||
{
|
||||
return new T();
|
||||
}
|
||||
else
|
||||
{
|
||||
return instance;
|
||||
}
|
||||
}
|
||||
|
||||
[DebuggerHidden()]
|
||||
private void Dispose__Instance__<T>(ref T instance)
|
||||
{
|
||||
instance = default;
|
||||
}
|
||||
|
||||
[DebuggerHidden()]
|
||||
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
|
||||
public MyWebServices() : base()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
private readonly static ThreadSafeObjectProvider<MyWebServices> m_MyWebServicesObjectProvider = new ThreadSafeObjectProvider<MyWebServices>();
|
||||
/* TODO ERROR: Skipped EndIfDirectiveTrivia */
|
||||
/* TODO ERROR: Skipped IfDirectiveTrivia *//* TODO ERROR: Skipped DisabledTextTrivia *//* TODO ERROR: Skipped EndIfDirectiveTrivia */
|
||||
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
|
||||
[System.Runtime.InteropServices.ComVisible(false)]
|
||||
internal sealed class ThreadSafeObjectProvider<T> where T : new()
|
||||
{
|
||||
internal T GetInstance
|
||||
{
|
||||
/* TODO ERROR: Skipped IfDirectiveTrivia */
|
||||
[DebuggerHidden()]
|
||||
get
|
||||
{
|
||||
var Value = m_Context.Value;
|
||||
if (Value == null)
|
||||
{
|
||||
Value = new T();
|
||||
m_Context.Value = Value;
|
||||
}
|
||||
|
||||
return Value;
|
||||
}
|
||||
/* TODO ERROR: Skipped ElseDirectiveTrivia *//* TODO ERROR: Skipped DisabledTextTrivia *//* TODO ERROR: Skipped EndIfDirectiveTrivia */
|
||||
}
|
||||
|
||||
[DebuggerHidden()]
|
||||
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
|
||||
public ThreadSafeObjectProvider() : base()
|
||||
{
|
||||
}
|
||||
|
||||
/* TODO ERROR: Skipped IfDirectiveTrivia */
|
||||
private readonly Microsoft.VisualBasic.MyServices.Internal.ContextValue<T> m_Context = new Microsoft.VisualBasic.MyServices.Internal.ContextValue<T>();
|
||||
/* TODO ERROR: Skipped ElseDirectiveTrivia *//* TODO ERROR: Skipped DisabledTextTrivia *//* TODO ERROR: Skipped EndIfDirectiveTrivia */
|
||||
}
|
||||
}
|
||||
}
|
||||
/* TODO ERROR: Skipped EndIfDirectiveTrivia */
|
||||
253
Pilz.IO/My Project/MyNamespace.Static.2.Designer.cs
generated
Normal file
253
Pilz.IO/My Project/MyNamespace.Static.2.Designer.cs
generated
Normal file
@@ -0,0 +1,253 @@
|
||||
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
// See Compiler::LoadXmlSolutionExtension
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Xml.Linq;
|
||||
using Microsoft.VisualBasic;
|
||||
using Microsoft.VisualBasic.CompilerServices;
|
||||
|
||||
namespace Pilz.IO.My
|
||||
{
|
||||
[Embedded()]
|
||||
[DebuggerNonUserCode()]
|
||||
[System.Runtime.CompilerServices.CompilerGenerated()]
|
||||
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
|
||||
internal sealed class InternalXmlHelper
|
||||
{
|
||||
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
|
||||
private InternalXmlHelper()
|
||||
{
|
||||
}
|
||||
|
||||
public static string get_Value(IEnumerable<XElement> source)
|
||||
{
|
||||
foreach (XElement item in source)
|
||||
return item.Value;
|
||||
return null;
|
||||
}
|
||||
|
||||
public static void set_Value(IEnumerable<XElement> source, string value)
|
||||
{
|
||||
foreach (XElement item in source)
|
||||
{
|
||||
item.Value = value;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public static string get_AttributeValue(IEnumerable<XElement> source, XName name)
|
||||
{
|
||||
foreach (XElement item in source)
|
||||
return Conversions.ToString(item.Attribute(name));
|
||||
return null;
|
||||
}
|
||||
|
||||
public static void set_AttributeValue(IEnumerable<XElement> source, XName name, string value)
|
||||
{
|
||||
foreach (XElement item in source)
|
||||
{
|
||||
item.SetAttributeValue(name, value);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public static string get_AttributeValue(XElement source, XName name)
|
||||
{
|
||||
return Conversions.ToString(source.Attribute(name));
|
||||
}
|
||||
|
||||
public static void set_AttributeValue(XElement source, XName name, string value)
|
||||
{
|
||||
source.SetAttributeValue(name, value);
|
||||
}
|
||||
|
||||
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
|
||||
public static XAttribute CreateAttribute(XName name, object value)
|
||||
{
|
||||
if (value is null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return new XAttribute(name, value);
|
||||
}
|
||||
|
||||
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
|
||||
public static XAttribute CreateNamespaceAttribute(XName name, XNamespace ns)
|
||||
{
|
||||
var a = new XAttribute(name, ns.NamespaceName);
|
||||
a.AddAnnotation(ns);
|
||||
return a;
|
||||
}
|
||||
|
||||
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
|
||||
public static object RemoveNamespaceAttributes(string[] inScopePrefixes, XNamespace[] inScopeNs, List<XAttribute> attributes, object obj)
|
||||
{
|
||||
if (obj is object)
|
||||
{
|
||||
XElement elem = obj as XElement;
|
||||
if (elem is object)
|
||||
{
|
||||
return RemoveNamespaceAttributes(inScopePrefixes, inScopeNs, attributes, elem);
|
||||
}
|
||||
else
|
||||
{
|
||||
IEnumerable elems = obj as IEnumerable;
|
||||
if (elems is object)
|
||||
{
|
||||
return RemoveNamespaceAttributes(inScopePrefixes, inScopeNs, attributes, elems);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
|
||||
public static IEnumerable RemoveNamespaceAttributes(string[] inScopePrefixes, XNamespace[] inScopeNs, List<XAttribute> attributes, IEnumerable obj)
|
||||
{
|
||||
if (obj is object)
|
||||
{
|
||||
IEnumerable<XElement> elems = obj as IEnumerable<XElement>;
|
||||
if (elems is object)
|
||||
{
|
||||
return elems.Select(new RemoveNamespaceAttributesClosure(inScopePrefixes, inScopeNs, attributes).ProcessXElement);
|
||||
}
|
||||
else
|
||||
{
|
||||
return obj.Cast<object>().Select(new RemoveNamespaceAttributesClosure(inScopePrefixes, inScopeNs, attributes).ProcessObject);
|
||||
}
|
||||
}
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
[DebuggerNonUserCode()]
|
||||
[System.Runtime.CompilerServices.CompilerGenerated()]
|
||||
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
|
||||
private sealed class RemoveNamespaceAttributesClosure
|
||||
{
|
||||
private readonly string[] m_inScopePrefixes;
|
||||
private readonly XNamespace[] m_inScopeNs;
|
||||
private readonly List<XAttribute> m_attributes;
|
||||
|
||||
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
|
||||
internal RemoveNamespaceAttributesClosure(string[] inScopePrefixes, XNamespace[] inScopeNs, List<XAttribute> attributes)
|
||||
{
|
||||
m_inScopePrefixes = inScopePrefixes;
|
||||
m_inScopeNs = inScopeNs;
|
||||
m_attributes = attributes;
|
||||
}
|
||||
|
||||
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
|
||||
internal XElement ProcessXElement(XElement elem)
|
||||
{
|
||||
return RemoveNamespaceAttributes(m_inScopePrefixes, m_inScopeNs, m_attributes, elem);
|
||||
}
|
||||
|
||||
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
|
||||
internal object ProcessObject(object obj)
|
||||
{
|
||||
XElement elem = obj as XElement;
|
||||
if (elem is object)
|
||||
{
|
||||
return RemoveNamespaceAttributes(m_inScopePrefixes, m_inScopeNs, m_attributes, elem);
|
||||
}
|
||||
else
|
||||
{
|
||||
return obj;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
|
||||
public static XElement RemoveNamespaceAttributes(string[] inScopePrefixes, XNamespace[] inScopeNs, List<XAttribute> attributes, XElement e)
|
||||
{
|
||||
if (e is object)
|
||||
{
|
||||
var a = e.FirstAttribute;
|
||||
while (a is object)
|
||||
{
|
||||
var nextA = a.NextAttribute;
|
||||
if (a.IsNamespaceDeclaration)
|
||||
{
|
||||
var ns = a.Annotation<XNamespace>();
|
||||
string prefix = a.Name.LocalName;
|
||||
if (ns is object)
|
||||
{
|
||||
if (inScopePrefixes is object && inScopeNs is object)
|
||||
{
|
||||
int lastIndex = inScopePrefixes.Length - 1;
|
||||
for (int i = 0, loopTo = lastIndex; i <= loopTo; i++)
|
||||
{
|
||||
string currentInScopePrefix = inScopePrefixes[i];
|
||||
var currentInScopeNs = inScopeNs[i];
|
||||
if (prefix.Equals(currentInScopePrefix))
|
||||
{
|
||||
if (ns == currentInScopeNs)
|
||||
{
|
||||
// prefix and namespace match. Remove the unneeded ns attribute
|
||||
a.Remove();
|
||||
}
|
||||
|
||||
// prefix is in scope but refers to something else. Leave the ns attribute.
|
||||
a = null;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (a is object)
|
||||
{
|
||||
// Prefix is not in scope
|
||||
// Now check whether it's going to be in scope because it is in the attributes list
|
||||
|
||||
if (attributes is object)
|
||||
{
|
||||
int lastIndex = attributes.Count - 1;
|
||||
for (int i = 0, loopTo1 = lastIndex; i <= loopTo1; i++)
|
||||
{
|
||||
var currentA = attributes[i];
|
||||
string currentInScopePrefix = currentA.Name.LocalName;
|
||||
var currentInScopeNs = currentA.Annotation<XNamespace>();
|
||||
if (currentInScopeNs is object)
|
||||
{
|
||||
if (prefix.Equals(currentInScopePrefix))
|
||||
{
|
||||
if (ns == currentInScopeNs)
|
||||
{
|
||||
// prefix and namespace match. Remove the unneeded ns attribute
|
||||
a.Remove();
|
||||
}
|
||||
|
||||
// prefix is in scope but refers to something else. Leave the ns attribute.
|
||||
a = null;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (a is object)
|
||||
{
|
||||
// Prefix is definitely not in scope
|
||||
a.Remove();
|
||||
// namespace is not defined either. Add this attributes list
|
||||
attributes.Add(a);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
a = nextA;
|
||||
}
|
||||
}
|
||||
|
||||
return e;
|
||||
}
|
||||
}
|
||||
}
|
||||
14
Pilz.IO/My Project/MyNamespace.Static.3.Designer.cs
generated
Normal file
14
Pilz.IO/My Project/MyNamespace.Static.3.Designer.cs
generated
Normal file
@@ -0,0 +1,14 @@
|
||||
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
using System;
|
||||
|
||||
namespace Microsoft.VisualBasic
|
||||
{
|
||||
[Embedded()]
|
||||
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Module | AttributeTargets.Assembly, Inherited = false)]
|
||||
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
|
||||
[System.Runtime.CompilerServices.CompilerGenerated()]
|
||||
internal sealed class Embedded : Attribute
|
||||
{
|
||||
}
|
||||
}
|
||||
63
Pilz.IO/My Project/Resources.Designer.vb
generated
63
Pilz.IO/My Project/Resources.Designer.vb
generated
@@ -1,63 +0,0 @@
|
||||
'------------------------------------------------------------------------------
|
||||
' <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>
|
||||
'------------------------------------------------------------------------------
|
||||
|
||||
Option Strict On
|
||||
Option Explicit On
|
||||
|
||||
Imports System
|
||||
|
||||
Namespace My.Resources
|
||||
|
||||
'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.
|
||||
'''<summary>
|
||||
''' Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw.
|
||||
'''</summary>
|
||||
<Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0"), _
|
||||
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
||||
Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
|
||||
Global.Microsoft.VisualBasic.HideModuleNameAttribute()> _
|
||||
Friend Module Resources
|
||||
|
||||
Private resourceMan As Global.System.Resources.ResourceManager
|
||||
|
||||
Private resourceCulture As Global.System.Globalization.CultureInfo
|
||||
|
||||
'''<summary>
|
||||
''' Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird.
|
||||
'''</summary>
|
||||
<Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
|
||||
Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager
|
||||
Get
|
||||
If Object.ReferenceEquals(resourceMan, Nothing) Then
|
||||
Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("Pilz.IO.Resources", GetType(Resources).Assembly)
|
||||
resourceMan = temp
|
||||
End If
|
||||
Return resourceMan
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'''<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)> _
|
||||
Friend Property Culture() As Global.System.Globalization.CultureInfo
|
||||
Get
|
||||
Return resourceCulture
|
||||
End Get
|
||||
Set
|
||||
resourceCulture = value
|
||||
End Set
|
||||
End Property
|
||||
End Module
|
||||
End Namespace
|
||||
73
Pilz.IO/My Project/Settings.Designer.vb
generated
73
Pilz.IO/My Project/Settings.Designer.vb
generated
@@ -1,73 +0,0 @@
|
||||
'------------------------------------------------------------------------------
|
||||
' <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>
|
||||
'------------------------------------------------------------------------------
|
||||
|
||||
Option Strict On
|
||||
Option Explicit On
|
||||
|
||||
|
||||
Namespace My
|
||||
|
||||
<Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
|
||||
Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.9.0.0"), _
|
||||
Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
|
||||
Partial Friend NotInheritable Class MySettings
|
||||
Inherits Global.System.Configuration.ApplicationSettingsBase
|
||||
|
||||
Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings()),MySettings)
|
||||
|
||||
#Region "Automatische My.Settings-Speicherfunktion"
|
||||
#If _MyType = "WindowsForms" Then
|
||||
Private Shared addedHandler As Boolean
|
||||
|
||||
Private Shared addedHandlerLockObject As New Object
|
||||
|
||||
<Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
|
||||
Private Shared Sub AutoSaveSettings(sender As Global.System.Object, e As Global.System.EventArgs)
|
||||
If My.Application.SaveMySettingsOnExit Then
|
||||
My.Settings.Save()
|
||||
End If
|
||||
End Sub
|
||||
#End If
|
||||
#End Region
|
||||
|
||||
Public Shared ReadOnly Property [Default]() As MySettings
|
||||
Get
|
||||
|
||||
#If _MyType = "WindowsForms" Then
|
||||
If Not addedHandler Then
|
||||
SyncLock addedHandlerLockObject
|
||||
If Not addedHandler Then
|
||||
AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings
|
||||
addedHandler = True
|
||||
End If
|
||||
End SyncLock
|
||||
End If
|
||||
#End If
|
||||
Return defaultInstance
|
||||
End Get
|
||||
End Property
|
||||
End Class
|
||||
End Namespace
|
||||
|
||||
Namespace My
|
||||
|
||||
<Global.Microsoft.VisualBasic.HideModuleNameAttribute(), _
|
||||
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
||||
Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute()> _
|
||||
Friend Module MySettingsProperty
|
||||
|
||||
<Global.System.ComponentModel.Design.HelpKeywordAttribute("My.Settings")> _
|
||||
Friend ReadOnly Property Settings() As Global.Pilz.IO.My.MySettings
|
||||
Get
|
||||
Return Global.Pilz.IO.My.MySettings.Default
|
||||
End Get
|
||||
End Property
|
||||
End Module
|
||||
End Namespace
|
||||
@@ -4,7 +4,7 @@
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{35591965-8339-41A2-8CD3-962ED54670AC}</ProjectGuid>
|
||||
<ProjectGuid>{877D980E-4F61-0E53-0E8B-5C50B7D1440C}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<RootNamespace>Pilz.IO</RootNamespace>
|
||||
<AssemblyName>Pilz.IO</AssemblyName>
|
||||
@@ -13,6 +13,8 @@
|
||||
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
|
||||
<Deterministic>true</Deterministic>
|
||||
<TargetFrameworkProfile />
|
||||
<DefaultItemExcludes>$(DefaultItemExcludes);$(ProjectDir)**\*.vb</DefaultItemExcludes>
|
||||
<LangVersion>latest</LangVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
@@ -21,7 +23,7 @@
|
||||
<DefineTrace>true</DefineTrace>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DocumentationFile>Pilz.IO.xml</DocumentationFile>
|
||||
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
|
||||
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022,CS1591</NoWarn>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
@@ -30,7 +32,7 @@
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DocumentationFile>Pilz.IO.xml</DocumentationFile>
|
||||
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
|
||||
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022,CS1591</NoWarn>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OptionExplicit>On</OptionExplicit>
|
||||
@@ -67,6 +69,10 @@
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Microsoft.VisualBasic" />
|
||||
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
@@ -87,43 +93,48 @@
|
||||
<Import Include="System.Threading.Tasks" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="ManagedPipes\ManagedPipeClient.vb" />
|
||||
<Compile Include="ManagedPipes\ManagedPipe.vb" />
|
||||
<Compile Include="EventArgs\DataEventargs.vb" />
|
||||
<Compile Include="My Project\AssemblyInfo.vb" />
|
||||
<Compile Include="My Project\Application.Designer.vb">
|
||||
<Compile Include="EmbeddedFilesContainer.cs" />
|
||||
<Compile Include="My Project\MyNamespace.Static.1.Designer.cs" />
|
||||
<Compile Include="My Project\MyNamespace.Static.2.Designer.cs" />
|
||||
<Compile Include="My Project\MyNamespace.Static.3.Designer.cs" />
|
||||
<Compile Include="ManagedPipes\ManagedPipeClient.cs" />
|
||||
<Compile Include="ManagedPipes\ManagedPipe.cs" />
|
||||
<Compile Include="EventArgs\DataEventargs.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="My Project\Application.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Application.myapp</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="My Project\Resources.Designer.vb">
|
||||
<Compile Include="Properties\Resources.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="My Project\Settings.Designer.vb">
|
||||
<Compile Include="Properties\Settings.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
</Compile>
|
||||
<Compile Include="ManagedPipes\ManagedPipeServer.vb" />
|
||||
<Compile Include="ManagedPipes\ManagedPipeServer.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="My Project\Resources.resx">
|
||||
<Generator>VbMyResourcesResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.vb</LastGenOutput>
|
||||
<CustomToolNamespace>My.Resources</CustomToolNamespace>
|
||||
<EmbeddedResource Include="Properties\Resources.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
<CustomToolNamespace>Pilz.IO.My.Resources</CustomToolNamespace>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="My Project\Application.myapp">
|
||||
<Generator>MyApplicationCodeGenerator</Generator>
|
||||
<LastGenOutput>Application.Designer.vb</LastGenOutput>
|
||||
<LastGenOutput>Application.Designer.cs</LastGenOutput>
|
||||
</None>
|
||||
<None Include="My Project\Settings.settings">
|
||||
<None Include="packages.config" />
|
||||
<None Include="Properties\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<CustomToolNamespace>My</CustomToolNamespace>
|
||||
<LastGenOutput>Settings.Designer.vb</LastGenOutput>
|
||||
<CustomToolNamespace>Pilz.IO.My</CustomToolNamespace>
|
||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
@@ -132,5 +143,5 @@
|
||||
<Name>Pilz.Threading</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
||||
35
Pilz.IO/Properties/AssemblyInfo.cs
Normal file
35
Pilz.IO/Properties/AssemblyInfo.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
using global::System;
|
||||
using global::System.Reflection;
|
||||
using global::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.
|
||||
|
||||
// Werte der Assemblyattribute überprüfen
|
||||
|
||||
[assembly: AssemblyTitle("NamedPipeManaging")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyCompany("Dr. Schneider Kunststoffwerke GmbH")]
|
||||
[assembly: AssemblyProduct("NamedPipeManaging")]
|
||||
[assembly: AssemblyCopyright("Copyright © Pascal Schedel 2017 - 2018")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird.
|
||||
[assembly: Guid("42b8af67-22bf-4d8f-8a95-84fcaecffec6")]
|
||||
|
||||
// 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.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
|
||||
63
Pilz.IO/Properties/Resources.Designer.cs
generated
Normal file
63
Pilz.IO/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 Pilz.IO.My.Resources {
|
||||
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", "15.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("Pilz.IO.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
Pilz.IO/Properties/Resources.resx
Normal file
117
Pilz.IO/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
Pilz.IO/Properties/Settings.Designer.cs
generated
Normal file
26
Pilz.IO/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 Pilz.IO.My {
|
||||
|
||||
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.9.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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
4
Pilz.IO/packages.config
Normal file
4
Pilz.IO/packages.config
Normal file
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="Newtonsoft.Json" version="12.0.3" targetFramework="net472" />
|
||||
</packages>
|
||||
Reference in New Issue
Block a user