From 8a308bad201ac5fd0cf4d1a08a4ba918b52f0261 Mon Sep 17 00:00:00 2001 From: Rick Falkvinge Date: Tue, 11 Jun 2013 12:56:30 +0000 Subject: [PATCH] COmmitting work before lunch --- .../BasicOutboundCommRecipient.cs | 6 + Console/Console.cs | 7 +- Console/Console.csproj | 1 + Database/Database-OutboundCommRecipients.cs | 509 ++++++++++++++++++ Database/Database.csproj | 1 + Logic/Communications/OutboundComm.cs | 16 + Logic/Communications/OutboundCommRecipient.cs | 16 + .../Communications/OutboundCommRecipients.cs | 14 + Logic/Communications/OutboundComms.cs | 13 + .../Transmission/NotificationPayload.cs | 49 ++ .../Transmission/PayloadBase.cs | 39 ++ Logic/Logic.csproj | 24 + .../Swarmops.Logic.Localizations.Designer.cs | 90 ++++ Logic/Swarmops.Logic.Localizations.resx | 129 +++++ Logic/SwarmopsLogicLoc.Designer.cs | 72 +++ Logic/SwarmopsLogicLoc.resx | 123 +++++ Utility/Utility.csproj | 1 + 17 files changed, 1104 insertions(+), 6 deletions(-) create mode 100644 Database/Database-OutboundCommRecipients.cs create mode 100644 Logic/Communications/OutboundComm.cs create mode 100644 Logic/Communications/OutboundCommRecipient.cs create mode 100644 Logic/Communications/OutboundCommRecipients.cs create mode 100644 Logic/Communications/OutboundComms.cs create mode 100644 Logic/Communications/Transmission/NotificationPayload.cs create mode 100644 Logic/Communications/Transmission/PayloadBase.cs create mode 100644 Logic/Swarmops.Logic.Localizations.Designer.cs create mode 100644 Logic/Swarmops.Logic.Localizations.resx create mode 100644 Logic/SwarmopsLogicLoc.Designer.cs create mode 100644 Logic/SwarmopsLogicLoc.resx diff --git a/Basic/Types/Communications/BasicOutboundCommRecipient.cs b/Basic/Types/Communications/BasicOutboundCommRecipient.cs index 06a0a6d9..834f2826 100644 --- a/Basic/Types/Communications/BasicOutboundCommRecipient.cs +++ b/Basic/Types/Communications/BasicOutboundCommRecipient.cs @@ -18,6 +18,12 @@ namespace Swarmops.Basic.Types.Communications this.FailReason = failReason; } + public BasicOutboundCommRecipient (BasicOutboundCommRecipient original): + this (original.OutboundCommRecipientId, original.OutboundCommId, original.PersonId, original.Open, original.Success, original.FailReason) + { + // copy ctor + } + public int OutboundCommRecipientId { get; private set; } public int OutboundCommId { get; private set; } public int PersonId { get; private set; } diff --git a/Console/Console.cs b/Console/Console.cs index 13d7e7b2..863396c6 100644 --- a/Console/Console.cs +++ b/Console/Console.cs @@ -51,16 +51,11 @@ namespace Swarmops // PWEvents.CreateEvent(EventSource.PirateBot, EventType.ParleyCancelled, 1, 1, 1, 1, 4, string.Empty); // PWEvents.CreateEvent(EventSource.PirateBot, EventType.ParleyCancelled, 1, 1, 1, 1, 5, string.Empty); - Utility.BotCode.EventProcessor.Run(); + // Utility.BotCode.EventProcessor.Run(); Console.WriteLine(string.Empty); Console.Write("Waiting for mail queue to flush... "); - while (!MailTransmitter.CanExit) - { - System.Threading.Thread.Sleep(50); - } - Console.WriteLine("done. Press Enter."); Console.ReadLine(); diff --git a/Console/Console.csproj b/Console/Console.csproj index 31a1293b..a17456a7 100644 --- a/Console/Console.csproj +++ b/Console/Console.csproj @@ -83,6 +83,7 @@ + \ No newline at end of file diff --git a/Database/Database-OutboundCommRecipients.cs b/Database/Database-OutboundCommRecipients.cs new file mode 100644 index 00000000..622c47db --- /dev/null +++ b/Database/Database-OutboundCommRecipients.cs @@ -0,0 +1,509 @@ +using System; +using System.Collections.Generic; +using System.Data; +using System.Data.Common; +using System.Text; +using Swarmops.Basic.Enums; +using Swarmops.Basic.Types; +using Swarmops.Basic.Types.Communications; + +namespace Swarmops.Database +{ + public partial class SwarmDb + { + + #region Database field reading + + private const string outboundCommRecipientFieldSequence = + " OutboundCommRecipientId,OutboundCommId,PersonId,Open,Success," + // 0-4 + "FailReasonId " + // 5 + "FROM OutboundCommRecipients "; + + private BasicOutboundCommRecipient ReadOutboundCommRecipientFromDataReader(IDataRecord reader) // Not static -- accesses cache, requiring connection strings + { + int outboundCommRecipientId = reader.GetInt32(0); + int outboundCommId = reader.GetInt32(1); + int personId = reader.GetInt32(2); + bool open = reader.GetBoolean(3); + bool success = reader.GetBoolean(4); + int failReasonId = reader.GetInt32(5); + + string failReason = GetCachedFailReasonName(failReasonId); + + return new BasicOutboundCommRecipient (outboundCommRecipientId, outboundCommId, personId, open, success, failReason); + + + } + + #endregion + + + #region Database record reading -- SELECT clauses + + + public BasicOutboundCommRecipient GetOutboundCommRecipient(int outboundCommRecipientId) + { + using (DbConnection connection = GetMySqlDbConnection()) + { + connection.Open(); + + DbCommand command = + GetDbCommand("SELECT" + outboundCommRecipientFieldSequence + + "WHERE OutboundCommRecipientId=" + outboundCommRecipientId.ToString(), + connection); + + using (DbDataReader reader = command.ExecuteReader()) + { + if (reader.Read()) + { + return ReadOutboundCommRecipientFromDataReader(reader); + } + + throw new ArgumentException("No such OutboundCommRecipientId:" + outboundCommRecipientId.ToString()); + } + } + + } + + + + public BasicOutboundCommRecipient[] GetOutboundCommRecipients(params object[] conditions) + { + List result = new List(); + + using (DbConnection connection = GetMySqlDbConnection()) + { + connection.Open(); + + DbCommand command = + GetDbCommand( + "SELECT" + outboundCommRecipientFieldSequence + ConstructWhereClause("OutboundCommRecipients", conditions), connection); + + using (DbDataReader reader = command.ExecuteReader()) + { + while (reader.Read()) + { + result.Add(ReadOutboundCommRecipientFromDataReader(reader)); + } + + return result.ToArray(); + } + } + } + + + #endregion + + + #region Database optimizations + + private static Dictionary _failReasonCache; + + protected string GetCachedFailReasonName(int failReasonId) + { + if (_failReasonCache == null) + { + _failReasonCache = new Dictionary(); + _failReasonCache[0] = null; // special case - no error + } + + if (_failReasonCache.ContainsKey(failReasonId)) + { + return _failReasonCache[failReasonId]; + } + + using (DbConnection connection = GetMySqlDbConnection()) + { + connection.Open(); + + DbCommand command = + GetDbCommand("SELECT Name FROM FailReasons WHERE FailReasonId=" + failReasonId.ToString(), + connection); + + using (DbDataReader reader = command.ExecuteReader()) + { + if (reader.Read()) + { + _failReasonCache[failReasonId] = reader.GetString(0); + return _failReasonCache[failReasonId]; + } + + throw new ArgumentException("No such FailReasonId:" + failReasonId.ToString()); + } + } + + } + + + #endregion + + + #region Creation and manipulation -- stored procedures + + + public int CreateOutboundCommRecipient(int senderPersonId, int fromPersonId, int organizationId, string resolverClass, string recipientDataXml, string transmitterClass, string payloadXml, OutboundCommPriority priority) + { + using (DbConnection connection = GetMySqlDbConnection()) + { + connection.Open(); + + DbCommand command = GetDbCommand("CreateOutboundCommRecipient", connection); + command.CommandType = CommandType.StoredProcedure; + + AddParameterWithName(command, "outboundCommId", senderPersonId); + AddParameterWithName(command, "personId", fromPersonId); + + return Convert.ToInt32(command.ExecuteScalar()); + } + } + + #endregion + + + #region Dead template code + + /* + public BasicExpenseClaim GetExpenseClaim(int expenseClaimId) + { + using (DbConnection connection = GetMySqlDbConnection()) + { + connection.Open(); + + DbCommand command = GetDbCommand( + "SELECT ExpenseClaimId,ClaimingPersonId,CreatedDateTime,Open,Attested," + + "Validated,Claimed,OrganizationId,GeographyId,BudgetId,BudgetYear," + + "ExpenseDate,Description,PreApprovedAmount,Amount,Repaid " + + "FROM ExpenseClaims WHERE ExpenseClaimId=" + expenseClaimId.ToString(), + connection); + + using (DbDataReader reader = command.ExecuteReader()) + { + if (reader.Read()) + { + return ReadExpenseFromDataReader(reader); + } + + throw new ArgumentException("Unknown ExpenseClaim Id"); + } + } + } + + public BasicExpenseClaim[] GetExpenseClaimsByClaimer(int claimingPersonId) + { + List result = new List(); + + using (DbConnection connection = GetMySqlDbConnection()) + { + connection.Open(); + + DbCommand command = + GetDbCommand("SELECT ExpenseClaimId,ClaimingPersonId,CreatedDateTime,Open,Attested," + + "Validated,Claimed,OrganizationId,GeographyId,BudgetId,BudgetYear," + + "ExpenseDate,Description,PreApprovedAmount,Amount,Repaid " + + "FROM ExpenseClaims WHERE ClaimingPersonId=" + claimingPersonId.ToString(), + connection); + + using (DbDataReader reader = command.ExecuteReader()) + { + while (reader.Read()) + { + result.Add(ReadExpenseFromDataReader(reader)); + } + + return result.ToArray(); + } + } + } + + public BasicExpenseClaim[] GetExpenseClaimsByBudgetAndYear(int budgetId, int budgetYear) + { + List result = new List(); + + using (DbConnection connection = GetMySqlDbConnection()) + { + connection.Open(); + + DbCommand command = + GetDbCommand("SELECT ExpenseClaimId,ClaimingPersonId,CreatedDateTime,Open,Attested," + + "Validated,Claimed,OrganizationId,GeographyId,BudgetId,BudgetYear," + + "ExpenseDate,Description,PreApprovedAmount,Amount,Repaid " + + "FROM ExpenseClaims WHERE BudgetId=" + budgetId.ToString() + " AND BudgetYear=" + budgetYear.ToString(), + connection); + + using (DbDataReader reader = command.ExecuteReader()) + { + while (reader.Read()) + { + result.Add(ReadExpenseFromDataReader(reader)); + } + + return result.ToArray(); + } + } + } + + public BasicExpenseClaim[] GetExpenseClaimsByOrganization(int organizationId) + { + List result = new List(); + + using (DbConnection connection = GetMySqlDbConnection()) + { + connection.Open(); + + DbCommand command = + GetDbCommand("SELECT ExpenseClaimId,ClaimingPersonId,CreatedDateTime,Open,Attested," + + "Validated,Claimed,OrganizationId,GeographyId,BudgetId,BudgetYear," + + "ExpenseDate,Description,PreApprovedAmount,Amount,Repaid " + + "FROM ExpenseClaims WHERE OrganizationId=" + organizationId.ToString(), + connection); + + using (DbDataReader reader = command.ExecuteReader()) + { + while (reader.Read()) + { + result.Add(ReadExpenseFromDataReader(reader)); + } + + return result.ToArray(); + } + } + } + + + private BasicExpenseClaim ReadExpenseFromDataReader(DbDataReader reader) + { + int expenseClaimId = reader.GetInt32(0); + int claimingPersonId = reader.GetInt32(1); + DateTime createdDateTime = reader.GetDateTime(2); + bool open = reader.GetBoolean(3); + bool attested = reader.GetBoolean(4); + bool documented = reader.GetBoolean(5); + bool claimed = reader.GetBoolean(6); + int organizationId = reader.GetInt32(7); + int geographyId = reader.GetInt32(8); // obsolete field + int budgetId = reader.GetInt32(9); + int budgetYear = reader.GetInt32(10); + DateTime expenseDate = reader.GetDateTime(11); + string description = reader.GetString(12); + double preApprovedAmount = reader.GetDouble(13); + double amount = reader.GetDouble(14); + bool repaid = reader.GetBoolean(15); + + return new BasicExpenseClaim(expenseClaimId, claimingPersonId, createdDateTime, + open, attested, documented, claimed, organizationId, geographyId, + budgetId, budgetYear, expenseDate, description, preApprovedAmount, + amount, repaid); + } + + + public int CreateExpenseClaim(int claimingPersonId, int organizationId, int budgetId, int budgetYear, + DateTime expenseDate, string description, double amount) + { + using (DbConnection connection = GetMySqlDbConnection()) + { + connection.Open(); + + DbCommand command = GetDbCommand("CreateExpenseClaim", connection); + command.CommandType = CommandType.StoredProcedure; + + AddParameterWithName(command, "claimingPersonId", claimingPersonId); + AddParameterWithName(command, "createdDateTime", DateTime.Now); + AddParameterWithName(command, "organizationId", organizationId); + AddParameterWithName(command, "budgetId", budgetId); + AddParameterWithName(command, "budgetYear", budgetYear); + AddParameterWithName(command, "expenseDate", expenseDate); + AddParameterWithName(command, "description", description); + AddParameterWithName(command, "amount", amount); + + return Convert.ToInt32(command.ExecuteScalar()); + } + } + + public int SetExpenseClaimDescription(int expenseClaimId, string description) + { + using (DbConnection connection = GetMySqlDbConnection()) + { + connection.Open(); + + DbCommand command = GetDbCommand("SetExpenseClaimDescription", connection); + command.CommandType = CommandType.StoredProcedure; + + AddParameterWithName(command, "expenseClaimId", expenseClaimId); + AddParameterWithName(command, "description", description); + + return Convert.ToInt32(command.ExecuteScalar()); + } + } + + + public int SetExpenseClaimBudget(int expenseClaimId, int budgetId) + { + using (DbConnection connection = GetMySqlDbConnection()) + { + connection.Open(); + + DbCommand command = GetDbCommand("SetExpenseClaimBudget", connection); + command.CommandType = CommandType.StoredProcedure; + + AddParameterWithName(command, "expenseClaimId", expenseClaimId); + AddParameterWithName(command, "budgetId", budgetId); + + return Convert.ToInt32(command.ExecuteScalar()); + } + } + + + public int SetExpenseClaimBudgetYear(int expenseClaimId, int budgetYear) + { + using (DbConnection connection = GetMySqlDbConnection()) + { + connection.Open(); + + DbCommand command = GetDbCommand("SetExpenseClaimBudgetYear", connection); + command.CommandType = CommandType.StoredProcedure; + + AddParameterWithName(command, "expenseClaimId", expenseClaimId); + AddParameterWithName(command, "budgetYear", budgetYear); + + return Convert.ToInt32(command.ExecuteScalar()); + } + } + + + public int SetExpenseClaimDate(int expenseClaimId, DateTime expenseDate) + { + using (DbConnection connection = GetMySqlDbConnection()) + { + connection.Open(); + + DbCommand command = GetDbCommand("SetExpenseClaimDate", connection); + command.CommandType = CommandType.StoredProcedure; + + AddParameterWithName(command, "expenseClaimId", expenseClaimId); + AddParameterWithName(command, "expenseDate", expenseDate); + + return Convert.ToInt32(command.ExecuteScalar()); + } + } + + + public int SetExpenseClaimAmount(int expenseClaimId, double amount) + { + using (DbConnection connection = GetMySqlDbConnection()) + { + connection.Open(); + + DbCommand command = GetDbCommand("SetExpenseClaimAmount", connection); + command.CommandType = CommandType.StoredProcedure; + + AddParameterWithName(command, "expenseClaimId", expenseClaimId); + AddParameterWithName(command, "amount", amount); + + return Convert.ToInt32(command.ExecuteScalar()); + } + } + + + + public int SetExpenseClaimAttested(int expenseClaimId, bool attested) + { + using (DbConnection connection = GetMySqlDbConnection()) + { + connection.Open(); + + DbCommand command = GetDbCommand("SetExpenseClaimAttested", connection); + command.CommandType = CommandType.StoredProcedure; + + AddParameterWithName(command, "expenseClaimId", expenseClaimId); + AddParameterWithName(command, "attested", attested); + + return Convert.ToInt32(command.ExecuteScalar()); + } + } + + + + public int SetExpenseClaimValidated(int expenseClaimId, bool validated) + { + using (DbConnection connection = GetMySqlDbConnection()) + { + connection.Open(); + + DbCommand command = GetDbCommand("SetExpenseClaimValidated", connection); + command.CommandType = CommandType.StoredProcedure; + + AddParameterWithName(command, "expenseClaimId", expenseClaimId); + AddParameterWithName(command, "validated", validated); + + return Convert.ToInt32(command.ExecuteScalar()); + } + } + + + + public int SetExpenseClaimOpen(int expenseClaimId, bool open) + { + using (DbConnection connection = GetMySqlDbConnection()) + { + connection.Open(); + + DbCommand command = GetDbCommand("SetExpenseClaimOpen", connection); + command.CommandType = CommandType.StoredProcedure; + + AddParameterWithName(command, "expenseClaimId", expenseClaimId); + AddParameterWithName(command, "open", open); + + return Convert.ToInt32(command.ExecuteScalar()); + } + } + + + + + public int SetExpenseClaimRepaid(int expenseClaimId, bool repaid) + { + using (DbConnection connection = GetMySqlDbConnection()) + { + connection.Open(); + + DbCommand command = GetDbCommand("SetExpenseClaimRepaid", connection); + command.CommandType = CommandType.StoredProcedure; + + AddParameterWithName(command, "expenseClaimId", expenseClaimId); + AddParameterWithName(command, "repaid", repaid); + + return Convert.ToInt32(command.ExecuteScalar()); + } + } + + + + + public int CreateExpenseEvent(int expenseId, ExpenseEventType eventType, int personId) + { + // WARNING: NOT CONVERTED TO V4 YET + + using (DbConnection connection = GetSqlServerDbConnection()) + { + connection.Open(); + + DbCommand command = GetDbCommand("CreateExpenseEvent", connection); + command.CommandType = CommandType.StoredProcedure; + + AddParameterWithName(command, "expenseId", expenseId); + AddParameterWithName(command, "dateTime", DateTime.Now); + AddParameterWithName(command, "eventPersonId", personId); + AddParameterWithName(command, "eventType", eventType.ToString()); + + return Convert.ToInt32(command.ExecuteScalar()); + } + } + + + */ + + #endregion + + + } +} \ No newline at end of file diff --git a/Database/Database.csproj b/Database/Database.csproj index 94b279e4..77ebca8b 100644 --- a/Database/Database.csproj +++ b/Database/Database.csproj @@ -92,6 +92,7 @@ + diff --git a/Logic/Communications/OutboundComm.cs b/Logic/Communications/OutboundComm.cs new file mode 100644 index 00000000..0b843a32 --- /dev/null +++ b/Logic/Communications/OutboundComm.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Swarmops.Basic.Types.Communications; + +namespace Swarmops.Logic.Communications +{ + public class OutboundComm: BasicOutboundComm + { + private OutboundComm (BasicOutboundComm basic): base (basic) + { + // private ctor + } + } +} diff --git a/Logic/Communications/OutboundCommRecipient.cs b/Logic/Communications/OutboundCommRecipient.cs new file mode 100644 index 00000000..94d92d61 --- /dev/null +++ b/Logic/Communications/OutboundCommRecipient.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Swarmops.Basic.Types.Communications; + +namespace Swarmops.Logic.Communications +{ + public class OutboundCommRecipient: BasicOutboundCommRecipient + { + private OutboundCommRecipient(BasicOutboundCommRecipient basic): base (basic) + { + // private ctor + } + } +} diff --git a/Logic/Communications/OutboundCommRecipients.cs b/Logic/Communications/OutboundCommRecipients.cs new file mode 100644 index 00000000..4f654935 --- /dev/null +++ b/Logic/Communications/OutboundCommRecipients.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Swarmops.Basic.Types.Communications; +using Swarmops.Logic.Support; + +namespace Swarmops.Logic.Communications +{ + public class OutboundCommRecipients: PluralBase + { + + } +} diff --git a/Logic/Communications/OutboundComms.cs b/Logic/Communications/OutboundComms.cs new file mode 100644 index 00000000..a1dde520 --- /dev/null +++ b/Logic/Communications/OutboundComms.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Swarmops.Basic.Types.Communications; +using Swarmops.Logic.Support; + +namespace Swarmops.Logic.Communications +{ + public class OutboundComms: PluralBase + { + } +} diff --git a/Logic/Communications/Transmission/NotificationPayload.cs b/Logic/Communications/Transmission/NotificationPayload.cs new file mode 100644 index 00000000..bd08759d --- /dev/null +++ b/Logic/Communications/Transmission/NotificationPayload.cs @@ -0,0 +1,49 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Resources; +using System.Text; +using System.Globalization; + +namespace Swarmops.Logic.Communications.Transmission +{ + [Serializable] + public class NotificationPayload: PayloadBase + { + public NotificationPayload() + { + // empty ctor, for XML reflection + } + + public NotificationPayload (string notificationResource) + { + this.SubjectResource = "Notifications_" + notificationResource + "_Subject"; + this.BodyResource = "Notifications_" + notificationResource + "_Body"; + } + + public string SubjectResource { get; set; } + public string BodyResource { get; set; } + + public string GetSubject() + { + ResourceManager resourceManager = new System.Resources.ResourceManager("Swarmops.Logic.Localizations", + System.Reflection.Assembly. + GetExecutingAssembly()); + // TODO: Pick culture + // TODO: Expand macros + + return resourceManager.GetString(this.SubjectResource); + } + + public string GetBody() + { + ResourceManager resourceManager = new System.Resources.ResourceManager("Swarmops.Logic.Localizations", + System.Reflection.Assembly. + GetExecutingAssembly()); + // TODO: Pick culture + // TODO: Expand macros + + return resourceManager.GetString(this.BodyResource); + } + } +} diff --git a/Logic/Communications/Transmission/PayloadBase.cs b/Logic/Communications/Transmission/PayloadBase.cs new file mode 100644 index 00000000..4886653e --- /dev/null +++ b/Logic/Communications/Transmission/PayloadBase.cs @@ -0,0 +1,39 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Xml.Serialization; + +namespace Swarmops.Logic.Communications.Transmission +{ + [Serializable] + public class PayloadBase + { + public string ToXml() + { + var serializer = new XmlSerializer(typeof(T)); + + var stream = new MemoryStream(); + serializer.Serialize(stream, this); + + byte[] xmlBytes = stream.GetBuffer(); + return Encoding.Default.GetString(xmlBytes); + } + + static T FromXml (string xml) + { + var serializer = new XmlSerializer(typeof(T)); + + var stream = new MemoryStream(); + byte[] xmlBytes = Encoding.Default.GetBytes(xml); + stream.Write(xmlBytes, 0, xmlBytes.Length); + + stream.Position = 0; + var result = (T)serializer.Deserialize(stream); + stream.Close(); + + return result; + } + } +} diff --git a/Logic/Logic.csproj b/Logic/Logic.csproj index 04820ad7..e42ab197 100644 --- a/Logic/Logic.csproj +++ b/Logic/Logic.csproj @@ -64,6 +64,12 @@ + + + + + + @@ -216,6 +222,16 @@ + + True + True + Swarmops.Logic.Localizations.resx + + + True + True + SwarmopsLogicLoc.resx + @@ -281,6 +297,14 @@ Authentication.sv-SE.Designer.cs Designer + + ResXFileCodeGenerator + Swarmops.Logic.Localizations.Designer.cs + + + ResXFileCodeGenerator + SwarmopsLogicLoc.Designer.cs + \ No newline at end of file diff --git a/Logic/Swarmops.Logic.Localizations.Designer.cs b/Logic/Swarmops.Logic.Localizations.Designer.cs new file mode 100644 index 00000000..988ac573 --- /dev/null +++ b/Logic/Swarmops.Logic.Localizations.Designer.cs @@ -0,0 +1,90 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.296 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Swarmops.Logic { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Swarmops_Logic_Localizations { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Swarmops_Logic_Localizations() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Swarmops.Logic.Swarmops.Logic.Localizations", typeof(Swarmops_Logic_Localizations).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Looks up a localized string similar to Swarmops Backend version [VERSION] on host [HOSTNAME] has successfully started and connected to database and notification frameworks.. + /// + internal static string Notifications_System_Startup_Body { + get { + return ResourceManager.GetString("Notifications_System_Startup_Body", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Swarmops Backend operational. + /// + internal static string Notifications_System_Startup_Subject { + get { + return ResourceManager.GetString("Notifications_System_Startup_Subject", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Test. + /// + internal static string Test { + get { + return ResourceManager.GetString("Test", resourceCulture); + } + } + } +} diff --git a/Logic/Swarmops.Logic.Localizations.resx b/Logic/Swarmops.Logic.Localizations.resx new file mode 100644 index 00000000..5cee363d --- /dev/null +++ b/Logic/Swarmops.Logic.Localizations.resx @@ -0,0 +1,129 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Swarmops Backend version [VERSION] on host [HOSTNAME] has successfully started and connected to database and notification frameworks. + + + Swarmops Backend operational + + + Test + + \ No newline at end of file diff --git a/Logic/SwarmopsLogicLoc.Designer.cs b/Logic/SwarmopsLogicLoc.Designer.cs new file mode 100644 index 00000000..63d0ee60 --- /dev/null +++ b/Logic/SwarmopsLogicLoc.Designer.cs @@ -0,0 +1,72 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.296 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Swarmops.Logic { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class SwarmopsLogicLoc { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal SwarmopsLogicLoc() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Swarmops.Logic.SwarmopsLogicLoc", typeof(SwarmopsLogicLoc).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Looks up a localized string similar to Test2. + /// + internal static string Test { + get { + return ResourceManager.GetString("Test", resourceCulture); + } + } + } +} diff --git a/Logic/SwarmopsLogicLoc.resx b/Logic/SwarmopsLogicLoc.resx new file mode 100644 index 00000000..df7a81ea --- /dev/null +++ b/Logic/SwarmopsLogicLoc.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Test2 + + \ No newline at end of file diff --git a/Utility/Utility.csproj b/Utility/Utility.csproj index de92db9b..428e36fd 100644 --- a/Utility/Utility.csproj +++ b/Utility/Utility.csproj @@ -145,6 +145,7 @@ +