add resharper and hover effect for modules; change navigation bar
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -6,6 +6,7 @@ using System.Text;
|
|||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace Server_Dashboard_Socket {
|
namespace Server_Dashboard_Socket {
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Client Socket
|
/// Client Socket
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ using System.Threading;
|
|||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace Server_Dashboard_Socket {
|
namespace Server_Dashboard_Socket {
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Generic Channel class that handles the connection and message sending / receiving
|
/// Generic Channel class that handles the connection and message sending / receiving
|
||||||
/// Inherits IDisposable to correctly cut the connection to the server
|
/// Inherits IDisposable to correctly cut the connection to the server
|
||||||
@@ -14,13 +15,12 @@ namespace Server_Dashboard_Socket {
|
|||||||
/// <typeparam name="TMessageType">The message type, either JObject or XDocument</typeparam>
|
/// <typeparam name="TMessageType">The message type, either JObject or XDocument</typeparam>
|
||||||
public abstract class SocketChannel<TProtocol, TMessageType> : IDisposable
|
public abstract class SocketChannel<TProtocol, TMessageType> : IDisposable
|
||||||
where TProtocol : Protocol<TMessageType>, new() {
|
where TProtocol : Protocol<TMessageType>, new() {
|
||||||
|
|
||||||
protected bool isDisposable = false;
|
protected bool isDisposable = false;
|
||||||
NetworkStream networkStream;
|
private NetworkStream networkStream;
|
||||||
readonly CancellationTokenSource cancellationTokenSource = new CancellationTokenSource();
|
private readonly CancellationTokenSource cancellationTokenSource = new CancellationTokenSource();
|
||||||
readonly TProtocol protocol = new TProtocol();
|
private readonly TProtocol protocol = new TProtocol();
|
||||||
|
|
||||||
Func<TMessageType, Task> messageCallback;
|
private Func<TMessageType, Task> messageCallback;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Attaches the socket to a network stream that owns the socket
|
/// Attaches the socket to a network stream that owns the socket
|
||||||
@@ -69,10 +69,12 @@ namespace Server_Dashboard_Socket {
|
|||||||
/// Deconstructor sets Dispose to false
|
/// Deconstructor sets Dispose to false
|
||||||
/// </summary>
|
/// </summary>
|
||||||
~SocketChannel() => Dispose(false);
|
~SocketChannel() => Dispose(false);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Sets dispose to true
|
/// Sets dispose to true
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void Dispose() => Dispose(true);
|
public void Dispose() => Dispose(true);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Disposes open sockets
|
/// Disposes open sockets
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -86,7 +88,7 @@ namespace Server_Dashboard_Socket {
|
|||||||
Close();
|
Close();
|
||||||
//If its closed, dispose it
|
//If its closed, dispose it
|
||||||
networkStream?.Dispose();
|
networkStream?.Dispose();
|
||||||
//Wait with the garbage collection untill the disposing is done
|
//Wait with the garbage collection until the disposing is done
|
||||||
if (isDisposing)
|
if (isDisposing)
|
||||||
GC.SuppressFinalize(this);
|
GC.SuppressFinalize(this);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ using Newtonsoft.Json.Linq;
|
|||||||
using System.Xml.Linq;
|
using System.Xml.Linq;
|
||||||
|
|
||||||
namespace Server_Dashboard_Socket {
|
namespace Server_Dashboard_Socket {
|
||||||
|
|
||||||
public class SocketClient {
|
public class SocketClient {
|
||||||
|
|
||||||
public SocketClient() {
|
public SocketClient() {
|
||||||
@@ -22,7 +23,7 @@ namespace Server_Dashboard_Socket {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private async void Start() {
|
private async void Start() {
|
||||||
//Creates a new endpoint with the IP adress and port
|
//Creates a new endpoint with the IP address and port
|
||||||
var endpoint = new IPEndPoint(IPAddress.Loopback, 9000);
|
var endpoint = new IPEndPoint(IPAddress.Loopback, 9000);
|
||||||
|
|
||||||
//Creates a new Channel for the Json protocol
|
//Creates a new Channel for the Json protocol
|
||||||
@@ -50,16 +51,17 @@ namespace Server_Dashboard_Socket {
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="jobject">The json to be converted back</param>
|
/// <param name="jobject">The json to be converted back</param>
|
||||||
/// <returns>Task completed</returns>
|
/// <returns>Task completed</returns>
|
||||||
static Task OnMessage(JObject jobject) {
|
private static Task OnMessage(JObject jobject) {
|
||||||
Console.WriteLine(Convert(jobject));
|
Console.WriteLine(Convert(jobject));
|
||||||
return Task.CompletedTask;
|
return Task.CompletedTask;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// When it receives a message it gets converted from XDocument back to MyMessage
|
/// When it receives a message it gets converted from XDocument back to MyMessage
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="xDocument">The xml to be converted back</param>
|
/// <param name="xDocument">The xml to be converted back</param>
|
||||||
/// <returns>Task completed</returns>
|
/// <returns>Task completed</returns>
|
||||||
static Task OnMessage(XDocument xDocument) {
|
private static Task OnMessage(XDocument xDocument) {
|
||||||
Console.WriteLine(Convert(xDocument));
|
Console.WriteLine(Convert(xDocument));
|
||||||
return Task.CompletedTask;
|
return Task.CompletedTask;
|
||||||
}
|
}
|
||||||
@@ -69,14 +71,14 @@ namespace Server_Dashboard_Socket {
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="jObject">The json to be converted</param>
|
/// <param name="jObject">The json to be converted</param>
|
||||||
/// <returns>MyMessage object</returns>
|
/// <returns>MyMessage object</returns>
|
||||||
static MyMessage Convert(JObject jObject) => jObject.ToObject(typeof(MyMessage)) as MyMessage;
|
private static MyMessage Convert(JObject jObject) => jObject.ToObject(typeof(MyMessage)) as MyMessage;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Converts XDocument to MyMessage
|
/// Converts XDocument to MyMessage
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="xmlDocument">The xml to be converted</param>
|
/// <param name="xmlDocument">The xml to be converted</param>
|
||||||
/// <returns>MyMessage object</returns>
|
/// <returns>MyMessage object</returns>
|
||||||
static MyMessage Convert(XDocument xmlDocument) => new XmlSerializer(typeof(MyMessage)).Deserialize(new StringReader(xmlDocument.ToString())) as MyMessage;
|
private static MyMessage Convert(XDocument xmlDocument) => new XmlSerializer(typeof(MyMessage)).Deserialize(new StringReader(xmlDocument.ToString())) as MyMessage;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -4,10 +4,12 @@ using System.Net.Sockets;
|
|||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace Server_Dashboard_Socket {
|
namespace Server_Dashboard_Socket {
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Basic echo server to test the socket connection
|
/// Basic echo server to test the socket connection
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class EchoServer {
|
public class EchoServer {
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Start the socket on 127.0.0.1:9000
|
/// Start the socket on 127.0.0.1:9000
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -32,20 +34,20 @@ namespace Server_Dashboard_Socket {
|
|||||||
/// <returns>poop</returns>
|
/// <returns>poop</returns>
|
||||||
private async Task DoEcho(Socket socket) {
|
private async Task DoEcho(Socket socket) {
|
||||||
while (true) {
|
while (true) {
|
||||||
//Listen for incomming connection requests and accept them
|
//Listen for incoming connection requests and accept them
|
||||||
Socket clientSocket = await Task.Factory.FromAsync(
|
Socket clientSocket = await Task.Factory.FromAsync(
|
||||||
new Func<AsyncCallback, object, IAsyncResult>(socket.BeginAccept),
|
new Func<AsyncCallback, object, IAsyncResult>(socket.BeginAccept),
|
||||||
new Func<IAsyncResult, Socket>(socket.EndAccept),
|
new Func<IAsyncResult, Socket>(socket.EndAccept),
|
||||||
null).ConfigureAwait(false);
|
null).ConfigureAwait(false);
|
||||||
//Create a network stream and make it the owner of the socket
|
//Create a network stream and make it the owner of the socket
|
||||||
//This will close the socket if the stream is closed and vice verca
|
//This will close the socket if the stream is closed and vice verca
|
||||||
using(NetworkStream stream = new NetworkStream(clientSocket, true)) {
|
await using NetworkStream stream = new NetworkStream(clientSocket, true);
|
||||||
//New buffer for the message in bytes
|
//New buffer for the message in bytes
|
||||||
byte[] buffer = new byte[1024];
|
byte[] buffer = new byte[1024];
|
||||||
while (true) {
|
while (true) {
|
||||||
//Read everything that somes in
|
//Read everything that comes in
|
||||||
int bytesRead = await stream.ReadAsync(buffer, 0, buffer.Length).ConfigureAwait(false);
|
int bytesRead = await stream.ReadAsync(buffer, 0, buffer.Length).ConfigureAwait(false);
|
||||||
//If its 0 just leave since its a obscolete connection
|
//If its 0 just leave since its a obsolete connection
|
||||||
if (bytesRead == 0)
|
if (bytesRead == 0)
|
||||||
break;
|
break;
|
||||||
//Send it back to the sender
|
//Send it back to the sender
|
||||||
@@ -55,4 +57,3 @@ namespace Server_Dashboard_Socket {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|||||||
@@ -7,21 +7,21 @@ using System.IO;
|
|||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
||||||
namespace Server_Dashboard_Socket.Protocol {
|
namespace Server_Dashboard_Socket.Protocol {
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Json serializer class
|
/// Json serializer class
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class JsonMessageProtocol : Protocol<JObject> {
|
public class JsonMessageProtocol : Protocol<JObject> {
|
||||||
|
|
||||||
//The Json serializer and the settings
|
//The Json serializer and the settings
|
||||||
static readonly JsonSerializer serializer;
|
private static readonly JsonSerializer serializer;
|
||||||
static readonly JsonSerializerSettings settings;
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Settings for the Json Serializer
|
/// Settings for the Json Serializer
|
||||||
/// </summary>
|
/// </summary>
|
||||||
static JsonMessageProtocol() {
|
static JsonMessageProtocol() {
|
||||||
//Set the settings
|
//Set the settings
|
||||||
settings = new JsonSerializerSettings {
|
JsonSerializerSettings settings = new JsonSerializerSettings {
|
||||||
Formatting = Formatting.Indented,
|
Formatting = Formatting.Indented,
|
||||||
DateTimeZoneHandling = DateTimeZoneHandling.Utc,
|
DateTimeZoneHandling = DateTimeZoneHandling.Utc,
|
||||||
ContractResolver = new DefaultContractResolver {
|
ContractResolver = new DefaultContractResolver {
|
||||||
@@ -34,6 +34,7 @@ namespace Server_Dashboard_Socket.Protocol {
|
|||||||
//Creates the serializer with the settings
|
//Creates the serializer with the settings
|
||||||
serializer = JsonSerializer.Create(settings);
|
serializer = JsonSerializer.Create(settings);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Decode the message, to Json
|
//Decode the message, to Json
|
||||||
protected override JObject Decode(byte[] message) => JObject.Parse(Encoding.UTF8.GetString(message));
|
protected override JObject Decode(byte[] message) => JObject.Parse(Encoding.UTF8.GetString(message));
|
||||||
|
|
||||||
|
|||||||
@@ -6,13 +6,15 @@ using System.Text;
|
|||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace Server_Dashboard_Socket {
|
namespace Server_Dashboard_Socket {
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Generic Protocol class for Json and Xml serialization
|
/// Generic Protocol class for Json and Xml serialization
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <typeparam name="TMessageType">JsonMessageProtocol or XmlMessageProtocol</typeparam>
|
/// <typeparam name="TMessageType">JsonMessageProtocol or XmlMessageProtocol</typeparam>
|
||||||
public abstract class Protocol<TMessageType> {
|
public abstract class Protocol<TMessageType> {
|
||||||
|
|
||||||
//Header size is always 4
|
//Header size is always 4
|
||||||
const int HEADER_SIZE = 4;
|
private const int HeaderSize = 4;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the message and checks with the header if the message is valid or not
|
/// Gets the message and checks with the header if the message is valid or not
|
||||||
@@ -26,7 +28,7 @@ namespace Server_Dashboard_Socket {
|
|||||||
//Validates the length
|
//Validates the length
|
||||||
AssertValidMessageLength(bodyLength);
|
AssertValidMessageLength(bodyLength);
|
||||||
//Returns the body message type
|
//Returns the body message type
|
||||||
return await Readbody(networkStream, bodyLength).ConfigureAwait(false);
|
return await ReadBody(networkStream, bodyLength).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -50,8 +52,8 @@ namespace Server_Dashboard_Socket {
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="networkStream">A network stream</param>
|
/// <param name="networkStream">A network stream</param>
|
||||||
/// <returns>Header as Integer</returns>
|
/// <returns>Header as Integer</returns>
|
||||||
async Task<int> ReadHeader(NetworkStream networkStream) {
|
private async Task<int> ReadHeader(NetworkStream networkStream) {
|
||||||
byte[] headerBytes = await ReadAsync(networkStream, HEADER_SIZE).ConfigureAwait(false);
|
byte[] headerBytes = await ReadAsync(networkStream, HeaderSize).ConfigureAwait(false);
|
||||||
return IPAddress.HostToNetworkOrder(BitConverter.ToInt32(headerBytes));
|
return IPAddress.HostToNetworkOrder(BitConverter.ToInt32(headerBytes));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -61,7 +63,7 @@ namespace Server_Dashboard_Socket {
|
|||||||
/// <param name="networkStream">A network stream</param>
|
/// <param name="networkStream">A network stream</param>
|
||||||
/// <param name="bodyLength">Length of the body</param>
|
/// <param name="bodyLength">Length of the body</param>
|
||||||
/// <returns>Decoded body</returns>
|
/// <returns>Decoded body</returns>
|
||||||
async Task<TMessageType> Readbody(NetworkStream networkStream, int bodyLength) {
|
private async Task<TMessageType> ReadBody(NetworkStream networkStream, int bodyLength) {
|
||||||
//Reads the bytes from the stream into an array
|
//Reads the bytes from the stream into an array
|
||||||
byte[] bodyBytes = await ReadAsync(networkStream, bodyLength).ConfigureAwait(false);
|
byte[] bodyBytes = await ReadAsync(networkStream, bodyLength).ConfigureAwait(false);
|
||||||
//Decodes it and returns the string
|
//Decodes it and returns the string
|
||||||
@@ -74,10 +76,10 @@ namespace Server_Dashboard_Socket {
|
|||||||
/// <param name="networkStream">A network stream</param>
|
/// <param name="networkStream">A network stream</param>
|
||||||
/// <param name="bytesToRead">how many bytes there are to read</param>
|
/// <param name="bytesToRead">how many bytes there are to read</param>
|
||||||
/// <returns>Every byte from the Stream</returns>
|
/// <returns>Every byte from the Stream</returns>
|
||||||
async Task<byte[]> ReadAsync(NetworkStream networkStream, int bytesToRead) {
|
private async Task<byte[]> ReadAsync(NetworkStream networkStream, int bytesToRead) {
|
||||||
//new buffer that is as big as the content(watch out for buffer overflows)
|
//new buffer that is as big as the content(watch out for buffer overflows)
|
||||||
byte[] buffer = new byte[bytesToRead];
|
byte[] buffer = new byte[bytesToRead];
|
||||||
//keep acount of the bytes that are already read
|
//keep account of the bytes that are already read
|
||||||
int bytesRead = 0;
|
int bytesRead = 0;
|
||||||
//White we still have something to read
|
//White we still have something to read
|
||||||
while (bytesRead < bytesToRead) {
|
while (bytesRead < bytesToRead) {
|
||||||
@@ -94,7 +96,7 @@ namespace Server_Dashboard_Socket {
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Encode the message from human readable to bytes for the stream
|
/// Encode the message from human readable to bytes for the stream
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <typeparam name="T">The message as anything e.g. object or strng</typeparam>
|
/// <typeparam name="T">The message as anything e.g. object or string</typeparam>
|
||||||
/// <param name="message">The message to be send</param>
|
/// <param name="message">The message to be send</param>
|
||||||
/// <returns>The Header and Body as bytes[]</returns>
|
/// <returns>The Header and Body as bytes[]</returns>
|
||||||
protected (byte[] header, byte[] body) Encode<T>(T message) {
|
protected (byte[] header, byte[] body) Encode<T>(T message) {
|
||||||
@@ -121,6 +123,7 @@ namespace Server_Dashboard_Socket {
|
|||||||
if (messageLength < 1)
|
if (messageLength < 1)
|
||||||
throw new ArgumentOutOfRangeException("Invalid message length");
|
throw new ArgumentOutOfRangeException("Invalid message length");
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Encode the message so it can be send via the network stream
|
/// Encode the message so it can be send via the network stream
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -52,11 +52,16 @@
|
|||||||
<SolidColorBrush x:Key="BackgroundSurface_16dp" Color="#343434" />
|
<SolidColorBrush x:Key="BackgroundSurface_16dp" Color="#343434" />
|
||||||
<SolidColorBrush x:Key="BackgroundSurface_24dp" Color="#363636" />
|
<SolidColorBrush x:Key="BackgroundSurface_24dp" Color="#363636" />
|
||||||
<SolidColorBrush x:Key="OnPrimarySecondaryError" Color="#000000" />
|
<SolidColorBrush x:Key="OnPrimarySecondaryError" Color="#000000" />
|
||||||
<SolidColorBrush x:Key="White" Color="#FFFFFFFF"/><!--0%-->
|
<SolidColorBrush x:Key="White" Color="#FFFFFFFF" />
|
||||||
<SolidColorBrush x:Key="White12" Color="#1EFFFFFF"/><!--12%-->
|
<!--0%-->
|
||||||
<SolidColorBrush x:Key="White38" Color="#60FFFFFF"/><!--38%-->
|
<SolidColorBrush x:Key="White12" Color="#1EFFFFFF" />
|
||||||
<SolidColorBrush x:Key="White60" Color="#99FFFFFF"/><!--60%-->
|
<!--12%-->
|
||||||
<SolidColorBrush x:Key="White87" Color="#DEFFFFFF"/><!--87%-->
|
<SolidColorBrush x:Key="White38" Color="#60FFFFFF" />
|
||||||
|
<!--38%-->
|
||||||
|
<SolidColorBrush x:Key="White60" Color="#99FFFFFF" />
|
||||||
|
<!--60%-->
|
||||||
|
<SolidColorBrush x:Key="White87" Color="#DEFFFFFF" />
|
||||||
|
<!--87%-->
|
||||||
<SolidColorBrush x:Key="ErrorRed" Color="#CF6679" />
|
<SolidColorBrush x:Key="ErrorRed" Color="#CF6679" />
|
||||||
|
|
||||||
<!--Indigo-->
|
<!--Indigo-->
|
||||||
@@ -94,10 +99,12 @@
|
|||||||
<!--Deep Purple-->
|
<!--Deep Purple-->
|
||||||
<SolidColorBrush x:Key="DeepPurple_50 " Color="#EDE7F6" />
|
<SolidColorBrush x:Key="DeepPurple_50 " Color="#EDE7F6" />
|
||||||
<SolidColorBrush x:Key="DeepPurple_100" Color="#D1C4E9" />
|
<SolidColorBrush x:Key="DeepPurple_100" Color="#D1C4E9" />
|
||||||
<SolidColorBrush x:Key="DeepPurple_200" Color="#B39DDB"/><!--Primary-->
|
<SolidColorBrush x:Key="DeepPurple_200" Color="#B39DDB" />
|
||||||
|
<!--Primary-->
|
||||||
<SolidColorBrush x:Key="DeepPurple_300" Color="#9575CD" />
|
<SolidColorBrush x:Key="DeepPurple_300" Color="#9575CD" />
|
||||||
<SolidColorBrush x:Key="DeepPurple_400" Color="#7E57C2" />
|
<SolidColorBrush x:Key="DeepPurple_400" Color="#7E57C2" />
|
||||||
<SolidColorBrush x:Key="DeepPurple_500" Color="#673AB7"/><!--Primary Variant-->
|
<SolidColorBrush x:Key="DeepPurple_500" Color="#673AB7" />
|
||||||
|
<!--Primary Variant-->
|
||||||
<SolidColorBrush x:Key="DeepPurple_600" Color="#5E35B1" />
|
<SolidColorBrush x:Key="DeepPurple_600" Color="#5E35B1" />
|
||||||
<SolidColorBrush x:Key="DeepPurple_700" Color="#512DA8" />
|
<SolidColorBrush x:Key="DeepPurple_700" Color="#512DA8" />
|
||||||
<SolidColorBrush x:Key="DeepPurple_800" Color="#4527A0" />
|
<SolidColorBrush x:Key="DeepPurple_800" Color="#4527A0" />
|
||||||
|
|||||||
BIN
Server Dashboard/Assets/Images/JetBrains.ReSharper.web.exe
Normal file
BIN
Server Dashboard/Assets/Images/JetBrains.ReSharper.web.exe
Normal file
Binary file not shown.
@@ -4,22 +4,30 @@ using System.Text;
|
|||||||
using System.Windows;
|
using System.Windows;
|
||||||
|
|
||||||
namespace Server_Dashboard {
|
namespace Server_Dashboard {
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Attached property base class
|
/// Attached property base class
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <typeparam name="Parent"></typeparam>
|
/// <typeparam name="TParent"></typeparam>
|
||||||
/// <typeparam name="Property"></typeparam>
|
/// <typeparam name="TProperty"></typeparam>
|
||||||
public abstract class BaseAttachedProperty<Parent, Property>
|
public abstract class BaseAttachedProperty<TParent, TProperty>
|
||||||
where Parent : BaseAttachedProperty<Parent, Property>, new() {
|
where TParent : BaseAttachedProperty<TParent, TProperty>, new() {
|
||||||
|
|
||||||
public event Action<DependencyObject, DependencyPropertyChangedEventArgs> ValueChanged = (sender, e) => { };
|
public event Action<DependencyObject, DependencyPropertyChangedEventArgs> ValueChanged = (sender, e) => { };
|
||||||
public static Parent Instance { get; private set; } = new Parent();
|
|
||||||
public static readonly DependencyProperty ValueProperty = DependencyProperty.RegisterAttached("Value", typeof(Property), typeof(BaseAttachedProperty<Parent, Property>), new PropertyMetadata(new PropertyChangedCallback(OnValuePropertyChanged)));
|
public static TParent Instance { get; private set; } = new TParent();
|
||||||
|
public static readonly DependencyProperty ValueProperty = DependencyProperty.RegisterAttached("Value", typeof(TProperty), typeof(BaseAttachedProperty<TParent, TProperty>), new PropertyMetadata(new PropertyChangedCallback(OnValuePropertyChanged)));
|
||||||
|
|
||||||
private static void OnValuePropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) {
|
private static void OnValuePropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) {
|
||||||
Instance.OnValueChanged(d, e);
|
Instance.OnValueChanged(d, e);
|
||||||
Instance.ValueChanged(d, e);
|
Instance.ValueChanged(d, e);
|
||||||
}
|
}
|
||||||
public static Property GetValue(DependencyObject d) => (Property)d.GetValue(ValueProperty);
|
|
||||||
public static void SetValue(DependencyObject d, Property value) => d.SetValue(ValueProperty, value);
|
public static TProperty GetValue(DependencyObject d) => (TProperty)d.GetValue(ValueProperty);
|
||||||
public virtual void OnValueChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e) { }
|
|
||||||
|
public static void SetValue(DependencyObject d, TProperty value) => d.SetValue(ValueProperty, value);
|
||||||
|
|
||||||
|
public virtual void OnValueChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e) {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -6,7 +6,9 @@ using System.Windows;
|
|||||||
using System.Windows.Documents;
|
using System.Windows.Documents;
|
||||||
|
|
||||||
namespace Server_Dashboard {
|
namespace Server_Dashboard {
|
||||||
|
|
||||||
public static class HyperlinkExtensions {
|
public static class HyperlinkExtensions {
|
||||||
|
|
||||||
public static bool GetIsExternal(DependencyObject obj) {
|
public static bool GetIsExternal(DependencyObject obj) {
|
||||||
return (bool)obj.GetValue(IsExternalProperty);
|
return (bool)obj.GetValue(IsExternalProperty);
|
||||||
}
|
}
|
||||||
@@ -14,22 +16,24 @@ namespace Server_Dashboard {
|
|||||||
public static void SetIsExternal(DependencyObject obj, bool value) {
|
public static void SetIsExternal(DependencyObject obj, bool value) {
|
||||||
obj.SetValue(IsExternalProperty, value);
|
obj.SetValue(IsExternalProperty, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static readonly DependencyProperty IsExternalProperty =
|
public static readonly DependencyProperty IsExternalProperty =
|
||||||
DependencyProperty.RegisterAttached("IsExternal", typeof(bool), typeof(HyperlinkExtensions), new UIPropertyMetadata(false, OnIsExternalChanged));
|
DependencyProperty.RegisterAttached("IsExternal", typeof(bool), typeof(HyperlinkExtensions), new UIPropertyMetadata(false, OnIsExternalChanged));
|
||||||
|
|
||||||
private static void OnIsExternalChanged(object sender, DependencyPropertyChangedEventArgs args) {
|
private static void OnIsExternalChanged(object sender, DependencyPropertyChangedEventArgs args) {
|
||||||
var hyperlink = sender as Hyperlink;
|
var hyperlink = sender as Hyperlink;
|
||||||
|
|
||||||
if ((bool)args.NewValue)
|
if ((bool)args.NewValue) {
|
||||||
|
if (hyperlink != null)
|
||||||
hyperlink.RequestNavigate += Hyperlink_RequestNavigate;
|
hyperlink.RequestNavigate += Hyperlink_RequestNavigate;
|
||||||
else
|
} else if (hyperlink != null)
|
||||||
hyperlink.RequestNavigate -= Hyperlink_RequestNavigate;
|
hyperlink.RequestNavigate -= Hyperlink_RequestNavigate;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void Hyperlink_RequestNavigate(object sender, System.Windows.Navigation.RequestNavigateEventArgs e) {
|
private static void Hyperlink_RequestNavigate(object sender, System.Windows.Navigation.RequestNavigateEventArgs e) {
|
||||||
try {
|
try {
|
||||||
Process.Start(new ProcessStartInfo(e.Uri.AbsoluteUri) { UseShellExecute = true });
|
Process.Start(new ProcessStartInfo(e.Uri.AbsoluteUri) { UseShellExecute = true });
|
||||||
} catch { }
|
} catch (Exception) { }
|
||||||
e.Handled = true;
|
e.Handled = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,18 +2,19 @@
|
|||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
|
|
||||||
namespace Server_Dashboard {
|
namespace Server_Dashboard {
|
||||||
|
|
||||||
public class MonitorPasswordProperty : BaseAttachedProperty<MonitorPasswordProperty, bool> {
|
public class MonitorPasswordProperty : BaseAttachedProperty<MonitorPasswordProperty, bool> {
|
||||||
|
|
||||||
public override void OnValueChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e) {
|
public override void OnValueChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e) {
|
||||||
var passwordBox = sender as PasswordBox;
|
if (!(sender is PasswordBox passwordBox))
|
||||||
if (passwordBox == null)
|
|
||||||
return;
|
return;
|
||||||
passwordBox.PasswordChanged -= PasswordBox_PasswordChanged;
|
passwordBox.PasswordChanged -= PasswordBox_PasswordChanged;
|
||||||
|
|
||||||
if ((bool)e.NewValue) {
|
if (!(bool)e.NewValue)
|
||||||
|
return;
|
||||||
HasTextProperty.SetValue(passwordBox);
|
HasTextProperty.SetValue(passwordBox);
|
||||||
passwordBox.PasswordChanged += PasswordBox_PasswordChanged;
|
passwordBox.PasswordChanged += PasswordBox_PasswordChanged;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
private void PasswordBox_PasswordChanged(object sender, RoutedEventArgs e) {
|
private void PasswordBox_PasswordChanged(object sender, RoutedEventArgs e) {
|
||||||
HasTextProperty.SetValue((PasswordBox)sender);
|
HasTextProperty.SetValue((PasswordBox)sender);
|
||||||
@@ -21,6 +22,7 @@ namespace Server_Dashboard {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public class HasTextProperty : BaseAttachedProperty<HasTextProperty, bool> {
|
public class HasTextProperty : BaseAttachedProperty<HasTextProperty, bool> {
|
||||||
|
|
||||||
public static void SetValue(DependencyObject sender) {
|
public static void SetValue(DependencyObject sender) {
|
||||||
SetValue(sender, ((PasswordBox)sender).SecurePassword.Length < 1);
|
SetValue(sender, ((PasswordBox)sender).SecurePassword.Length < 1);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
using System.Windows;
|
using System.Windows;
|
||||||
|
|
||||||
namespace Server_Dashboard {
|
namespace Server_Dashboard {
|
||||||
|
|
||||||
public class CloseProperty : BaseAttachedProperty<CloseProperty, bool> {
|
public class CloseProperty : BaseAttachedProperty<CloseProperty, bool> {
|
||||||
|
|
||||||
public override void OnValueChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e) {
|
public override void OnValueChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e) {
|
||||||
if (sender is Window window) {
|
if (sender is Window window) {
|
||||||
window.Loaded += (s, e) => {
|
window.Loaded += (s, e) => {
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
<UserControl.Resources>
|
<UserControl.Resources>
|
||||||
<root:ValueToAngleConverter x:Key="valueToAngle" />
|
<root:ValueToAngleConverter x:Key="valueToAngle" />
|
||||||
</UserControl.Resources>
|
</UserControl.Resources>
|
||||||
<!--Circular Prograss bar-->
|
<!--Circular Progress bar-->
|
||||||
<Grid>
|
<Grid>
|
||||||
<Ellipse x:Name="Background" Fill="{Binding ElementName=_this, Path=BackgroundBrush}" Margin="0" Stroke="{Binding ElementName=_this, Path=BackgroundBrush}" />
|
<Ellipse x:Name="Background" Fill="{Binding ElementName=_this, Path=BackgroundBrush}" Margin="0" Stroke="{Binding ElementName=_this, Path=BackgroundBrush}" />
|
||||||
<ed:Arc ArcThickness="8" ArcThicknessUnit="Pixel" EndAngle="{Binding Converter={StaticResource valueToAngle}, ElementName=_this, Path=ValueRead}" Fill="{Binding ElementName=_this, Path=ReadIndicatorBrush}" Stretch="None" StartAngle="0" />
|
<ed:Arc ArcThickness="8" ArcThicknessUnit="Pixel" EndAngle="{Binding Converter={StaticResource valueToAngle}, ElementName=_this, Path=ValueRead}" Fill="{Binding ElementName=_this, Path=ReadIndicatorBrush}" Stretch="None" StartAngle="0" />
|
||||||
|
|||||||
@@ -1,16 +1,6 @@
|
|||||||
using System;
|
using System.Windows;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Globalization;
|
|
||||||
using System.Text;
|
|
||||||
using System.Windows;
|
|
||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
using System.Windows.Data;
|
|
||||||
using System.Windows.Documents;
|
|
||||||
using System.Windows.Input;
|
|
||||||
using System.Windows.Media;
|
using System.Windows.Media;
|
||||||
using System.Windows.Media.Imaging;
|
|
||||||
using System.Windows.Navigation;
|
|
||||||
using System.Windows.Shapes;
|
|
||||||
|
|
||||||
namespace Server_Dashboard.Controls.DoubleRoundProgressBar {
|
namespace Server_Dashboard.Controls.DoubleRoundProgressBar {
|
||||||
|
|
||||||
@@ -20,51 +10,51 @@ namespace Server_Dashboard.Controls.DoubleRoundProgressBar {
|
|||||||
public partial class DoubleRoundProgressBar : UserControl {
|
public partial class DoubleRoundProgressBar : UserControl {
|
||||||
|
|
||||||
//Property for the ReadIndicatorBrush
|
//Property for the ReadIndicatorBrush
|
||||||
public static DependencyProperty ReadIndicatorBrushProperty = DependencyProperty.Register("ReadIndicatorBrush", typeof(Brush), typeof(DoubleRoundProgressBar));
|
public static readonly DependencyProperty ReadIndicatorBrushProperty = DependencyProperty.Register("ReadIndicatorBrush", typeof(Brush), typeof(DoubleRoundProgressBar));
|
||||||
|
|
||||||
public Brush ReadIndicatorBrush {
|
public Brush ReadIndicatorBrush {
|
||||||
get { return (Brush)GetValue(ReadIndicatorBrushProperty); }
|
get => (Brush)GetValue(ReadIndicatorBrushProperty);
|
||||||
set { SetValue(ReadIndicatorBrushProperty, value); }
|
set => SetValue(ReadIndicatorBrushProperty, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Property for the WriteIndicatorBrush
|
//Property for the WriteIndicatorBrush
|
||||||
public static DependencyProperty WriteIndicatorBrushProperty = DependencyProperty.Register("WriteIndicatorBrush", typeof(Brush), typeof(DoubleRoundProgressBar));
|
public static readonly DependencyProperty WriteIndicatorBrushProperty = DependencyProperty.Register("WriteIndicatorBrush", typeof(Brush), typeof(DoubleRoundProgressBar));
|
||||||
|
|
||||||
public Brush WriteIndicatorBrush {
|
public Brush WriteIndicatorBrush {
|
||||||
get { return (Brush)GetValue(WriteIndicatorBrushProperty); }
|
get => (Brush)GetValue(WriteIndicatorBrushProperty);
|
||||||
set { SetValue(WriteIndicatorBrushProperty, value); }
|
set => SetValue(WriteIndicatorBrushProperty, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Property for the BackgroundBrush
|
//Property for the BackgroundBrush
|
||||||
public static DependencyProperty BackgroundBrushProperty = DependencyProperty.Register("BackgroundBrush", typeof(Brush), typeof(DoubleRoundProgressBar));
|
public static readonly DependencyProperty BackgroundBrushProperty = DependencyProperty.Register("BackgroundBrush", typeof(Brush), typeof(DoubleRoundProgressBar));
|
||||||
|
|
||||||
public Brush BackgroundBrush {
|
public Brush BackgroundBrush {
|
||||||
get { return (Brush)GetValue(BackgroundBrushProperty); }
|
get => (Brush)GetValue(BackgroundBrushProperty);
|
||||||
set { SetValue(BackgroundBrushProperty, value); }
|
set => SetValue(BackgroundBrushProperty, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Property for the ProgressBorderBrush
|
//Property for the ProgressBorderBrush
|
||||||
public static DependencyProperty ProgressBorderBrushProperty = DependencyProperty.Register("ProgressBorderBrush", typeof(Brush), typeof(DoubleRoundProgressBar));
|
public static readonly DependencyProperty ProgressBorderBrushProperty = DependencyProperty.Register("ProgressBorderBrush", typeof(Brush), typeof(DoubleRoundProgressBar));
|
||||||
|
|
||||||
public Brush ProgressBorderBrush {
|
public Brush ProgressBorderBrush {
|
||||||
get { return (Brush)GetValue(ProgressBorderBrushProperty); }
|
get => (Brush)GetValue(ProgressBorderBrushProperty);
|
||||||
set { SetValue(ProgressBorderBrushProperty, value); }
|
set => SetValue(ProgressBorderBrushProperty, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Property for the Value Write
|
//Property for the Value Write
|
||||||
public static DependencyProperty ValueWriteProperty = DependencyProperty.Register("ValueWrite", typeof(int), typeof(DoubleRoundProgressBar));
|
public static readonly DependencyProperty ValueWriteProperty = DependencyProperty.Register("ValueWrite", typeof(int), typeof(DoubleRoundProgressBar));
|
||||||
|
|
||||||
public int ValueWrite {
|
public int ValueWrite {
|
||||||
get { return (int)GetValue(ValueWriteProperty); }
|
get => (int)GetValue(ValueWriteProperty);
|
||||||
set { SetValue(ValueWriteProperty, value); }
|
set => SetValue(ValueWriteProperty, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Property for the Value Read
|
//Property for the Value Read
|
||||||
public static DependencyProperty ValueReadProperty = DependencyProperty.Register("ValueRead", typeof(int), typeof(DoubleRoundProgressBar));
|
public static readonly DependencyProperty ValueReadProperty = DependencyProperty.Register("ValueRead", typeof(int), typeof(DoubleRoundProgressBar));
|
||||||
|
|
||||||
public int ValueRead {
|
public int ValueRead {
|
||||||
get { return (int)GetValue(ValueReadProperty); }
|
get => (int)GetValue(ValueReadProperty);
|
||||||
set { SetValue(ValueReadProperty, value); }
|
set => SetValue(ValueReadProperty, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
public DoubleRoundProgressBar() {
|
public DoubleRoundProgressBar() {
|
||||||
|
|||||||
@@ -1,16 +1,6 @@
|
|||||||
using System;
|
using System.Windows;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Globalization;
|
|
||||||
using System.Text;
|
|
||||||
using System.Windows;
|
|
||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
using System.Windows.Data;
|
|
||||||
using System.Windows.Documents;
|
|
||||||
using System.Windows.Input;
|
|
||||||
using System.Windows.Media;
|
using System.Windows.Media;
|
||||||
using System.Windows.Media.Imaging;
|
|
||||||
using System.Windows.Navigation;
|
|
||||||
using System.Windows.Shapes;
|
|
||||||
|
|
||||||
namespace Server_Dashboard.Controls.HalfRoundProgressBar {
|
namespace Server_Dashboard.Controls.HalfRoundProgressBar {
|
||||||
|
|
||||||
@@ -20,35 +10,35 @@ namespace Server_Dashboard.Controls.HalfRoundProgressBar {
|
|||||||
public partial class HalfRoundProgressBar : UserControl {
|
public partial class HalfRoundProgressBar : UserControl {
|
||||||
|
|
||||||
//Indicator Brush Property
|
//Indicator Brush Property
|
||||||
public static DependencyProperty IndicatorBrushProperty = DependencyProperty.Register("IndicatorBrush", typeof(Brush), typeof(HalfRoundProgressBar));
|
public static readonly DependencyProperty IndicatorBrushProperty = DependencyProperty.Register("IndicatorBrush", typeof(Brush), typeof(HalfRoundProgressBar));
|
||||||
|
|
||||||
public Brush IndicatorBrush {
|
public Brush IndicatorBrush {
|
||||||
get { return (Brush)GetValue(IndicatorBrushProperty); }
|
get => (Brush)GetValue(IndicatorBrushProperty);
|
||||||
set { SetValue(IndicatorBrushProperty, value); }
|
set => SetValue(IndicatorBrushProperty, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Background Brush Property
|
//Background Brush Property
|
||||||
public static DependencyProperty BackgroundBrushProperty = DependencyProperty.Register("BackgroundBrush", typeof(Brush), typeof(HalfRoundProgressBar));
|
public static readonly DependencyProperty BackgroundBrushProperty = DependencyProperty.Register("BackgroundBrush", typeof(Brush), typeof(HalfRoundProgressBar));
|
||||||
|
|
||||||
public Brush BackgroundBrush {
|
public Brush BackgroundBrush {
|
||||||
get { return (Brush)GetValue(BackgroundBrushProperty); }
|
get => (Brush)GetValue(BackgroundBrushProperty);
|
||||||
set { SetValue(BackgroundBrushProperty, value); }
|
set => SetValue(BackgroundBrushProperty, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
//ProgressBorder Property
|
//ProgressBorder Property
|
||||||
public static DependencyProperty ProgressBorderBrushProperty = DependencyProperty.Register("ProgressBorderBrush", typeof(Brush), typeof(HalfRoundProgressBar));
|
public static readonly DependencyProperty ProgressBorderBrushProperty = DependencyProperty.Register("ProgressBorderBrush", typeof(Brush), typeof(HalfRoundProgressBar));
|
||||||
|
|
||||||
public Brush ProgressBorderBrush {
|
public Brush ProgressBorderBrush {
|
||||||
get { return (Brush)GetValue(ProgressBorderBrushProperty); }
|
get => (Brush)GetValue(ProgressBorderBrushProperty);
|
||||||
set { SetValue(ProgressBorderBrushProperty, value); }
|
set => SetValue(ProgressBorderBrushProperty, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Value
|
//Value
|
||||||
public static DependencyProperty ValueProperty = DependencyProperty.Register("Value", typeof(int), typeof(HalfRoundProgressBar));
|
public static readonly DependencyProperty ValueProperty = DependencyProperty.Register("Value", typeof(int), typeof(HalfRoundProgressBar));
|
||||||
|
|
||||||
public int Value {
|
public int Value {
|
||||||
get { return (int)GetValue(ValueProperty); }
|
get => (int)GetValue(ValueProperty);
|
||||||
set { SetValue(ValueProperty, value); }
|
set => SetValue(ValueProperty, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
public HalfRoundProgressBar() {
|
public HalfRoundProgressBar() {
|
||||||
|
|||||||
@@ -7,17 +7,25 @@
|
|||||||
xmlns:halfroundprogressbar="clr-namespace:Server_Dashboard.Controls.HalfRoundProgressBar"
|
xmlns:halfroundprogressbar="clr-namespace:Server_Dashboard.Controls.HalfRoundProgressBar"
|
||||||
xmlns:doubleroundprogressbar="clr-namespace:Server_Dashboard.Controls.DoubleRoundProgressBar" mc:Ignorable="d">
|
xmlns:doubleroundprogressbar="clr-namespace:Server_Dashboard.Controls.DoubleRoundProgressBar" mc:Ignorable="d">
|
||||||
<!--Module-->
|
<!--Module-->
|
||||||
<Border Background="{StaticResource BackgroundSurface_02dp}" MinHeight="100" MinWidth="300" Width="Auto" Height="Auto" Margin="10" CornerRadius="5">
|
<Button>
|
||||||
|
<Button.Style>
|
||||||
|
<Style TargetType="Button">
|
||||||
|
<Setter Property="Template">
|
||||||
|
<Setter.Value>
|
||||||
|
<ControlTemplate TargetType="Button">
|
||||||
|
<Border x:Name="Border" Background="{StaticResource BackgroundSurface_02dp}" BorderThickness="2" MinHeight="300" MinWidth="400" Width="Auto" Height="Auto" Margin="10" CornerRadius="5">
|
||||||
<Border.Effect>
|
<Border.Effect>
|
||||||
<DropShadowEffect BlurRadius="5" ShadowDepth="0" />
|
<DropShadowEffect BlurRadius="5" ShadowDepth="0" />
|
||||||
</Border.Effect>
|
</Border.Effect>
|
||||||
|
<Border x:Name="BorderBackground" Background="{StaticResource BackgroundSurface_02dp}" CornerRadius="5">
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition Height="40" />
|
<RowDefinition Height="40" />
|
||||||
|
<RowDefinition Height="Auto" />
|
||||||
<RowDefinition Height="*" />
|
<RowDefinition Height="*" />
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
<!--Top Bar-->
|
<!--Top Bar-->
|
||||||
<Border CornerRadius="5 5 0 0" Grid.Row="0" Background="{StaticResource BackgroundSurface_08dp}">
|
<Border CornerRadius="4 4 0 0" Grid.Row="0" Background="{StaticResource BackgroundSurface_08dp}">
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="Auto" />
|
<ColumnDefinition Width="Auto" />
|
||||||
@@ -38,102 +46,168 @@
|
|||||||
<SolidColorBrush Color="White" Opacity="0.87" />
|
<SolidColorBrush Color="White" Opacity="0.87" />
|
||||||
</TextBlock.Foreground>
|
</TextBlock.Foreground>
|
||||||
</TextBlock>
|
</TextBlock>
|
||||||
<Border CornerRadius="0 5 0 0" Grid.Column="1" HorizontalAlignment="Right" Background="{Binding StatusIndicatorBG}" Padding="6">
|
<Border CornerRadius="0 4 0 0" Grid.Column="1" HorizontalAlignment="Right" Background="{Binding StatusIndicatorBG}" Padding="6">
|
||||||
<Ellipse Fill="{Binding StatusIndicator}" StrokeThickness="0" Width="25" Height="25" />
|
<Ellipse Fill="{Binding StatusIndicator}" StrokeThickness="0" Width="25" Height="25" />
|
||||||
</Border>
|
</Border>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Border>
|
</Border>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Border>
|
</Border>
|
||||||
|
<Grid Grid.Row="1">
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="Auto" />
|
||||||
|
<ColumnDefinition />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<TextBlock Grid.Column="0" Text="Server" FontSize="20" Margin="10 5 0 5">
|
||||||
|
<TextBlock.Foreground>
|
||||||
|
<SolidColorBrush Color="White" Opacity="0.87" />
|
||||||
|
</TextBlock.Foreground>
|
||||||
|
</TextBlock>
|
||||||
|
<TextBlock Grid.Column="1" Text="{Binding ServerInformation.ServerName}" FontSize="20" Margin="10 5 0 5">
|
||||||
|
<TextBlock.Foreground>
|
||||||
|
<SolidColorBrush Color="White" Opacity="0.87" />
|
||||||
|
</TextBlock.Foreground>
|
||||||
|
</TextBlock>
|
||||||
|
</Grid>
|
||||||
<!--Main Content-->
|
<!--Main Content-->
|
||||||
<Grid Grid.Row="2" Margin="20" Width="Auto">
|
<Grid Grid.Row="2" Margin="20" Width="Auto">
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="1.5*" />
|
<ColumnDefinition Width="1.5*" />
|
||||||
<ColumnDefinition />
|
<ColumnDefinition />
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<!--Information pannel, left-->
|
<!--Information panel, left-->
|
||||||
<Grid Grid.Row="1" Margin="0 0 25 0">
|
<Grid Margin="0 0 25 0">
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="Auto" />
|
<ColumnDefinition Width="Auto" />
|
||||||
<ColumnDefinition Width="Auto" />
|
<ColumnDefinition Width="Auto" />
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<StackPanel Grid.Column="0">
|
<StackPanel Grid.Column="0">
|
||||||
<TextBlock Text="Servername" FontSize="16" Margin="2 2 5 10">
|
<Border BorderThickness="0 0 0 1" Padding="0 0 0 5">
|
||||||
|
<Border.BorderBrush>
|
||||||
|
<SolidColorBrush Color="White" Opacity="0.12" />
|
||||||
|
</Border.BorderBrush>
|
||||||
|
<TextBlock Text="User" FontSize="16">
|
||||||
<TextBlock.Foreground>
|
<TextBlock.Foreground>
|
||||||
<SolidColorBrush Color="White" Opacity="0.60" />
|
<SolidColorBrush Color="White" Opacity="0.60" />
|
||||||
</TextBlock.Foreground>
|
</TextBlock.Foreground>
|
||||||
</TextBlock>
|
</TextBlock>
|
||||||
<TextBlock Text="User" FontSize="16" Margin="2 2 5 10">
|
</Border>
|
||||||
|
<Border BorderThickness="0 1 0 1" Padding="0 5 0 5">
|
||||||
|
<Border.BorderBrush>
|
||||||
|
<SolidColorBrush Color="White" Opacity="0.12" />
|
||||||
|
</Border.BorderBrush>
|
||||||
|
<TextBlock Text="Public IP" FontSize="16">
|
||||||
<TextBlock.Foreground>
|
<TextBlock.Foreground>
|
||||||
<SolidColorBrush Color="White" Opacity="0.60" />
|
<SolidColorBrush Color="White" Opacity="0.60" />
|
||||||
</TextBlock.Foreground>
|
</TextBlock.Foreground>
|
||||||
</TextBlock>
|
</TextBlock>
|
||||||
<TextBlock Text="Public IP" FontSize="16" Margin="2 2 5 10">
|
</Border>
|
||||||
|
<Border BorderThickness="0 1 0 1" Padding="0 5 0 5">
|
||||||
|
<Border.BorderBrush>
|
||||||
|
<SolidColorBrush Color="White" Opacity="0.12" />
|
||||||
|
</Border.BorderBrush>
|
||||||
|
<TextBlock Text="Private IP" FontSize="16">
|
||||||
<TextBlock.Foreground>
|
<TextBlock.Foreground>
|
||||||
<SolidColorBrush Color="White" Opacity="0.60" />
|
<SolidColorBrush Color="White" Opacity="0.60" />
|
||||||
</TextBlock.Foreground>
|
</TextBlock.Foreground>
|
||||||
</TextBlock>
|
</TextBlock>
|
||||||
<TextBlock Text="Private IP" FontSize="16" Margin="2 2 5 10">
|
</Border>
|
||||||
|
<Border BorderThickness="0 1 0 1" Padding="0 5 0 5">
|
||||||
|
<Border.BorderBrush>
|
||||||
|
<SolidColorBrush Color="White" Opacity="0.12" />
|
||||||
|
</Border.BorderBrush>
|
||||||
|
<TextBlock Text="Uptime" FontSize="16">
|
||||||
<TextBlock.Foreground>
|
<TextBlock.Foreground>
|
||||||
<SolidColorBrush Color="White" Opacity="0.60" />
|
<SolidColorBrush Color="White" Opacity="0.60" />
|
||||||
</TextBlock.Foreground>
|
</TextBlock.Foreground>
|
||||||
</TextBlock>
|
</TextBlock>
|
||||||
<TextBlock Text="Uptime" FontSize="16" Margin="2 2 5 10">
|
</Border>
|
||||||
|
<Border BorderThickness="0 1 0 1" Padding="0 5 0 5">
|
||||||
|
<Border.BorderBrush>
|
||||||
|
<SolidColorBrush Color="White" Opacity="0.12" />
|
||||||
|
</Border.BorderBrush>
|
||||||
|
<TextBlock Text="Creation Date" FontSize="16">
|
||||||
<TextBlock.Foreground>
|
<TextBlock.Foreground>
|
||||||
<SolidColorBrush Color="White" Opacity="0.60" />
|
<SolidColorBrush Color="White" Opacity="0.60" />
|
||||||
</TextBlock.Foreground>
|
</TextBlock.Foreground>
|
||||||
</TextBlock>
|
</TextBlock>
|
||||||
<TextBlock Text="Creation Date" FontSize="16" Margin="2 2 5 10">
|
</Border>
|
||||||
<TextBlock.Foreground>
|
<Border BorderThickness="0 1 0 0" Padding="0 5 0 0">
|
||||||
<SolidColorBrush Color="White" Opacity="0.60" />
|
<Border.BorderBrush>
|
||||||
</TextBlock.Foreground>
|
<SolidColorBrush Color="White" Opacity="0.12" />
|
||||||
</TextBlock>
|
</Border.BorderBrush>
|
||||||
<TextBlock Text="Creator" FontSize="16" Margin="2 2 5 10">
|
<TextBlock Text="Creator" FontSize="16">
|
||||||
<TextBlock.Foreground>
|
<TextBlock.Foreground>
|
||||||
<SolidColorBrush Color="White" Opacity="0.60" />
|
<SolidColorBrush Color="White" Opacity="0.60" />
|
||||||
</TextBlock.Foreground>
|
</TextBlock.Foreground>
|
||||||
</TextBlock>
|
</TextBlock>
|
||||||
|
</Border>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
<StackPanel Grid.Column="1">
|
<StackPanel Grid.Column="1">
|
||||||
<TextBlock Text="{Binding ServerInfo.ServerName}" FontSize="16" Margin="5 2 2 10">
|
<Border BorderThickness="0 0 0 1" Padding="0 0 0 5">
|
||||||
|
<Border.BorderBrush>
|
||||||
|
<SolidColorBrush Color="White" Opacity="0.12" />
|
||||||
|
</Border.BorderBrush>
|
||||||
|
<TextBlock Text="{Binding ServerInformation.OsUserName}" FontSize="16" Padding="15 0 0 0">
|
||||||
<TextBlock.Foreground>
|
<TextBlock.Foreground>
|
||||||
<SolidColorBrush Color="White" Opacity="0.60" />
|
<SolidColorBrush Color="White" Opacity="0.60" />
|
||||||
</TextBlock.Foreground>
|
</TextBlock.Foreground>
|
||||||
</TextBlock>
|
</TextBlock>
|
||||||
<TextBlock Text="{Binding ServerInfo.OSUserName}" FontSize="16" Margin="5 2 2 10">
|
</Border>
|
||||||
|
<Border BorderThickness="0 1 0 1" Padding="0 5 0 5">
|
||||||
|
<Border.BorderBrush>
|
||||||
|
<SolidColorBrush Color="White" Opacity="0.12" />
|
||||||
|
</Border.BorderBrush>
|
||||||
|
<TextBlock Text="{Binding ServerInformation.PublicIpAddress}" FontSize="16" Padding="15 0 0 0">
|
||||||
<TextBlock.Foreground>
|
<TextBlock.Foreground>
|
||||||
<SolidColorBrush Color="White" Opacity="0.60" />
|
<SolidColorBrush Color="White" Opacity="0.60" />
|
||||||
</TextBlock.Foreground>
|
</TextBlock.Foreground>
|
||||||
</TextBlock>
|
</TextBlock>
|
||||||
<TextBlock Text="{Binding ServerInfo.PublicIpAdress}" FontSize="16" Margin="5 2 2 10">
|
</Border>
|
||||||
|
<Border BorderThickness="0 1 0 1" Padding="0 5 0 5">
|
||||||
|
<Border.BorderBrush>
|
||||||
|
<SolidColorBrush Color="White" Opacity="0.12" />
|
||||||
|
</Border.BorderBrush>
|
||||||
|
<TextBlock Text="{Binding ServerInformation.PrivateIpAddress}" FontSize="16" Padding="15 0 0 0">
|
||||||
<TextBlock.Foreground>
|
<TextBlock.Foreground>
|
||||||
<SolidColorBrush Color="White" Opacity="0.60" />
|
<SolidColorBrush Color="White" Opacity="0.60" />
|
||||||
</TextBlock.Foreground>
|
</TextBlock.Foreground>
|
||||||
</TextBlock>
|
</TextBlock>
|
||||||
<TextBlock Text="{Binding ServerInfo.PrivateIpAdress}" FontSize="16" Margin="5 2 2 10">
|
</Border>
|
||||||
|
<Border BorderThickness="0 1 0 1" Padding="0 5 0 5">
|
||||||
|
<Border.BorderBrush>
|
||||||
|
<SolidColorBrush Color="White" Opacity="0.12" />
|
||||||
|
</Border.BorderBrush>
|
||||||
|
<TextBlock Text="{Binding ServerInformation.Uptime}" FontSize="16" Padding="15 0 0 0">
|
||||||
<TextBlock.Foreground>
|
<TextBlock.Foreground>
|
||||||
<SolidColorBrush Color="White" Opacity="0.60" />
|
<SolidColorBrush Color="White" Opacity="0.60" />
|
||||||
</TextBlock.Foreground>
|
</TextBlock.Foreground>
|
||||||
</TextBlock>
|
</TextBlock>
|
||||||
<TextBlock Text="{Binding ServerInfo.Uptime}" FontSize="16" Margin="5 2 2 10">
|
</Border>
|
||||||
|
<Border BorderThickness="0 1 0 1" Padding="0 5 0 5">
|
||||||
|
<Border.BorderBrush>
|
||||||
|
<SolidColorBrush Color="White" Opacity="0.12" />
|
||||||
|
</Border.BorderBrush>
|
||||||
|
<TextBlock Text="{Binding CreationDate}" FontSize="16" Padding="15 0 0 0">
|
||||||
<TextBlock.Foreground>
|
<TextBlock.Foreground>
|
||||||
<SolidColorBrush Color="White" Opacity="0.60" />
|
<SolidColorBrush Color="White" Opacity="0.60" />
|
||||||
</TextBlock.Foreground>
|
</TextBlock.Foreground>
|
||||||
</TextBlock>
|
</TextBlock>
|
||||||
<TextBlock Text="{Binding CreationDate}" FontSize="16" Margin="5 2 2 10">
|
</Border>
|
||||||
<TextBlock.Foreground>
|
<Border BorderThickness="0 1 0 0" Padding="0 5 0 0">
|
||||||
<SolidColorBrush Color="White" Opacity="0.60" />
|
<Border.BorderBrush>
|
||||||
</TextBlock.Foreground>
|
<SolidColorBrush Color="White" Opacity="0.12" />
|
||||||
</TextBlock>
|
</Border.BorderBrush>
|
||||||
<TextBlock Text="{Binding Creator}" FontSize="16" Margin="5 2 2 10">
|
<TextBlock Text="{Binding Creator}" FontSize="16" Padding="15 0 0 0">
|
||||||
<TextBlock.Foreground>
|
<TextBlock.Foreground>
|
||||||
<SolidColorBrush Color="White" Opacity="0.60" />
|
<SolidColorBrush Color="White" Opacity="0.60" />
|
||||||
</TextBlock.Foreground>
|
</TextBlock.Foreground>
|
||||||
</TextBlock>
|
</TextBlock>
|
||||||
|
</Border>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Grid>
|
</Grid>
|
||||||
<!--Graphical Indicators Right-->
|
<!--Graphical Indicators Right-->
|
||||||
<Grid Grid.Row="1" Grid.Column="1">
|
<Grid Grid.Column="1">
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition />
|
<ColumnDefinition />
|
||||||
<ColumnDefinition />
|
<ColumnDefinition />
|
||||||
@@ -168,4 +242,29 @@
|
|||||||
</Grid>
|
</Grid>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Border>
|
</Border>
|
||||||
|
</Border>
|
||||||
|
<ControlTemplate.Triggers>
|
||||||
|
<Trigger Property="IsMouseOver" Value="True">
|
||||||
|
<Setter TargetName="Border" Property="BorderBrush">
|
||||||
|
<Setter.Value>
|
||||||
|
<SolidColorBrush Color="#B388FF" Opacity=".37" />
|
||||||
|
</Setter.Value>
|
||||||
|
</Setter>
|
||||||
|
</Trigger>
|
||||||
|
<Trigger Property="IsFocused" Value="True">
|
||||||
|
</Trigger>
|
||||||
|
<Trigger Property="IsPressed" Value="True">
|
||||||
|
<Setter TargetName="Border" Property="BorderBrush">
|
||||||
|
<Setter.Value>
|
||||||
|
<SolidColorBrush Color="#B388FF" Opacity=".87" />
|
||||||
|
</Setter.Value>
|
||||||
|
</Setter>
|
||||||
|
</Trigger>
|
||||||
|
</ControlTemplate.Triggers>
|
||||||
|
</ControlTemplate>
|
||||||
|
</Setter.Value>
|
||||||
|
</Setter>
|
||||||
|
</Style>
|
||||||
|
</Button.Style>
|
||||||
|
</Button>
|
||||||
</UserControl>
|
</UserControl>
|
||||||
@@ -1,12 +1,7 @@
|
|||||||
using Microsoft.Win32;
|
using System;
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Configuration;
|
using System.Configuration;
|
||||||
using System.Data;
|
using System.Data;
|
||||||
using System.Data.SqlClient;
|
using System.Data.SqlClient;
|
||||||
using System.Reflection;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Windows.Media.Imaging;
|
|
||||||
|
|
||||||
namespace Server_Dashboard {
|
namespace Server_Dashboard {
|
||||||
|
|
||||||
@@ -39,17 +34,11 @@ namespace Server_Dashboard {
|
|||||||
com.Parameters.Add("@valid", SqlDbType.NVarChar, 250);
|
com.Parameters.Add("@valid", SqlDbType.NVarChar, 250);
|
||||||
com.Parameters["@valid"].Direction = ParameterDirection.Output;
|
com.Parameters["@valid"].Direction = ParameterDirection.Output;
|
||||||
//Execute query and return number of rows affected
|
//Execute query and return number of rows affected
|
||||||
int sqlResponse = com.ExecuteNonQuery();
|
com.ExecuteNonQuery();
|
||||||
//Checks if there are any rows successful
|
//Checks if there are any rows successful
|
||||||
//If the query returns 0 the query wasn't successful
|
//If the query returns 0 the query wasn't successful
|
||||||
//if its any number above 0 it was successfull
|
//if its any number above 0 it was successful
|
||||||
if (Convert.ToInt32(com.Parameters["@Valid"].Value) == 0) {
|
return Convert.ToInt32(com.Parameters["@Valid"].Value) == 0 ? 1 : 0;
|
||||||
//Error, not successful
|
|
||||||
return 1;
|
|
||||||
} else {
|
|
||||||
//Successful
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
//Catch any error
|
//Catch any error
|
||||||
} catch (SqlException ex) {
|
} catch (SqlException ex) {
|
||||||
return ex.Number;
|
return ex.Number;
|
||||||
@@ -66,7 +55,7 @@ namespace Server_Dashboard {
|
|||||||
//Open the connection
|
//Open the connection
|
||||||
con.Open();
|
con.Open();
|
||||||
//SQL Query
|
//SQL Query
|
||||||
string query = "SELECT ID, Username, Email, RegistrationDate FROM UserData WHERE Username = @username";
|
const string query = "SELECT ID, Username, Email, RegistrationDate FROM UserData WHERE Username = @username";
|
||||||
//Creates a new command
|
//Creates a new command
|
||||||
using SqlCommand com = new SqlCommand(query, con);//For security reasons the values are added with this function
|
using SqlCommand com = new SqlCommand(query, con);//For security reasons the values are added with this function
|
||||||
//this will avoid SQL Injections
|
//this will avoid SQL Injections
|
||||||
@@ -78,9 +67,9 @@ namespace Server_Dashboard {
|
|||||||
return resultTable;
|
return resultTable;
|
||||||
//Checks if there are any rows successful
|
//Checks if there are any rows successful
|
||||||
//If the query returns 0 the query wasn't successful
|
//If the query returns 0 the query wasn't successful
|
||||||
//if its any number above 0 it was successfull
|
//if its any number above 0 it was successful
|
||||||
//Catch any error
|
//Catch any error
|
||||||
} catch (SqlException ex) {
|
} catch (SqlException) {
|
||||||
return null;
|
return null;
|
||||||
} finally {
|
} finally {
|
||||||
//Always close the connection
|
//Always close the connection
|
||||||
@@ -95,7 +84,7 @@ namespace Server_Dashboard {
|
|||||||
//Open the connection
|
//Open the connection
|
||||||
con.Open();
|
con.Open();
|
||||||
//SQL Query
|
//SQL Query
|
||||||
string query = "SELECT Creator, CreationTime, ModuleName, MI.Image FROM ModuleData LEFT JOIN ModuleIcon MI on ModuleData.ID = MI.Module WHERE UserID = @userID";
|
const string query = "SELECT Creator, CreationTime, ModuleName, MI.Image, ModuleData.ID FROM ModuleData LEFT JOIN ModuleIcon MI on ModuleData.ID = MI.Module WHERE UserID = @userID";
|
||||||
//Creates a new command
|
//Creates a new command
|
||||||
using SqlCommand com = new SqlCommand(query, con);//For security reasons the values are added with this function
|
using SqlCommand com = new SqlCommand(query, con);//For security reasons the values are added with this function
|
||||||
//this will avoid SQL Injections
|
//this will avoid SQL Injections
|
||||||
@@ -107,9 +96,9 @@ namespace Server_Dashboard {
|
|||||||
return resultTable;
|
return resultTable;
|
||||||
//Checks if there are any rows successful
|
//Checks if there are any rows successful
|
||||||
//If the query returns 0 the query wasn't successful
|
//If the query returns 0 the query wasn't successful
|
||||||
//if its any number above 0 it was successfull
|
//if its any number above 0 it was successful
|
||||||
//Catch any error
|
//Catch any error
|
||||||
} catch (SqlException ex) {
|
} catch (SqlException) {
|
||||||
return null;
|
return null;
|
||||||
} finally {
|
} finally {
|
||||||
//Always close the connection
|
//Always close the connection
|
||||||
@@ -118,20 +107,20 @@ namespace Server_Dashboard {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// This function will fetch every Serverdata for each module
|
/// This function will fetch every server data for each module
|
||||||
/// This will need some optimization, for now we just asynchronously
|
/// This will need some optimization, for now we just asynchronously
|
||||||
/// fetch the server data for each module
|
/// fetch the server data for each module
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="mid">ModuleID to fetch the data from</param>
|
/// <param name="mid">ModuleID to fetch the data from</param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static DataTable GetServerData(string mid) {
|
public static DataTable GetServerData(int mid) {
|
||||||
//Creates the database connection
|
//Creates the database connection
|
||||||
using SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["ServerDashboardDB"].ConnectionString);
|
using SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["ServerDashboardDB"].ConnectionString);
|
||||||
try {
|
try {
|
||||||
//Open the connection
|
//Open the connection
|
||||||
con.Open();
|
con.Open();
|
||||||
//SQL Query
|
//SQL Query
|
||||||
string query = "SELECT * FROM ServerData WHERE ModuleID = @mid";
|
const string query = "SELECT * FROM ServerData WHERE ModuleID = @mid";
|
||||||
//Creates a new command
|
//Creates a new command
|
||||||
using SqlCommand com = new SqlCommand(query, con);//For security reasons the values are added with this function
|
using SqlCommand com = new SqlCommand(query, con);//For security reasons the values are added with this function
|
||||||
//this will avoid SQL Injections
|
//this will avoid SQL Injections
|
||||||
@@ -143,9 +132,9 @@ namespace Server_Dashboard {
|
|||||||
return resultTable;
|
return resultTable;
|
||||||
//Checks if there are any rows successful
|
//Checks if there are any rows successful
|
||||||
//If the query returns 0 the query wasn't successful
|
//If the query returns 0 the query wasn't successful
|
||||||
//if its any number above 0 it was successfull
|
//if its any number above 0 it was successful
|
||||||
//Catch any error
|
//Catch any error
|
||||||
} catch (SqlException ex) {
|
} catch (SqlException) {
|
||||||
return null;
|
return null;
|
||||||
} finally {
|
} finally {
|
||||||
//Always close the connection
|
//Always close the connection
|
||||||
@@ -156,21 +145,21 @@ namespace Server_Dashboard {
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates a new Module for the current user
|
/// Creates a new Module for the current user
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="ipAdress">Server IP Address</param>
|
/// <param name="ipAddress">Server IP Address</param>
|
||||||
/// <param name="moduleName">Module name, default is Module</param>
|
/// <param name="moduleName">Module name, default is Module</param>
|
||||||
/// <param name="serverName">Server name, default is Server</param>
|
/// <param name="serverName">Server name, default is Server</param>
|
||||||
/// <param name="username">Username of the current user</param>
|
/// <param name="username">Username of the current user</param>
|
||||||
/// <param name="moduleIcon">module icon as byte[]</param>
|
/// <param name="moduleIcon">module icon as byte[]</param>
|
||||||
/// <param name="port">port, defalt ist 22</param>
|
/// <param name="port">port, default ist 22</param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static int CreateNewModule(string ipAdress, string moduleName, string serverName, string username, byte[] moduleIcon, string port = "22") {
|
public static int CreateNewModule(string ipAddress, string moduleName, string serverName, string username, byte[] moduleIcon, string port = "22") {
|
||||||
//Creates the database connection
|
//Creates the database connection
|
||||||
using SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["ServerDashboardDB"].ConnectionString);
|
using SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["ServerDashboardDB"].ConnectionString);
|
||||||
try {
|
try {
|
||||||
//Open the connection
|
//Open the connection
|
||||||
con.Open();
|
con.Open();
|
||||||
//SQL Query
|
//SQL Query
|
||||||
string query = "EXEC AddNewModuleToUser @UserName = @username, @DateTime = @time, @ModuleName = @moduleName, @ServerName = @serverName, @ModuleIcon = @moduleIcon, @IPAddress = @ipAdress, @Port = @port";
|
const string query = "EXEC AddNewModuleToUser @UserName = @username, @DateTime = @time, @ModuleName = @moduleName, @ServerName = @serverName, @ModuleIcon = @moduleIcon, @IPAddress = @ipAddress, @Port = @port";
|
||||||
//Creates a new command
|
//Creates a new command
|
||||||
using SqlCommand com = new SqlCommand(query, con);
|
using SqlCommand com = new SqlCommand(query, con);
|
||||||
//For security reasons the values are added with this function
|
//For security reasons the values are added with this function
|
||||||
@@ -183,20 +172,14 @@ namespace Server_Dashboard {
|
|||||||
if (moduleIcon == null)
|
if (moduleIcon == null)
|
||||||
com.Parameters["@moduleIcon"].Value = DBNull.Value;
|
com.Parameters["@moduleIcon"].Value = DBNull.Value;
|
||||||
//com.Parameters.AddWithValue("@moduleIcon", moduleIcon);
|
//com.Parameters.AddWithValue("@moduleIcon", moduleIcon);
|
||||||
com.Parameters.AddWithValue("@ipAdress", ipAdress);
|
com.Parameters.AddWithValue("@ipAddress", ipAddress);
|
||||||
com.Parameters.AddWithValue("@port", port);
|
com.Parameters.AddWithValue("@port", port);
|
||||||
//Execute query and return number of rows affected
|
//Execute query and return number of rows affected
|
||||||
int sqlResponse = com.ExecuteNonQuery();
|
int sqlResponse = com.ExecuteNonQuery();
|
||||||
//Checks if there are any rows successful
|
//Checks if there are any rows successful
|
||||||
//If the query returns 0 the query wasn't successful
|
//If the query returns 0 the query wasn't successful
|
||||||
//if its any number above 0 it was successfull
|
//if its any number above 0 it was successful
|
||||||
if (sqlResponse == 0) {
|
return sqlResponse == 0 ? 1 : 0;
|
||||||
//Error, not successful
|
|
||||||
return 1;
|
|
||||||
} else {
|
|
||||||
//Successful
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
//Catch any error
|
//Catch any error
|
||||||
} catch (SqlException ex) {
|
} catch (SqlException ex) {
|
||||||
return ex.Number;
|
return ex.Number;
|
||||||
@@ -207,7 +190,7 @@ namespace Server_Dashboard {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Currently obscolete, would check the Username and Cookie
|
/// Currently obsolete, would check the Username and Cookie
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="cookie">Locally stored user cookie</param>
|
/// <param name="cookie">Locally stored user cookie</param>
|
||||||
/// <param name="username">Locally stored username</param>
|
/// <param name="username">Locally stored username</param>
|
||||||
@@ -219,7 +202,7 @@ namespace Server_Dashboard {
|
|||||||
//Open the connection
|
//Open the connection
|
||||||
con.Open();
|
con.Open();
|
||||||
//SQL Query
|
//SQL Query
|
||||||
string query = "((SELECT Cookie FROM UserData WHERE Username = @username) = @cookie)";
|
const string query = "((SELECT Cookie FROM UserData WHERE Username = @username) = @cookie)";
|
||||||
//Creates a new command
|
//Creates a new command
|
||||||
using SqlCommand com = new SqlCommand(query, con);
|
using SqlCommand com = new SqlCommand(query, con);
|
||||||
//For security reasons the values are added with this function
|
//For security reasons the values are added with this function
|
||||||
@@ -231,13 +214,7 @@ namespace Server_Dashboard {
|
|||||||
//Checks if there are any rows successful
|
//Checks if there are any rows successful
|
||||||
//If the query returns 0 the query wasn't successful
|
//If the query returns 0 the query wasn't successful
|
||||||
//if its any number above 0 it was successfull
|
//if its any number above 0 it was successfull
|
||||||
if (sqlResponse == 0) {
|
return sqlResponse == 0 ? 1 : 0;
|
||||||
//Error, not successful
|
|
||||||
return 1;
|
|
||||||
} else {
|
|
||||||
//Successful
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
//Catch any error
|
//Catch any error
|
||||||
} catch (SqlException ex) {
|
} catch (SqlException ex) {
|
||||||
return ex.Number;
|
return ex.Number;
|
||||||
@@ -258,7 +235,7 @@ namespace Server_Dashboard {
|
|||||||
//Open the connection
|
//Open the connection
|
||||||
con.Open();
|
con.Open();
|
||||||
//SQL Query
|
//SQL Query
|
||||||
string query = "UPDATE UserData SET Cookie = null WHERE Username = @username";
|
const string query = "UPDATE UserData SET Cookie = null WHERE Username = @username";
|
||||||
//Creates a new command
|
//Creates a new command
|
||||||
using SqlCommand com = new SqlCommand(query, con);
|
using SqlCommand com = new SqlCommand(query, con);
|
||||||
//For security reasons the values are added with this function
|
//For security reasons the values are added with this function
|
||||||
@@ -268,14 +245,8 @@ namespace Server_Dashboard {
|
|||||||
int sqlResponse = com.ExecuteNonQuery();
|
int sqlResponse = com.ExecuteNonQuery();
|
||||||
//Checks if there are any rows successful
|
//Checks if there are any rows successful
|
||||||
//If the query returns 0 the query wasn't successful
|
//If the query returns 0 the query wasn't successful
|
||||||
//if its any number above 0 it was successfull
|
//if its any number above 0 it was successful
|
||||||
if (sqlResponse == 0) {
|
return sqlResponse == 0 ? 1 : 0;
|
||||||
//Error, not successful
|
|
||||||
return 1;
|
|
||||||
} else {
|
|
||||||
//Successful
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
//Catch any error
|
//Catch any error
|
||||||
} catch (SqlException ex) {
|
} catch (SqlException ex) {
|
||||||
return ex.Number;
|
return ex.Number;
|
||||||
@@ -293,30 +264,31 @@ namespace Server_Dashboard {
|
|||||||
/// <returns>[0] is false, [1] is true, [2] connection error</returns>
|
/// <returns>[0] is false, [1] is true, [2] connection error</returns>
|
||||||
public static int AddCookie(string username, string cookie) {
|
public static int AddCookie(string username, string cookie) {
|
||||||
//Creates the database connection
|
//Creates the database connection
|
||||||
using SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["ServerDashboardDB"].ConnectionString);
|
using SqlConnection con =
|
||||||
|
new SqlConnection(ConfigurationManager.ConnectionStrings["ServerDashboardDB"].ConnectionString);
|
||||||
try {
|
try {
|
||||||
//Open the connection
|
//Open the connection
|
||||||
con.Open();
|
con.Open();
|
||||||
|
|
||||||
//SQL Query
|
//SQL Query
|
||||||
string query = "UPDATE UserData SET Cookie = @cookie WHERE Username = @username";
|
const string query = "UPDATE UserData SET Cookie = @cookie WHERE Username = @username";
|
||||||
|
|
||||||
//Creates a new command
|
//Creates a new command
|
||||||
using SqlCommand com = new SqlCommand(query, con);
|
using SqlCommand com = new SqlCommand(query, con);
|
||||||
|
|
||||||
//For security reasons the values are added with this function
|
//For security reasons the values are added with this function
|
||||||
//this will avoid SQL Injections
|
//this will avoid SQL Injections
|
||||||
com.Parameters.Add("@cookie", SqlDbType.NVarChar, -1).Value = cookie;
|
com.Parameters.Add("@cookie", SqlDbType.NVarChar, -1).Value = cookie;
|
||||||
com.Parameters.AddWithValue("@username", username);
|
com.Parameters.AddWithValue("@username", username);
|
||||||
|
|
||||||
//Execute query and return number of rows affected
|
//Execute query and return number of rows affected
|
||||||
int sqlResponse = com.ExecuteNonQuery();
|
int sqlResponse = com.ExecuteNonQuery();
|
||||||
|
|
||||||
//Checks if there are any rows successful
|
//Checks if there are any rows successful
|
||||||
//If the query returns 0 the query wasn't successful
|
//If the query returns 0 the query wasn't successful
|
||||||
//if its any number above 0 it was successfull
|
//if its any number above 0 it was successful
|
||||||
if (sqlResponse == 0) {
|
return sqlResponse == 0 ? 1 : 0;
|
||||||
//Error, not successful
|
|
||||||
return 1;
|
|
||||||
} else {
|
|
||||||
//Successful
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
//Catch any error
|
//Catch any error
|
||||||
} catch (SqlException ex) {
|
} catch (SqlException ex) {
|
||||||
return ex.Number;
|
return ex.Number;
|
||||||
@@ -324,8 +296,8 @@ namespace Server_Dashboard {
|
|||||||
//Always close the connection
|
//Always close the connection
|
||||||
con.Close();
|
con.Close();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#endregion Public Methods
|
#endregion Public Methods
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
@@ -4,6 +4,7 @@ using System.Security;
|
|||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
||||||
namespace Server_Dashboard {
|
namespace Server_Dashboard {
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Interface that makes a SecurePassword go one way
|
/// Interface that makes a SecurePassword go one way
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -3,10 +3,11 @@ using System.Collections.Generic;
|
|||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
||||||
namespace Server_Dashboard {
|
namespace Server_Dashboard {
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Interface to help close a window with a button
|
/// Interface to help close a window with a button
|
||||||
/// </summary>
|
/// </summary>
|
||||||
interface IWindowHelper {
|
internal interface IWindowHelper {
|
||||||
Action Close { get; set; }
|
Action Close { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -5,10 +5,12 @@ using System.Security;
|
|||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
||||||
namespace Server_Dashboard {
|
namespace Server_Dashboard {
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Secure string helper class to unsecure the Password b4 it goes to the database
|
/// Secure string helper class to unsecure the Password b4 it goes to the database
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static class SecureStringHelpers {
|
public static class SecureStringHelpers {
|
||||||
|
|
||||||
//Unsecures a given password
|
//Unsecures a given password
|
||||||
public static string Unsecure(this SecureString secureString) {
|
public static string Unsecure(this SecureString secureString) {
|
||||||
//If empty return nothing
|
//If empty return nothing
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ namespace Server_Dashboard {
|
|||||||
public DateTime CreationDate { get; set; }
|
public DateTime CreationDate { get; set; }
|
||||||
|
|
||||||
//List that contains all the serverinformation over a period of time(lifespan of the module)
|
//List that contains all the serverinformation over a period of time(lifespan of the module)
|
||||||
public List<ServerInformation> ServerInformation { get; set; }
|
public ServerInformation ServerInformation { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// This will set the Module status indicator red or green if the server is available or not
|
/// This will set the Module status indicator red or green if the server is available or not
|
||||||
|
|||||||
@@ -11,13 +11,13 @@ namespace Server_Dashboard {
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
internal class ServerInformation {
|
internal class ServerInformation {
|
||||||
public string ServerName { get; set; }
|
public string ServerName { get; set; }
|
||||||
public string OSUserName { get; set; }
|
public string OsUserName { get; set; }
|
||||||
public double CpuTemp { get; set; }
|
public double CpuTemp { get; set; }
|
||||||
public double GpuTemp { get; set; }
|
public double GpuTemp { get; set; }
|
||||||
public DateTime Uptime { get; set; }
|
public TimeSpan Uptime { get; set; }
|
||||||
public DateTime DeployDate { get; set; }
|
public DateTime DeployDate { get; set; }
|
||||||
public string PublicIpAdress { get; set; }
|
public string PublicIpAddress { get; set; }
|
||||||
public string PrivateIpAdress { get; set; }
|
public string PrivateIpAddress { get; set; }
|
||||||
public int GpuUsage { get; set; }
|
public int GpuUsage { get; set; }
|
||||||
public int CpuUsage { get; set; }
|
public int CpuUsage { get; set; }
|
||||||
public double NetworkUP { get; set; }
|
public double NetworkUP { get; set; }
|
||||||
|
|||||||
@@ -5,11 +5,13 @@ using System.Text;
|
|||||||
using System.Windows.Data;
|
using System.Windows.Data;
|
||||||
|
|
||||||
namespace Server_Dashboard {
|
namespace Server_Dashboard {
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Value to angle converter
|
/// Value to angle converter
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[ValueConversion(typeof(int), typeof(double))]
|
[ValueConversion(typeof(int), typeof(double))]
|
||||||
public class ValueToAngleConverter : IValueConverter {
|
public class ValueToAngleConverter : IValueConverter {
|
||||||
|
|
||||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) => (int)value * 0.01 * 360;
|
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) => (int)value * 0.01 * 360;
|
||||||
|
|
||||||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) => (int)((double)value / 360);
|
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) => (int)((double)value / 360);
|
||||||
|
|||||||
@@ -1,14 +1,13 @@
|
|||||||
using System;
|
using System.ComponentModel;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.ComponentModel;
|
|
||||||
using System.Text;
|
|
||||||
|
|
||||||
namespace Server_Dashboard {
|
namespace Server_Dashboard {
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Base View Model all the other view models inherit from
|
/// Base View Model all the other view models inherit from
|
||||||
/// Makes me write the INotifyPropertyChanged only once
|
/// Makes me write the INotifyPropertyChanged only once
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class BaseViewModel : INotifyPropertyChanged {
|
public class BaseViewModel : INotifyPropertyChanged {
|
||||||
|
|
||||||
public event PropertyChangedEventHandler PropertyChanged = (sender, e) => { };
|
public event PropertyChangedEventHandler PropertyChanged = (sender, e) => { };
|
||||||
|
|
||||||
protected void OnPropertyChanged(string prop) {
|
protected void OnPropertyChanged(string prop) {
|
||||||
|
|||||||
@@ -16,25 +16,38 @@ namespace Server_Dashboard {
|
|||||||
//List with all Modules inside
|
//List with all Modules inside
|
||||||
public ObservableCollection<ModuleData> Modules { get; set; }
|
public ObservableCollection<ModuleData> Modules { get; set; }
|
||||||
|
|
||||||
//Creates Default Modules, remove before release and when implementing the actual data comming from the socket
|
//Creates Default Modules, remove before release and when implementing the actual data coming from the socket
|
||||||
public DashboardModuleViewModel(DataTable moduleData) {
|
public DashboardModuleViewModel(DataTable moduleData) {
|
||||||
Modules = new ObservableCollection<ModuleData>();
|
Modules = new ObservableCollection<ModuleData>();
|
||||||
foreach (DataRow row in moduleData.Rows) {
|
foreach (DataRow row in moduleData.Rows) {
|
||||||
if (row[0] != null) {
|
if (row[0] == null)
|
||||||
|
return;
|
||||||
byte[] iconBytes = row[3] == DBNull.Value ? null : (byte[])row[3];
|
byte[] iconBytes = row[3] == DBNull.Value ? null : (byte[])row[3];
|
||||||
Modules.Add(new ModuleData(true) {
|
DataTable serverData = DatabaseHandler.GetServerData((int)row[4]);
|
||||||
ModuleName = (string)row?[2],
|
ServerInformation serverInformation = null;
|
||||||
Creator = (string)row?[0],
|
if (serverData.Rows.Count != 0) {
|
||||||
|
DataRow serverRow = serverData.Rows[0];
|
||||||
|
serverInformation = new ServerInformation {
|
||||||
|
ServerName = (string)serverRow[4] ?? "",
|
||||||
|
PublicIpAddress = (string)serverRow[6] ?? "",
|
||||||
|
PrivateIpAddress = (string)serverRow[5] ?? "",
|
||||||
|
Uptime = (TimeSpan)serverRow[7],
|
||||||
|
OsUserName = (string)serverRow[3] ?? ""
|
||||||
|
};
|
||||||
|
}
|
||||||
|
Modules.Add(new ModuleData(false) {
|
||||||
|
ModuleName = (string)row[2] ?? "",
|
||||||
|
Creator = (string)row[0] ?? "",
|
||||||
ModuleIcon = ConvertByteToBitmapImage(iconBytes),
|
ModuleIcon = ConvertByteToBitmapImage(iconBytes),
|
||||||
CreationDate = (DateTime)row?[1],
|
CreationDate = (DateTime)row[1],
|
||||||
ServerInformation = null
|
ServerInformation = serverInformation
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
private BitmapImage ConvertByteToBitmapImage(byte[] icon) {
|
private static BitmapImage ConvertByteToBitmapImage(byte[] icon) {
|
||||||
if (icon != null) {
|
if (icon == null)
|
||||||
|
return null;
|
||||||
try {
|
try {
|
||||||
using MemoryStream ms = new MemoryStream(icon);
|
using MemoryStream ms = new MemoryStream(icon);
|
||||||
BitmapImage moduleIcon = new BitmapImage();
|
BitmapImage moduleIcon = new BitmapImage();
|
||||||
@@ -46,7 +59,6 @@ namespace Server_Dashboard {
|
|||||||
moduleIcon.Freeze();
|
moduleIcon.Freeze();
|
||||||
return moduleIcon;
|
return moduleIcon;
|
||||||
} catch { }
|
} catch { }
|
||||||
}
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,13 +1,9 @@
|
|||||||
using Server_Dashboard.Views.DashboardPages.ModuleCRUD;
|
using Server_Dashboard.Views.DashboardPages.ModuleCRUD;
|
||||||
using System.Collections.ObjectModel;
|
using System.Collections.ObjectModel;
|
||||||
|
using System.Data;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
using Server_Dashboard_Socket;
|
|
||||||
using System;
|
|
||||||
using System.Data;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
|
|
||||||
namespace Server_Dashboard {
|
namespace Server_Dashboard {
|
||||||
|
|
||||||
@@ -53,7 +49,7 @@ namespace Server_Dashboard {
|
|||||||
#region Constructor
|
#region Constructor
|
||||||
|
|
||||||
public DashboardViewModel(string username) {
|
public DashboardViewModel(string username) {
|
||||||
//Command inits
|
//Command init
|
||||||
OpenLinkCommand = new RelayCommand(OpenLink);
|
OpenLinkCommand = new RelayCommand(OpenLink);
|
||||||
OpenNewModuleWindowCommand = new RelayCommand(OpenNewModuleWindow);
|
OpenNewModuleWindowCommand = new RelayCommand(OpenNewModuleWindow);
|
||||||
|
|
||||||
@@ -77,9 +73,7 @@ namespace Server_Dashboard {
|
|||||||
/// Opens a given link in the default browser
|
/// Opens a given link in the default browser
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="param">The Link to be opened e.g. https://github.com/Crylia/Server-Dashboard </param>
|
/// <param name="param">The Link to be opened e.g. https://github.com/Crylia/Server-Dashboard </param>
|
||||||
private void OpenLink(object param) {
|
private static void OpenLink(object param) => Process.Start(new ProcessStartInfo((string)param) { UseShellExecute = true });
|
||||||
Process.Start(new ProcessStartInfo((string)param) { UseShellExecute = true });
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates a new window to create a new Module
|
/// Creates a new window to create a new Module
|
||||||
@@ -98,8 +92,7 @@ namespace Server_Dashboard {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void GetModules() {
|
private void GetModules() {
|
||||||
DataTable moduleData = DatabaseHandler.GetUserModuleData(User.UID);
|
dmvm = new DashboardModuleViewModel(DatabaseHandler.GetUserModuleData(User.UID));
|
||||||
dmvm = new DashboardModuleViewModel(moduleData);
|
|
||||||
//Sets the local module to the dashboard view module modules
|
//Sets the local module to the dashboard view module modules
|
||||||
Modules = dmvm.Modules;
|
Modules = dmvm.Modules;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ namespace Server_Dashboard {
|
|||||||
private string serverName;
|
private string serverName;
|
||||||
|
|
||||||
public string ServerName {
|
public string ServerName {
|
||||||
get { return serverName; }
|
get => serverName;
|
||||||
set {
|
set {
|
||||||
if (serverName != value)
|
if (serverName != value)
|
||||||
serverName = value;
|
serverName = value;
|
||||||
@@ -28,7 +28,7 @@ namespace Server_Dashboard {
|
|||||||
private string moduleName;
|
private string moduleName;
|
||||||
|
|
||||||
public string ModuleName {
|
public string ModuleName {
|
||||||
get { return moduleName; }
|
get => moduleName;
|
||||||
set {
|
set {
|
||||||
if (moduleName != value)
|
if (moduleName != value)
|
||||||
moduleName = value;
|
moduleName = value;
|
||||||
@@ -36,21 +36,21 @@ namespace Server_Dashboard {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private string ipAdress;
|
private string ipAddress;
|
||||||
|
|
||||||
public string IPAdress {
|
public string IpAddress {
|
||||||
get { return ipAdress; }
|
get => ipAddress;
|
||||||
set {
|
set {
|
||||||
if (ipAdress != value)
|
if (ipAddress != value)
|
||||||
ipAdress = value;
|
ipAddress = value;
|
||||||
OnPropertyChanged(nameof(ipAdress));
|
OnPropertyChanged(nameof(ipAddress));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private string port;
|
private string port;
|
||||||
|
|
||||||
public string Port {
|
public string Port {
|
||||||
get { return port; }
|
get => port;
|
||||||
set {
|
set {
|
||||||
if (port != value)
|
if (port != value)
|
||||||
port = value;
|
port = value;
|
||||||
@@ -61,7 +61,7 @@ namespace Server_Dashboard {
|
|||||||
private BitmapImage moduleIcon;
|
private BitmapImage moduleIcon;
|
||||||
|
|
||||||
public BitmapImage ModuleIcon {
|
public BitmapImage ModuleIcon {
|
||||||
get { return moduleIcon; }
|
get => moduleIcon;
|
||||||
set {
|
set {
|
||||||
if (moduleIcon != value)
|
if (moduleIcon != value)
|
||||||
moduleIcon = value;
|
moduleIcon = value;
|
||||||
@@ -72,7 +72,7 @@ namespace Server_Dashboard {
|
|||||||
private string userInformationMessage;
|
private string userInformationMessage;
|
||||||
|
|
||||||
public string UserInformationMessage {
|
public string UserInformationMessage {
|
||||||
get { return userInformationMessage; }
|
get => userInformationMessage;
|
||||||
set {
|
set {
|
||||||
if (userInformationMessage != value)
|
if (userInformationMessage != value)
|
||||||
userInformationMessage = value;
|
userInformationMessage = value;
|
||||||
@@ -108,39 +108,39 @@ namespace Server_Dashboard {
|
|||||||
/// <param name="param">Nothing</param>
|
/// <param name="param">Nothing</param>
|
||||||
private async void CreateModuleAsync(object param) {
|
private async void CreateModuleAsync(object param) {
|
||||||
//Checks if the IP field is not empty and valid
|
//Checks if the IP field is not empty and valid
|
||||||
if (!String.IsNullOrWhiteSpace(ipAdress) && ipFilter.IsMatch(ipAdress)) {
|
if (!string.IsNullOrWhiteSpace(ipAddress) && ipFilter.IsMatch(ipAddress)) {
|
||||||
//Gives the Module a default name if the user doesnt name it
|
//Gives the Module a default name if the user doesn't name it
|
||||||
if (String.IsNullOrWhiteSpace(moduleName))
|
if (string.IsNullOrWhiteSpace(moduleName))
|
||||||
moduleName = "Module";
|
moduleName = "Module";
|
||||||
//Gives the Server a default name is the user doesnt name it
|
//Gives the Server a default name is the user doesn't name it
|
||||||
if (String.IsNullOrWhiteSpace(serverName))
|
if (string.IsNullOrWhiteSpace(serverName))
|
||||||
serverName = "Server";
|
serverName = "Server";
|
||||||
//Makes sure the name isnt any longer than characters
|
//Makes sure the name isn't any longer than characters
|
||||||
if (moduleName.Length >= 20) {
|
if (moduleName.Length >= 20) {
|
||||||
UserInformationMessage = "The Module Name is too long";
|
UserInformationMessage = "The Module Name is too long";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
//Makes sure the name isnt any longer than characters
|
//Makes sure the name isn't any longer than characters
|
||||||
if (serverName.Length >= 20) {
|
if (serverName.Length >= 20) {
|
||||||
UserInformationMessage = "The Server Name is too long";
|
UserInformationMessage = "The Server Name is too long";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
//Clears the error message if there isnt any error
|
//Clears the error message if there isn't any error
|
||||||
UserInformationMessage = "";
|
UserInformationMessage = "";
|
||||||
byte[] moduleIconStream = null;
|
byte[] moduleIconStream = null;
|
||||||
if (moduleIcon != null) {
|
if (moduleIcon != null) {
|
||||||
try {
|
try {
|
||||||
JpegBitmapEncoder encoder = new JpegBitmapEncoder();
|
JpegBitmapEncoder encoder = new JpegBitmapEncoder();
|
||||||
encoder.Frames.Add(BitmapFrame.Create(moduleIcon));
|
encoder.Frames.Add(BitmapFrame.Create(moduleIcon));
|
||||||
using MemoryStream ms = new MemoryStream();
|
await using MemoryStream ms = new MemoryStream();
|
||||||
encoder.Save(ms);
|
encoder.Save(ms);
|
||||||
moduleIconStream = ms.ToArray();
|
moduleIconStream = ms.ToArray();
|
||||||
} catch { }
|
} catch (Exception) { }
|
||||||
}
|
}
|
||||||
if (await Task.Run(() => DatabaseHandler.CreateNewModule(ipAdress, moduleName, serverName, username, moduleIconStream, port)) == 0) {
|
if (await Task.Run(() => DatabaseHandler.CreateNewModule(ipAddress, moduleName, serverName, username, moduleIconStream, port)) == 0) {
|
||||||
Close?.Invoke();
|
Close?.Invoke();
|
||||||
} else {
|
} else {
|
||||||
UserInformationMessage = "Unknown error occured, please try again later";
|
UserInformationMessage = "Unknown error occurred, please try again later";
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
UserInformationMessage = "The IP Address is invalid";
|
UserInformationMessage = "The IP Address is invalid";
|
||||||
@@ -156,7 +156,7 @@ namespace Server_Dashboard {
|
|||||||
Title = "Choose an Image",
|
Title = "Choose an Image",
|
||||||
Filter = "Supported format|*.jpg;*.jpeg;*.png"
|
Filter = "Supported format|*.jpg;*.jpeg;*.png"
|
||||||
};
|
};
|
||||||
if ((bool)ofd.ShowDialog()) {
|
if (Convert.ToBoolean(ofd.ShowDialog())) {
|
||||||
ModuleIcon = new BitmapImage(new Uri(ofd.FileName));
|
ModuleIcon = new BitmapImage(new Uri(ofd.FileName));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -108,7 +108,7 @@ namespace Server_Dashboard {
|
|||||||
if (!String.IsNullOrWhiteSpace(Username) && !String.IsNullOrWhiteSpace((parameter as IHavePassword).SecurePassword.Unsecure())) {
|
if (!String.IsNullOrWhiteSpace(Username) && !String.IsNullOrWhiteSpace((parameter as IHavePassword).SecurePassword.Unsecure())) {
|
||||||
//Sets loading to true to show the loading icon
|
//Sets loading to true to show the loading icon
|
||||||
Loading = "Visible";
|
Loading = "Visible";
|
||||||
//Sends the Username and Password to the database and saved the result, 1 successfull, 0 wrong username or password
|
//Sends the Username and Password to the database and saved the result, 1 successful, 0 wrong username or password
|
||||||
int result = await Task.Run(() => DatabaseHandler.CheckLogin(Username, (parameter as IHavePassword).SecurePassword.Unsecure()));
|
int result = await Task.Run(() => DatabaseHandler.CheckLogin(Username, (parameter as IHavePassword).SecurePassword.Unsecure()));
|
||||||
//hides the loading again
|
//hides the loading again
|
||||||
Loading = "Hidden";
|
Loading = "Hidden";
|
||||||
@@ -142,7 +142,7 @@ namespace Server_Dashboard {
|
|||||||
//If the remember user option is checked and the cookie is not set save everything locally
|
//If the remember user option is checked and the cookie is not set save everything locally
|
||||||
if (RememberUser && Settings.Default.Username != Username) {
|
if (RememberUser && Settings.Default.Username != Username) {
|
||||||
//Creates a new GUID with the username at the end, this is the cookie
|
//Creates a new GUID with the username at the end, this is the cookie
|
||||||
var cookie = $"{Guid.NewGuid().ToString()}+user:{Username}";
|
var cookie = $"{Guid.NewGuid()}+user:{Username}";
|
||||||
//Saves cookie, Username Remember me option to the local storage (Settings.settings)
|
//Saves cookie, Username Remember me option to the local storage (Settings.settings)
|
||||||
Settings.Default.Cookies = cookie;
|
Settings.Default.Cookies = cookie;
|
||||||
Settings.Default.Username = Username;
|
Settings.Default.Username = Username;
|
||||||
@@ -197,7 +197,7 @@ namespace Server_Dashboard {
|
|||||||
|
|
||||||
#region private functions
|
#region private functions
|
||||||
|
|
||||||
//TODO: Add autologin function that locks the UI untill the user hits the abort button or the login completes
|
//TODO: Add auto login function that locks the UI until the user hits the abort button or the login completes
|
||||||
/*private async void AutoLoginAsync() {
|
/*private async void AutoLoginAsync() {
|
||||||
if (Settings.Default.RememberMe && !String.IsNullOrEmpty(Settings.Default.Username) && !String.IsNullOrEmpty(Settings.Default.Cookies)) {
|
if (Settings.Default.RememberMe && !String.IsNullOrEmpty(Settings.Default.Username) && !String.IsNullOrEmpty(Settings.Default.Cookies)) {
|
||||||
Loading = "Visible";
|
Loading = "Visible";
|
||||||
|
|||||||
@@ -34,7 +34,7 @@
|
|||||||
</i:EventTrigger>
|
</i:EventTrigger>
|
||||||
</i:Interaction.Triggers>
|
</i:Interaction.Triggers>
|
||||||
</TextBlock>
|
</TextBlock>
|
||||||
<Button Style="{StaticResource CloseButton}" Grid.Column="2" Content="✕" Cursor="Hand">
|
<Button Style="{StaticResource CloseButton}" Grid.Column="1" Content="✕">
|
||||||
<i:Interaction.Triggers>
|
<i:Interaction.Triggers>
|
||||||
<i:EventTrigger EventName="Click">
|
<i:EventTrigger EventName="Click">
|
||||||
<i:CallMethodAction MethodName="Close" TargetObject="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Window}}" />
|
<i:CallMethodAction MethodName="Close" TargetObject="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Window}}" />
|
||||||
@@ -69,8 +69,8 @@
|
|||||||
<Grid.Effect>
|
<Grid.Effect>
|
||||||
<DropShadowEffect Direction="0" BlurRadius="5" ShadowDepth="0" />
|
<DropShadowEffect Direction="0" BlurRadius="5" ShadowDepth="0" />
|
||||||
</Grid.Effect>
|
</Grid.Effect>
|
||||||
<TextBox Text="{Binding ModuleName}" Grid.Column="1" Height="40" FontSize="20" x:Name="ServerName"/>
|
<TextBox Text="{Binding ModuleName}" Height="40" FontSize="20" x:Name="ServerName" />
|
||||||
<TextBlock VerticalAlignment="Center" HorizontalAlignment="Left" Text="My Awesome Server" FontSize="20" Visibility="{Binding ElementName=ServerName, Path=Text.IsEmpty, Converter={StaticResource UserNameVisibillity}}" Grid.Column="1" IsHitTestVisible="False" Margin="5 0 0 0">
|
<TextBlock VerticalAlignment="Center" HorizontalAlignment="Left" Text="My Awesome Server" FontSize="20" Visibility="{Binding ElementName=ServerName, PresentationTraceSources.TraceLevel=High, Path=Text.IsEmpty, Converter={StaticResource UserNameVisibillity}}" IsHitTestVisible="False" Margin="5 0 0 0">
|
||||||
<TextBlock.Foreground>
|
<TextBlock.Foreground>
|
||||||
<SolidColorBrush Color="White" Opacity="0.12" />
|
<SolidColorBrush Color="White" Opacity="0.12" />
|
||||||
</TextBlock.Foreground>
|
</TextBlock.Foreground>
|
||||||
@@ -90,8 +90,8 @@
|
|||||||
<Grid.Effect>
|
<Grid.Effect>
|
||||||
<DropShadowEffect Direction="0" BlurRadius="5" ShadowDepth="0" />
|
<DropShadowEffect Direction="0" BlurRadius="5" ShadowDepth="0" />
|
||||||
</Grid.Effect>
|
</Grid.Effect>
|
||||||
<TextBox Text="{Binding ServerName}" Grid.Column="1" Height="40" FontSize="20" x:Name="UserName"/>
|
<TextBox Text="{Binding ServerName}" Height="40" FontSize="20" x:Name="UserName" />
|
||||||
<TextBlock VerticalAlignment="Center" HorizontalAlignment="Left" Text="Name" FontSize="20" Visibility="{Binding ElementName=UserName, Path=Text.IsEmpty, Converter={StaticResource UserNameVisibillity}}" Grid.Column="1" IsHitTestVisible="False" Margin="5 0 0 0">
|
<TextBlock VerticalAlignment="Center" HorizontalAlignment="Left" Text="Name" FontSize="20" Visibility="{Binding ElementName=UserName, Path=Text.IsEmpty, Converter={StaticResource UserNameVisibillity}}" IsHitTestVisible="False" Margin="5 0 0 0">
|
||||||
<TextBlock.Foreground>
|
<TextBlock.Foreground>
|
||||||
<SolidColorBrush Color="White" Opacity="0.12" />
|
<SolidColorBrush Color="White" Opacity="0.12" />
|
||||||
</TextBlock.Foreground>
|
</TextBlock.Foreground>
|
||||||
@@ -101,7 +101,7 @@
|
|||||||
<!--IP Adress-->
|
<!--IP Adress-->
|
||||||
<StackPanel VerticalAlignment="Center" Grid.Row="2" Margin="20 0 20 0">
|
<StackPanel VerticalAlignment="Center" Grid.Row="2" Margin="20 0 20 0">
|
||||||
<StackPanel Orientation="Horizontal">
|
<StackPanel Orientation="Horizontal">
|
||||||
<TextBlock Text="IP Adress" FontSize="24" Margin="0 0 0 5">
|
<TextBlock Text="IP Address" FontSize="24" Margin="0 0 0 5">
|
||||||
<TextBlock.Foreground>
|
<TextBlock.Foreground>
|
||||||
<SolidColorBrush Color="White" Opacity="0.87" />
|
<SolidColorBrush Color="White" Opacity="0.87" />
|
||||||
</TextBlock.Foreground>
|
</TextBlock.Foreground>
|
||||||
@@ -112,8 +112,8 @@
|
|||||||
<Grid.Effect>
|
<Grid.Effect>
|
||||||
<DropShadowEffect Direction="0" BlurRadius="5" ShadowDepth="0" />
|
<DropShadowEffect Direction="0" BlurRadius="5" ShadowDepth="0" />
|
||||||
</Grid.Effect>
|
</Grid.Effect>
|
||||||
<TextBox Text="{Binding IPAdress}" Grid.Column="1" Height="40" FontSize="20" x:Name="IPAdress"/>
|
<TextBox Text="{Binding IpAddress}" Height="40" FontSize="20" />
|
||||||
<TextBlock VerticalAlignment="Center" HorizontalAlignment="Left" Text="sample.ssh.com" FontSize="20" Visibility="{Binding ElementName=IPAdress, Path=Text.IsEmpty, Converter={StaticResource UserNameVisibillity}}" Grid.Column="1" IsHitTestVisible="False" Margin="5 0 0 0">
|
<TextBlock VerticalAlignment="Center" HorizontalAlignment="Left" Text="sample.ssh.com" FontSize="20" Visibility="{Binding ElementName=IpAddress, Path=Text.IsEmpty, Converter={StaticResource UserNameVisibillity}}" IsHitTestVisible="False" Margin="5 0 0 0">
|
||||||
<TextBlock.Foreground>
|
<TextBlock.Foreground>
|
||||||
<SolidColorBrush Color="White" Opacity="0.12" />
|
<SolidColorBrush Color="White" Opacity="0.12" />
|
||||||
</TextBlock.Foreground>
|
</TextBlock.Foreground>
|
||||||
@@ -131,7 +131,7 @@
|
|||||||
<Grid.Effect>
|
<Grid.Effect>
|
||||||
<DropShadowEffect Direction="0" BlurRadius="5" ShadowDepth="0" />
|
<DropShadowEffect Direction="0" BlurRadius="5" ShadowDepth="0" />
|
||||||
</Grid.Effect>
|
</Grid.Effect>
|
||||||
<TextBox Text="{Binding Port}" Grid.Column="1" Height="40" FontSize="20" x:Name="Port"/>
|
<TextBox Text="{Binding Port}" Height="40" FontSize="20" x:Name="Port" />
|
||||||
<TextBlock VerticalAlignment="Center" HorizontalAlignment="Left" Text="22" FontSize="20" Visibility="{Binding ElementName=Port, Path=Text.IsEmpty, Converter={StaticResource UserNameVisibillity}}" Grid.Column="1" IsHitTestVisible="False" Margin="5 0 0 0">
|
<TextBlock VerticalAlignment="Center" HorizontalAlignment="Left" Text="22" FontSize="20" Visibility="{Binding ElementName=Port, Path=Text.IsEmpty, Converter={StaticResource UserNameVisibillity}}" Grid.Column="1" IsHitTestVisible="False" Margin="5 0 0 0">
|
||||||
<TextBlock.Foreground>
|
<TextBlock.Foreground>
|
||||||
<SolidColorBrush Color="White" Opacity="0.12" />
|
<SolidColorBrush Color="White" Opacity="0.12" />
|
||||||
@@ -167,7 +167,6 @@
|
|||||||
</Grid>
|
</Grid>
|
||||||
</Border>
|
</Border>
|
||||||
<ControlTemplate.Triggers>
|
<ControlTemplate.Triggers>
|
||||||
|
|
||||||
</ControlTemplate.Triggers>
|
</ControlTemplate.Triggers>
|
||||||
</ControlTemplate>
|
</ControlTemplate>
|
||||||
</Setter.Value>
|
</Setter.Value>
|
||||||
|
|||||||
@@ -3,8 +3,6 @@
|
|||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:local="clr-namespace:Server_Dashboard.Views"
|
|
||||||
xmlns:root="clr-namespace:Server_Dashboard"
|
|
||||||
xmlns:views="clr-namespace:Server_Dashboard.Views.DashboardPages"
|
xmlns:views="clr-namespace:Server_Dashboard.Views.DashboardPages"
|
||||||
xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
|
xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
|
||||||
xmlns:svgc="http://sharpvectors.codeplex.com/svgc/"
|
xmlns:svgc="http://sharpvectors.codeplex.com/svgc/"
|
||||||
@@ -32,7 +30,7 @@
|
|||||||
</i:EventTrigger>
|
</i:EventTrigger>
|
||||||
</i:Interaction.Triggers>
|
</i:Interaction.Triggers>
|
||||||
</Label>
|
</Label>
|
||||||
<Button Style="{StaticResource CloseButton}" Grid.Column="2" Content="✕" Cursor="Hand">
|
<Button Style="{StaticResource CloseButton}" Grid.Column="1" Content="✕">
|
||||||
<i:Interaction.Triggers>
|
<i:Interaction.Triggers>
|
||||||
<i:EventTrigger EventName="Click">
|
<i:EventTrigger EventName="Click">
|
||||||
<i:CallMethodAction MethodName="Close" TargetObject="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Window}}" />
|
<i:CallMethodAction MethodName="Close" TargetObject="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Window}}" />
|
||||||
@@ -41,7 +39,7 @@
|
|||||||
</Button>
|
</Button>
|
||||||
</Grid>
|
</Grid>
|
||||||
<!--Settings, Docs, User, links etc-->
|
<!--Settings, Docs, User, links etc-->
|
||||||
<Grid Background="{StaticResource BackgroundSurface_04dp}" Grid.Row="1" x:Name="TopBarGrid">
|
<Grid Background="{StaticResource BackgroundSurface_04dp}" Grid.Row="1">
|
||||||
<Grid.Effect>
|
<Grid.Effect>
|
||||||
<DropShadowEffect Direction="270" BlurRadius="5" />
|
<DropShadowEffect Direction="270" BlurRadius="5" />
|
||||||
</Grid.Effect>
|
</Grid.Effect>
|
||||||
@@ -198,7 +196,7 @@
|
|||||||
</Button>
|
</Button>
|
||||||
</Grid>
|
</Grid>
|
||||||
<!--UserControl Container for the Dashboard pages-->
|
<!--UserControl Container for the Dashboard pages-->
|
||||||
<UserControl Grid.Row="3">
|
<UserControl Grid.Row="2">
|
||||||
<views:MainDashboardPage />
|
<views:MainDashboardPage />
|
||||||
</UserControl>
|
</UserControl>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|||||||
@@ -3,11 +3,6 @@
|
|||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:vm="clr-namespace:Server_Dashboard"
|
|
||||||
xmlns:local="clr-namespace:Server_Dashboard.Views.DashboardPages"
|
|
||||||
xmlns:modulescrud="clr-namespace:Server_Dashboard.Views.DashboardPages.ModuleCRUD"
|
|
||||||
xmlns:root="clr-namespace:Server_Dashboard"
|
|
||||||
xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
|
|
||||||
xmlns:controls="clr-namespace:Server_Dashboard.Controls.ServerModules"
|
xmlns:controls="clr-namespace:Server_Dashboard.Controls.ServerModules"
|
||||||
mc:Ignorable="d" d:DesignHeight="920" d:DesignWidth="1600">
|
mc:Ignorable="d" d:DesignHeight="920" d:DesignWidth="1600">
|
||||||
<Grid Background="{StaticResource BackgroundSurface_00dp}">
|
<Grid Background="{StaticResource BackgroundSurface_00dp}">
|
||||||
@@ -15,21 +10,49 @@
|
|||||||
<RowDefinition Height="*" />
|
<RowDefinition Height="*" />
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
<!--Dashboard and Options-->
|
<!--Dashboard and Options-->
|
||||||
<Grid Grid.Row="2">
|
<Grid>
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="200" />
|
<ColumnDefinition Width="200" />
|
||||||
<ColumnDefinition Width="*" />
|
<ColumnDefinition Width="*" />
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<Grid Grid.Column="0" Background="{StaticResource BackgroundSurface_02dp}">
|
<Grid Grid.Column="0" Background="{StaticResource BackgroundSurface_02dp}">
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition Height="Auto"/>
|
<RowDefinition Height="80" />
|
||||||
<RowDefinition Height="Auto"/>
|
<RowDefinition Height="*" />
|
||||||
<RowDefinition Height="Auto"/>
|
|
||||||
<RowDefinition Height="*" />
|
<RowDefinition Height="*" />
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
<Button Grid.Row="0" Command="{Binding OpenNewModuleWindowCommand}" Content="New Module" Height="50" Margin="5 10 5 0" Cursor="Hand" x:Name="CreateModule"/>
|
<Grid Grid.Row="1">
|
||||||
<Button Grid.Row="1" Command="{Binding OpenDeleteModuleWindowCommand}" Content="Remove Module" Height="50" Margin="5 10 5 0" Cursor="Hand" x:Name="RemoveModule"/>
|
<Grid.RowDefinitions>
|
||||||
<Button Grid.Row="2" Command="{Binding OpenUpdateModuleWindowCommand}" Content="Change Module" Height="50" Margin="5 10 5 0" Cursor="Hand" x:Name="ChangeModule"/>
|
<RowDefinition Height="40" />
|
||||||
|
<RowDefinition Height="Auto" />
|
||||||
|
<RowDefinition Height="Auto" />
|
||||||
|
<RowDefinition Height="Auto" />
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
<TextBlock Grid.Row="0" Text="Navigation" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="10 0 0 0">
|
||||||
|
<TextBlock.Foreground>
|
||||||
|
<SolidColorBrush Color="White" Opacity="0.67" />
|
||||||
|
</TextBlock.Foreground>
|
||||||
|
</TextBlock>
|
||||||
|
<Button Grid.Row="1" Content="PLACEHOLDER" Height="50" Margin="5 10 5 0" Cursor="Hand" />
|
||||||
|
<Button Grid.Row="2" Content="PLACEHOLDER" Height="50" Margin="5 10 5 0" Cursor="Hand" />
|
||||||
|
<Button Grid.Row="3" Content="PLACEHOLDER" Height="50" Margin="5 10 5 0" Cursor="Hand" />
|
||||||
|
</Grid>
|
||||||
|
<Grid Grid.Row="2">
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="40" />
|
||||||
|
<RowDefinition Height="Auto" />
|
||||||
|
<RowDefinition Height="Auto" />
|
||||||
|
<RowDefinition Height="Auto" />
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
<TextBlock Grid.Row="0" Text="Module" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="10 0 0 0">
|
||||||
|
<TextBlock.Foreground>
|
||||||
|
<SolidColorBrush Color="White" Opacity="0.67" />
|
||||||
|
</TextBlock.Foreground>
|
||||||
|
</TextBlock>
|
||||||
|
<Button Grid.Row="1" Command="{Binding OpenNewModuleWindowCommand}" Content="New Module" Height="50" Margin="5 10 5 0" Cursor="Hand" />
|
||||||
|
<Button Grid.Row="2" Command="{Binding OpenDeleteModuleWindowCommand}" Content="Remove Module" Height="50" Margin="5 10 5 0" Cursor="Hand" />
|
||||||
|
<Button Grid.Row="3" Command="{Binding OpenUpdateModuleWindowCommand}" Content="Change Module" Height="50" Margin="5 10 5 0" Cursor="Hand" />
|
||||||
|
</Grid>
|
||||||
</Grid>
|
</Grid>
|
||||||
<!--ItemsControl list for the Dashboard modules-->
|
<!--ItemsControl list for the Dashboard modules-->
|
||||||
<Grid Grid.Column="1">
|
<Grid Grid.Column="1">
|
||||||
@@ -37,7 +60,7 @@
|
|||||||
<ItemsControl ItemsSource="{Binding Modules}">
|
<ItemsControl ItemsSource="{Binding Modules}">
|
||||||
<ItemsControl.ItemsPanel>
|
<ItemsControl.ItemsPanel>
|
||||||
<ItemsPanelTemplate>
|
<ItemsPanelTemplate>
|
||||||
<WrapPanel HorizontalAlignment="Center"/>
|
<WrapPanel VerticalAlignment="Top" HorizontalAlignment="Left" />
|
||||||
</ItemsPanelTemplate>
|
</ItemsPanelTemplate>
|
||||||
</ItemsControl.ItemsPanel>
|
</ItemsControl.ItemsPanel>
|
||||||
<ItemsControl.ItemTemplate>
|
<ItemsControl.ItemTemplate>
|
||||||
|
|||||||
@@ -12,10 +12,12 @@ using System.Windows.Navigation;
|
|||||||
using System.Windows.Shapes;
|
using System.Windows.Shapes;
|
||||||
|
|
||||||
namespace Server_Dashboard.Views.DashboardPages {
|
namespace Server_Dashboard.Views.DashboardPages {
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Interaktionslogik für MainDashboardPage.xaml
|
/// Interaktionslogik für MainDashboardPage.xaml
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class MainDashboardPage : UserControl {
|
public partial class MainDashboardPage : UserControl {
|
||||||
|
|
||||||
public MainDashboardPage() {
|
public MainDashboardPage() {
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,4 +1,4 @@
|
|||||||
#pragma checksum "..\..\..\App.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "FA6871C28C6B96CD3932405F6C88CE357B9CAC41"
|
#pragma checksum "..\..\..\App.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "89671BCD36227E8CA37EFCBD47B7D56B75748C0B"
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// <auto-generated>
|
// <auto-generated>
|
||||||
// This code was generated by a tool.
|
// This code was generated by a tool.
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#pragma checksum "..\..\..\App.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "FA6871C28C6B96CD3932405F6C88CE357B9CAC41"
|
#pragma checksum "..\..\..\App.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "89671BCD36227E8CA37EFCBD47B7D56B75748C0B"
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// <auto-generated>
|
// <auto-generated>
|
||||||
// This code was generated by a tool.
|
// This code was generated by a tool.
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#pragma checksum "..\..\..\..\..\Controls\DoubleRoundProgressBar\DoubleRoundProgressBar.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "086FBA685C865D0623D9F28DA3FE76C1340ED6A4"
|
#pragma checksum "..\..\..\..\..\Controls\DoubleRoundProgressBar\DoubleRoundProgressBar.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "74BED8DF4E986CFA6EFDD59B3915D539092EE365"
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// <auto-generated>
|
// <auto-generated>
|
||||||
// This code was generated by a tool.
|
// This code was generated by a tool.
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#pragma checksum "..\..\..\..\..\Controls\DoubleRoundProgressBar\DoubleRoundProgressBar.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "086FBA685C865D0623D9F28DA3FE76C1340ED6A4"
|
#pragma checksum "..\..\..\..\..\Controls\DoubleRoundProgressBar\DoubleRoundProgressBar.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "74BED8DF4E986CFA6EFDD59B3915D539092EE365"
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// <auto-generated>
|
// <auto-generated>
|
||||||
// This code was generated by a tool.
|
// This code was generated by a tool.
|
||||||
|
|||||||
Binary file not shown.
@@ -1,4 +1,4 @@
|
|||||||
#pragma checksum "..\..\..\..\..\Controls\ServerModules\ServerModule.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "6F9DB4C5946CBF25B6E68335E790A78274B363A2"
|
#pragma checksum "..\..\..\..\..\Controls\ServerModules\ServerModule.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "8948CA51F35EA3D65C0627B41D6C20A9C63FAE8A"
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// <auto-generated>
|
// <auto-generated>
|
||||||
// This code was generated by a tool.
|
// This code was generated by a tool.
|
||||||
@@ -64,13 +64,6 @@ namespace Server_Dashboard.Controls.ServerModules {
|
|||||||
#line hidden
|
#line hidden
|
||||||
}
|
}
|
||||||
|
|
||||||
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
|
||||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "5.0.4.0")]
|
|
||||||
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
|
||||||
internal System.Delegate _CreateDelegate(System.Type delegateType, string handler) {
|
|
||||||
return System.Delegate.CreateDelegate(delegateType, this, handler);
|
|
||||||
}
|
|
||||||
|
|
||||||
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "5.0.4.0")]
|
[System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "5.0.4.0")]
|
||||||
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
|
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#pragma checksum "..\..\..\..\..\Controls\ServerModules\ServerModule.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "6F9DB4C5946CBF25B6E68335E790A78274B363A2"
|
#pragma checksum "..\..\..\..\..\Controls\ServerModules\ServerModule.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "8948CA51F35EA3D65C0627B41D6C20A9C63FAE8A"
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// <auto-generated>
|
// <auto-generated>
|
||||||
// This code was generated by a tool.
|
// This code was generated by a tool.
|
||||||
@@ -64,13 +64,6 @@ namespace Server_Dashboard.Controls.ServerModules {
|
|||||||
#line hidden
|
#line hidden
|
||||||
}
|
}
|
||||||
|
|
||||||
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
|
||||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "5.0.4.0")]
|
|
||||||
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
|
||||||
internal System.Delegate _CreateDelegate(System.Type delegateType, string handler) {
|
|
||||||
return System.Delegate.CreateDelegate(delegateType, this, handler);
|
|
||||||
}
|
|
||||||
|
|
||||||
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "5.0.4.0")]
|
[System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "5.0.4.0")]
|
||||||
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
|
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,4 +1,4 @@
|
|||||||
#pragma checksum "..\..\..\..\..\..\Views\Dashboard\CRUD Popup\CreateModulePopup.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "9622FD4ED1908727106706E3ADC79DA4E6BAF4FC"
|
#pragma checksum "..\..\..\..\..\..\Views\Dashboard\CRUD Popup\CreateModulePopup.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "DD12D199E41C2A2DD246D632627FFEDEF260FE3A"
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// <auto-generated>
|
// <auto-generated>
|
||||||
// This code was generated by a tool.
|
// This code was generated by a tool.
|
||||||
@@ -65,14 +65,6 @@ namespace Server_Dashboard.Views.DashboardPages.ModuleCRUD {
|
|||||||
#line hidden
|
#line hidden
|
||||||
|
|
||||||
|
|
||||||
#line 115 "..\..\..\..\..\..\Views\Dashboard\CRUD Popup\CreateModulePopup.xaml"
|
|
||||||
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
|
|
||||||
internal System.Windows.Controls.TextBox IPAdress;
|
|
||||||
|
|
||||||
#line default
|
|
||||||
#line hidden
|
|
||||||
|
|
||||||
|
|
||||||
#line 134 "..\..\..\..\..\..\Views\Dashboard\CRUD Popup\CreateModulePopup.xaml"
|
#line 134 "..\..\..\..\..\..\Views\Dashboard\CRUD Popup\CreateModulePopup.xaml"
|
||||||
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
|
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
|
||||||
internal System.Windows.Controls.TextBox Port;
|
internal System.Windows.Controls.TextBox Port;
|
||||||
@@ -124,9 +116,6 @@ namespace Server_Dashboard.Views.DashboardPages.ModuleCRUD {
|
|||||||
this.UserName = ((System.Windows.Controls.TextBox)(target));
|
this.UserName = ((System.Windows.Controls.TextBox)(target));
|
||||||
return;
|
return;
|
||||||
case 3:
|
case 3:
|
||||||
this.IPAdress = ((System.Windows.Controls.TextBox)(target));
|
|
||||||
return;
|
|
||||||
case 4:
|
|
||||||
this.Port = ((System.Windows.Controls.TextBox)(target));
|
this.Port = ((System.Windows.Controls.TextBox)(target));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#pragma checksum "..\..\..\..\..\..\Views\Dashboard\CRUD Popup\CreateModulePopup.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "9622FD4ED1908727106706E3ADC79DA4E6BAF4FC"
|
#pragma checksum "..\..\..\..\..\..\Views\Dashboard\CRUD Popup\CreateModulePopup.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "DD12D199E41C2A2DD246D632627FFEDEF260FE3A"
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// <auto-generated>
|
// <auto-generated>
|
||||||
// This code was generated by a tool.
|
// This code was generated by a tool.
|
||||||
@@ -65,14 +65,6 @@ namespace Server_Dashboard.Views.DashboardPages.ModuleCRUD {
|
|||||||
#line hidden
|
#line hidden
|
||||||
|
|
||||||
|
|
||||||
#line 115 "..\..\..\..\..\..\Views\Dashboard\CRUD Popup\CreateModulePopup.xaml"
|
|
||||||
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
|
|
||||||
internal System.Windows.Controls.TextBox IPAdress;
|
|
||||||
|
|
||||||
#line default
|
|
||||||
#line hidden
|
|
||||||
|
|
||||||
|
|
||||||
#line 134 "..\..\..\..\..\..\Views\Dashboard\CRUD Popup\CreateModulePopup.xaml"
|
#line 134 "..\..\..\..\..\..\Views\Dashboard\CRUD Popup\CreateModulePopup.xaml"
|
||||||
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
|
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
|
||||||
internal System.Windows.Controls.TextBox Port;
|
internal System.Windows.Controls.TextBox Port;
|
||||||
@@ -124,9 +116,6 @@ namespace Server_Dashboard.Views.DashboardPages.ModuleCRUD {
|
|||||||
this.UserName = ((System.Windows.Controls.TextBox)(target));
|
this.UserName = ((System.Windows.Controls.TextBox)(target));
|
||||||
return;
|
return;
|
||||||
case 3:
|
case 3:
|
||||||
this.IPAdress = ((System.Windows.Controls.TextBox)(target));
|
|
||||||
return;
|
|
||||||
case 4:
|
|
||||||
this.Port = ((System.Windows.Controls.TextBox)(target));
|
this.Port = ((System.Windows.Controls.TextBox)(target));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Binary file not shown.
@@ -1,4 +1,4 @@
|
|||||||
#pragma checksum "..\..\..\..\Views\DashboardWindow.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "3593041613773C511381544197463CBAC4FA5B88"
|
#pragma checksum "..\..\..\..\Views\DashboardWindow.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "7D684497049C84ED9B984ABA13FB98FAA7EC8050"
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// <auto-generated>
|
// <auto-generated>
|
||||||
// This code was generated by a tool.
|
// This code was generated by a tool.
|
||||||
@@ -14,8 +14,6 @@ using Microsoft.Xaml.Behaviors.Core;
|
|||||||
using Microsoft.Xaml.Behaviors.Input;
|
using Microsoft.Xaml.Behaviors.Input;
|
||||||
using Microsoft.Xaml.Behaviors.Layout;
|
using Microsoft.Xaml.Behaviors.Layout;
|
||||||
using Microsoft.Xaml.Behaviors.Media;
|
using Microsoft.Xaml.Behaviors.Media;
|
||||||
using Server_Dashboard;
|
|
||||||
using Server_Dashboard.Views;
|
|
||||||
using Server_Dashboard.Views.DashboardPages;
|
using Server_Dashboard.Views.DashboardPages;
|
||||||
using SharpVectors.Converters;
|
using SharpVectors.Converters;
|
||||||
using System;
|
using System;
|
||||||
@@ -49,14 +47,6 @@ namespace Server_Dashboard.Views {
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class DashboardWindow : System.Windows.Window, System.Windows.Markup.IComponentConnector {
|
public partial class DashboardWindow : System.Windows.Window, System.Windows.Markup.IComponentConnector {
|
||||||
|
|
||||||
|
|
||||||
#line 44 "..\..\..\..\Views\DashboardWindow.xaml"
|
|
||||||
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
|
|
||||||
internal System.Windows.Controls.Grid TopBarGrid;
|
|
||||||
|
|
||||||
#line default
|
|
||||||
#line hidden
|
|
||||||
|
|
||||||
private bool _contentLoaded;
|
private bool _contentLoaded;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -85,12 +75,6 @@ namespace Server_Dashboard.Views {
|
|||||||
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")]
|
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")]
|
||||||
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")]
|
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")]
|
||||||
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
|
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
|
||||||
switch (connectionId)
|
|
||||||
{
|
|
||||||
case 1:
|
|
||||||
this.TopBarGrid = ((System.Windows.Controls.Grid)(target));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this._contentLoaded = true;
|
this._contentLoaded = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#pragma checksum "..\..\..\..\Views\DashboardWindow.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "3593041613773C511381544197463CBAC4FA5B88"
|
#pragma checksum "..\..\..\..\Views\DashboardWindow.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "7D684497049C84ED9B984ABA13FB98FAA7EC8050"
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// <auto-generated>
|
// <auto-generated>
|
||||||
// This code was generated by a tool.
|
// This code was generated by a tool.
|
||||||
@@ -14,8 +14,6 @@ using Microsoft.Xaml.Behaviors.Core;
|
|||||||
using Microsoft.Xaml.Behaviors.Input;
|
using Microsoft.Xaml.Behaviors.Input;
|
||||||
using Microsoft.Xaml.Behaviors.Layout;
|
using Microsoft.Xaml.Behaviors.Layout;
|
||||||
using Microsoft.Xaml.Behaviors.Media;
|
using Microsoft.Xaml.Behaviors.Media;
|
||||||
using Server_Dashboard;
|
|
||||||
using Server_Dashboard.Views;
|
|
||||||
using Server_Dashboard.Views.DashboardPages;
|
using Server_Dashboard.Views.DashboardPages;
|
||||||
using SharpVectors.Converters;
|
using SharpVectors.Converters;
|
||||||
using System;
|
using System;
|
||||||
@@ -49,14 +47,6 @@ namespace Server_Dashboard.Views {
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class DashboardWindow : System.Windows.Window, System.Windows.Markup.IComponentConnector {
|
public partial class DashboardWindow : System.Windows.Window, System.Windows.Markup.IComponentConnector {
|
||||||
|
|
||||||
|
|
||||||
#line 44 "..\..\..\..\Views\DashboardWindow.xaml"
|
|
||||||
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
|
|
||||||
internal System.Windows.Controls.Grid TopBarGrid;
|
|
||||||
|
|
||||||
#line default
|
|
||||||
#line hidden
|
|
||||||
|
|
||||||
private bool _contentLoaded;
|
private bool _contentLoaded;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -85,12 +75,6 @@ namespace Server_Dashboard.Views {
|
|||||||
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")]
|
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")]
|
||||||
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")]
|
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")]
|
||||||
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
|
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
|
||||||
switch (connectionId)
|
|
||||||
{
|
|
||||||
case 1:
|
|
||||||
this.TopBarGrid = ((System.Windows.Controls.Grid)(target));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this._contentLoaded = true;
|
this._contentLoaded = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Binary file not shown.
@@ -1,4 +1,4 @@
|
|||||||
#pragma checksum "..\..\..\..\..\Views\Pages\MainDashboardPage.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "47F667437FD33C591010E2D8FB596082CE45DAC4"
|
#pragma checksum "..\..\..\..\..\Views\Pages\MainDashboardPage.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "17174C7675263D17294DBE843DB6C895C1BCC3FF"
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// <auto-generated>
|
// <auto-generated>
|
||||||
// This code was generated by a tool.
|
// This code was generated by a tool.
|
||||||
@@ -9,15 +9,7 @@
|
|||||||
// </auto-generated>
|
// </auto-generated>
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
using Microsoft.Xaml.Behaviors;
|
|
||||||
using Microsoft.Xaml.Behaviors.Core;
|
|
||||||
using Microsoft.Xaml.Behaviors.Input;
|
|
||||||
using Microsoft.Xaml.Behaviors.Layout;
|
|
||||||
using Microsoft.Xaml.Behaviors.Media;
|
|
||||||
using Server_Dashboard;
|
|
||||||
using Server_Dashboard.Controls.ServerModules;
|
using Server_Dashboard.Controls.ServerModules;
|
||||||
using Server_Dashboard.Views.DashboardPages;
|
|
||||||
using Server_Dashboard.Views.DashboardPages.ModuleCRUD;
|
|
||||||
using System;
|
using System;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
@@ -49,30 +41,6 @@ namespace Server_Dashboard.Views.DashboardPages {
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class MainDashboardPage : System.Windows.Controls.UserControl, System.Windows.Markup.IComponentConnector {
|
public partial class MainDashboardPage : System.Windows.Controls.UserControl, System.Windows.Markup.IComponentConnector {
|
||||||
|
|
||||||
|
|
||||||
#line 30 "..\..\..\..\..\Views\Pages\MainDashboardPage.xaml"
|
|
||||||
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
|
|
||||||
internal System.Windows.Controls.Button CreateModule;
|
|
||||||
|
|
||||||
#line default
|
|
||||||
#line hidden
|
|
||||||
|
|
||||||
|
|
||||||
#line 31 "..\..\..\..\..\Views\Pages\MainDashboardPage.xaml"
|
|
||||||
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
|
|
||||||
internal System.Windows.Controls.Button RemoveModule;
|
|
||||||
|
|
||||||
#line default
|
|
||||||
#line hidden
|
|
||||||
|
|
||||||
|
|
||||||
#line 32 "..\..\..\..\..\Views\Pages\MainDashboardPage.xaml"
|
|
||||||
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
|
|
||||||
internal System.Windows.Controls.Button ChangeModule;
|
|
||||||
|
|
||||||
#line default
|
|
||||||
#line hidden
|
|
||||||
|
|
||||||
private bool _contentLoaded;
|
private bool _contentLoaded;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -101,18 +69,6 @@ namespace Server_Dashboard.Views.DashboardPages {
|
|||||||
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")]
|
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")]
|
||||||
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")]
|
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")]
|
||||||
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
|
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
|
||||||
switch (connectionId)
|
|
||||||
{
|
|
||||||
case 1:
|
|
||||||
this.CreateModule = ((System.Windows.Controls.Button)(target));
|
|
||||||
return;
|
|
||||||
case 2:
|
|
||||||
this.RemoveModule = ((System.Windows.Controls.Button)(target));
|
|
||||||
return;
|
|
||||||
case 3:
|
|
||||||
this.ChangeModule = ((System.Windows.Controls.Button)(target));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this._contentLoaded = true;
|
this._contentLoaded = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#pragma checksum "..\..\..\..\..\Views\Pages\MainDashboardPage.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "47F667437FD33C591010E2D8FB596082CE45DAC4"
|
#pragma checksum "..\..\..\..\..\Views\Pages\MainDashboardPage.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "17174C7675263D17294DBE843DB6C895C1BCC3FF"
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// <auto-generated>
|
// <auto-generated>
|
||||||
// This code was generated by a tool.
|
// This code was generated by a tool.
|
||||||
@@ -9,15 +9,7 @@
|
|||||||
// </auto-generated>
|
// </auto-generated>
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
using Microsoft.Xaml.Behaviors;
|
|
||||||
using Microsoft.Xaml.Behaviors.Core;
|
|
||||||
using Microsoft.Xaml.Behaviors.Input;
|
|
||||||
using Microsoft.Xaml.Behaviors.Layout;
|
|
||||||
using Microsoft.Xaml.Behaviors.Media;
|
|
||||||
using Server_Dashboard;
|
|
||||||
using Server_Dashboard.Controls.ServerModules;
|
using Server_Dashboard.Controls.ServerModules;
|
||||||
using Server_Dashboard.Views.DashboardPages;
|
|
||||||
using Server_Dashboard.Views.DashboardPages.ModuleCRUD;
|
|
||||||
using System;
|
using System;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
@@ -49,30 +41,6 @@ namespace Server_Dashboard.Views.DashboardPages {
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class MainDashboardPage : System.Windows.Controls.UserControl, System.Windows.Markup.IComponentConnector {
|
public partial class MainDashboardPage : System.Windows.Controls.UserControl, System.Windows.Markup.IComponentConnector {
|
||||||
|
|
||||||
|
|
||||||
#line 30 "..\..\..\..\..\Views\Pages\MainDashboardPage.xaml"
|
|
||||||
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
|
|
||||||
internal System.Windows.Controls.Button CreateModule;
|
|
||||||
|
|
||||||
#line default
|
|
||||||
#line hidden
|
|
||||||
|
|
||||||
|
|
||||||
#line 31 "..\..\..\..\..\Views\Pages\MainDashboardPage.xaml"
|
|
||||||
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
|
|
||||||
internal System.Windows.Controls.Button RemoveModule;
|
|
||||||
|
|
||||||
#line default
|
|
||||||
#line hidden
|
|
||||||
|
|
||||||
|
|
||||||
#line 32 "..\..\..\..\..\Views\Pages\MainDashboardPage.xaml"
|
|
||||||
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
|
|
||||||
internal System.Windows.Controls.Button ChangeModule;
|
|
||||||
|
|
||||||
#line default
|
|
||||||
#line hidden
|
|
||||||
|
|
||||||
private bool _contentLoaded;
|
private bool _contentLoaded;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -101,18 +69,6 @@ namespace Server_Dashboard.Views.DashboardPages {
|
|||||||
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")]
|
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")]
|
||||||
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")]
|
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")]
|
||||||
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
|
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
|
||||||
switch (connectionId)
|
|
||||||
{
|
|
||||||
case 1:
|
|
||||||
this.CreateModule = ((System.Windows.Controls.Button)(target));
|
|
||||||
return;
|
|
||||||
case 2:
|
|
||||||
this.RemoveModule = ((System.Windows.Controls.Button)(target));
|
|
||||||
return;
|
|
||||||
case 3:
|
|
||||||
this.ChangeModule = ((System.Windows.Controls.Button)(target));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this._contentLoaded = true;
|
this._contentLoaded = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user