code optimization
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
Imports System.Reflection
|
||||
Imports System.Runtime.InteropServices
|
||||
|
||||
Namespace SimpleHistory
|
||||
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
Imports System.Reflection
|
||||
|
||||
Namespace SimpleHistory
|
||||
Namespace SimpleHistory
|
||||
|
||||
Public Class HistoryStack
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
using System;
|
||||
|
||||
namespace Pilz.Configuration
|
||||
namespace Pilz.Configuration;
|
||||
|
||||
public class AutoSaveConfigurationManager : ConfigurationManager
|
||||
{
|
||||
public class AutoSaveConfigurationManager : ConfigurationManager
|
||||
{
|
||||
private bool addedHandler = false;
|
||||
private bool enableAutoSave = false;
|
||||
private string _ConfigFilePath = string.Empty;
|
||||
@@ -83,5 +83,4 @@ namespace Pilz.Configuration
|
||||
{
|
||||
RemoveAutoSaveHandler();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,12 +1,11 @@
|
||||
namespace Pilz.Configuration
|
||||
namespace Pilz.Configuration;
|
||||
|
||||
public abstract class ConfigurationManager
|
||||
{
|
||||
public abstract class ConfigurationManager
|
||||
{
|
||||
public SimpleConfiguration Configuration { get; private set; }
|
||||
|
||||
internal void SetConfiguration(SimpleConfiguration configuration)
|
||||
{
|
||||
Configuration = configuration;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,11 @@
|
||||
using System.Collections;
|
||||
using Pilz.GeneralEventArgs;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Pilz.GeneralEventArgs;
|
||||
|
||||
namespace Pilz.Configuration
|
||||
namespace Pilz.Configuration;
|
||||
|
||||
public class ConfigurationManagerList : IList<ConfigurationManager>
|
||||
{
|
||||
public class ConfigurationManagerList : IList<ConfigurationManager>
|
||||
{
|
||||
public event GettingParentManagerEventHandler GettingParentManager;
|
||||
|
||||
public delegate void GettingParentManagerEventHandler(object sender, GetValueEventArgs<SimpleConfiguration> e);
|
||||
@@ -84,5 +84,4 @@ namespace Pilz.Configuration
|
||||
}
|
||||
|
||||
IEnumerator IEnumerable.GetEnumerator() => IEnumerable_GetEnumerator();
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,11 @@
|
||||
using System.IO;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json;
|
||||
using Pilz.GeneralEventArgs;
|
||||
using System.IO;
|
||||
|
||||
namespace Pilz.Configuration
|
||||
namespace Pilz.Configuration;
|
||||
|
||||
public static class ConfigurationSerializer
|
||||
{
|
||||
public static class ConfigurationSerializer
|
||||
{
|
||||
public static event GettingJsonSerializerEventHandler GettingJsonSerializer;
|
||||
|
||||
public delegate void GettingJsonSerializerEventHandler(object instance, GetValueEventArgs<JsonSerializer> e);
|
||||
@@ -135,5 +135,4 @@ namespace Pilz.Configuration
|
||||
fs.Close();
|
||||
return content;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,6 @@
|
||||
namespace Pilz.Configuration
|
||||
namespace Pilz.Configuration;
|
||||
|
||||
public interface IChildSettings
|
||||
{
|
||||
public interface IChildSettings
|
||||
{
|
||||
void Reset();
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,10 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Pilz.Configuration
|
||||
namespace Pilz.Configuration;
|
||||
|
||||
public interface ISettings
|
||||
{
|
||||
public interface ISettings
|
||||
{
|
||||
IReadOnlyCollection<IChildSettings> Childs { get; }
|
||||
T Get<T>() where T : IChildSettings, ISettingsIdentifier;
|
||||
void Reset();
|
||||
}
|
||||
}
|
||||
@@ -1,13 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
namespace Pilz.Configuration;
|
||||
|
||||
namespace Pilz.Configuration
|
||||
public interface ISettingsIdentifier
|
||||
{
|
||||
public interface ISettingsIdentifier
|
||||
{
|
||||
static abstract string Identifier { get; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
|
||||
namespace Pilz.Configuration
|
||||
namespace Pilz.Configuration;
|
||||
|
||||
public interface ISettingsManager
|
||||
{
|
||||
public interface ISettingsManager
|
||||
{
|
||||
ISettings Instance { get; }
|
||||
void Save();
|
||||
void Load();
|
||||
void Reset();
|
||||
}
|
||||
}
|
||||
@@ -1,12 +1,11 @@
|
||||
using System;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Pilz.Configuration
|
||||
namespace Pilz.Configuration;
|
||||
|
||||
public class Settings : ISettings
|
||||
{
|
||||
public class Settings : ISettings
|
||||
{
|
||||
[JsonProperty(nameof(Settings))]
|
||||
protected readonly Dictionary<string, IChildSettings> mySettings = [];
|
||||
|
||||
@@ -33,5 +32,4 @@ namespace Pilz.Configuration
|
||||
foreach (var s in mySettings.Values)
|
||||
s.Reset();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,14 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.IO;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Serialization;
|
||||
using ErrorEventArgs = Newtonsoft.Json.Serialization.ErrorEventArgs;
|
||||
|
||||
namespace Pilz.Configuration
|
||||
namespace Pilz.Configuration;
|
||||
|
||||
public class SettingsManager : ISettingsManager
|
||||
{
|
||||
public class SettingsManager : ISettingsManager
|
||||
{
|
||||
public event EventHandler AutoSavingSettings;
|
||||
public event EventHandler SavingSettings;
|
||||
public event EventHandler SavedSettings;
|
||||
@@ -138,5 +136,4 @@ namespace Pilz.Configuration
|
||||
if (!e.ErrorContext.Handled && e.ErrorContext.Error is JsonSerializationException serializationException && serializationException.Message.StartsWith(errorResolvingType))
|
||||
e.ErrorContext.Handled = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,11 @@
|
||||
using System.IO;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json;
|
||||
using Pilz.GeneralEventArgs;
|
||||
using System.IO;
|
||||
|
||||
namespace Pilz.Configuration
|
||||
namespace Pilz.Configuration;
|
||||
|
||||
public class SimpleConfiguration
|
||||
{
|
||||
public class SimpleConfiguration
|
||||
{
|
||||
[JsonIgnore]
|
||||
public readonly ConfigurationManagerList Managers = new ConfigurationManagerList();
|
||||
|
||||
@@ -106,5 +106,4 @@ namespace Pilz.Configuration
|
||||
{
|
||||
ConfigurationSerializer.ReadFromFile(this, filePath);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,18 +1,15 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Management;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Pilz.Cryptography
|
||||
namespace Pilz.Cryptography;
|
||||
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public static class Helpers
|
||||
{
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public static class Helpers
|
||||
{
|
||||
private static string clientSecret = null;
|
||||
|
||||
public static string CalculateClientSecret()
|
||||
@@ -51,5 +48,4 @@ namespace Pilz.Cryptography
|
||||
|
||||
return hash;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
namespace Pilz.Cryptography;
|
||||
|
||||
namespace Pilz.Cryptography
|
||||
public interface ICrypter
|
||||
{
|
||||
public interface ICrypter
|
||||
{
|
||||
string Encrypt(string plainValue);
|
||||
string Decrypt(string encryptedValue);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,18 +1,14 @@
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace Pilz.Cryptography
|
||||
namespace Pilz.Cryptography;
|
||||
|
||||
[JsonConverter(typeof(Json.Converters.UniquieIDStringJsonConverter))]
|
||||
public interface IUniquieID
|
||||
{
|
||||
[JsonConverter(typeof(Json.Converters.UniquieIDStringJsonConverter))]
|
||||
public interface IUniquieID
|
||||
{
|
||||
bool HasID { get; }
|
||||
string ID { get; }
|
||||
|
||||
void GenerateIfNull();
|
||||
void Generate();
|
||||
bool Equals(object obj);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,9 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
namespace Pilz.Cryptography;
|
||||
|
||||
namespace Pilz.Cryptography
|
||||
/// <summary>
|
||||
/// Can be implemented on objects that provides an UniquieID.
|
||||
/// </summary>
|
||||
public interface IUniquieIDHost
|
||||
{
|
||||
/// <summary>
|
||||
/// Can be implemented on objects that provides an UniquieID.
|
||||
/// </summary>
|
||||
public interface IUniquieIDHost
|
||||
{
|
||||
UniquieID ID { get; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
using Newtonsoft.Json;
|
||||
using Pilz.Cryptography;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace Pilz.Json.Converters
|
||||
namespace Pilz.Json.Converters;
|
||||
|
||||
public class UniquieIDStringJsonConverter : JsonConverter
|
||||
{
|
||||
public class UniquieIDStringJsonConverter : JsonConverter
|
||||
{
|
||||
public static bool EnableCheckForDepricatedTypes { get; set; } = true;
|
||||
|
||||
public override bool CanConvert(Type objectType)
|
||||
@@ -34,5 +32,4 @@ namespace Pilz.Json.Converters
|
||||
{
|
||||
serializer.Serialize(writer, ((UniquieID)value).ID);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// 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
|
||||
|
||||
@@ -1,15 +1,11 @@
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Pilz.Cryptography
|
||||
namespace Pilz.Cryptography;
|
||||
|
||||
[JsonConverter(typeof(Json.Converters.SecureStringJsonConverter))]
|
||||
public class SecureString
|
||||
{
|
||||
[JsonConverter(typeof(Json.Converters.SecureStringJsonConverter))]
|
||||
public class SecureString
|
||||
{
|
||||
public static ICrypter DefaultCrypter { get; set; }
|
||||
public ICrypter Crypter { get; set; }
|
||||
public string EncryptedValue { get; set; }
|
||||
@@ -74,5 +70,4 @@ namespace Pilz.Cryptography
|
||||
|
||||
public static bool operator ==(SecureString left, SecureString right) => left?.EncryptedValue == right?.EncryptedValue;
|
||||
public static bool operator !=(SecureString left, SecureString right) => left?.EncryptedValue != right?.EncryptedValue;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,17 +1,11 @@
|
||||
using Newtonsoft.Json;
|
||||
using Pilz.Cryptography;
|
||||
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.Json.Converters
|
||||
namespace Pilz.Json.Converters;
|
||||
|
||||
public class SecureStringJsonConverter : JsonConverter
|
||||
{
|
||||
public class SecureStringJsonConverter : JsonConverter
|
||||
{
|
||||
public override bool CanConvert(Type objectType)
|
||||
{
|
||||
return typeof(SecureString).IsAssignableFrom(objectType);
|
||||
@@ -37,5 +31,4 @@ namespace Pilz.Json.Converters
|
||||
{
|
||||
serializer.Serialize(writer, ((SecureString)value).EncryptedValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,15 +1,27 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
/* Nicht gemergte Änderung aus Projekt "Pilz.Cryptography (net6.0)"
|
||||
Vor:
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Security.Cryptography;
|
||||
using System.IO;
|
||||
Nach:
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
*/
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
|
||||
namespace Pilz.Cryptography
|
||||
namespace Pilz.Cryptography;
|
||||
|
||||
public class SimpleStringCrypter : ICrypter
|
||||
{
|
||||
public class SimpleStringCrypter : ICrypter
|
||||
{
|
||||
private readonly TripleDES TripleDes;
|
||||
public Encoding TextEncoding { get; private set; } = Encoding.Default;
|
||||
|
||||
@@ -25,7 +37,7 @@ namespace Pilz.Cryptography
|
||||
{
|
||||
TextEncoding = textEncoding;
|
||||
TripleDes = TripleDES.Create();
|
||||
TripleDes.Key = TruncateHash(key,TripleDes.KeySize / 8);
|
||||
TripleDes.Key = TruncateHash(key, TripleDes.KeySize / 8);
|
||||
TripleDes.IV = TruncateHash(string.Empty, TripleDes.BlockSize / 8);
|
||||
}
|
||||
|
||||
@@ -76,5 +88,4 @@ namespace Pilz.Cryptography
|
||||
else
|
||||
return DecryptData(encryptedValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,16 +1,12 @@
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Management;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
|
||||
namespace Pilz.Cryptography
|
||||
namespace Pilz.Cryptography;
|
||||
|
||||
[JsonConverter(typeof(Json.Converters.UniquieIDStringJsonConverter))]
|
||||
public class UniquieID : IUniquieID
|
||||
{
|
||||
[JsonConverter(typeof(Json.Converters.UniquieIDStringJsonConverter))]
|
||||
public class UniquieID : IUniquieID
|
||||
{
|
||||
protected static ulong currentSimpleID = 0;
|
||||
|
||||
[JsonProperty(nameof(ID))]
|
||||
@@ -131,5 +127,4 @@ namespace Pilz.Cryptography
|
||||
|
||||
public static bool operator ==(UniquieID left, UniquieID right) => left.ID.Equals(right.ID);
|
||||
public static bool operator !=(UniquieID left, UniquieID right) => !left.ID.Equals(right.ID);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +1,8 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
namespace Pilz.Cryptography;
|
||||
|
||||
namespace Pilz.Cryptography
|
||||
public enum UniquieIDGenerationMode
|
||||
{
|
||||
public enum UniquieIDGenerationMode
|
||||
{
|
||||
None,
|
||||
GenerateOnGet,
|
||||
GenerateOnInit
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
Imports System.Windows.Forms
|
||||
|
||||
Imports OpenTK
|
||||
Imports OpenTK.Mathematics
|
||||
|
||||
Namespace CameraN
|
||||
|
||||
@@ -1,16 +1,32 @@
|
||||
Imports System.Drawing
|
||||
|
||||
' Nicht gemergte Änderung aus Projekt "Pilz.Drawing.Drawing3D.OpenGLFactory (net6.0-windows)"
|
||||
' Vor:
|
||||
' Imports System.Windows.Forms
|
||||
' Imports Pilz.Drawing.Drawing3D.OpenGLFactory.CameraN
|
||||
' Nach:
|
||||
' Imports System.Windows.Forms
|
||||
'
|
||||
' Imports OpenTK
|
||||
' Imports OpenTK.Graphics.OpenGL
|
||||
' Imports OpenTK.Mathematics
|
||||
' Imports OpenTK.WinForms
|
||||
'
|
||||
' Imports Pilz.Drawing.Drawing3D.OpenGLFactory.CameraN
|
||||
Imports System.Windows.Forms
|
||||
Imports Pilz.Drawing.Drawing3D.OpenGLFactory.CameraN
|
||||
Imports Pilz.Drawing.Drawing3D.OpenGLFactory.RenderingN
|
||||
Imports OpenTK
|
||||
|
||||
Imports OpenTK.Graphics.OpenGL
|
||||
Imports Pilz.S3DFileParser
|
||||
Imports Point = System.Drawing.Point
|
||||
Imports Color = System.Drawing.Color
|
||||
Imports OpenTK.Mathematics
|
||||
Imports OpenTK.WinForms
|
||||
|
||||
Imports Pilz.Drawing.Drawing3D.OpenGLFactory.CameraN
|
||||
Imports Pilz.Drawing.Drawing3D.OpenGLFactory.RenderingN
|
||||
Imports Pilz.S3DFileParser
|
||||
Imports Pilz.Win32.Mapped
|
||||
|
||||
Imports Color = System.Drawing.Color
|
||||
Imports Point = System.Drawing.Point
|
||||
|
||||
Namespace PreviewN
|
||||
|
||||
Public Class ModelPreview
|
||||
|
||||
@@ -1,5 +1,14 @@
|
||||
Imports System.Drawing
|
||||
Imports OpenTK
|
||||
|
||||
' Nicht gemergte Änderung aus Projekt "Pilz.Drawing.Drawing3D.OpenGLFactory (net6.0-windows)"
|
||||
' Vor:
|
||||
' Imports System.Drawing
|
||||
' Imports OpenTK
|
||||
' Nach:
|
||||
' Imports System.Drawing
|
||||
'
|
||||
' Imports OpenTK
|
||||
Imports System.Drawing
|
||||
|
||||
Imports OpenTK.Graphics.OpenGL
|
||||
|
||||
Namespace RenderingN
|
||||
|
||||
@@ -1,8 +1,18 @@
|
||||
Imports System
|
||||
Imports OpenTK
|
||||
Imports OpenTK.Graphics.OpenGL
|
||||
Imports System.Drawing
|
||||
' Nicht gemergte Änderung aus Projekt "Pilz.Drawing.Drawing3D.OpenGLFactory (net6.0-windows)"
|
||||
' Vor:
|
||||
' Imports OpenTK
|
||||
' Imports OpenTK.Graphics.OpenGL
|
||||
' Imports System.Drawing
|
||||
' Nach:
|
||||
' Imports System.Drawing
|
||||
' Imports System.Drawing.Imaging
|
||||
'
|
||||
' Imports OpenTK
|
||||
.Drawing
|
||||
Imports System.Drawing.Imaging
|
||||
|
||||
Imports OpenTK.Graphics.OpenGL
|
||||
|
||||
Imports Bitmap = System.Drawing.Bitmap
|
||||
|
||||
Namespace RenderingN
|
||||
|
||||
@@ -1,9 +1,4 @@
|
||||
Imports System.Drawing
|
||||
Imports System.Threading
|
||||
Imports System.Windows.Forms
|
||||
|
||||
Imports OpenTK
|
||||
Imports OpenTK.Graphics.OpenGL
|
||||
Imports OpenTK.Graphics.OpenGL
|
||||
Imports OpenTK.Mathematics
|
||||
|
||||
Imports Pilz.S3DFileParser
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
Imports System.Drawing
|
||||
Imports System.Drawing.Drawing2D
|
||||
|
||||
Public Module HelpfulDrawingFunctions
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
|
||||
namespace Pilz.Gaming.Minecraft
|
||||
namespace Pilz.Gaming.Minecraft;
|
||||
|
||||
public static class Utils
|
||||
{
|
||||
public static class Utils
|
||||
{
|
||||
public static string GetUUID(string value)
|
||||
{
|
||||
using var md5 = MD5.Create();
|
||||
@@ -39,5 +39,4 @@ namespace Pilz.Gaming.Minecraft
|
||||
|
||||
return GetUUID("OfflinePlayer:" + username);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,14 +3,12 @@ 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
|
||||
namespace Pilz.IO;
|
||||
|
||||
public class EmbeddedFilesContainer
|
||||
{
|
||||
public class EmbeddedFilesContainer
|
||||
{
|
||||
[JsonProperty("CompressedFiles")]
|
||||
private readonly Dictionary<string, byte[]> compressedFiles = new Dictionary<string, byte[]>();
|
||||
|
||||
@@ -170,5 +168,4 @@ namespace Pilz.IO
|
||||
decompressor.Close();
|
||||
compressed.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
using System;
|
||||
|
||||
namespace Pilz.IO
|
||||
namespace Pilz.IO;
|
||||
|
||||
public class DataEventArgs : EventArgs
|
||||
{
|
||||
public class DataEventArgs : EventArgs
|
||||
{
|
||||
public readonly byte[] Data;
|
||||
|
||||
public DataEventArgs(byte[] bytes) : base()
|
||||
{
|
||||
Data = bytes;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,14 +1,12 @@
|
||||
using Pilz.Runtime;
|
||||
using Pilz.Win32.Native;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Text;
|
||||
|
||||
namespace Pilz.IO
|
||||
namespace Pilz.IO;
|
||||
|
||||
public static class Extensions
|
||||
{
|
||||
public static class Extensions
|
||||
{
|
||||
static readonly int MAX_PATH = 255;
|
||||
|
||||
public static string GetExecutablePath(bool checkRealOS = false)
|
||||
@@ -22,5 +20,4 @@ namespace Pilz.IO
|
||||
else
|
||||
return Process.GetCurrentProcess().MainModule.FileName;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace Pilz.IO
|
||||
namespace Pilz.IO;
|
||||
|
||||
public partial class FileLocker : IDisposable
|
||||
{
|
||||
public partial class FileLocker : IDisposable
|
||||
{
|
||||
private FileStream fsLock = null;
|
||||
|
||||
/// <summary>
|
||||
@@ -114,5 +114,4 @@ namespace Pilz.IO
|
||||
disposedValue = true;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -2,14 +2,14 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Pilz.IO
|
||||
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
|
||||
{
|
||||
/// <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>
|
||||
@@ -63,5 +63,4 @@ namespace Pilz.IO
|
||||
Disposed?.Invoke(this);
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,12 +1,12 @@
|
||||
using System;
|
||||
using global::System.IO.Pipes;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using global::System.IO.Pipes;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Pilz.IO
|
||||
namespace Pilz.IO;
|
||||
|
||||
public class ManagedPipeClient : ManagedPipe
|
||||
{
|
||||
public class ManagedPipeClient : ManagedPipe
|
||||
{
|
||||
private PipeStream pipeStream;
|
||||
private byte[] _Buf = new byte[1024];
|
||||
|
||||
@@ -86,5 +86,4 @@ namespace Pilz.IO
|
||||
{
|
||||
pipeStream.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,12 +1,12 @@
|
||||
using System;
|
||||
using global::System.IO.Pipes;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using global::System.IO.Pipes;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Pilz.IO
|
||||
namespace Pilz.IO;
|
||||
|
||||
public class ManagedPipeServer : ManagedPipe
|
||||
{
|
||||
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>();
|
||||
@@ -104,5 +104,4 @@ namespace Pilz.IO
|
||||
for (int i = Clients.Count - 1; i >= 0; i -= 1)
|
||||
Clients[i].Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,4 @@
|
||||
using global::System;
|
||||
using global::System.Reflection;
|
||||
using global::System.Runtime.InteropServices;
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
|
||||
@@ -6,10 +6,10 @@ using System.Runtime.CompilerServices;
|
||||
using System.Text;
|
||||
using System.Xml;
|
||||
|
||||
namespace Pilz.LicenseHelper
|
||||
namespace Pilz.LicenseHelper;
|
||||
|
||||
public static class AsposeModifyInMemory
|
||||
{
|
||||
public static class AsposeModifyInMemory
|
||||
{
|
||||
private static string AsposeList = "Aspose.3D.dll, Aspose.BarCode.dll, Aspose.BarCode.Compact.dll, Aspose.BarCode.WPF.dll, Aspose.Cells.GridDesktop.dll, Aspose.Cells.GridWeb.dll, Aspose.CAD.dll, Aspose.Cells.dll, Aspose.Diagram.dll, Aspose.Email.dll, Aspose.Imaging.dll, Aspose.Note.dll, Aspose.OCR.dll, Aspose.Pdf.dll, Aspose.Slides.dll, Aspose.Tasks.dll, Aspose.Words.dll";
|
||||
|
||||
public static void ActivateMemoryPatching()
|
||||
@@ -181,5 +181,4 @@ namespace Pilz.LicenseHelper
|
||||
return new IntPtr(address);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// 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
|
||||
|
||||
@@ -1,14 +1,9 @@
|
||||
using Pilz.Networking.CloudProviders.Nextcloud.Client.Apps.FileRetention.Model;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Pilz.Networking.CloudProviders.Nextcloud.Client.Apps.FileRetention
|
||||
namespace Pilz.Networking.CloudProviders.Nextcloud.Client.Apps.FileRetention;
|
||||
|
||||
public class FilesRetentionClient : ClientBase
|
||||
{
|
||||
public class FilesRetentionClient : ClientBase
|
||||
{
|
||||
public FilesRetentionClient(NextcloudClient client) : base(client)
|
||||
{
|
||||
}
|
||||
@@ -41,5 +36,4 @@ namespace Pilz.Networking.CloudProviders.Nextcloud.Client.Apps.FileRetention
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,9 @@
|
||||
using Pilz.Networking.CloudProviders.Nextcloud.Client.Apps.FileRetention.Ocs;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Pilz.Networking.CloudProviders.Nextcloud.Client.Apps.FileRetention.Model
|
||||
namespace Pilz.Networking.CloudProviders.Nextcloud.Client.Apps.FileRetention.Model;
|
||||
|
||||
public class RetentionRule : RetentionRuleInfo
|
||||
{
|
||||
public class RetentionRule : RetentionRuleInfo
|
||||
{
|
||||
/// <summary>
|
||||
/// The ID for the retention rule.
|
||||
/// </summary>
|
||||
@@ -32,5 +27,4 @@ namespace Pilz.Networking.CloudProviders.Nextcloud.Client.Apps.FileRetention.Mod
|
||||
TimeAfter = (RetentionTimeAfter)(data.TimeAfter ?? 0);
|
||||
HasJob = data.HasJob ?? false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,9 @@
|
||||
using Pilz.Networking.CloudProviders.Nextcloud.Client.Apps.FileRetention.Ocs;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Pilz.Networking.CloudProviders.Nextcloud.Client.Apps.FileRetention.Model
|
||||
namespace Pilz.Networking.CloudProviders.Nextcloud.Client.Apps.FileRetention.Model;
|
||||
|
||||
public class RetentionRuleInfo
|
||||
{
|
||||
public class RetentionRuleInfo
|
||||
{
|
||||
/// <summary>
|
||||
/// The ID for the tag that is used for this rule.
|
||||
/// </summary>
|
||||
@@ -39,5 +34,4 @@ namespace Pilz.Networking.CloudProviders.Nextcloud.Client.Apps.FileRetention.Mod
|
||||
TimeAfter = (int)TimeAfter
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
namespace Pilz.Networking.CloudProviders.Nextcloud.Client.Apps.FileRetention.Model;
|
||||
|
||||
namespace Pilz.Networking.CloudProviders.Nextcloud.Client.Apps.FileRetention.Model
|
||||
public enum RetentionTimeAfter
|
||||
{
|
||||
public enum RetentionTimeAfter
|
||||
{
|
||||
CreationDate,
|
||||
LastAccess
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,16 +1,9 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
namespace Pilz.Networking.CloudProviders.Nextcloud.Client.Apps.FileRetention.Model;
|
||||
|
||||
namespace Pilz.Networking.CloudProviders.Nextcloud.Client.Apps.FileRetention.Model
|
||||
public enum RetentionTimeUnit
|
||||
{
|
||||
public enum RetentionTimeUnit
|
||||
{
|
||||
Day,
|
||||
Week,
|
||||
Month,
|
||||
Year
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,15 +1,10 @@
|
||||
using Newtonsoft.Json;
|
||||
using Pilz.Networking.CloudProviders.Nextcloud.Ocs;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Pilz.Networking.CloudProviders.Nextcloud.Client.Apps.FileRetention.Ocs
|
||||
namespace Pilz.Networking.CloudProviders.Nextcloud.Client.Apps.FileRetention.Ocs;
|
||||
|
||||
public class OcsDataRetentionRule : OcsData
|
||||
{
|
||||
public class OcsDataRetentionRule : OcsData
|
||||
{
|
||||
|
||||
[JsonProperty("tagid")]
|
||||
public int? TagID { get; set; }
|
||||
@@ -22,5 +17,4 @@ namespace Pilz.Networking.CloudProviders.Nextcloud.Client.Apps.FileRetention.Ocs
|
||||
|
||||
[JsonProperty("timeafter")]
|
||||
public int? TimeAfter { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,15 +1,10 @@
|
||||
using Newtonsoft.Json;
|
||||
using Pilz.Networking.CloudProviders.Nextcloud.Ocs.Responses;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Pilz.Networking.CloudProviders.Nextcloud.Client.Apps.FileRetention.Ocs
|
||||
namespace Pilz.Networking.CloudProviders.Nextcloud.Client.Apps.FileRetention.Ocs;
|
||||
|
||||
public class OcsResponseDataEntryRetention : OcsResponseDataEntry
|
||||
{
|
||||
public class OcsResponseDataEntryRetention : OcsResponseDataEntry
|
||||
{
|
||||
[JsonProperty("id")]
|
||||
public int? ID { get; set; }
|
||||
|
||||
@@ -27,5 +22,4 @@ namespace Pilz.Networking.CloudProviders.Nextcloud.Client.Apps.FileRetention.Ocs
|
||||
|
||||
[JsonProperty("hasJob")]
|
||||
public bool? HasJob { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,7 @@
|
||||
using Newtonsoft.Json;
|
||||
using Pilz.Networking.CloudProviders.Nextcloud.Ocs.Responses;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Pilz.Networking.CloudProviders.Nextcloud.Ocs.Responses;
|
||||
|
||||
namespace Pilz.Networking.CloudProviders.Nextcloud.Client.Apps.FileRetention.Ocs
|
||||
namespace Pilz.Networking.CloudProviders.Nextcloud.Client.Apps.FileRetention.Ocs;
|
||||
|
||||
public class OcsResponseRetention : OcsResponse<OcsResponseDataArray<OcsResponseDataEntryRetention>>
|
||||
{
|
||||
public class OcsResponseRetention : OcsResponse<OcsResponseDataArray<OcsResponseDataEntryRetention>>
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,16 +1,10 @@
|
||||
using Pilz.Networking.CloudProviders.Nextcloud.Client.Apps.FileRetention.Ocs;
|
||||
using Pilz.Networking.CloudProviders.Nextcloud.Ocs;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Pilz.Networking.CloudProviders.Nextcloud.Client.Apps.FileRetention
|
||||
namespace Pilz.Networking.CloudProviders.Nextcloud.Client.Apps.FileRetention;
|
||||
|
||||
public class OcsApiFilesRetention : OcsApiBase
|
||||
{
|
||||
public class OcsApiFilesRetention : OcsApiBase
|
||||
{
|
||||
public static readonly OcsApiUrlPath OCS_FILE_RETENTION_RULES = new("/ocs/v2.php/apps/files_retention/api/v1/retentions");
|
||||
public static readonly OcsApiUrlPath OCS_FILE_RETENTION_RULE = new("/ocs/v2.php/apps/files_retention/api/v1/retentions/{0}");
|
||||
|
||||
@@ -34,5 +28,4 @@ namespace Pilz.Networking.CloudProviders.Nextcloud.Client.Apps.FileRetention
|
||||
{
|
||||
return Manager.MakeRequestOcs<OcsResponseRetention>(HttpMethod.Get, OCS_FILE_RETENTION_RULES);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,9 @@
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Pilz.Networking.CloudProviders.Nextcloud.Client.Apps.Tables.Model
|
||||
namespace Pilz.Networking.CloudProviders.Nextcloud.Client.Apps.Tables.Model;
|
||||
|
||||
public class Column
|
||||
{
|
||||
public class Column
|
||||
{
|
||||
[JsonProperty("type")]
|
||||
private string? type;
|
||||
|
||||
@@ -112,5 +107,4 @@ namespace Pilz.Networking.CloudProviders.Nextcloud.Client.Apps.Tables.Model
|
||||
_ => ""
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,18 +1,12 @@
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Pilz.Networking.CloudProviders.Nextcloud.Client.Apps.Tables.Model
|
||||
namespace Pilz.Networking.CloudProviders.Nextcloud.Client.Apps.Tables.Model;
|
||||
|
||||
public class ColumnSelectionOption
|
||||
{
|
||||
public class ColumnSelectionOption
|
||||
{
|
||||
[JsonProperty("id")]
|
||||
public long Id { get; set; }
|
||||
|
||||
[JsonProperty("label")]
|
||||
public string? Label { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,15 +1,8 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
namespace Pilz.Networking.CloudProviders.Nextcloud.Client.Apps.Tables.Model;
|
||||
|
||||
namespace Pilz.Networking.CloudProviders.Nextcloud.Client.Apps.Tables.Model
|
||||
public enum ColumnSubtype
|
||||
{
|
||||
public enum ColumnSubtype
|
||||
{
|
||||
None,
|
||||
Unknown,
|
||||
Line
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,16 +1,9 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
namespace Pilz.Networking.CloudProviders.Nextcloud.Client.Apps.Tables.Model;
|
||||
|
||||
namespace Pilz.Networking.CloudProviders.Nextcloud.Client.Apps.Tables.Model
|
||||
public enum ColumnType
|
||||
{
|
||||
public enum ColumnType
|
||||
{
|
||||
Unknown,
|
||||
Text,
|
||||
Selection,
|
||||
DateTime
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
namespace Pilz.Networking.CloudProviders.Nextcloud.Client.Apps.Tables.Model;
|
||||
|
||||
namespace Pilz.Networking.CloudProviders.Nextcloud.Client.Apps.Tables.Model
|
||||
public class Columns : List<Column>
|
||||
{
|
||||
public class Columns : List<Column>
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,9 @@
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Pilz.Networking.CloudProviders.Nextcloud.Client.Apps.Tables.Model
|
||||
namespace Pilz.Networking.CloudProviders.Nextcloud.Client.Apps.Tables.Model;
|
||||
|
||||
public class Row
|
||||
{
|
||||
public class Row
|
||||
{
|
||||
[JsonProperty("id")]
|
||||
public long RowId { get; set; } = -1;
|
||||
|
||||
@@ -29,5 +24,4 @@ namespace Pilz.Networking.CloudProviders.Nextcloud.Client.Apps.Tables.Model
|
||||
|
||||
[JsonProperty("data")]
|
||||
public List<RowData> Data { get; set; } = new();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,18 +1,12 @@
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Pilz.Networking.CloudProviders.Nextcloud.Client.Apps.Tables.Model
|
||||
namespace Pilz.Networking.CloudProviders.Nextcloud.Client.Apps.Tables.Model;
|
||||
|
||||
public class RowData
|
||||
{
|
||||
public class RowData
|
||||
{
|
||||
[JsonProperty("columnId")]
|
||||
public long ColumnId { get; set; }
|
||||
|
||||
[JsonProperty("value")]
|
||||
public object? Value { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
namespace Pilz.Networking.CloudProviders.Nextcloud.Client.Apps.Tables.Model;
|
||||
|
||||
namespace Pilz.Networking.CloudProviders.Nextcloud.Client.Apps.Tables.Model
|
||||
public class RowSimple : List<object>
|
||||
{
|
||||
public class RowSimple : List<object>
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,15 +1,9 @@
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Pilz.Networking.CloudProviders.Nextcloud.Client.Apps.Tables.Model
|
||||
namespace Pilz.Networking.CloudProviders.Nextcloud.Client.Apps.Tables.Model;
|
||||
|
||||
public class RowUpdate
|
||||
{
|
||||
public class RowUpdate
|
||||
{
|
||||
[JsonProperty("data")]
|
||||
public Dictionary<long, object?> Data { get; set; } = new();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
namespace Pilz.Networking.CloudProviders.Nextcloud.Client.Apps.Tables.Model;
|
||||
|
||||
namespace Pilz.Networking.CloudProviders.Nextcloud.Client.Apps.Tables.Model
|
||||
public class Rows : List<Row>
|
||||
{
|
||||
public class Rows : List<Row>
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
namespace Pilz.Networking.CloudProviders.Nextcloud.Client.Apps.Tables.Model;
|
||||
|
||||
namespace Pilz.Networking.CloudProviders.Nextcloud.Client.Apps.Tables.Model
|
||||
public class RowsSimple : List<RowSimple>
|
||||
{
|
||||
public class RowsSimple : List<RowSimple>
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,16 +1,10 @@
|
||||
using Pilz.Networking.CloudProviders.Nextcloud.Client.Apps.Tables.Model;
|
||||
using Pilz.Networking.CloudProviders.Nextcloud.Ocs;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Pilz.Networking.CloudProviders.Nextcloud.Client.Apps.Tables
|
||||
namespace Pilz.Networking.CloudProviders.Nextcloud.Client.Apps.Tables;
|
||||
|
||||
public class OcsApiTables : OcsApiBase
|
||||
{
|
||||
public class OcsApiTables : OcsApiBase
|
||||
{
|
||||
public static readonly OcsApiUrlPath OCS_TABLES_TABLE_ROWS = new("/apps/tables/api/1/tables/{0}/rows");
|
||||
public static readonly OcsApiUrlPath OCS_TABLES_VIEW_ROWS = new("/apps/tables/api/1/views/{0}/rows");
|
||||
public static readonly OcsApiUrlPath OCS_TABLES_TABLE_ROWS_SIMPLE = new("/apps/tables/api/1/tables/{0}/rows/simple");
|
||||
@@ -82,5 +76,4 @@ namespace Pilz.Networking.CloudProviders.Nextcloud.Client.Apps.Tables
|
||||
{
|
||||
return Manager.MakeRequest<Row>(HttpMethod.Post, OCS_TABLES_VIEW_ROWS.FillParameters(viewId), content: values);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,9 @@
|
||||
using Pilz.Networking.CloudProviders.Nextcloud.Client.Apps.Tables.Model;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Pilz.Networking.CloudProviders.Nextcloud.Client.Apps.Tables
|
||||
namespace Pilz.Networking.CloudProviders.Nextcloud.Client.Apps.Tables;
|
||||
|
||||
public class TablesClient : ClientBase
|
||||
{
|
||||
public class TablesClient : ClientBase
|
||||
{
|
||||
public TablesClient(NextcloudClient client) : base(client)
|
||||
{
|
||||
}
|
||||
@@ -77,5 +72,4 @@ namespace Pilz.Networking.CloudProviders.Nextcloud.Client.Apps.Tables
|
||||
{
|
||||
return Client.Ocs.GetApi<OcsApiTables>().CreateRow(tableId, values);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,20 +1,22 @@
|
||||
using Pilz.Networking.CloudProviders.Nextcloud.Client.Apps.Tables;
|
||||
using Pilz.Networking.CloudProviders.Nextcloud.Client.Apps.Tables.Model;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
namespace Pilz.Networking.CloudProviders.Nextcloud.Client;
|
||||
|
||||
|
||||
/* Nicht gemergte Änderung aus Projekt "Pilz.Networking.CloudProviders.Nextcloud (net6.0)"
|
||||
Vor:
|
||||
namespace Pilz.Networking.CloudProviders.Nextcloud.Client
|
||||
{
|
||||
public abstract class ClientBase
|
||||
{
|
||||
Nach:
|
||||
namespace Pilz.Networking.CloudProviders.Nextcloud.Client;
|
||||
|
||||
public abstract class ClientBase
|
||||
*/
|
||||
public abstract class ClientBase
|
||||
{
|
||||
protected NextcloudClient Client { get; init; }
|
||||
|
||||
protected ClientBase(NextcloudClient client)
|
||||
{
|
||||
Client = client;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,9 @@
|
||||
using Pilz.Networking.CloudProviders.Nextcloud.Client.Cloud.Model;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Pilz.Networking.CloudProviders.Nextcloud.Client.Cloud
|
||||
namespace Pilz.Networking.CloudProviders.Nextcloud.Client.Cloud;
|
||||
|
||||
public class CloudClient : ClientBase
|
||||
{
|
||||
public class CloudClient : ClientBase
|
||||
{
|
||||
public CloudClient(NextcloudClient client) : base(client)
|
||||
{
|
||||
}
|
||||
@@ -30,5 +25,4 @@ namespace Pilz.Networking.CloudProviders.Nextcloud.Client.Cloud
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,7 @@
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
namespace Pilz.Networking.CloudProviders.Nextcloud.Client.Cloud.Model;
|
||||
|
||||
namespace Pilz.Networking.CloudProviders.Nextcloud.Client.Cloud.Model
|
||||
public class UserBackendCapabilities
|
||||
{
|
||||
public class UserBackendCapabilities
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines if the display name can be changed.
|
||||
/// </summary>
|
||||
@@ -18,5 +11,4 @@ namespace Pilz.Networking.CloudProviders.Nextcloud.Client.Cloud.Model
|
||||
/// Defines if the password can be changed.
|
||||
/// </summary>
|
||||
public bool SetPassword { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,9 @@
|
||||
using Pilz.Networking.CloudProviders.Nextcloud.Client.Cloud.Ocs;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Pilz.Networking.CloudProviders.Nextcloud.Client.Cloud.Model
|
||||
namespace Pilz.Networking.CloudProviders.Nextcloud.Client.Cloud.Model;
|
||||
|
||||
public class UserInfo
|
||||
{
|
||||
public class UserInfo
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines if the user is enabled.
|
||||
/// </summary>
|
||||
@@ -127,5 +122,4 @@ namespace Pilz.Networking.CloudProviders.Nextcloud.Client.Cloud.Model
|
||||
BackendCapabilities.SetPassword = Convert.ToBoolean(responseData.BackendCapabilities.SetPassword);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,7 @@
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
namespace Pilz.Networking.CloudProviders.Nextcloud.Client.Cloud.Model;
|
||||
|
||||
namespace Pilz.Networking.CloudProviders.Nextcloud.Client.Cloud.Model
|
||||
public class UserQuota
|
||||
{
|
||||
public class UserQuota
|
||||
{
|
||||
/// <summary>
|
||||
/// Amount of free bytes left.
|
||||
/// </summary>
|
||||
@@ -33,5 +26,4 @@ namespace Pilz.Networking.CloudProviders.Nextcloud.Client.Cloud.Model
|
||||
/// Total amount of bytes available.
|
||||
/// </summary>
|
||||
public long Quota { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,15 +1,10 @@
|
||||
using Newtonsoft.Json;
|
||||
using Pilz.Networking.CloudProviders.Nextcloud.Ocs.Responses;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Pilz.Networking.CloudProviders.Nextcloud.Client.Cloud.Ocs
|
||||
namespace Pilz.Networking.CloudProviders.Nextcloud.Client.Cloud.Ocs;
|
||||
|
||||
public class OcsResponseDataUser : OcsResponseData
|
||||
{
|
||||
public class OcsResponseDataUser : OcsResponseData
|
||||
{
|
||||
public class ResponseQuota
|
||||
{
|
||||
[JsonProperty("free")]
|
||||
@@ -87,5 +82,4 @@ namespace Pilz.Networking.CloudProviders.Nextcloud.Client.Cloud.Ocs
|
||||
|
||||
[JsonProperty("backendCapabilities")]
|
||||
public ResponseBackendCapabilities? BackendCapabilities { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,7 @@
|
||||
using Newtonsoft.Json;
|
||||
using Pilz.Networking.CloudProviders.Nextcloud.Ocs.Responses;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Pilz.Networking.CloudProviders.Nextcloud.Ocs.Responses;
|
||||
|
||||
namespace Pilz.Networking.CloudProviders.Nextcloud.Client.Cloud.Ocs
|
||||
namespace Pilz.Networking.CloudProviders.Nextcloud.Client.Cloud.Ocs;
|
||||
|
||||
public class OcsResponseUser : OcsResponse<OcsResponseDataUser>
|
||||
{
|
||||
public class OcsResponseUser : OcsResponse<OcsResponseDataUser>
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,15 +1,10 @@
|
||||
using Pilz.Networking.CloudProviders.Nextcloud.Client.Cloud.Ocs;
|
||||
using Pilz.Networking.CloudProviders.Nextcloud.Ocs;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Pilz.Networking.CloudProviders.Nextcloud.Client.Cloud
|
||||
namespace Pilz.Networking.CloudProviders.Nextcloud.Client.Cloud;
|
||||
|
||||
public class OcsApiCloud : OcsApiBase
|
||||
{
|
||||
public class OcsApiCloud : OcsApiBase
|
||||
{
|
||||
public readonly static OcsApiUrlPath OCS_CLOUD_USER_METADATA = new("/ocs/v1.php/cloud/users/{0}");
|
||||
|
||||
public OcsApiCloud(OcsApi manager) : base(manager)
|
||||
@@ -20,5 +15,4 @@ namespace Pilz.Networking.CloudProviders.Nextcloud.Client.Cloud
|
||||
{
|
||||
return Manager.MakeRequestOcs<OcsResponseUser>(HttpMethod.Get, OCS_CLOUD_USER_METADATA.FillParameters(username));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,25 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
/* Nicht gemergte Änderung aus Projekt "Pilz.Networking.CloudProviders.Nextcloud (net6.0)"
|
||||
Vor:
|
||||
using System;
|
||||
Nach:
|
||||
using Pilz.Networking.CloudProviders.Nextcloud.Ocs;
|
||||
using System;
|
||||
*/
|
||||
using
|
||||
/* Nicht gemergte Änderung aus Projekt "Pilz.Networking.CloudProviders.Nextcloud (net6.0)"
|
||||
Vor:
|
||||
using System.Threading.Tasks;
|
||||
using Pilz.Networking.CloudProviders.Nextcloud.Ocs;
|
||||
Nach:
|
||||
using System.Threading.Tasks;
|
||||
*/
|
||||
Pilz.Networking.CloudProviders.Nextcloud.Ocs;
|
||||
|
||||
namespace Pilz.Networking.CloudProviders.Nextcloud.Client.Core
|
||||
namespace Pilz.Networking.CloudProviders.Nextcloud.Client.Core;
|
||||
|
||||
public class OcsApiCore : OcsApiBase
|
||||
{
|
||||
public class OcsApiCore : OcsApiBase
|
||||
{
|
||||
public static readonly OcsApiUrlPath OCS_CORE_APPPASSWORD = "/ocs/v2.php/core/apppassword";
|
||||
|
||||
public OcsApiCore(OcsApi manager) : base(manager)
|
||||
@@ -20,5 +31,4 @@ namespace Pilz.Networking.CloudProviders.Nextcloud.Client.Core
|
||||
using var msg = Manager.MakeRequest(HttpMethod.Delete, OCS_CORE_APPPASSWORD);
|
||||
return msg != null && msg.IsSuccessStatusCode;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,9 @@
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Pilz.Networking.CloudProviders.Nextcloud.Client.LoginFlowV2.Ocs
|
||||
namespace Pilz.Networking.CloudProviders.Nextcloud.Client.LoginFlowV2.Ocs;
|
||||
|
||||
public class OcsResponseLoginFlowV2
|
||||
{
|
||||
public class OcsResponseLoginFlowV2
|
||||
{
|
||||
public class PollData
|
||||
{
|
||||
/// <summary>
|
||||
@@ -36,5 +31,4 @@ namespace Pilz.Networking.CloudProviders.Nextcloud.Client.LoginFlowV2.Ocs
|
||||
/// </summary>
|
||||
[JsonProperty("login")]
|
||||
public string? LoginUrl { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,9 @@
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Pilz.Networking.CloudProviders.Nextcloud.Client.LoginFlowV2.Ocs
|
||||
namespace Pilz.Networking.CloudProviders.Nextcloud.Client.LoginFlowV2.Ocs;
|
||||
|
||||
public class OcsResponseLoginFlowV2Credentials
|
||||
{
|
||||
public class OcsResponseLoginFlowV2Credentials
|
||||
{
|
||||
/// <summary>
|
||||
/// The server url the login credentials are for.
|
||||
/// </summary>
|
||||
@@ -26,5 +21,4 @@ namespace Pilz.Networking.CloudProviders.Nextcloud.Client.LoginFlowV2.Ocs
|
||||
/// </summary>
|
||||
[JsonProperty("appPassword")]
|
||||
public string? AppPassword { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,15 +1,10 @@
|
||||
using Pilz.Networking.CloudProviders.Nextcloud.Client.LoginFlowV2.Ocs;
|
||||
using Pilz.Networking.CloudProviders.Nextcloud.Ocs;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Pilz.Networking.CloudProviders.Nextcloud.Client.LoginFlowV2
|
||||
namespace Pilz.Networking.CloudProviders.Nextcloud.Client.LoginFlowV2;
|
||||
|
||||
public class OcsApiLoginFlowV2 : OcsApiBase
|
||||
{
|
||||
public class OcsApiLoginFlowV2 : OcsApiBase
|
||||
{
|
||||
private const string OCS_LOGIN_INIT = "/index.php/login/v2";
|
||||
|
||||
public OcsApiLoginFlowV2(OcsApi manager) : base(manager)
|
||||
@@ -32,5 +27,4 @@ namespace Pilz.Networking.CloudProviders.Nextcloud.Client.LoginFlowV2
|
||||
{ "token", poll.Token }
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,10 @@
|
||||
using Pilz.Networking.CloudProviders.Nextcloud.Ocs;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Pilz.Networking.CloudProviders.Nextcloud
|
||||
namespace Pilz.Networking.CloudProviders.Nextcloud;
|
||||
|
||||
public static class Extensions
|
||||
{
|
||||
public static class Extensions
|
||||
{
|
||||
public static string ToBasicAuth(this OcsApiAuthCredentials? credentials)
|
||||
{
|
||||
if (credentials != null)
|
||||
@@ -42,5 +38,4 @@ namespace Pilz.Networking.CloudProviders.Nextcloud
|
||||
{
|
||||
return new DateTimeOffset(value).ToUnixTimeMilliseconds();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,14 @@
|
||||
using System;
|
||||
using Pilz.Networking.CloudProviders.Nextcloud.Client;
|
||||
using Pilz.Networking.CloudProviders.Nextcloud.Client.Cloud;
|
||||
using Pilz.Networking.CloudProviders.Nextcloud.Client.Cloud.Model;
|
||||
using Pilz.Networking.CloudProviders.Nextcloud.Client.LoginFlowV2.Ocs;
|
||||
|
||||
/* Nicht gemergte Änderung aus Projekt "Pilz.Networking.CloudProviders.Nextcloud (net6.0)"
|
||||
Vor:
|
||||
using Pilz.Networking.CloudProviders.Nextcloud.Ocs;
|
||||
Nach:
|
||||
using Pilz.Networking.CloudProviders.Nextcloud.Ocs;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
@@ -6,16 +16,14 @@ using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Pilz.Networking.CloudProviders.Nextcloud.Client;
|
||||
using Pilz.Networking.CloudProviders.Nextcloud.Client.Cloud;
|
||||
using Pilz.Networking.CloudProviders.Nextcloud.Client.Cloud.Model;
|
||||
using Pilz.Networking.CloudProviders.Nextcloud.Client.LoginFlowV2.Ocs;
|
||||
*/
|
||||
using Pilz.Networking.CloudProviders.Nextcloud.Ocs;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace Pilz.Networking.CloudProviders.Nextcloud
|
||||
namespace Pilz.Networking.CloudProviders.Nextcloud;
|
||||
|
||||
public class NextcloudClient : IDisposable
|
||||
{
|
||||
public class NextcloudClient : IDisposable
|
||||
{
|
||||
private readonly List<ClientBase> clients = new();
|
||||
private NextcloudLogin? currentLogin;
|
||||
|
||||
@@ -151,5 +159,4 @@ namespace Pilz.Networking.CloudProviders.Nextcloud
|
||||
Ocs.Dispose();
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,15 +1,9 @@
|
||||
using Newtonsoft.Json;
|
||||
using Pilz.Networking.CloudProviders.Nextcloud.Client.LoginFlowV2.Ocs;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Pilz.Networking.CloudProviders.Nextcloud.Client.LoginFlowV2.Ocs;
|
||||
|
||||
namespace Pilz.Networking.CloudProviders.Nextcloud
|
||||
namespace Pilz.Networking.CloudProviders.Nextcloud;
|
||||
|
||||
public class NextcloudLogin
|
||||
{
|
||||
public class NextcloudLogin
|
||||
{
|
||||
/// <summary>
|
||||
/// The server url the login credentials are for.
|
||||
/// </summary>
|
||||
@@ -35,5 +29,4 @@ namespace Pilz.Networking.CloudProviders.Nextcloud
|
||||
LoginName = response.LoginName;
|
||||
AppPassword = response.AppPassword;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,15 +1,8 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
namespace Pilz.Networking.CloudProviders.Nextcloud.Ocs;
|
||||
|
||||
namespace Pilz.Networking.CloudProviders.Nextcloud.Ocs
|
||||
public delegate void GetOcsApiAuthCredentailsEventHandler(object sender, GetOcsApiAuthCredentailsEventArgs eventArgs);
|
||||
|
||||
public class GetOcsApiAuthCredentailsEventArgs : EventArgs
|
||||
{
|
||||
public delegate void GetOcsApiAuthCredentailsEventHandler(object sender, GetOcsApiAuthCredentailsEventArgs eventArgs);
|
||||
|
||||
public class GetOcsApiAuthCredentailsEventArgs : EventArgs
|
||||
{
|
||||
public OcsApiAuthCredentials? Credentials { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,23 +1,32 @@
|
||||
using System;
|
||||
/* Nicht gemergte Änderung aus Projekt "Pilz.Networking.CloudProviders.Nextcloud (net6.0)"
|
||||
Vor:
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Net.Http.Headers;
|
||||
using Newtonsoft.Json;
|
||||
using System.Diagnostics;
|
||||
using System.Net;
|
||||
using System.Net.Sockets;
|
||||
using System.Xml.Linq;
|
||||
Nach:
|
||||
using Newtonsoft.Json;
|
||||
using Pilz.Networking.CloudProviders.Nextcloud.Client.Cloud;
|
||||
using Pilz.Networking.CloudProviders.Nextcloud.Client.Core;
|
||||
using Pilz.Networking.CloudProviders.Nextcloud.Client.LoginFlowV2;
|
||||
using Pilz.Networking.CloudProviders.Nextcloud.Ocs.Responses;
|
||||
using System;
|
||||
using System.Json;
|
||||
*/
|
||||
|
||||
namespace Pilz.Networking.CloudProviders.Nextcloud.Ocs
|
||||
/* Nicht gemergte Änderung aus Projekt "Pilz.Networking.CloudProviders.Nextcloud (net6.0)"
|
||||
Vor:
|
||||
using
|
||||
Nach:
|
||||
using
|
||||
*/
|
||||
namespace Pilz.Networking.CloudProviders.Nextcloud.Ocs;
|
||||
|
||||
public class OcsApi : IDisposable
|
||||
{
|
||||
public class OcsApi : IDisposable
|
||||
{
|
||||
public const string CONTENT_TYPE_JSON = "application/json";
|
||||
|
||||
public event GetOcsApiAuthCredentailsEventHandler? GetOcsApiAuthCredentails;
|
||||
@@ -125,8 +134,8 @@ namespace Pilz.Networking.CloudProviders.Nextcloud.Ocs
|
||||
var bodyInit = responseInit.Content.ReadAsStringAsync().Result;
|
||||
return JsonConvert.DeserializeObject<TResponse>(bodyInit);
|
||||
}
|
||||
catch(FormatException) { }
|
||||
catch(JsonSerializationException) { }
|
||||
catch (FormatException) { }
|
||||
catch (JsonSerializationException) { }
|
||||
}
|
||||
|
||||
return default;
|
||||
@@ -214,5 +223,4 @@ namespace Pilz.Networking.CloudProviders.Nextcloud.Ocs
|
||||
client.Dispose();
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reflection.Emit;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
namespace Pilz.Networking.CloudProviders.Nextcloud.Ocs;
|
||||
|
||||
namespace Pilz.Networking.CloudProviders.Nextcloud.Ocs
|
||||
public struct OcsApiAuthCredentials
|
||||
{
|
||||
public struct OcsApiAuthCredentials
|
||||
{
|
||||
public string LoginName { get; set; }
|
||||
public string AppPassword { get; set; }
|
||||
|
||||
@@ -17,5 +10,4 @@ namespace Pilz.Networking.CloudProviders.Nextcloud.Ocs
|
||||
LoginName = loginName;
|
||||
AppPassword = appPassword;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,18 +1,11 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
namespace Pilz.Networking.CloudProviders.Nextcloud.Ocs;
|
||||
|
||||
namespace Pilz.Networking.CloudProviders.Nextcloud.Ocs
|
||||
public abstract class OcsApiBase
|
||||
{
|
||||
public abstract class OcsApiBase
|
||||
{
|
||||
protected OcsApi Manager { get; init; }
|
||||
|
||||
protected OcsApiBase(OcsApi manager)
|
||||
{
|
||||
Manager = manager;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,17 +1,10 @@
|
||||
using Newtonsoft.Json;
|
||||
using Pilz.Networking.CloudProviders.Nextcloud.Ocs.Responses;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Xml.Linq;
|
||||
|
||||
namespace Pilz.Networking.CloudProviders.Nextcloud.Ocs
|
||||
namespace Pilz.Networking.CloudProviders.Nextcloud.Ocs;
|
||||
|
||||
public class OcsApiResponse<TOcsResponse> where TOcsResponse : IOcsResponse
|
||||
{
|
||||
public class OcsApiResponse<TOcsResponse> where TOcsResponse : IOcsResponse
|
||||
{
|
||||
[JsonProperty("ocs")]
|
||||
public TOcsResponse? Ocs { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
namespace Pilz.Networking.CloudProviders.Nextcloud.Ocs;
|
||||
|
||||
namespace Pilz.Networking.CloudProviders.Nextcloud.Ocs
|
||||
public readonly struct OcsApiUrlPath
|
||||
{
|
||||
public readonly struct OcsApiUrlPath
|
||||
{
|
||||
private readonly string path;
|
||||
|
||||
public OcsApiUrlPath()
|
||||
@@ -27,5 +21,4 @@ namespace Pilz.Networking.CloudProviders.Nextcloud.Ocs
|
||||
{
|
||||
return path;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
namespace Pilz.Networking.CloudProviders.Nextcloud.Ocs;
|
||||
|
||||
namespace Pilz.Networking.CloudProviders.Nextcloud.Ocs
|
||||
public class OcsData
|
||||
{
|
||||
public class OcsData
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
namespace Pilz.Networking.CloudProviders.Nextcloud.Ocs.Responses;
|
||||
|
||||
namespace Pilz.Networking.CloudProviders.Nextcloud.Ocs.Responses
|
||||
public interface IOcsResponse
|
||||
{
|
||||
public interface IOcsResponse
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
namespace Pilz.Networking.CloudProviders.Nextcloud.Ocs.Responses;
|
||||
|
||||
namespace Pilz.Networking.CloudProviders.Nextcloud.Ocs.Responses
|
||||
public interface IOcsResponseData
|
||||
{
|
||||
public interface IOcsResponseData
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
namespace Pilz.Networking.CloudProviders.Nextcloud.Ocs.Responses;
|
||||
|
||||
namespace Pilz.Networking.CloudProviders.Nextcloud.Ocs.Responses
|
||||
public interface IOcsResponseMeta
|
||||
{
|
||||
public interface IOcsResponseMeta
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,26 +1,20 @@
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Pilz.Networking.CloudProviders.Nextcloud.Ocs.Responses
|
||||
namespace Pilz.Networking.CloudProviders.Nextcloud.Ocs.Responses;
|
||||
|
||||
public class OcsResponse<TMeta, TData> : IOcsResponse where TMeta : IOcsResponseMeta where TData : IOcsResponseData
|
||||
{
|
||||
public class OcsResponse<TMeta, TData> : IOcsResponse where TMeta : IOcsResponseMeta where TData : IOcsResponseData
|
||||
{
|
||||
[JsonProperty("meta")]
|
||||
public TMeta? Meta { get; set; }
|
||||
|
||||
[JsonProperty("data")]
|
||||
public TData? Data { get; set; }
|
||||
}
|
||||
|
||||
public class OcsResponse<TData> : OcsResponse<OcsResponseMeta, TData> where TData : IOcsResponseData
|
||||
{
|
||||
}
|
||||
|
||||
public class OcsResponse : OcsResponse<OcsResponseMeta, OcsResponseData>
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
public class OcsResponse<TData> : OcsResponse<OcsResponseMeta, TData> where TData : IOcsResponseData
|
||||
{
|
||||
}
|
||||
|
||||
public class OcsResponse : OcsResponse<OcsResponseMeta, OcsResponseData>
|
||||
{
|
||||
}
|
||||
|
||||
@@ -1,12 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
namespace Pilz.Networking.CloudProviders.Nextcloud.Ocs.Responses;
|
||||
|
||||
namespace Pilz.Networking.CloudProviders.Nextcloud.Ocs.Responses
|
||||
public class OcsResponseData : IOcsResponseData
|
||||
{
|
||||
public class OcsResponseData : IOcsResponseData
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
namespace Pilz.Networking.CloudProviders.Nextcloud.Ocs.Responses;
|
||||
|
||||
namespace Pilz.Networking.CloudProviders.Nextcloud.Ocs.Responses
|
||||
public class OcsResponseDataArray<TEntry> : List<TEntry>, IOcsResponseData where TEntry : OcsResponseDataEntry
|
||||
{
|
||||
public class OcsResponseDataArray<TEntry> : List<TEntry>, IOcsResponseData where TEntry : OcsResponseDataEntry
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
namespace Pilz.Networking.CloudProviders.Nextcloud.Ocs.Responses;
|
||||
|
||||
namespace Pilz.Networking.CloudProviders.Nextcloud.Ocs.Responses
|
||||
public class OcsResponseDataEntry
|
||||
{
|
||||
public class OcsResponseDataEntry
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,9 @@
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Pilz.Networking.CloudProviders.Nextcloud.Ocs.Responses
|
||||
namespace Pilz.Networking.CloudProviders.Nextcloud.Ocs.Responses;
|
||||
|
||||
public class OcsResponseMeta : IOcsResponseMeta
|
||||
{
|
||||
public class OcsResponseMeta : IOcsResponseMeta
|
||||
{
|
||||
[JsonProperty("status")]
|
||||
public string? Status { get; set; }
|
||||
|
||||
@@ -17,5 +12,4 @@ namespace Pilz.Networking.CloudProviders.Nextcloud.Ocs.Responses
|
||||
|
||||
[JsonProperty("message")]
|
||||
public string? Message { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
Imports System.IO
|
||||
Imports System.Net
|
||||
|
||||
Imports Newtonsoft.Json.Linq
|
||||
|
||||
Public MustInherit Class ConnectionManagerBase
|
||||
|
||||
@@ -1,8 +1,14 @@
|
||||
Imports System.IO
|
||||
Imports System.Net
|
||||
Imports System.Net.NetworkInformation
|
||||
Imports System.Net
|
||||
|
||||
' Nicht gemergte Änderung aus Projekt "Pilz.Networking (net8.0-windows)"
|
||||
' Vor:
|
||||
' Imports System.Net.Sockets
|
||||
' Imports Newtonsoft.Json.Linq
|
||||
' Nach:
|
||||
' Imports System.Net.Sockets
|
||||
'
|
||||
' Imports Newtonsoft.Json.Linq
|
||||
Imports System.Net.Sockets
|
||||
Imports Newtonsoft.Json.Linq
|
||||
|
||||
Public Class TCPManager
|
||||
Inherits ConnectionManagerBase
|
||||
|
||||
@@ -1,9 +1,15 @@
|
||||
Imports System.IO
|
||||
Imports System.Net
|
||||
Imports System.Net.NetworkInformation
|
||||
Imports System.Net
|
||||
Imports System.Net.Sockets
|
||||
|
||||
' Nicht gemergte Änderung aus Projekt "Pilz.Networking (net8.0-windows)"
|
||||
' Vor:
|
||||
' Imports System.Threading
|
||||
' Imports Newtonsoft.Json.Linq
|
||||
' Nach:
|
||||
' Imports System.Threading
|
||||
'
|
||||
' Imports Newtonsoft.Json.Linq
|
||||
Imports System.Threading
|
||||
Imports Newtonsoft.Json.Linq
|
||||
|
||||
Public Class UDPManager
|
||||
Inherits ConnectionManagerBase
|
||||
|
||||
@@ -1,13 +1,10 @@
|
||||
using System.Drawing;
|
||||
using System.Reflection;
|
||||
using Telerik.WinControls;
|
||||
using Telerik.WinControls.Elements;
|
||||
using Telerik.WinControls;
|
||||
using Telerik.WinControls.UI;
|
||||
|
||||
namespace Pilz.Plugins.Advanced.UI.Telerik
|
||||
namespace Pilz.Plugins.Advanced.UI.Telerik;
|
||||
|
||||
public static class Extensions
|
||||
{
|
||||
public static class Extensions
|
||||
{
|
||||
public static Icon? ToIcon(this Image image)
|
||||
{
|
||||
if (image is Bitmap bitmap)
|
||||
@@ -121,5 +118,4 @@ namespace Pilz.Plugins.Advanced.UI.Telerik
|
||||
if (sender is RadMenuItem item && item.Tag is PluginFunction function)
|
||||
function.Execute();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,14 +1,11 @@
|
||||
using Pilz.Plugins.Advanced.UI;
|
||||
using Pilz.UI.Telerik;
|
||||
using Pilz.UI.Telerik;
|
||||
using Pilz.UI.Telerik.Dialogs;
|
||||
using System.Drawing;
|
||||
using System.Windows.Forms;
|
||||
using Telerik.WinControls;
|
||||
|
||||
namespace Pilz.Plugins.Advanced.UI.Telerik
|
||||
namespace Pilz.Plugins.Advanced.UI.Telerik;
|
||||
|
||||
public abstract class PluginModule : PluginModule<PluginModuleUI>
|
||||
{
|
||||
public abstract class PluginModule : PluginModule<PluginModuleUI>
|
||||
{
|
||||
/// <summary>
|
||||
/// Wrapper for the <see cref="PluginFeature.Icon"/> property to directly use it as <see cref="RadSvgImage"/>.
|
||||
/// </summary>
|
||||
@@ -35,5 +32,4 @@ namespace Pilz.Plugins.Advanced.UI.Telerik
|
||||
DialogBase.Show(ui, Name!, SvgImage!.ToImage().ToIcon()!);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,15 +1,9 @@
|
||||
using Pilz.UI.Telerik.Dialogs;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace Pilz.Plugins.Advanced.UI.Telerik
|
||||
namespace Pilz.Plugins.Advanced.UI.Telerik;
|
||||
|
||||
public class PluginModuleUI : FlyoutBase, ILoadContent
|
||||
{
|
||||
public class PluginModuleUI : FlyoutBase, ILoadContent
|
||||
{
|
||||
public PluginModuleUI()
|
||||
{
|
||||
ActionPanelVisible = false;
|
||||
@@ -18,5 +12,4 @@ namespace Pilz.Plugins.Advanced.UI.Telerik
|
||||
public virtual void LoadContent()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,8 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
namespace Pilz.Plugins.Advanced.UI;
|
||||
|
||||
namespace Pilz.Plugins.Advanced.UI
|
||||
[Flags]
|
||||
public enum FeatureInsertMode
|
||||
{
|
||||
[Flags]
|
||||
public enum FeatureInsertMode
|
||||
{
|
||||
/// <summary>
|
||||
/// Features will be inserted at the end of the collection.
|
||||
/// </summary>
|
||||
@@ -35,5 +29,4 @@ namespace Pilz.Plugins.Advanced.UI
|
||||
/// Features with prioritization other then <see cref="FeaturePrioritization.Default"/> will be inserted at the top or bottom.
|
||||
/// </summary>
|
||||
InsertTopAndBottom = InsertTop | InsertBottom,
|
||||
}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user