small code refactoring
This commit is contained in:
@@ -1,76 +1,74 @@
|
||||
using System;
|
||||
using Microsoft.VisualBasic.CompilerServices;
|
||||
using Telerik.WinControls.UI;
|
||||
|
||||
namespace Pilz.Updating.Administration.GUI
|
||||
namespace Pilz.Updating.Administration.GUI;
|
||||
|
||||
public partial class ApplicationVersionInput
|
||||
{
|
||||
public partial class ApplicationVersionInput
|
||||
|
||||
// C o n s t r u c t o r s
|
||||
|
||||
public ApplicationVersionInput()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
// C o n s t r u c t o r s
|
||||
// Init Channel-ComboBox
|
||||
radDropDownList_Channel.Items.Add(new RadListDataItem() { Text = My.Resources.UpdatingAdministrationLangRes.Channel_Stable, Tag = Channels.Stable });
|
||||
radDropDownList_Channel.Items.Add(new RadListDataItem() { Text = My.Resources.UpdatingAdministrationLangRes.Channel_PreRelease, Tag = Channels.PreRelease });
|
||||
radDropDownList_Channel.Items.Add(new RadListDataItem() { Text = My.Resources.UpdatingAdministrationLangRes.Channel_Beta, Tag = Channels.Beta });
|
||||
radDropDownList_Channel.Items.Add(new RadListDataItem() { Text = My.Resources.UpdatingAdministrationLangRes.Channel_Alpha, Tag = Channels.Alpha });
|
||||
radDropDownList_Channel.SelectedIndex = 0;
|
||||
}
|
||||
|
||||
public ApplicationVersionInput()
|
||||
// P r o p e r t i e s
|
||||
|
||||
public Version Version
|
||||
{
|
||||
get
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
// Init Channel-ComboBox
|
||||
radDropDownList_Channel.Items.Add(new RadListDataItem() { Text = My.Resources.UpdatingAdministrationLangRes.Channel_Stable, Tag = Channels.Stable });
|
||||
radDropDownList_Channel.Items.Add(new RadListDataItem() { Text = My.Resources.UpdatingAdministrationLangRes.Channel_PreRelease, Tag = Channels.PreRelease });
|
||||
radDropDownList_Channel.Items.Add(new RadListDataItem() { Text = My.Resources.UpdatingAdministrationLangRes.Channel_Beta, Tag = Channels.Beta });
|
||||
radDropDownList_Channel.Items.Add(new RadListDataItem() { Text = My.Resources.UpdatingAdministrationLangRes.Channel_Alpha, Tag = Channels.Alpha });
|
||||
radDropDownList_Channel.SelectedIndex = 0;
|
||||
return new Version(radTextBoxControl_Version.Text.Trim());
|
||||
}
|
||||
|
||||
// P r o p e r t i e s
|
||||
|
||||
public Version Version
|
||||
set
|
||||
{
|
||||
get
|
||||
{
|
||||
return new Version(radTextBoxControl_Version.Text.Trim());
|
||||
}
|
||||
radTextBoxControl_Version.Text = value.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
radTextBoxControl_Version.Text = value.ToString();
|
||||
}
|
||||
public Channels Channel
|
||||
{
|
||||
get
|
||||
{
|
||||
return (Channels)radDropDownList_Channel.SelectedItem.Tag;
|
||||
}
|
||||
|
||||
public Channels Channel
|
||||
set
|
||||
{
|
||||
get
|
||||
foreach (var ci in radDropDownList_Channel.Items)
|
||||
{
|
||||
return (Channels)radDropDownList_Channel.SelectedItem.Tag;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
foreach (var ci in radDropDownList_Channel.Items)
|
||||
if ((Channels)ci.Tag == value)
|
||||
{
|
||||
if ((Channels)ci.Tag == value)
|
||||
{
|
||||
radDropDownList_Channel.SelectedItem = ci;
|
||||
}
|
||||
radDropDownList_Channel.SelectedItem = ci;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public int Build
|
||||
public int Build
|
||||
{
|
||||
get
|
||||
{
|
||||
get
|
||||
{
|
||||
return (int)Math.Round(radSpinEditor_Build.Value);
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
radSpinEditor_Build.Value = value;
|
||||
}
|
||||
return (int)Math.Round(radSpinEditor_Build.Value);
|
||||
}
|
||||
|
||||
private void radButton_Accept_Click(object sender, EventArgs e)
|
||||
set
|
||||
{
|
||||
|
||||
radSpinEditor_Build.Value = value;
|
||||
}
|
||||
}
|
||||
|
||||
private void radButton_Accept_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,70 +1,63 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using Pilz.Updating.Administration.Discord;
|
||||
using System;
|
||||
using Telerik.WinControls.UI;
|
||||
|
||||
namespace Pilz.Updating.Administration.GUI
|
||||
namespace Pilz.Updating.Administration.GUI;
|
||||
|
||||
public partial class DiscordBotSettingsWindow : RadForm
|
||||
{
|
||||
public partial class DiscordBotSettingsWindow : RadForm
|
||||
private readonly DiscordBotConfig config = null;
|
||||
private Channels currentChannel = Channels.Stable;
|
||||
private readonly bool hasInit = false;
|
||||
|
||||
public DiscordBotSettingsWindow(DiscordBotConfig config)
|
||||
{
|
||||
private readonly DiscordBotConfig config = null;
|
||||
private Channels currentChannel = Channels.Stable;
|
||||
private readonly bool hasInit = false;
|
||||
this.config = config;
|
||||
|
||||
public DiscordBotSettingsWindow(DiscordBotConfig config)
|
||||
{
|
||||
this.config = config;
|
||||
InitializeComponent();
|
||||
|
||||
InitializeComponent();
|
||||
foreach (var value in Enum.GetValues<Channels>())
|
||||
radDropDownList_PresetChannel.Items.Add(new RadListDataItem(Enum.GetName(value), value));
|
||||
radDropDownList_PresetChannel.SelectedValue = Channels.Stable;
|
||||
|
||||
foreach (var value in Enum.GetValues<Channels>())
|
||||
radDropDownList_PresetChannel.Items.Add(new RadListDataItem(Enum.GetName(value), value));
|
||||
radDropDownList_PresetChannel.SelectedValue = Channels.Stable;
|
||||
radTextBoxControl_BotToken.Text = config.DiscordBotToken;
|
||||
radTextBoxControl_DefaultProgramName.Text = config.DefaultAppName;
|
||||
ShowDefaultMessage();
|
||||
radToggleSwitch_UseProxy.Value = config.UseProxy;
|
||||
|
||||
radTextBoxControl_BotToken.Text = config.DiscordBotToken;
|
||||
radTextBoxControl_DefaultProgramName.Text = config.DefaultAppName;
|
||||
ShowDefaultMessage();
|
||||
radToggleSwitch_UseProxy.Value = config.UseProxy;
|
||||
hasInit = true;
|
||||
}
|
||||
|
||||
hasInit = true;
|
||||
}
|
||||
private Channels GetCurrentChannel()
|
||||
{
|
||||
return radDropDownList_PresetChannel?.SelectedValue as Channels? ?? Channels.Stable;
|
||||
}
|
||||
|
||||
private Channels GetCurrentChannel()
|
||||
{
|
||||
return radDropDownList_PresetChannel?.SelectedValue as Channels? ?? Channels.Stable;
|
||||
}
|
||||
private void ShowDefaultMessage()
|
||||
{
|
||||
radTextBox_DefaultMessage.Text = config.DefaultUpdateMessages[currentChannel];
|
||||
}
|
||||
|
||||
private void ShowDefaultMessage()
|
||||
{
|
||||
radTextBox_DefaultMessage.Text = config.DefaultUpdateMessages[currentChannel];
|
||||
}
|
||||
private void SaveDefaultMessage()
|
||||
{
|
||||
config.DefaultUpdateMessages[currentChannel] = radTextBox_DefaultMessage.Text.Trim();
|
||||
}
|
||||
|
||||
private void SaveDefaultMessage()
|
||||
{
|
||||
config.DefaultUpdateMessages[currentChannel] = radTextBox_DefaultMessage.Text.Trim();
|
||||
}
|
||||
private void ButtonX_Okay_Click(object sender, EventArgs e)
|
||||
{
|
||||
SaveDefaultMessage();
|
||||
config.DefaultAppName = radTextBoxControl_DefaultProgramName.Text.Trim();
|
||||
config.DiscordBotToken = radTextBoxControl_BotToken.Text.Trim();
|
||||
config.UseProxy = radToggleSwitch_UseProxy.Value;
|
||||
}
|
||||
|
||||
private void ButtonX_Okay_Click(object sender, EventArgs e)
|
||||
{
|
||||
private void radDropDownList_PresetChannel_SelectedValueChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (hasInit)
|
||||
SaveDefaultMessage();
|
||||
config.DefaultAppName = radTextBoxControl_DefaultProgramName.Text.Trim();
|
||||
config.DiscordBotToken = radTextBoxControl_BotToken.Text.Trim();
|
||||
config.UseProxy = radToggleSwitch_UseProxy.Value;
|
||||
}
|
||||
|
||||
private void radDropDownList_PresetChannel_SelectedValueChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (hasInit)
|
||||
SaveDefaultMessage();
|
||||
currentChannel = radDropDownList_PresetChannel?.SelectedValue as Channels? ?? Channels.Stable;
|
||||
|
||||
currentChannel = radDropDownList_PresetChannel?.SelectedValue as Channels? ?? Channels.Stable;
|
||||
|
||||
ShowDefaultMessage();
|
||||
}
|
||||
ShowDefaultMessage();
|
||||
}
|
||||
}
|
||||
@@ -1,91 +1,85 @@
|
||||
using Pilz.Updating.Administration.Discord;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using Telerik.WinControls;
|
||||
using Telerik.WinControls.UI;
|
||||
|
||||
namespace Pilz.Updating.Administration.GUI
|
||||
namespace Pilz.Updating.Administration.GUI;
|
||||
|
||||
public partial class DiscordPostDialog : RadForm
|
||||
{
|
||||
public partial class DiscordPostDialog : RadForm
|
||||
// F i e l d s
|
||||
|
||||
private readonly DiscordBot bot;
|
||||
private readonly UpdatePackageInfo package;
|
||||
|
||||
// C o n s t r u c t o r
|
||||
|
||||
public DiscordPostDialog(DiscordBot bot, UpdatePackageInfo package)
|
||||
{
|
||||
// F i e l d s
|
||||
this.bot = bot;
|
||||
this.package = package;
|
||||
|
||||
private readonly DiscordBot bot;
|
||||
private readonly UpdatePackageInfo package;
|
||||
InitializeComponent();
|
||||
|
||||
// C o n s t r u c t o r
|
||||
radTextBoxControl_ProgramName.Text = General.CurProject.DiscordBotConfig.DefaultAppName;
|
||||
radTextBox_Message.Text = General.CurProject.DiscordBotConfig.DefaultUpdateMessages[package.Version.Channel];
|
||||
|
||||
public DiscordPostDialog(DiscordBot bot, UpdatePackageInfo package)
|
||||
LoadBgrTree();
|
||||
}
|
||||
|
||||
private void LoadBgrTree()
|
||||
{
|
||||
radTreeView_Channels.BeginUpdate();
|
||||
radTreeView_Channels.Nodes.Clear();
|
||||
|
||||
foreach (var guild in bot.GetGuilds())
|
||||
{
|
||||
this.bot = bot;
|
||||
this.package = package;
|
||||
|
||||
InitializeComponent();
|
||||
|
||||
radTextBoxControl_ProgramName.Text = General.CurProject.DiscordBotConfig.DefaultAppName;
|
||||
radTextBox_Message.Text = General.CurProject.DiscordBotConfig.DefaultUpdateMessages[package.Version.Channel];
|
||||
|
||||
LoadBgrTree();
|
||||
}
|
||||
|
||||
private void LoadBgrTree()
|
||||
{
|
||||
radTreeView_Channels.BeginUpdate();
|
||||
radTreeView_Channels.Nodes.Clear();
|
||||
|
||||
foreach (var guild in bot.GetGuilds())
|
||||
var nGuild = new RadTreeNode()
|
||||
{
|
||||
var nGuild = new RadTreeNode()
|
||||
Name = "g" + guild.Key,
|
||||
Text = guild.Value,
|
||||
Tag = guild.Key,
|
||||
Expanded = true
|
||||
};
|
||||
|
||||
foreach (var channel in bot.GetTextChannels(guild.Key).OrderBy((n) => n.Value))
|
||||
{
|
||||
var nChannel = new RadTreeNode()
|
||||
{
|
||||
Name = "g" + guild.Key,
|
||||
Text = guild.Value,
|
||||
Tag = guild.Key,
|
||||
Expanded = true
|
||||
Name = "c" + channel.Key,
|
||||
Text = "#" + channel.Value,
|
||||
Tag = channel.Key
|
||||
};
|
||||
|
||||
foreach (var channel in bot.GetTextChannels(guild.Key).OrderBy((n) => n.Value))
|
||||
{
|
||||
var nChannel = new RadTreeNode()
|
||||
{
|
||||
Name = "c" + channel.Key,
|
||||
Text = "#" + channel.Value,
|
||||
Tag = channel.Key
|
||||
};
|
||||
|
||||
nGuild.Nodes.Add(nChannel);
|
||||
}
|
||||
|
||||
radTreeView_Channels.Nodes.Add(nGuild);
|
||||
nGuild.Nodes.Add(nChannel);
|
||||
}
|
||||
|
||||
radTreeView_Channels.EndUpdate();
|
||||
radTreeView_Channels.Nodes.Add(nGuild);
|
||||
}
|
||||
|
||||
private async void ButtonX_SendMsg_Click(object sender, EventArgs e)
|
||||
radTreeView_Channels.EndUpdate();
|
||||
}
|
||||
|
||||
private async void ButtonX_SendMsg_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
try
|
||||
{
|
||||
var selNode = radTreeView_Channels.SelectedNode;
|
||||
ulong gID = (ulong)selNode.Parent.Tag;
|
||||
ulong cID = (ulong)selNode.Tag;
|
||||
var msg = radTextBox_Message.Text;
|
||||
var selNode = radTreeView_Channels.SelectedNode;
|
||||
ulong gID = (ulong)selNode.Parent.Tag;
|
||||
ulong cID = (ulong)selNode.Tag;
|
||||
var msg = radTextBox_Message.Text;
|
||||
|
||||
await bot.SendUpdateNotification(package, gID, cID, radTextBoxControl_ProgramName.Text, msg, radCheckBox_AttachDescription.Checked, radCheckBoxPingAtEveryone.Checked);
|
||||
await bot.SendUpdateNotification(package, gID, cID, radTextBoxControl_ProgramName.Text, msg, radCheckBox_AttachDescription.Checked, radCheckBoxPingAtEveryone.Checked);
|
||||
|
||||
RadMessageBox.Show(this, "Nachricht erfolgreich gesendet.", string.Empty, MessageBoxButtons.OK, RadMessageIcon.Info);
|
||||
DialogResult = DialogResult.OK;
|
||||
}
|
||||
catch(Exception)
|
||||
{
|
||||
RadMessageBox.Show(this, "Fehler beim Senden der Nachricht.", string.Empty, MessageBoxButtons.OK, RadMessageIcon.Error);
|
||||
}
|
||||
RadMessageBox.Show(this, "Nachricht erfolgreich gesendet.", string.Empty, MessageBoxButtons.OK, RadMessageIcon.Info);
|
||||
DialogResult = DialogResult.OK;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
RadMessageBox.Show(this, "Fehler beim Senden der Nachricht.", string.Empty, MessageBoxButtons.OK, RadMessageIcon.Error);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,35 +1,28 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.IO;
|
||||
using System.Net;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Pilz.Updating.Administration.GUI
|
||||
namespace Pilz.Updating.Administration.GUI;
|
||||
|
||||
public static class General
|
||||
{
|
||||
public static class General
|
||||
private static string myAppPath = string.Empty;
|
||||
public static UpdateProject CurProject { get; set; } = null;
|
||||
|
||||
public static string MyAppPath
|
||||
{
|
||||
private static string myAppPath = string.Empty;
|
||||
public static UpdateProject CurProject { get; set; } = null;
|
||||
|
||||
public static string MyAppPath
|
||||
get
|
||||
{
|
||||
get
|
||||
{
|
||||
if (string.IsNullOrEmpty(myAppPath))
|
||||
Path.GetDirectoryName(IO.Extensions.GetExecutablePath());
|
||||
return myAppPath;
|
||||
}
|
||||
}
|
||||
|
||||
public static void SetProxyConfig()
|
||||
{
|
||||
if (CurProject.ProxyConfig.UseProxyAuth)
|
||||
WebRequest.DefaultWebProxy.Credentials = new NetworkCredential(CurProject.ProxyConfig.Username, CurProject.ProxyConfig.Password);
|
||||
else
|
||||
WebRequest.DefaultWebProxy.Credentials = null;
|
||||
if (string.IsNullOrEmpty(myAppPath))
|
||||
Path.GetDirectoryName(IO.Extensions.GetExecutablePath());
|
||||
return myAppPath;
|
||||
}
|
||||
}
|
||||
|
||||
public static void SetProxyConfig()
|
||||
{
|
||||
if (CurProject.ProxyConfig.UseProxyAuth)
|
||||
WebRequest.DefaultWebProxy.Credentials = new NetworkCredential(CurProject.ProxyConfig.Username, CurProject.ProxyConfig.Password);
|
||||
else
|
||||
WebRequest.DefaultWebProxy.Credentials = null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,38 +0,0 @@
|
||||
// ------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// Dieser Code wurde von einem Tool generiert.
|
||||
// Laufzeitversion:4.0.30319.42000
|
||||
//
|
||||
// Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn
|
||||
// der Code erneut generiert wird.
|
||||
// </auto-generated>
|
||||
// ------------------------------------------------------------------------------
|
||||
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace Pilz.Updating.Administration.GUI.My
|
||||
{
|
||||
|
||||
// HINWEIS: Diese Datei wird automatisch generiert und darf nicht direkt bearbeitet werden. Wenn Sie Änderungen vornehmen möchten
|
||||
// oder in dieser Datei Buildfehler auftreten, wechseln Sie zum Projekt-Designer.
|
||||
// (Wechseln Sie dazu zu den Projekteigenschaften, oder doppelklicken Sie auf den Knoten "Mein Projekt" im
|
||||
// Projektmappen-Explorer). Nehmen Sie auf der Registerkarte "Anwendung" entsprechende Änderungen vor.
|
||||
//
|
||||
internal partial class MyApplication
|
||||
{
|
||||
[DebuggerStepThrough()]
|
||||
public MyApplication() : base(Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows)
|
||||
{
|
||||
IsSingleInstance = false;
|
||||
EnableVisualStyles = true;
|
||||
SaveMySettingsOnExit = true;
|
||||
ShutdownStyle = Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterAllFormsClose;
|
||||
}
|
||||
|
||||
[DebuggerStepThrough()]
|
||||
protected override void OnCreateMainForm()
|
||||
{
|
||||
MainForm = MyProject.Forms.UpdateManagerWindow;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<MyApplicationData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
|
||||
<MySubMain>true</MySubMain>
|
||||
<MainForm>ToolSelectionWindow</MainForm>
|
||||
<SingleInstance>false</SingleInstance>
|
||||
<ShutdownMode>1</ShutdownMode>
|
||||
<EnableVisualStyles>true</EnableVisualStyles>
|
||||
<AuthenticationMode>0</AuthenticationMode>
|
||||
<SaveMySettingsOnExit>true</SaveMySettingsOnExit>
|
||||
</MyApplicationData>
|
||||
@@ -1,81 +0,0 @@
|
||||
using global::System;
|
||||
using global::System.ComponentModel;
|
||||
using global::System.Diagnostics;
|
||||
|
||||
namespace Pilz.Updating.Administration.GUI.My
|
||||
{
|
||||
internal static partial class MyProject
|
||||
{
|
||||
internal partial class MyForms
|
||||
{
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public ApplicationVersionInput m_ApplicationVersionInput;
|
||||
|
||||
public ApplicationVersionInput ApplicationVersionInput
|
||||
{
|
||||
[DebuggerHidden]
|
||||
get
|
||||
{
|
||||
m_ApplicationVersionInput = MyForms.Create__Instance__(m_ApplicationVersionInput);
|
||||
return m_ApplicationVersionInput;
|
||||
}
|
||||
|
||||
[DebuggerHidden]
|
||||
set
|
||||
{
|
||||
if (value == m_ApplicationVersionInput)
|
||||
return;
|
||||
if (value is object)
|
||||
throw new ArgumentException("Property can only be set to Nothing");
|
||||
Dispose__Instance__(ref m_ApplicationVersionInput);
|
||||
}
|
||||
}
|
||||
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public UpdateManagerWindow m_UpdateManagerWindow;
|
||||
|
||||
public UpdateManagerWindow UpdateManagerWindow
|
||||
{
|
||||
[DebuggerHidden]
|
||||
get
|
||||
{
|
||||
m_UpdateManagerWindow = MyForms.Create__Instance__(m_UpdateManagerWindow);
|
||||
return m_UpdateManagerWindow;
|
||||
}
|
||||
|
||||
[DebuggerHidden]
|
||||
set
|
||||
{
|
||||
if (value == m_UpdateManagerWindow)
|
||||
return;
|
||||
if (value is object)
|
||||
throw new ArgumentException("Property can only be set to Nothing");
|
||||
Dispose__Instance__(ref m_UpdateManagerWindow);
|
||||
}
|
||||
}
|
||||
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public UpdateServerInfoEditor m_UpdateServerInfoEditor;
|
||||
|
||||
public UpdateServerInfoEditor UpdateServerInfoEditor
|
||||
{
|
||||
[DebuggerHidden]
|
||||
get
|
||||
{
|
||||
m_UpdateServerInfoEditor = MyForms.Create__Instance__(m_UpdateServerInfoEditor);
|
||||
return m_UpdateServerInfoEditor;
|
||||
}
|
||||
|
||||
[DebuggerHidden]
|
||||
set
|
||||
{
|
||||
if (value == m_UpdateServerInfoEditor)
|
||||
return;
|
||||
if (value is object)
|
||||
throw new ArgumentException("Property can only be set to Nothing");
|
||||
Dispose__Instance__(ref m_UpdateServerInfoEditor);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,305 +0,0 @@
|
||||
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Diagnostics;
|
||||
using System.Windows.Forms;
|
||||
using Microsoft.VisualBasic;
|
||||
|
||||
/* TODO ERROR: Skipped IfDirectiveTrivia *//* TODO ERROR: Skipped DisabledTextTrivia *//* TODO ERROR: Skipped EndIfDirectiveTrivia */
|
||||
/* TODO ERROR: Skipped IfDirectiveTrivia */
|
||||
/* TODO ERROR: Skipped DefineDirectiveTrivia *//* TODO ERROR: Skipped DefineDirectiveTrivia *//* TODO ERROR: Skipped DefineDirectiveTrivia *//* TODO ERROR: Skipped DefineDirectiveTrivia *//* TODO ERROR: Skipped DefineDirectiveTrivia */
|
||||
/* TODO ERROR: Skipped ElifDirectiveTrivia *//* TODO ERROR: Skipped DisabledTextTrivia *//* TODO ERROR: Skipped ElifDirectiveTrivia *//* TODO ERROR: Skipped DisabledTextTrivia *//* TODO ERROR: Skipped ElifDirectiveTrivia *//* TODO ERROR: Skipped DisabledTextTrivia *//* TODO ERROR: Skipped ElifDirectiveTrivia *//* TODO ERROR: Skipped DisabledTextTrivia *//* TODO ERROR: Skipped ElifDirectiveTrivia *//* TODO ERROR: Skipped DisabledTextTrivia *//* TODO ERROR: Skipped ElifDirectiveTrivia *//* TODO ERROR: Skipped DisabledTextTrivia *//* TODO ERROR: Skipped ElifDirectiveTrivia *//* TODO ERROR: Skipped DisabledTextTrivia *//* TODO ERROR: Skipped EndIfDirectiveTrivia */
|
||||
/* TODO ERROR: Skipped IfDirectiveTrivia */
|
||||
namespace Pilz.Updating.Administration.GUI.My
|
||||
{
|
||||
|
||||
/* TODO ERROR: Skipped IfDirectiveTrivia */
|
||||
[System.CodeDom.Compiler.GeneratedCode("MyTemplate", "11.0.0.0")]
|
||||
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
|
||||
|
||||
/* TODO ERROR: Skipped IfDirectiveTrivia */
|
||||
internal partial class MyApplication : Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase
|
||||
{
|
||||
/* TODO ERROR: Skipped IfDirectiveTrivia */
|
||||
[STAThread()]
|
||||
[DebuggerHidden()]
|
||||
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static void Main(string[] Args)
|
||||
{
|
||||
try
|
||||
{
|
||||
Application.SetCompatibleTextRenderingDefault(UseCompatibleTextRendering);
|
||||
}
|
||||
finally
|
||||
{
|
||||
}
|
||||
|
||||
MyProject.Application.Run(Args);
|
||||
}
|
||||
/* TODO ERROR: Skipped EndIfDirectiveTrivia */
|
||||
/* TODO ERROR: Skipped ElifDirectiveTrivia *//* TODO ERROR: Skipped DisabledTextTrivia *//* TODO ERROR: Skipped ElifDirectiveTrivia *//* TODO ERROR: Skipped DisabledTextTrivia *//* TODO ERROR: Skipped EndIfDirectiveTrivia */
|
||||
}
|
||||
|
||||
/* TODO ERROR: Skipped EndIfDirectiveTrivia */
|
||||
/* TODO ERROR: Skipped IfDirectiveTrivia */
|
||||
[System.CodeDom.Compiler.GeneratedCode("MyTemplate", "11.0.0.0")]
|
||||
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
|
||||
|
||||
/* TODO ERROR: Skipped IfDirectiveTrivia */
|
||||
internal partial class MyComputer : Microsoft.VisualBasic.Devices.Computer
|
||||
{
|
||||
/* TODO ERROR: Skipped ElifDirectiveTrivia *//* TODO ERROR: Skipped DisabledTextTrivia *//* TODO ERROR: Skipped EndIfDirectiveTrivia */
|
||||
[DebuggerHidden()]
|
||||
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
|
||||
public MyComputer() : base()
|
||||
{
|
||||
}
|
||||
}
|
||||
/* TODO ERROR: Skipped EndIfDirectiveTrivia */
|
||||
[HideModuleName()]
|
||||
[System.CodeDom.Compiler.GeneratedCode("MyTemplate", "11.0.0.0")]
|
||||
internal static partial class MyProject
|
||||
{
|
||||
|
||||
/* TODO ERROR: Skipped IfDirectiveTrivia */
|
||||
[System.ComponentModel.Design.HelpKeyword("My.Computer")]
|
||||
internal static MyComputer Computer
|
||||
{
|
||||
[DebuggerHidden()]
|
||||
get
|
||||
{
|
||||
return m_ComputerObjectProvider.GetInstance;
|
||||
}
|
||||
}
|
||||
|
||||
private readonly static ThreadSafeObjectProvider<MyComputer> m_ComputerObjectProvider = new ThreadSafeObjectProvider<MyComputer>();
|
||||
/* TODO ERROR: Skipped EndIfDirectiveTrivia */
|
||||
/* TODO ERROR: Skipped IfDirectiveTrivia */
|
||||
[System.ComponentModel.Design.HelpKeyword("My.Application")]
|
||||
internal static MyApplication Application
|
||||
{
|
||||
[DebuggerHidden()]
|
||||
get
|
||||
{
|
||||
return m_AppObjectProvider.GetInstance;
|
||||
}
|
||||
}
|
||||
|
||||
private readonly static ThreadSafeObjectProvider<MyApplication> m_AppObjectProvider = new ThreadSafeObjectProvider<MyApplication>();
|
||||
/* TODO ERROR: Skipped EndIfDirectiveTrivia */
|
||||
/* TODO ERROR: Skipped IfDirectiveTrivia */
|
||||
[System.ComponentModel.Design.HelpKeyword("My.User")]
|
||||
internal static Microsoft.VisualBasic.ApplicationServices.User User
|
||||
{
|
||||
[DebuggerHidden()]
|
||||
get
|
||||
{
|
||||
return m_UserObjectProvider.GetInstance;
|
||||
}
|
||||
}
|
||||
|
||||
private readonly static ThreadSafeObjectProvider<Microsoft.VisualBasic.ApplicationServices.User> m_UserObjectProvider = new ThreadSafeObjectProvider<Microsoft.VisualBasic.ApplicationServices.User>();
|
||||
/* TODO ERROR: Skipped ElifDirectiveTrivia *//* TODO ERROR: Skipped DisabledTextTrivia *//* TODO ERROR: Skipped EndIfDirectiveTrivia */
|
||||
/* TODO ERROR: Skipped IfDirectiveTrivia */
|
||||
/* TODO ERROR: Skipped DefineDirectiveTrivia */
|
||||
[System.ComponentModel.Design.HelpKeyword("My.Forms")]
|
||||
internal static MyForms Forms
|
||||
{
|
||||
[DebuggerHidden()]
|
||||
get
|
||||
{
|
||||
return m_MyFormsObjectProvider.GetInstance;
|
||||
}
|
||||
}
|
||||
|
||||
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
|
||||
[MyGroupCollection("System.Windows.Forms.Form", "Create__Instance__", "Dispose__Instance__", "My.MyProject.Forms")]
|
||||
internal sealed partial class MyForms
|
||||
{
|
||||
[DebuggerHidden()]
|
||||
private static T Create__Instance__<T>(T Instance) where T : Form, new()
|
||||
{
|
||||
if (Instance is null || Instance.IsDisposed)
|
||||
{
|
||||
if (m_FormBeingCreated is object)
|
||||
{
|
||||
if (m_FormBeingCreated.ContainsKey(typeof(T)) == true)
|
||||
{
|
||||
throw new InvalidOperationException(Microsoft.VisualBasic.CompilerServices.Utils.GetResourceString("WinForms_RecursiveFormCreate"));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_FormBeingCreated = new Hashtable();
|
||||
}
|
||||
|
||||
m_FormBeingCreated.Add(typeof(T), null);
|
||||
try
|
||||
{
|
||||
return new T();
|
||||
}
|
||||
catch (System.Reflection.TargetInvocationException ex) when (ex.InnerException is object)
|
||||
{
|
||||
string BetterMessage = Microsoft.VisualBasic.CompilerServices.Utils.GetResourceString("WinForms_SeeInnerException", ex.InnerException.Message);
|
||||
throw new InvalidOperationException(BetterMessage, ex.InnerException);
|
||||
}
|
||||
finally
|
||||
{
|
||||
m_FormBeingCreated.Remove(typeof(T));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return Instance;
|
||||
}
|
||||
}
|
||||
|
||||
[DebuggerHidden()]
|
||||
private void Dispose__Instance__<T>(ref T instance) where T : Form
|
||||
{
|
||||
instance.Dispose();
|
||||
instance = null;
|
||||
}
|
||||
|
||||
[DebuggerHidden()]
|
||||
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
|
||||
public MyForms() : base()
|
||||
{
|
||||
}
|
||||
|
||||
[ThreadStatic()]
|
||||
private static Hashtable m_FormBeingCreated;
|
||||
|
||||
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
|
||||
public override bool Equals(object o)
|
||||
{
|
||||
return base.Equals(o);
|
||||
}
|
||||
|
||||
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return base.GetHashCode();
|
||||
}
|
||||
|
||||
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
|
||||
internal new Type GetType()
|
||||
{
|
||||
return typeof(MyForms);
|
||||
}
|
||||
|
||||
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
|
||||
public override string ToString()
|
||||
{
|
||||
return base.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
private static ThreadSafeObjectProvider<MyForms> m_MyFormsObjectProvider = new ThreadSafeObjectProvider<MyForms>();
|
||||
|
||||
/* TODO ERROR: Skipped EndIfDirectiveTrivia */
|
||||
/* TODO ERROR: Skipped IfDirectiveTrivia */
|
||||
[System.ComponentModel.Design.HelpKeyword("My.WebServices")]
|
||||
internal static MyWebServices WebServices
|
||||
{
|
||||
[DebuggerHidden()]
|
||||
get
|
||||
{
|
||||
return m_MyWebServicesObjectProvider.GetInstance;
|
||||
}
|
||||
}
|
||||
|
||||
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
|
||||
[MyGroupCollection("System.Web.Services.Protocols.SoapHttpClientProtocol", "Create__Instance__", "Dispose__Instance__", "")]
|
||||
internal sealed class MyWebServices
|
||||
{
|
||||
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
|
||||
[DebuggerHidden()]
|
||||
public override bool Equals(object o)
|
||||
{
|
||||
return base.Equals(o);
|
||||
}
|
||||
|
||||
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
|
||||
[DebuggerHidden()]
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return base.GetHashCode();
|
||||
}
|
||||
|
||||
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
|
||||
[DebuggerHidden()]
|
||||
internal new Type GetType()
|
||||
{
|
||||
return typeof(MyWebServices);
|
||||
}
|
||||
|
||||
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
|
||||
[DebuggerHidden()]
|
||||
public override string ToString()
|
||||
{
|
||||
return base.ToString();
|
||||
}
|
||||
|
||||
[DebuggerHidden()]
|
||||
private static T Create__Instance__<T>(T instance) where T : new()
|
||||
{
|
||||
if (instance == null)
|
||||
{
|
||||
return new T();
|
||||
}
|
||||
else
|
||||
{
|
||||
return instance;
|
||||
}
|
||||
}
|
||||
|
||||
[DebuggerHidden()]
|
||||
private void Dispose__Instance__<T>(ref T instance)
|
||||
{
|
||||
instance = default;
|
||||
}
|
||||
|
||||
[DebuggerHidden()]
|
||||
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
|
||||
public MyWebServices() : base()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
private readonly static ThreadSafeObjectProvider<MyWebServices> m_MyWebServicesObjectProvider = new ThreadSafeObjectProvider<MyWebServices>();
|
||||
/* TODO ERROR: Skipped EndIfDirectiveTrivia */
|
||||
/* TODO ERROR: Skipped IfDirectiveTrivia *//* TODO ERROR: Skipped DisabledTextTrivia *//* TODO ERROR: Skipped EndIfDirectiveTrivia */
|
||||
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
|
||||
[System.Runtime.InteropServices.ComVisible(false)]
|
||||
internal sealed class ThreadSafeObjectProvider<T> where T : new()
|
||||
{
|
||||
internal T GetInstance
|
||||
{
|
||||
/* TODO ERROR: Skipped IfDirectiveTrivia *//* TODO ERROR: Skipped DisabledTextTrivia *//* TODO ERROR: Skipped ElseDirectiveTrivia */
|
||||
[DebuggerHidden()]
|
||||
get
|
||||
{
|
||||
if (m_ThreadStaticValue == null)
|
||||
m_ThreadStaticValue = new T();
|
||||
return m_ThreadStaticValue;
|
||||
}
|
||||
/* TODO ERROR: Skipped EndIfDirectiveTrivia */
|
||||
}
|
||||
|
||||
[DebuggerHidden()]
|
||||
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
|
||||
public ThreadSafeObjectProvider() : base()
|
||||
{
|
||||
}
|
||||
|
||||
/* TODO ERROR: Skipped IfDirectiveTrivia *//* TODO ERROR: Skipped DisabledTextTrivia *//* TODO ERROR: Skipped ElseDirectiveTrivia */
|
||||
[System.Runtime.CompilerServices.CompilerGenerated()]
|
||||
[ThreadStatic()]
|
||||
private static T m_ThreadStaticValue;
|
||||
/* TODO ERROR: Skipped EndIfDirectiveTrivia */
|
||||
}
|
||||
}
|
||||
}
|
||||
/* TODO ERROR: Skipped EndIfDirectiveTrivia */
|
||||
@@ -1,253 +0,0 @@
|
||||
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
// See Compiler::LoadXmlSolutionExtension
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Xml.Linq;
|
||||
using Microsoft.VisualBasic;
|
||||
using Microsoft.VisualBasic.CompilerServices;
|
||||
|
||||
namespace Pilz.Updating.Administration.GUI.My
|
||||
{
|
||||
[Embedded()]
|
||||
[DebuggerNonUserCode()]
|
||||
[System.Runtime.CompilerServices.CompilerGenerated()]
|
||||
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
|
||||
internal sealed class InternalXmlHelper
|
||||
{
|
||||
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
|
||||
private InternalXmlHelper()
|
||||
{
|
||||
}
|
||||
|
||||
public static string get_Value(IEnumerable<XElement> source)
|
||||
{
|
||||
foreach (XElement item in source)
|
||||
return item.Value;
|
||||
return null;
|
||||
}
|
||||
|
||||
public static void set_Value(IEnumerable<XElement> source, string value)
|
||||
{
|
||||
foreach (XElement item in source)
|
||||
{
|
||||
item.Value = value;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public static string get_AttributeValue(IEnumerable<XElement> source, XName name)
|
||||
{
|
||||
foreach (XElement item in source)
|
||||
return Conversions.ToString(item.Attribute(name));
|
||||
return null;
|
||||
}
|
||||
|
||||
public static void set_AttributeValue(IEnumerable<XElement> source, XName name, string value)
|
||||
{
|
||||
foreach (XElement item in source)
|
||||
{
|
||||
item.SetAttributeValue(name, value);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public static string get_AttributeValue(XElement source, XName name)
|
||||
{
|
||||
return Conversions.ToString(source.Attribute(name));
|
||||
}
|
||||
|
||||
public static void set_AttributeValue(XElement source, XName name, string value)
|
||||
{
|
||||
source.SetAttributeValue(name, value);
|
||||
}
|
||||
|
||||
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
|
||||
public static XAttribute CreateAttribute(XName name, object value)
|
||||
{
|
||||
if (value is null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return new XAttribute(name, value);
|
||||
}
|
||||
|
||||
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
|
||||
public static XAttribute CreateNamespaceAttribute(XName name, XNamespace ns)
|
||||
{
|
||||
var a = new XAttribute(name, ns.NamespaceName);
|
||||
a.AddAnnotation(ns);
|
||||
return a;
|
||||
}
|
||||
|
||||
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
|
||||
public static object RemoveNamespaceAttributes(string[] inScopePrefixes, XNamespace[] inScopeNs, List<XAttribute> attributes, object obj)
|
||||
{
|
||||
if (obj is object)
|
||||
{
|
||||
XElement elem = obj as XElement;
|
||||
if (elem is object)
|
||||
{
|
||||
return RemoveNamespaceAttributes(inScopePrefixes, inScopeNs, attributes, elem);
|
||||
}
|
||||
else
|
||||
{
|
||||
IEnumerable elems = obj as IEnumerable;
|
||||
if (elems is object)
|
||||
{
|
||||
return RemoveNamespaceAttributes(inScopePrefixes, inScopeNs, attributes, elems);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
|
||||
public static IEnumerable RemoveNamespaceAttributes(string[] inScopePrefixes, XNamespace[] inScopeNs, List<XAttribute> attributes, IEnumerable obj)
|
||||
{
|
||||
if (obj is object)
|
||||
{
|
||||
IEnumerable<XElement> elems = obj as IEnumerable<XElement>;
|
||||
if (elems is object)
|
||||
{
|
||||
return elems.Select(new RemoveNamespaceAttributesClosure(inScopePrefixes, inScopeNs, attributes).ProcessXElement);
|
||||
}
|
||||
else
|
||||
{
|
||||
return obj.Cast<object>().Select(new RemoveNamespaceAttributesClosure(inScopePrefixes, inScopeNs, attributes).ProcessObject);
|
||||
}
|
||||
}
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
[DebuggerNonUserCode()]
|
||||
[System.Runtime.CompilerServices.CompilerGenerated()]
|
||||
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
|
||||
private sealed class RemoveNamespaceAttributesClosure
|
||||
{
|
||||
private readonly string[] m_inScopePrefixes;
|
||||
private readonly XNamespace[] m_inScopeNs;
|
||||
private readonly List<XAttribute> m_attributes;
|
||||
|
||||
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
|
||||
internal RemoveNamespaceAttributesClosure(string[] inScopePrefixes, XNamespace[] inScopeNs, List<XAttribute> attributes)
|
||||
{
|
||||
m_inScopePrefixes = inScopePrefixes;
|
||||
m_inScopeNs = inScopeNs;
|
||||
m_attributes = attributes;
|
||||
}
|
||||
|
||||
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
|
||||
internal XElement ProcessXElement(XElement elem)
|
||||
{
|
||||
return RemoveNamespaceAttributes(m_inScopePrefixes, m_inScopeNs, m_attributes, elem);
|
||||
}
|
||||
|
||||
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
|
||||
internal object ProcessObject(object obj)
|
||||
{
|
||||
XElement elem = obj as XElement;
|
||||
if (elem is object)
|
||||
{
|
||||
return RemoveNamespaceAttributes(m_inScopePrefixes, m_inScopeNs, m_attributes, elem);
|
||||
}
|
||||
else
|
||||
{
|
||||
return obj;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
|
||||
public static XElement RemoveNamespaceAttributes(string[] inScopePrefixes, XNamespace[] inScopeNs, List<XAttribute> attributes, XElement e)
|
||||
{
|
||||
if (e is object)
|
||||
{
|
||||
var a = e.FirstAttribute;
|
||||
while (a is object)
|
||||
{
|
||||
var nextA = a.NextAttribute;
|
||||
if (a.IsNamespaceDeclaration)
|
||||
{
|
||||
var ns = a.Annotation<XNamespace>();
|
||||
string prefix = a.Name.LocalName;
|
||||
if (ns is object)
|
||||
{
|
||||
if (inScopePrefixes is object && inScopeNs is object)
|
||||
{
|
||||
int lastIndex = inScopePrefixes.Length - 1;
|
||||
for (int i = 0, loopTo = lastIndex; i <= loopTo; i++)
|
||||
{
|
||||
string currentInScopePrefix = inScopePrefixes[i];
|
||||
var currentInScopeNs = inScopeNs[i];
|
||||
if (prefix.Equals(currentInScopePrefix))
|
||||
{
|
||||
if (ns == currentInScopeNs)
|
||||
{
|
||||
// prefix and namespace match. Remove the unneeded ns attribute
|
||||
a.Remove();
|
||||
}
|
||||
|
||||
// prefix is in scope but refers to something else. Leave the ns attribute.
|
||||
a = null;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (a is object)
|
||||
{
|
||||
// Prefix is not in scope
|
||||
// Now check whether it's going to be in scope because it is in the attributes list
|
||||
|
||||
if (attributes is object)
|
||||
{
|
||||
int lastIndex = attributes.Count - 1;
|
||||
for (int i = 0, loopTo1 = lastIndex; i <= loopTo1; i++)
|
||||
{
|
||||
var currentA = attributes[i];
|
||||
string currentInScopePrefix = currentA.Name.LocalName;
|
||||
var currentInScopeNs = currentA.Annotation<XNamespace>();
|
||||
if (currentInScopeNs is object)
|
||||
{
|
||||
if (prefix.Equals(currentInScopePrefix))
|
||||
{
|
||||
if (ns == currentInScopeNs)
|
||||
{
|
||||
// prefix and namespace match. Remove the unneeded ns attribute
|
||||
a.Remove();
|
||||
}
|
||||
|
||||
// prefix is in scope but refers to something else. Leave the ns attribute.
|
||||
a = null;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (a is object)
|
||||
{
|
||||
// Prefix is definitely not in scope
|
||||
a.Remove();
|
||||
// namespace is not defined either. Add this attributes list
|
||||
attributes.Add(a);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
a = nextA;
|
||||
}
|
||||
}
|
||||
|
||||
return e;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
using System;
|
||||
|
||||
namespace Microsoft.VisualBasic
|
||||
{
|
||||
[Embedded()]
|
||||
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Module | AttributeTargets.Assembly, Inherited = false)]
|
||||
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
|
||||
[System.Runtime.CompilerServices.CompilerGenerated()]
|
||||
internal sealed class Embedded : Attribute
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
using Microsoft.VisualBasic.ApplicationServices;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Telerik.WinControls;
|
||||
using Telerik.WinControls.Themes;
|
||||
|
||||
namespace Pilz.Updating.Administration.GUI.My
|
||||
{
|
||||
|
||||
// HINWEIS: Diese Datei wird automatisch generiert und darf nicht direkt bearbeitet werden. Wenn Sie Änderungen vornehmen möchten
|
||||
// oder in dieser Datei Buildfehler auftreten, wechseln Sie zum Projekt-Designer.
|
||||
// (Wechseln Sie dazu zu den Projekteigenschaften, oder doppelklicken Sie auf den Knoten "Mein Projekt" im
|
||||
// Projektmappen-Explorer). Nehmen Sie auf der Registerkarte "Anwendung" entsprechende Änderungen vor.
|
||||
//
|
||||
internal partial class MyApplication
|
||||
{
|
||||
protected override bool OnStartup(StartupEventArgs eventArgs)
|
||||
{
|
||||
var success = ThemeResolutionService.LoadPackageResource("Pilz.Updating.Administration.GUI.CustomThemes.Office2019DarkPurple.tssp");
|
||||
if (success)
|
||||
ThemeResolutionService.ApplicationThemeName = "Office2019DarkPurple";
|
||||
return base.OnStartup(eventArgs);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,62 +1,60 @@
|
||||
using System;
|
||||
using Microsoft.VisualBasic.CompilerServices;
|
||||
using Telerik.WinControls.UI;
|
||||
|
||||
namespace Pilz.Updating.Administration.GUI
|
||||
namespace Pilz.Updating.Administration.GUI;
|
||||
|
||||
public partial class PackageDescriptionEditor
|
||||
{
|
||||
public partial class PackageDescriptionEditor
|
||||
|
||||
// C o n s t r u c t o r s
|
||||
|
||||
public PackageDescriptionEditor()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
// C o n s t r u c t o r s
|
||||
|
||||
public PackageDescriptionEditor()
|
||||
radDropDownList_Formatting.Items.AddRange(new RadListDataItem[]
|
||||
{
|
||||
InitializeComponent();
|
||||
new() { Text = "Nur Text", Tag = UpdateNotesContentType.PlainText },
|
||||
new() { Text = "Markdown", Tag = UpdateNotesContentType.Markdown },
|
||||
new() { Text = "HTML", Tag = UpdateNotesContentType.HTML },
|
||||
});
|
||||
}
|
||||
|
||||
radDropDownList_Formatting.Items.AddRange(new RadListDataItem[]
|
||||
{
|
||||
new RadListDataItem { Text = "Nur Text", Tag = UpdateNotesContentType.PlainText },
|
||||
new RadListDataItem { Text = "Markdown", Tag = UpdateNotesContentType.Markdown },
|
||||
new RadListDataItem { Text = "HTML", Tag = UpdateNotesContentType.HTML },
|
||||
});
|
||||
// P r o p e r t i e s
|
||||
|
||||
public string Titel
|
||||
{
|
||||
get
|
||||
{
|
||||
return radTextBoxControl_Titel.Text;
|
||||
}
|
||||
|
||||
// P r o p e r t i e s
|
||||
|
||||
public string Titel
|
||||
set
|
||||
{
|
||||
get
|
||||
{
|
||||
return radTextBoxControl_Titel.Text;
|
||||
}
|
||||
set
|
||||
{
|
||||
radTextBoxControl_Titel.Text = value;
|
||||
}
|
||||
radTextBoxControl_Titel.Text = value;
|
||||
}
|
||||
}
|
||||
|
||||
public string Description
|
||||
public string Description
|
||||
{
|
||||
get
|
||||
{
|
||||
get
|
||||
{
|
||||
return radTextBox_Description.Text;
|
||||
}
|
||||
set
|
||||
{
|
||||
radTextBox_Description.Text = value ?? String.Empty;
|
||||
}
|
||||
return radTextBox_Description.Text;
|
||||
}
|
||||
|
||||
public UpdateNotesContentType DescriptionType
|
||||
set
|
||||
{
|
||||
get =>
|
||||
(UpdateNotesContentType)radDropDownList_Formatting.SelectedItem?.Tag;
|
||||
set
|
||||
{
|
||||
foreach (var item in radDropDownList_Formatting.Items)
|
||||
if ((UpdateNotesContentType)item.Tag == value)
|
||||
radDropDownList_Formatting.SelectedItem = item;
|
||||
}
|
||||
radTextBox_Description.Text = value ?? String.Empty;
|
||||
}
|
||||
}
|
||||
|
||||
public UpdateNotesContentType DescriptionType
|
||||
{
|
||||
get =>
|
||||
(UpdateNotesContentType)radDropDownList_Formatting.SelectedItem?.Tag;
|
||||
set
|
||||
{
|
||||
foreach (var item in radDropDownList_Formatting.Items)
|
||||
if ((UpdateNotesContentType)item.Tag == value)
|
||||
radDropDownList_Formatting.SelectedItem = item;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -48,13 +48,10 @@
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft-WindowsAPICodePack-Shell" Version="1.1.5" />
|
||||
<PackageReference Include="Microsoft.VisualBasic" Version="10.3.0" />
|
||||
<PackageReference Include="Pilz.Cryptography" Version="2.0.0" />
|
||||
<PackageReference Include="Pilz.Cryptography" Version="2.0.1" />
|
||||
<PackageReference Include="Pilz.IO" Version="2.0.0" />
|
||||
<PackageReference Include="System.Data.DataSetExtensions" Version="4.5.0" />
|
||||
<PackageReference Include="System.Net.Http" Version="4.3.4" />
|
||||
<PackageReference Include="UI.for.WinForms.AllControls.Net60">
|
||||
<Version>2023.1.117</Version>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Import Include="Microsoft.VisualBasic" />
|
||||
@@ -71,15 +68,11 @@
|
||||
<Import Include="Z.Collections.Extensions" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Update="DiscordBotSettingsWindow.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Update="DiscordBotSettingsWindow.cs" />
|
||||
<Compile Update="DiscordBotSettingsWindow.Designer.cs">
|
||||
<DependentUpon>DiscordBotSettingsWindow.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Update="DiscordPostDialog.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Update="DiscordPostDialog.cs" />
|
||||
<Compile Update="DiscordPostDialog.Designer.cs">
|
||||
<DependentUpon>DiscordPostDialog.cs</DependentUpon>
|
||||
</Compile>
|
||||
@@ -90,17 +83,11 @@
|
||||
<Compile Update="ApplicationVersionInput.Designer.cs">
|
||||
<DependentUpon>ApplicationVersionInput.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Update="ApplicationVersionInput.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Update="ApplicationVersionInput.cs" />
|
||||
<Compile Update="UpdateManagerWindow.cs" />
|
||||
<Compile Update="UpdateManagerWindow.Designer.cs">
|
||||
<DependentUpon>UpdateManagerWindow.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Update="My Project\Application.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Application.myapp</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Update="Properties\Resources.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
@@ -111,9 +98,7 @@
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
</Compile>
|
||||
<Compile Update="ProxyConfigEditor.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Update="ProxyConfigEditor.cs" />
|
||||
<Compile Update="ProxyConfigEditor.Designer.cs">
|
||||
<DependentUpon>ProxyConfigEditor.cs</DependentUpon>
|
||||
</Compile>
|
||||
@@ -162,10 +147,6 @@
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="My Project\Application.myapp">
|
||||
<Generator>MyApplicationCodeGenerator</Generator>
|
||||
<LastGenOutput>Application.Designer.cs</LastGenOutput>
|
||||
</None>
|
||||
<None Include="Properties\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<CustomToolNamespace>Pilz.Updating.Administration.GUI.My</CustomToolNamespace>
|
||||
@@ -217,9 +198,11 @@
|
||||
<ProjectReference Include="..\Pilz.Updating\Pilz.Updating.csproj" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Markdig" Version="0.33.0" />
|
||||
<PackageReference Include="Markdig" Version="0.37.0" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
||||
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="6.0.0" />
|
||||
<PackageReference Include="UI.for.WinForms.Common" Version="2024.2.514" />
|
||||
<PackageReference Include="UI.for.WinForms.Themes" Version="2024.2.514" />
|
||||
<PackageReference Include="Z.ExtensionMethods.WithNamespace" Version="2.1.1" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
||||
21
Pilz.Updating.Administration.GUI/Program.cs
Normal file
21
Pilz.Updating.Administration.GUI/Program.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using Pilz.Updating.Administration.GUI;
|
||||
using System.Windows.Forms;
|
||||
using Telerik.WinControls;
|
||||
|
||||
namespace Pilz.Updating.UpdateInstaller;
|
||||
|
||||
internal static class Program
|
||||
{
|
||||
internal static void Main(string[] args)
|
||||
{
|
||||
Application.EnableVisualStyles();
|
||||
Application.SetCompatibleTextRenderingDefault(false);
|
||||
Application.SetHighDpiMode(HighDpiMode.PerMonitorV2);
|
||||
|
||||
var success = ThemeResolutionService.LoadPackageResource("Pilz.Updating.Administration.GUI.CustomThemes.Office2019DarkPurple.tssp");
|
||||
if (success)
|
||||
ThemeResolutionService.ApplicationThemeName = "Office2019DarkPurple";
|
||||
|
||||
Application.Run(new UpdateManagerWindow());
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,4 @@
|
||||
using global::System;
|
||||
using global::System.Reflection;
|
||||
using global::System.Runtime.InteropServices;
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
|
||||
@@ -1,38 +1,29 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using Telerik.WinControls.UI;
|
||||
|
||||
namespace Pilz.Updating.Administration.GUI
|
||||
namespace Pilz.Updating.Administration.GUI;
|
||||
|
||||
public partial class ProxyConfigEditor : RadForm
|
||||
{
|
||||
public partial class ProxyConfigEditor : RadForm
|
||||
private readonly ProxyConfiguration config = null;
|
||||
|
||||
public ProxyConfigEditor(ProxyConfiguration config)
|
||||
{
|
||||
private readonly ProxyConfiguration config = null;
|
||||
this.config = config;
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
public ProxyConfigEditor(ProxyConfiguration config)
|
||||
{
|
||||
this.config = config;
|
||||
InitializeComponent();
|
||||
}
|
||||
private void UpdateServerInfoEditor_Shown(object sender, EventArgs e)
|
||||
{
|
||||
radToggleSwitch_UserProxy.Value = config.UseProxyAuth;
|
||||
radTextBoxControl_Username.Text = config.Username;
|
||||
radTextBoxControl_Password.Text = config.Password ?? string.Empty;
|
||||
}
|
||||
|
||||
private void UpdateServerInfoEditor_Shown(object sender, EventArgs e)
|
||||
{
|
||||
radToggleSwitch_UserProxy.Value = config.UseProxyAuth;
|
||||
radTextBoxControl_Username.Text = config.Username;
|
||||
radTextBoxControl_Password.Text = config.Password ?? string.Empty;
|
||||
}
|
||||
|
||||
private void ButtonX_OK_Click(object sender, EventArgs e)
|
||||
{
|
||||
config.UseProxyAuth = radToggleSwitch_UserProxy.Value;
|
||||
config.Username = radTextBoxControl_Username.Text.Trim();
|
||||
config.Password = radTextBoxControl_Password.Text;
|
||||
}
|
||||
private void ButtonX_OK_Click(object sender, EventArgs e)
|
||||
{
|
||||
config.UseProxyAuth = radToggleSwitch_UserProxy.Value;
|
||||
config.Username = radTextBoxControl_Username.Text.Trim();
|
||||
config.Password = radTextBoxControl_Password.Text;
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,41 +1,32 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using Telerik.WinControls.UI;
|
||||
|
||||
namespace Pilz.Updating.Administration.GUI
|
||||
namespace Pilz.Updating.Administration.GUI;
|
||||
|
||||
public partial class UpdateServerInfoEditor : RadForm
|
||||
{
|
||||
public partial class UpdateServerInfoEditor : RadForm
|
||||
public UpdateServerInfoEditor()
|
||||
{
|
||||
public UpdateServerInfoEditor()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void UpdateServerInfoEditor_Shown(object sender, EventArgs e)
|
||||
{
|
||||
radTextBoxControl_ServerAddress.Text = General.CurProject.UpdateServerConfig.ServerAdress;
|
||||
radTextBoxControl_PublicBasisURL.Text = General.CurProject.UpdateServerConfig.PublicPackageBaseURL;
|
||||
radTextBoxControl_PackageConfigurationFileName.Text = General.CurProject.UpdateServerConfig.UpdateInfoFilename;
|
||||
radTextBoxControl_Username.Text = General.CurProject.UpdateServerConfig.Username;
|
||||
radTextBoxControl_Password.Text = General.CurProject.UpdateServerConfig.Password;
|
||||
radToggleSwitch_UseProxyForWebDAV.Value = General.CurProject.UpdateServerConfig.UseProxyForWebDAV;
|
||||
}
|
||||
private void UpdateServerInfoEditor_Shown(object sender, EventArgs e)
|
||||
{
|
||||
radTextBoxControl_ServerAddress.Text = General.CurProject.UpdateServerConfig.ServerAdress;
|
||||
radTextBoxControl_PublicBasisURL.Text = General.CurProject.UpdateServerConfig.PublicPackageBaseURL;
|
||||
radTextBoxControl_PackageConfigurationFileName.Text = General.CurProject.UpdateServerConfig.UpdateInfoFilename;
|
||||
radTextBoxControl_Username.Text = General.CurProject.UpdateServerConfig.Username;
|
||||
radTextBoxControl_Password.Text = General.CurProject.UpdateServerConfig.Password;
|
||||
radToggleSwitch_UseProxyForWebDAV.Value = General.CurProject.UpdateServerConfig.UseProxyForWebDAV;
|
||||
}
|
||||
|
||||
private void ButtonX_OK_Click(object sender, EventArgs e)
|
||||
{
|
||||
General.CurProject.UpdateServerConfig.ServerAdress = radTextBoxControl_ServerAddress.Text.Trim();
|
||||
General.CurProject.UpdateServerConfig.PublicPackageBaseURL = radTextBoxControl_PublicBasisURL.Text.Trim();
|
||||
General.CurProject.UpdateServerConfig.UpdateInfoFilename = radTextBoxControl_PackageConfigurationFileName.Text.Trim();
|
||||
General.CurProject.UpdateServerConfig.Username = radTextBoxControl_Username.Text.Trim();
|
||||
General.CurProject.UpdateServerConfig.Password = radTextBoxControl_Password.Text;
|
||||
General.CurProject.UpdateServerConfig.UseProxyForWebDAV = radToggleSwitch_UseProxyForWebDAV.Value;
|
||||
}
|
||||
private void ButtonX_OK_Click(object sender, EventArgs e)
|
||||
{
|
||||
General.CurProject.UpdateServerConfig.ServerAdress = radTextBoxControl_ServerAddress.Text.Trim();
|
||||
General.CurProject.UpdateServerConfig.PublicPackageBaseURL = radTextBoxControl_PublicBasisURL.Text.Trim();
|
||||
General.CurProject.UpdateServerConfig.UpdateInfoFilename = radTextBoxControl_PackageConfigurationFileName.Text.Trim();
|
||||
General.CurProject.UpdateServerConfig.Username = radTextBoxControl_Username.Text.Trim();
|
||||
General.CurProject.UpdateServerConfig.Password = radTextBoxControl_Password.Text;
|
||||
General.CurProject.UpdateServerConfig.UseProxyForWebDAV = radToggleSwitch_UseProxyForWebDAV.Value;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user