Changes to Hardware class

Changes to Hardware class

--- DAQ/D006MMTFZ400Hardware.cs
+++ DAQ/D006MMTFZ400Hardware.cs
@@ -18,26 +18,37 @@

         public D006MMTFZ400Hardware()
 		{
-            //Boards.Add("testBoard1", "/dev1");
-            //string TCLBoard = (string)Boards["testBoard1"];
+            Boards.Add("pgBoard", "/PXI1Slot2");
+            string pgBoard = (string)Boards["pgBoard"];
+            Info.Add("PatternGeneratorBoard", pgBoard);
+            Info.Add("PGType", "dedicated");
             //Boards.Add("testBoard2", "/dev2");
             //string TCLBoard2 = (string)Boards["testBoard2"];

+            //PG channels
+            AddDigitalOutputChannel("q", pgBoard, 0, 0); //t = 0;
+            AddDigitalOutputChannel("valve", pgBoard, 0, 1); //Use this for the microwaves as it has the valvePulseLength feature!
+            AddDigitalOutputChannel("flash", pgBoard, 0, 2); //Basically unused
+            AddDigitalOutputChannel("detector", pgBoard, 0, 3);
+            AddDigitalOutputChannel("detectorprime", pgBoard, 0, 4);
+            AddDigitalOutputChannel("aom", pgBoard, 0, 5);
+
+
             //Info.Add("analogTrigger2", TCLBoard + "/PFI0");
             //TCL Lockable lasers
-            Info.Add("TCLLockableLasers", new string[] { "laser" });
-            Info.Add("TCLPhotodiodes", new string[] { "cavity", "master", "p1" });// THE FIRST TWO MUST BE CAVITY AND MASTER PHOTODIODE!!!!
-            Info.Add("TCL_Slave_Voltage_Limit_Upper",5.0); //volts: Laser control
-            Info.Add("TCL_Slave_Voltage_Limit_Lower", 0.0); //volts: Laser control
-            Info.Add("TCL_Default_Gain", 0.5);
-            Info.Add("TCL_Default_VoltageToLaser", 0.0);
-            Info.Add("TCL_MAX_INPUT_VOLTAGE", 10.0);
-            Info.Add("TCL_Default_ScanPoints", 100);
-            Info.Add("TCLReadAutostart", true);
+            //Info.Add("TCLLockableLasers", new string[] { "laser" });
+            //Info.Add("TCLPhotodiodes", new string[] { "cavity", "master", "p1" });// THE FIRST TWO MUST BE CAVITY AND MASTER PHOTODIODE!!!!
+            //Info.Add("TCL_Slave_Voltage_Limit_Upper",5.0); //volts: Laser control
+            //Info.Add("TCL_Slave_Voltage_Limit_Lower", 0.0); //volts: Laser control
+            //Info.Add("TCL_Default_Gain", 0.5);
+            //Info.Add("TCL_Default_VoltageToLaser", 0.0);
+            //Info.Add("TCL_MAX_INPUT_VOLTAGE", 10.0);
+            //Info.Add("TCL_Default_ScanPoints", 100);
+            //Info.Add("TCLReadAutostart", true);

             // Some matching up for TCL
-            Info.Add("laser", "p1");
-            Info.Add("laser2", "p2");
+            //Info.Add("laser", "p1");
+            //Info.Add("laser2", "p2");

            // AddAnalogInputChannel("p1", TCLBoard + "/ai0", AITerminalConfiguration.Rse);//Pin 2
             //AddAnalogInputChannel("p2", TCLBoard + "/ai1", AITerminalConfiguration.Rse);//Pin 5


Fix ConvertLight.

Fix ConvertLight.

--- Converter.cs
+++ Converter.cs
@@ -265,8 +265,6 @@
             var name = ((string)obj.Values[1]);
             var light = new Light(name);

-            return light;
-
             foreach (var prop in obj.Properties)
             {
                 int index;
@@ -287,6 +285,8 @@
                     throw new NotImplementedException();
                 }
             }
+
+            return light;
         }

         public static Geometry ConvertGeometry(ParseObject obj)


Basic Logic

Basic Logic

--- Core/Core.cs
+++ Core/Core.cs
@@ -15,6 +15,7 @@

         const int playerX = 5;
         static int playerY = Console.WindowHeight / 2;
+
         static int pastPlayerY = 0;
         static int velocity = 0;


Fix internal use of InternalStatus

Fix internal use of InternalStatus

--- DSharpPlus/DiscordClient.cs
+++ DSharpPlus/DiscordClient.cs
@@ -303,7 +303,7 @@
                     Discord = this,
                     RawActivity = new TransportActivity(),
                     Activity = new DiscordActivity(),
-                    InternalStatus = "online",
+                    Status = UserStatus.Online,
                     InternalUser = new TransportUser
                     {
                         Id = this.CurrentUser.Id,
@@ -318,7 +318,7 @@
                 var pr = this._presences[this.CurrentUser.Id];
                 pr.RawActivity = new TransportActivity();
                 pr.Activity = new DiscordActivity();
-                pr.InternalStatus = "online";
+                pr.Status = UserStatus.Online;
             }

             Volatile.Write(ref this._skippedHeartbeats, 0);
@@ -2162,7 +2162,7 @@
                 {
                     Discord = this,
                     Activity = act,
-                    InternalStatus = userStatus?.ToString() ?? "online",
+                    Status = userStatus ?? UserStatus.Online,
                     InternalUser = new TransportUser { Id = this.CurrentUser.Id }
                 };
             }
@@ -2170,7 +2170,7 @@
             {
                 var pr = this._presences[this.CurrentUser.Id];
                 pr.Activity = act;
-                pr.InternalStatus = userStatus?.ToString() ?? pr.InternalStatus;
+                pr.Status = userStatus ?? pr.Status;
             }

             return Task.Delay(0);


Update RtClass.cs

Update RtClass.cs

--- Reinforced.Typings/Ast/RtClass.cs
+++ Reinforced.Typings/Ast/RtClass.cs
@@ -20,13 +20,17 @@
         /// <inheritdoc />
         public List<RtSimpleTypeName> Implementees { get; private set; }

-        /// <inheritdoc />
+        /// <summary>
+        /// Gets or sets type name that this class is being extened (inherit) from
+        /// </summary>
         public RtTypeName Extendee { get; set; }

         /// <inheritdoc />
-        public List<RtNode> Members { get; private set; }        //todo this needs to be sorted to be cross-platform, it's returning different order for Mono
+        public List<RtNode> Members { get; private set; }

-        ///  <inheritdoc />
+        /// <summary>
+        /// Gets or sets whether generated class will be abstract or not
+        /// </summary>
         public bool Abstract { get; set; }

         /// <summary>


cleanup time

cleanup time

--- DataTool/SaveLogic/Combo.cs
+++ DataTool/SaveLogic/Combo.cs
@@ -860,7 +860,7 @@
         public static void ConvertSoundFileVgmStream(string input, string output) {
             try {
                 var proc = new ProcessStartInfo {
-                    FileName = OperatingSystem.IsLinux() ? VgmStreamPathLx : VgmStreamPathWin,
+                    FileName = VgmStreamPath,
                     Arguments = $"\"{input}\" -l 0 -f 0 -d 0 -L -o \"{output}\"",
                     CreateNoWindow = true,
                     WindowStyle = ProcessWindowStyle.Hidden,


Better refuel logic

Better refuel logic

--- BARABAS.cs
+++ BARABAS.cs
@@ -247,8 +247,6 @@
 List < IMyTerminalBlock > local_antennas = null;
 List < IMyTerminalBlock > remote_storage = null;
 List < IMyTerminalBlock > remote_ship_storage = null;
-List < IMyTerminalBlock > remote_oxygen_tanks = null;
-List < IMyTerminalBlock > remote_hydrogen_tanks = null;
 IMyTextPanel config_block = null;
 List < IMyCubeGrid > local_grids = null;
 List < IMyCubeGrid > remote_base_grids = null;
@@ -343,6 +341,8 @@
 bool can_use_oxygen;
 bool can_refine;
 bool can_refine_ice;
+bool can_refuel_hydrogen;
+bool can_refuel_oxygen;
 bool large_grid;
 bool has_air_vents;
 bool has_status_panels;
@@ -1072,6 +1072,9 @@
  // for each block, get its grid, store data for this grid, and populate respective
  // object list if it's one of the objects we're interested in
  foreach (var b in local_blocks) {
+  if (slimBlock(b) == null) {
+   continue;
+  }
   GridData data;
   if (!tmp_grid_data.TryGetValue(b.CubeGrid, out data)) {
    data = new GridData();
@@ -1310,34 +1313,28 @@
  return remote_ship_storage;
 }

-List < IMyTerminalBlock > getRemoteOxygenTanks(bool force_update = false) {
- if (remote_oxygen_tanks != null && !force_update) {
-  return removeNulls(remote_oxygen_tanks);
- }
- remote_oxygen_tanks = new List < IMyTerminalBlock > ();
- GridTerminalSystem.GetBlocksOfType < IMyOxygenTank > (remote_oxygen_tanks, remoteGridFilter);
- for (int i = remote_oxygen_tanks.Count - 1; i >= 0; i--) {
-  var b = remote_oxygen_tanks[i] as IMyOxygenTank;
-  if (b.BlockDefinition.ToString().Contains("Hydrogen") || b.GetValue < bool > ("Stockpile") || b.GetOxygenLevel() == 0) {
-   remote_oxygen_tanks.RemoveAt(i);
-  }
- }
- return remote_oxygen_tanks;
-}
-
-List < IMyTerminalBlock > getRemoteHydrogenTanks(bool force_update = false) {
- if (remote_hydrogen_tanks != null && !force_update) {
-  return removeNulls(remote_hydrogen_tanks);
- }
- remote_hydrogen_tanks = new List < IMyTerminalBlock > ();
- GridTerminalSystem.GetBlocksOfType < IMyOxygenTank > (remote_hydrogen_tanks, remoteGridFilter);
- for (int i = remote_oxygen_tanks.Count - 1; i >= 0; i--) {
-  var b = remote_oxygen_tanks[i] as IMyOxygenTank;
-  if (!b.BlockDefinition.ToString().Contains("Hydrogen") || b.GetValue < bool > ("Stockpile") || b.GetOxygenLevel() == 0) {
-   remote_hydrogen_tanks.RemoveAt(i);
-  }
- }
- return remote_hydrogen_tanks;
+void getRemoteOxyHydroLevels() {
+ var blocks = new List < IMyTerminalBlock > ();
+ GridTerminalSystem.GetBlocksOfType < IMyOxygenTank > (blocks, remoteGridFilter);
+ Decimal o_level = 0;
+ Decimal h_level = 0;
+ for (int i = blocks.Count - 1; i >= 0; i--) {
+  var b = blocks[i] as IMyOxygenTank;
+  if (b.GetValue < bool > ("Stockpile") || slimBlock(b) == null) {
+   continue;
+  }
+
+  bool sz = b.BlockDefinition.ToString().Contains("Large");
+
+  if (b.BlockDefinition.ToString().Contains("Hydrogen")) {
+   h_level += (Decimal) b.GetOxygenLevel() * (sz ? 2500000M : 40000M);
+  } else {
+   o_level += (Decimal) b.GetOxygenLevel() * (sz ? 100000M : 50000M);
+  }
+ }
+ // if we have at least half a tank, we can refuel
+ can_refuel_hydrogen = h_level > (large_grid ? 1250000M : 20000M);
+ can_refuel_oxygen = o_level > (large_grid ? 50000M : 25000M);
 }

 // get local trash disposal connector
@@ -4274,8 +4271,7 @@
  if (connected) {
   getRemoteStorage(true);
   getRemoteShipStorage(true);
-  getRemoteOxygenTanks(true);
-  getRemoteHydrogenTanks(true);
+  getRemoteOxyHydroLevels();
   addAlert(GREEN_ALERT);
  } else {
   removeAlert(GREEN_ALERT);
@@ -4385,10 +4381,10 @@
   toggleStockpile(h, h_s);
   return;
  }
- if (refuel_oxygen && getRemoteOxygenTanks().Count != 0 && !oxygenAboveHighWatermark()) {
+ if (refuel_oxygen && can_refuel_oxygen && !oxygenAboveHighWatermark()) {
   o_s = true;
  }
- if (refuel_hydrogen && getRemoteHydrogenTanks().Count != 0 && !hydrogenAboveHighWatermark()) {
+ if (refuel_hydrogen && can_refuel_hydrogen && !hydrogenAboveHighWatermark()) {
   h_s = true;
  }
  toggleStockpile(o, o_s);


Added catch for empty providerName in connection. Fixes issue 4

--- Massive.cs
+++ Massive.cs
@@ -97,7 +97,8 @@
                 connectionStringName = ConfigurationManager.ConnectionStrings[0].Name;
             var _providerName = "System.Data.SqlClient";
             if (ConfigurationManager.ConnectionStrings[connectionStringName] != null) {
-                _providerName = ConfigurationManager.ConnectionStrings[connectionStringName].ProviderName ?? "System.Data.SqlClient";
+                if (!string.IsNullOrEmpty(ConfigurationManager.ConnectionStrings[connectionStringName].ProviderName))
+                    _providerName = ConfigurationManager.ConnectionStrings[connectionStringName].ProviderName;
             } else {
                 throw new InvalidOperationException("Can't find a connection string with the name '" + connectionStringName + "'");
             }


Removed old file

Removed old file

--- yafsrc/YAF.Core/Services/Logger/UserAgentLogger.cs
+++ yafsrc/YAF.Core/Services/Logger/UserAgentLogger.cs
@@ -1,39 +0,0 @@
-using System;
-using System.Web;
-using YAF.Classes.Data;
-using YAF.Types.Constants;
-
-namespace YAF.Utils.Helpers
-{
-    public class UserAgentLogger
-    {
-        public void WriteLog(string userAgent, HttpRequestBase request, string platform, string browser, string user)
-        {
-            if (request == null) return;
-
-            if (userAgent.IsNotSet())
-            {
-                LegacyDb.eventlog_create(null, this, "UserAgent string is empty.", EventLogTypes.Warning);
-            }
-            else
-            {
-                if (request.Browser != null && platform.ToLower().Contains("unknown") ||
-                    browser.ToLower().Contains("unknown"))
-                {
-                    LegacyDb.eventlog_create(
-                        null,
-                        this,
-                        "Unhandled UserAgent string:'{0}' /r/nPlatform:'{1}' /r/nBrowser:'{2}' /r/nSupports cookies='{3}' /r/nSupports EcmaScript='{4}' /r/nUserID='{5}'."
-                            .FormatWith(
-                                userAgent,
-                                request.Browser.Platform,
-                                request.Browser.Browser,
-                                request.Browser.Cookies,
-                                request.Browser.EcmaScriptVersion.ToString(),
-                                user ?? String.Empty),
-                        EventLogTypes.Warning);
-                }
-            }
-        }
-    }
-}


- optimized content encoding

- optimized content encoding

git-svn-id: 024815966b14bc162104d7308994938bf1039524@1082509 13f79535-47bb-0310-9956-ffa450edef68

--- DotCMIS/binding/atompub/atompub-writer.cs
+++ DotCMIS/binding/atompub/atompub-writer.cs
@@ -169,25 +169,17 @@

         private void WriteContent(XmlWriter writer)
         {
-            byte[] byteArray = null;
-
-            if (stream is MemoryStream)
-            {
-                byteArray = ((MemoryStream)stream).ToArray();
-            }
-            else
-            {
-                MemoryStream memStream = new MemoryStream();
+            using (BinaryReader br = new BinaryReader(stream))
+            {
                 byte[] buffer = new byte[BufferSize];
-                int bytes;
-                while ((bytes = stream.Read(buffer, 0, buffer.Length)) > 0)
-                {
-                    memStream.Write(buffer, 0, bytes);
-                }
-                byteArray = memStream.ToArray();
-            }
-
-            writer.WriteBase64(byteArray, 0, byteArray.Length);
+                int readBytes = 0;
+
+                do
+                {
+                    readBytes = br.Read(buffer, 0, BufferSize);
+                    writer.WriteBase64(buffer, 0, readBytes);
+                } while (BufferSize <= readBytes);
+            }
         }
     }


Made minor consistency changes to DbcLoader.

--- Drama.Tools.Load/Formats/Dbc/DbcLoader.cs
+++ Drama.Tools.Load/Formats/Dbc/DbcLoader.cs
@@ -61,16 +61,17 @@
 		/// <param name="grainFactory">The IGrainFactory to load into</param>
 		public void LoadEntities(IGrainFactory grainFactory)
 		{
-			var fileName = typeof(TEntity).GetTypeInfo().GetCustomAttribute<DbcEntityAttribute>()?.DbcFileName
+			var entityType = typeof(TEntity);
+			var fileName = entityType.GetTypeInfo().GetCustomAttribute<DbcEntityAttribute>()?.DbcFileName
 				?? throw new DramaException($"type {typeof(TEntity).Name} does not have a {nameof(DbcEntityAttribute)} but is used as a DbcEntity");
-			var idProperty = GetIdProperty(typeof(TEntity));
+			var idProperty = GetIdProperty(entityType);

 			using (var dbc = new Dbc<TEntity>(new FileStream(Path.Combine(DbcPath, fileName), FileMode.Open, FileAccess.Read, FileShare.Read)))
 			{
 				foreach (var row in dbc)
 				{
 					var idValue = Convert.ToInt64(idProperty.GetValue(row));
-					TGrain grain = grainFactory.GetGrain<TGrain>(idValue);
+					var grain = grainFactory.GetGrain<TGrain>(idValue);

 					grain.Clear().Wait();
 					grain.Merge(row).Wait();
@@ -88,7 +89,7 @@

 			var candidateKeys = properties.ToList();

-			if (candidateKeys.Count == 0)
+			if (candidateKeys.Count < 1)
 				throw new ArgumentException($"this type does not have any fields with {nameof(DbcKeyAttribute)}", nameof(type));
 			if (candidateKeys.Count > 1)
 				throw new ArgumentException($"this type has {candidateKeys.Count} fields with {nameof(DbcKeyAttribute)} but expected 1", nameof(type));


Bugfix: Moved wrong systems to duplicate commander  (-2)

--- EDDiscovery/EliteDangerous/NetLogClass.cs
+++ EDDiscovery/EliteDangerous/NetLogClass.cs
@@ -172,13 +172,16 @@
                     {
                         if (visitedSystems.Count == 0)
                             visitedSystems.Add(vs);
-                        else if (!vsSystemsList.Last<VisitedSystemsClass>().Name.Equals(vs.Name))  // Avoid duplicate if times exist in same system from different files.
+                        else if (!visitedSystems.Last<VisitedSystemsClass>().Name.Equals(vs.Name))  // Avoid duplicate if times exist in same system from different files.
                             visitedSystems.Add(vs);
                         else
                         {
-                            VisitedSystemsClass vs2 = (VisitedSystemsClass)vsSystemsList.Last<VisitedSystemsClass>();
-                            vs.Commander = -2; // Move to dupe user
-                            vs.Update();
+                            VisitedSystemsClass vs2 = (VisitedSystemsClass)visitedSystems.Last<VisitedSystemsClass>();
+                            if (vs2.id != vs.id)
+                            {
+                                vs.Commander = -2; // Move to dupe user
+                                vs.Update();
+                            }
                         }

                     }


New constants

New constants

--- EasterFarm/EasterFarm.Common/Constants.cs
+++ EasterFarm/EasterFarm.Common/Constants.cs
@@ -8,8 +8,8 @@
         public const double UpDownScreenRatio = 0.5;
         public const int Difficulty = 10; // the greater, the easyer
         public const int DifficultyLevel = 1; // should be lesser than Difficulty/2
-        public const int WorldRowsWPF = 20;
-        public const int WorldColsWPF = 29;
+        public const int WorldRowsWPF = 21;
+        public const int WorldColsWPF = 30;

         public static readonly char[,] GameOverMessage = new char[,]
         {


Handle Castellan Belt cluster scans

Handle Castellan Belt cluster scans

--- EliteDangerous/EliteDangerous/StarScan.cs
+++ EliteDangerous/EliteDangerous/StarScan.cs
@@ -936,6 +936,12 @@
                 }
             }

+            // Special case for Castellan Belt
+            if (system.ToLowerInvariant() == "lave" && je.BodyName.StartsWith("Castellan Belt ", StringComparison.InvariantCultureIgnoreCase))
+            {
+                return "Lave A Belt " + je.BodyName.Substring("Castellan Belt ".Length);
+            }
+
             // Special case for 9 Aurigae
             if (je.IsStar && system.ToLowerInvariant() == "9 Aurigae")
             {


Apply edits in a sequential manner

Apply edits in a sequential manner

--- Engine/Commands/InvokeFormatterCommand.cs
+++ Engine/Commands/InvokeFormatterCommand.cs
@@ -12,12 +12,16 @@

 using System;
 using System.Collections;
+using System.Collections.Generic;
 using System.Globalization;
 using System.Linq;
 using System.Management.Automation;
+using Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic;

 namespace Microsoft.Windows.PowerShell.ScriptAnalyzer.Commands
 {
+    using PSSASettings = Microsoft.Windows.PowerShell.ScriptAnalyzer.Settings;
+
     [Cmdlet(VerbsLifecycle.Invoke, "Formatter")]
     public class InvokeFormatterCommand : PSCmdlet, IOutputWriter
     {
@@ -30,12 +34,37 @@
         [ValidateNotNull]
         public string ScriptDefinition { get; set; }

+        // todo make this settings and maybe rename Settings class
         [Parameter(Mandatory = false)]
         [ValidateNotNull]
         public object Settings { get; set; }

+#if DEBUG
+        [Parameter(Mandatory = false)]
+        public SwitchParameter AttachAndDebug
+        {
+            get { return attachAndDebug; }
+            set { attachAndDebug = value; }
+        }
+        private bool attachAndDebug = false;
+#endif
+
         protected override void BeginProcessing()
         {
+#if DEBUG
+            if (attachAndDebug)
+            {
+                if (System.Diagnostics.Debugger.IsAttached)
+                {
+                    System.Diagnostics.Debugger.Break();
+                }
+                else
+                {
+                    System.Diagnostics.Debugger.Launch();
+                }
+            }
+#endif
+
             // todo move to a common initalize session method
             Helper.Instance = new Helper(SessionState.InvokeCommand, this);
             Helper.Instance.Initialize();
@@ -86,10 +115,12 @@

             try
             {
-                defaultSettings = new Settings(defaultSettingsPreset);
+                defaultSettings = new PSSASettings(
+                    defaultSettingsPreset,
+                    PSSASettings.GetSettingPresetFilePath);
                 if (settingsMode != SettingsMode.None)
                 {
-                    inputSettings = new Settings(settingsFound);
+                    inputSettings = new PSSASettings(settingsFound);
                     ValidateInputSettings();
                 }
                 else
@@ -116,6 +147,7 @@
                 "PSAlignAssignmentStatement"
             };

+            var text = new EditableText(ScriptDefinition);
             foreach (var rule in ruleOrder)
             {
                 if (!inputSettings.RuleArguments.ContainsKey(rule))
@@ -131,8 +163,43 @@
                 currentSettingsHashtable.Add("Rules", ruleSettings);
                 var currentSettings = new Settings(currentSettingsHashtable);
                 ScriptAnalyzer.Instance.UpdateSettings(currentSettings);
-                ScriptAnalyzer.Instance.Initialize(this, null, null, null, null, false, false);
-            }
+                ScriptAnalyzer.Instance.Initialize(this, null, null, null, null, true, false);
+
+                var corrections = new List<CorrectionExtent>();
+                var records = Enumerable.Empty<DiagnosticRecord>();
+
+                // todo add a check for this while loop so that it doesn't go into a black hole
+                do
+                {
+                    var correctionApplied = new HashSet<int>();
+                    foreach (var correction in corrections)
+                    {
+                        // apply only one edit per line
+                        if (correctionApplied.Contains(correction.StartLineNumber))
+                        {
+                            continue;
+                        }
+
+                        correctionApplied.Add(correction.StartLineNumber);
+                        text.ApplyEdit(correction);
+                    }
+
+                    records = ScriptAnalyzer.Instance.AnalyzeScriptDefinition(text.ToString());
+                    corrections = records.Select(r => r.SuggestedCorrections.ElementAt(0)).ToList();
+
+                    // get unique correction instances
+                    // sort them by line numbers
+                    corrections.Sort((x, y) =>
+                    {
+                        return x.StartLineNumber < x.StartLineNumber ?
+                                    1 :
+                                    (x.StartLineNumber == x.StartLineNumber ? 0 : -1);
+                    });
+
+                } while (records.Any());
+            }
+
+            this.WriteObject(text.ToString());
         }

         private void ValidateInputSettings()


Add checks to prevent formatter loop from getting stuck

--- Engine/Commands/InvokeFormatterCommand.cs
+++ Engine/Commands/InvokeFormatterCommand.cs
@@ -29,17 +29,18 @@
         private Settings defaultSettings;
         private Settings inputSettings;

-
         [ParameterAttribute(Mandatory = true)]
         [ValidateNotNull]
         public string ScriptDefinition { get; set; }

-        // todo make this settings and maybe rename Settings class
         [Parameter(Mandatory = false)]
         [ValidateNotNull]
         public object Settings { get; set; }

 #if DEBUG
+        /// <summary>
+        /// Attaches to an instance of a .Net debugger
+        /// </summary>
         [Parameter(Mandatory = false)]
         public SwitchParameter AttachAndDebug
         {
@@ -167,8 +168,8 @@

                 var corrections = new List<CorrectionExtent>();
                 var records = Enumerable.Empty<DiagnosticRecord>();
-
-                // todo add a check for this while loop so that it doesn't go into a black hole
+                var numPreviousCorrections = corrections.Count;
+
                 do
                 {
                     var correctionApplied = new HashSet<int>();
@@ -186,6 +187,16 @@

                     records = ScriptAnalyzer.Instance.AnalyzeScriptDefinition(text.ToString());
                     corrections = records.Select(r => r.SuggestedCorrections.ElementAt(0)).ToList();
+                    if (numPreviousCorrections > 0 && numPreviousCorrections == corrections.Count)
+                    {
+                        this.ThrowTerminatingError(new ErrorRecord(
+                            new InvalidOperationException(),
+                            "FORMATTER_ERROR",
+                            ErrorCategory.InvalidOperation,
+                            corrections));
+                    }
+
+                    numPreviousCorrections = corrections.Count;

                     // get unique correction instances
                     // sort them by line numbers
@@ -196,7 +207,7 @@
                                     (x.StartLineNumber == x.StartLineNumber ? 0 : -1);
                     });

-                } while (records.Any());
+                } while (numPreviousCorrections > 0);
             }

             this.WriteObject(text.ToString());


add output, explicit types

add output, explicit types

--- Examples/BtreeExample03/BtreeExample03.cs
+++ Examples/BtreeExample03/BtreeExample03.cs
@@ -5,6 +5,7 @@

 using System;
 using System.Linq;
+using System.Collections.Generic;
 using Kaos.Collections;

 namespace ExampleApp
@@ -13,7 +14,7 @@
     {
         static void Main()
         {
-            var towns = new BtreeDictionary<string, int>();
+            var towns = new BtreeDictionary<string,int>();

             // Load sample data.
             towns.Add ("Albany", 43600);
@@ -40,19 +41,18 @@
             double avg = towns.Average (x => x.Value);
             Console.WriteLine ("Average population of all towns = {0:f0}", avg);

-
             // Lambda expression
-            var r1 =  towns.Where (t => t.Key.CompareTo ("E") < 0);
+            IEnumerable<KeyValuePair<string,int>> r1 = towns.Where (t => t.Key.CompareTo ("E") < 0);

             Console.WriteLine ("\nTowns A-D:");
-            foreach (var e in r1)
+            foreach (KeyValuePair<string,int> e in r1)
                 Console.WriteLine (e.Key);

             // LINQ range: O(n)
-            var r2 =  towns.SkipWhile (t => t.Key.CompareTo ("E") < 0).TakeWhile (t => t.Key.CompareTo ("J") < 0);
+            IEnumerable<KeyValuePair<string,int>> r2 = towns.SkipWhile (t => t.Key.CompareTo ("E") < 0).TakeWhile (t => t.Key.CompareTo ("J") < 0);

             Console.WriteLine ("\nTowns E-G:");
-            foreach (var e in r2)
+            foreach (KeyValuePair<string,int> e in r2)
                 Console.WriteLine (e.Key);

             //
@@ -61,17 +61,17 @@
             //

             // BtreeDictionary range operator: O(log n)
-            var r3 = towns.BetweenKeys ("K", "M");
+            IEnumerable<KeyValuePair<string,int>> r3 = towns.BetweenKeys ("K", "M");

             Console.WriteLine ("\nTowns K-L:");
-            foreach (var town in r3)
+            foreach (KeyValuePair<string,int> town in r3)
                 Console.WriteLine (town.Key);

             // BtreeDictionary range operator without upper limit: O(log n)
-            var r4 = towns.SkipUntilKey ("M");
+            IEnumerable<KeyValuePair<string,int>> r4 = towns.SkipUntilKey ("M");

             Console.WriteLine ("\nTowns M-R:");
-            foreach (var town in r4)
+            foreach (KeyValuePair<string,int> town in r4)
                 // This avoids the issue in the last example where a town named "M" would be included.
                 if (town.Key.CompareTo ("S") >= 0)
                     break;
@@ -79,11 +79,44 @@
                     Console.WriteLine (town.Key);

             // BtreeDictionary range operator without upper limit: O(log n)
-            var r5 = towns.SkipUntilKey ("T");
+            IEnumerable<KeyValuePair<string,int>> r5 = towns.SkipUntilKey ("T");

             Console.WriteLine ("\nTowns T-Z:");
-            foreach (var town in r5)
+            foreach (KeyValuePair<string,int> town in r5)
                 Console.WriteLine (town.Key);
         }
+
+        /* Output:
+
+        Average population of all towns = 13447
+
+        Towns A-D:
+        Albany
+        Bandon
+        Corvallis
+        Damascus
+
+        Towns E-G:
+        Elkton
+        Florence
+        Glide
+
+        Towns K-L:
+        Lebanon
+        Lookingglass
+
+        Towns M-R:
+        Medford
+        Powers
+        Riddle
+        Roseburg
+
+        Towns T-Z:
+        Talent
+        Umatilla
+        Winston
+        Yamhill
+
+         */
     }
 }


Minor changes

Minor changes

--- mp4box/MainForm.cs
+++ mp4box/MainForm.cs
@@ -2949,6 +2949,7 @@

         #region Log

+        [Obsolete("Not used")]
         public void Log(string path)
         {
             ProcessStartInfo start = new ProcessStartInfo(path);//设置运行的命令行文件问ping.exe文件，这个文件系统会自己找到
@@ -2972,6 +2973,7 @@
             reader.Close();//关闭流
         }

+        // TODO: use Log4Net
         public void LogRecord(string log)
         {
             FileStringUtil.ensureDirectoryExists(logPath);
@@ -3176,6 +3178,7 @@

         #endregion globalization

+        [Obsolete("Not used")]
         public static void RunProcess(string exe, string arg)
         {
             Thread thread = new Thread(() =>


do stuff

do stuff

--- src/csharp/StackExchangeAlexa.cs
+++ src/csharp/StackExchangeAlexa.cs
@@ -1,4 +1,6 @@
 using Amazon.Lambda.Core;
+
+[assembly:LambdaSerializer(typeof(Amazon.Lambda.Serialization.Json.JsonSerializer))]

 namespace StackExchange.Alexa
 {


Replaced an instance of explicit "Red" in the SplitBlockDlg with the Warning color from the palette.

--- Glyssen/Dialogs/SplitBlockDlg.Designer.cs
+++ Glyssen/Dialogs/SplitBlockDlg.Designer.cs
@@ -48,10 +48,10 @@
 			// m_lblInstructions
 			//
 			this.m_lblInstructions.AutoSize = true;
-			this.m_lblInstructions.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(73)))), ((int)(((byte)(108)))));
 			this.glyssenColorPalette.SetBackColor(this.m_lblInstructions, Glyssen.Utilities.GlyssenColors.BackColor);
+			this.m_lblInstructions.BackColor = System.Drawing.SystemColors.Control;
+			this.m_lblInstructions.ForeColor = System.Drawing.SystemColors.WindowText;
 			this.glyssenColorPalette.SetForeColor(this.m_lblInstructions, Glyssen.Utilities.GlyssenColors.ForeColor);
-			this.m_lblInstructions.ForeColor = System.Drawing.Color.White;
 			this.m_l10NSharpExtender.SetLocalizableToolTip(this.m_lblInstructions, null);
 			this.m_l10NSharpExtender.SetLocalizationComment(this.m_lblInstructions, null);
 			this.m_l10NSharpExtender.SetLocalizingId(this.m_lblInstructions, "DialogBoxes.SplitBlockDlg.ClickSplitLocation");
@@ -60,12 +60,14 @@
 			this.m_lblInstructions.Size = new System.Drawing.Size(249, 13);
 			this.m_lblInstructions.TabIndex = 2;
 			this.m_lblInstructions.Text = "Click the location where you want to split the block.";
+			this.glyssenColorPalette.SetUsePaletteColors(this.m_lblInstructions, true);
 			//
 			// m_btnCancel
 			//
 			this.m_btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
 			this.glyssenColorPalette.SetBackColor(this.m_btnCancel, Glyssen.Utilities.GlyssenColors.BackColor);
 			this.m_btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
+			this.glyssenColorPalette.SetFlatAppearanceBorderColor(this.m_btnCancel, Glyssen.Utilities.GlyssenColors.ForeColor);
 			this.glyssenColorPalette.SetForeColor(this.m_btnCancel, Glyssen.Utilities.GlyssenColors.ForeColor);
 			this.m_l10NSharpExtender.SetLocalizableToolTip(this.m_btnCancel, null);
 			this.m_l10NSharpExtender.SetLocalizationComment(this.m_btnCancel, null);
@@ -85,6 +87,7 @@
 			this.glyssenColorPalette.SetBackColor(this.m_btnOk, Glyssen.Utilities.GlyssenColors.BackColor);
 			this.m_btnOk.DialogResult = System.Windows.Forms.DialogResult.OK;
 			this.m_btnOk.Enabled = false;
+			this.glyssenColorPalette.SetFlatAppearanceBorderColor(this.m_btnOk, Glyssen.Utilities.GlyssenColors.ForeColor);
 			this.glyssenColorPalette.SetForeColor(this.m_btnOk, Glyssen.Utilities.GlyssenColors.ForeColor);
 			this.m_l10NSharpExtender.SetLocalizableToolTip(this.m_btnOk, null);
 			this.m_l10NSharpExtender.SetLocalizationComment(this.m_btnOk, null);
@@ -103,8 +106,9 @@
 			this.m_lblInvalidSplitLocation.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
 			this.m_lblInvalidSplitLocation.AutoSize = true;
 			this.glyssenColorPalette.SetBackColor(this.m_lblInvalidSplitLocation, Glyssen.Utilities.GlyssenColors.BackColor);
-			this.glyssenColorPalette.SetForeColor(this.m_lblInvalidSplitLocation, Glyssen.Utilities.GlyssenColors.ForeColor);
+			this.m_lblInvalidSplitLocation.BackColor = System.Drawing.SystemColors.Control;
 			this.m_lblInvalidSplitLocation.ForeColor = System.Drawing.Color.Red;
+			this.glyssenColorPalette.SetForeColor(this.m_lblInvalidSplitLocation, Glyssen.Utilities.GlyssenColors.Warning);
 			this.m_l10NSharpExtender.SetLocalizableToolTip(this.m_lblInvalidSplitLocation, null);
 			this.m_l10NSharpExtender.SetLocalizationComment(this.m_lblInvalidSplitLocation, null);
 			this.m_l10NSharpExtender.SetLocalizingId(this.m_lblInvalidSplitLocation, "DialogBoxes.SplitBlockDlg.InvalidSplitLocation");
@@ -113,7 +117,7 @@
 			this.m_lblInvalidSplitLocation.Size = new System.Drawing.Size(165, 13);
 			this.m_lblInvalidSplitLocation.TabIndex = 5;
 			this.m_lblInvalidSplitLocation.Text = "This is not a valid location to split.";
-			this.glyssenColorPalette.SetUsePaletteColors(this.m_lblInvalidSplitLocation, false);
+			this.glyssenColorPalette.SetUsePaletteColors(this.m_lblInvalidSplitLocation, true);
 			this.m_lblInvalidSplitLocation.Visible = false;
 			//
 			// m_blocksDisplayBrowser
@@ -122,11 +126,11 @@
             | System.Windows.Forms.AnchorStyles.Left)
             | System.Windows.Forms.AnchorStyles.Right)));
 			this.m_blocksDisplayBrowser.AutoSize = true;
-			this.m_blocksDisplayBrowser.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(73)))), ((int)(((byte)(108)))));
+			this.m_blocksDisplayBrowser.BackColor = System.Drawing.SystemColors.Control;
 			this.glyssenColorPalette.SetBackColor(this.m_blocksDisplayBrowser, Glyssen.Utilities.GlyssenColors.BackColor);
 			this.m_blocksDisplayBrowser.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+			this.m_blocksDisplayBrowser.ForeColor = System.Drawing.SystemColors.WindowText;
 			this.glyssenColorPalette.SetForeColor(this.m_blocksDisplayBrowser, Glyssen.Utilities.GlyssenColors.ForeColor);
-			this.m_blocksDisplayBrowser.ForeColor = System.Drawing.Color.White;
 			this.m_l10NSharpExtender.SetLocalizableToolTip(this.m_blocksDisplayBrowser, null);
 			this.m_l10NSharpExtender.SetLocalizationComment(this.m_blocksDisplayBrowser, null);
 			this.m_l10NSharpExtender.SetLocalizingId(this.m_blocksDisplayBrowser, "DialogBoxes.SplitBlockDlg.Browser");
@@ -134,6 +138,7 @@
 			this.m_blocksDisplayBrowser.Name = "m_blocksDisplayBrowser";
 			this.m_blocksDisplayBrowser.Size = new System.Drawing.Size(505, 263);
 			this.m_blocksDisplayBrowser.TabIndex = 1;
+			this.glyssenColorPalette.SetUsePaletteColors(this.m_blocksDisplayBrowser, true);
 			this.m_blocksDisplayBrowser.OnMouseClick += new System.EventHandler<Gecko.DomMouseEventArgs>(this.InsertSplitLocation);
 			//
 			// SplitBlockDlg
@@ -161,6 +166,7 @@
 			this.ShowInTaskbar = false;
 			this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
 			this.Text = "Split Block";
+			this.glyssenColorPalette.SetUsePaletteColors(this, true);
 			((System.ComponentModel.ISupportInitialize)(this.m_l10NSharpExtender)).EndInit();
 			((System.ComponentModel.ISupportInitialize)(this.glyssenColorPalette)).EndInit();
 			this.ResumeLayout(false);


Fixed https for Q42 links

Fixed https for Q42 links

--- HaagsVertaler/Views/Shared/_Layout.cshtml
+++ HaagsVertaler/Views/Shared/_Layout.cshtml
@@ -73,8 +73,8 @@

-
-
+
+


Copy - Added reference to Haags dictee

Copy - Added reference to Haags dictee

--- HaagsVertaler/Views/Shared/_Layout.cshtml
+++ HaagsVertaler/Views/Shared/_Layout.cshtml
@@ -81,7 +81,7 @@

-				Gemaakt door @@markvanstraten en @@roelfjandevries.
+				Gemaakt door @@markvanstraten en @@roelfjandevries (2e op het Haags dictee 2020).


Removed commented out tests and rewrote them using the testcase syntax

--- DiffLib.Tests/MergeTests.cs
+++ DiffLib.Tests/MergeTests.cs
@@ -12,37 +12,10 @@
     [TestFixture]
     public class MergeTests
     {
-        //[Test]
-        //public void Perform_AllEmptyCollections_ReturnsEmptyResults()
-        //{
-        //    var output = Merge.Perform(new int[0], new int[0], new int[0], new BasicInsertDeleteDiffElementAligner<int>(), new TakeLeftThenRightMergeConflictResolver<int>());
-        //    CollectionAssert.IsEmpty(output);
-        //}
-
-        //[Test]
-        //public void Perform_EmptyCommonBaseLeftSideInserts_ReturnsLeftSideContent()
-        //{
-        //    var commonBase = new int[0];
-        //    var left = new[] { 1, 2, 3 };
-        //    var right = new int[0];
-
-        //    var output = Merge.Perform(commonBase, left, right, new BasicInsertDeleteDiffElementAligner<int>(), new TakeLeftThenRightMergeConflictResolver<int>());
-        //    CollectionAssert.AreEqual(output, left);
-
-        //}
-
-        //[Test]
-        //public void Perform_EmptyCommonBaseRightSideInserts_ReturnsRightSideContent()
-        //{
-        //    var commonBase = new int[0];
-        //    var left = new int[0];
-        //    var right = new[] { 1, 2, 3 };
-
-        //    var output = Merge.Perform(commonBase, left, right, new BasicInsertDeleteDiffElementAligner<int>(), new TakeLeftThenRightMergeConflictResolver<int>());
-        //    CollectionAssert.AreEqual(output, right);
-        //}
-
         [Test]
+        [TestCase("", "", "", "", TestName = "Nothing to merge")]
+        [TestCase("", "123", "", "123", TestName = "Only left side inserts")]
+        [TestCase("", "", "123", "123", TestName = "Only right side inserts")]
         [TestCase("1234567890", "1234567890", "1234567890", "1234567890", TestName = "Nothing changed")]
         [TestCase("1234567890", "12a4567890", "123456b890", "12a456b890", TestName = "Both sides replaced to same")]
         [TestCase("1234567890", "123abc4567890", "1234567klm890", "123abc4567klm890", TestName = "Both sides inserted in separate places")]


Context action text

Context action text

--- 03-Inspections/1-As_you_type/1.3-Context_actions.cs
+++ 03-Inspections/1-As_you_type/1.3-Context_actions.cs
@@ -4,7 +4,9 @@
     //
     // Similar to quick fixes, but tied to a code block, not a highlight
     //
-    // Alt+Enter
+    // Alt+Enter whenever hammer gutter icon is visible
+    //
+    // NOTE: ReSharper has HUNDREDS of context actions. This file provides a very small sample

     public class ContextActions
     {


Changed so WinLess dont save settings to programData but to userData instead

--- WinLess/Settings.cs
+++ WinLess/Settings.cs
@@ -57,7 +57,7 @@
         }

         public void SaveSettings(){
-            string dataDir = string.Format("{0}\\data", Application.CommonAppDataPath);
+            string dataDir = string.Format("{0}\\data", Application.UserAppDataPath);
             string settingsFilePath = string.Format("{0}\\settings.xml", dataDir);

             try {
@@ -82,7 +82,7 @@

         public static Settings LoadSettings()
         {
-            string path = string.Format("{0}\\data\\settings.xml", Application.CommonAppDataPath);
+            string path = string.Format("{0}\\data\\settings.xml", Application.UserAppDataPath);
             if (System.IO.File.Exists(path))
             {
                 try


Update

Update

Help Updated

--- Windows/Chat_frm.cs
+++ Windows/Chat_frm.cs
@@ -934,8 +934,8 @@
                     if (Program.UserInfo.rank > 3)
                     {
                         WriteMessage(new ChatMessage(MessageType.System, CommandType.None, null, "-- SMod Commands --"));
-                        WriteMessage(new ChatMessage(MessageType.System, CommandType.None, null, "/shutdown [forced] servername - instructs the duel server to shutdown. If 'forced' is added: Does not wait for games to finish."));
-                        WriteMessage(new ChatMessage(MessageType.System, CommandType.None, null, "/restart [forced] servername - instructs the duel server to restart. If 'forced' is added: Does not wait for games to finish."));
+                        WriteMessage(new ChatMessage(MessageType.System, CommandType.None, null, "/shutdown [false]/[forced] servername - instructs the duel server to shutdown. If 'forced' is added: Does not wait for games to finish. Do not use false if you use Forced."));
+                        WriteMessage(new ChatMessage(MessageType.System, CommandType.None, null, "/restart [false]/[forced] servername - instructs the duel server to restart. If 'forced' is added: Does not wait for games to finish. Do not use false if you use Forced."));
                         WriteMessage(new ChatMessage(MessageType.System, CommandType.None, null, "/kill [forced]- Kills all crashed cores. If 'forced' is added: Kills all cores (including running games)."));
                         WriteMessage(new ChatMessage(MessageType.System, CommandType.None, null, "/ban username time reason - Bans a user, time format has to be in hours (max 730 hours), also you must give a reason."));
                         WriteMessage(new ChatMessage(MessageType.System, CommandType.None, null, "/banusername username - Bans a user's username"));


Querying using raw SQL

Querying using raw SQL

--- Intel.BikeRental.ConsoleClient/Program.cs
+++ Intel.BikeRental.ConsoleClient/Program.cs
@@ -5,6 +5,7 @@
 using System;
 using System.Collections.Generic;
 using System.Data.Entity;
+using System.Data.SqlClient;
 using System.Linq;

 namespace Intel.BikeRental.ConsoleClient
@@ -25,9 +26,80 @@
             AddVehiclesTest();
             GetVehiclesTest();
             SelectTest();
-            GroupByTest();*/
-
+            GroupByTest();
             ExceptTest();
+            SyntaxTest();
+            SqlUpdateTest();
+            SqlUpdateWithParamUnsafeTest("Red");
+            SqlUpdateWithParamUnsafeTest(@"Red'; USE master;
+ALTER DATABASE [BikeRentalDb] SET SINGLE_USER WITH ROLLBACK IMMEDIATE;
+DROP DATABASE [BikeRentalDb] ;
+select 'HE HE");
+            SqlUpdateWithParamTest("Red");
+            SqlUpdateWithParamTest(@"Red'; USE master;
+ALTER DATABASE [BikeRentalDb] SET SINGLE_USER WITH ROLLBACK IMMEDIATE;
+DROP DATABASE [BikeRentalDb] ;
+select 'HE HE");*/
+
+            GetSqlTest();
+        }
+
+        private static void GetSqlTest()
+        {
+            string sql = $"SELECT * FROM [rentals].[Vehicles] where [Color] like 'r%' and Discriminator = 'Bike';";
+
+            using (var context = new BikeRentalContext())
+            {
+                var bikes = context.Database.SqlQuery<Bike>(sql);
+                bikes.ToList().Dump();
+            }
+        }
+
+        private static void SqlUpdateWithParamTest(string color)
+        {
+            string sql = $"update[rentals].[Vehicles] set [IsActive] = 0 where [Color] = @pColor;";
+            var colorParameter = new SqlParameter("pColor", color);
+
+            using (var context = new BikeRentalContext())
+            {
+                context.Database.ExecuteSqlCommand(sql, colorParameter);
+            }
+        }
+
+        private static void SqlUpdateWithParamUnsafeTest(string color)
+        {
+            string sql = $"update[rentals].[Vehicles] set [IsActive] = 0 where [Color] = '{color}';";
+
+            using (var context = new BikeRentalContext())
+            {
+                context.Database.ExecuteSqlCommand(sql);
+            }
+        }
+
+        private static void SqlUpdateTest()
+        {
+            string sql = "update[rentals].[Vehicles] set [IsActive] = 0;";
+
+            using (var context = new BikeRentalContext())
+            {
+                context.Database.ExecuteSqlCommand(sql);
+            }
+        }
+
+        private static void SyntaxTest()
+        {
+            using (var context = new BikeRentalContext())
+            {
+                var query = (from vehicle in context.Vehicles
+                            where vehicle.Color == "Red"
+                            orderby vehicle.Number
+                            select vehicle)
+                            .Where(x => x.Number.Contains("1"));
+
+                Console.WriteLine(query.ToString());
+                var unionDistinct = query.Distinct();
+                unionDistinct.ToList().Dump();
+            }
         }

         private static void ExceptTest()


Added member filter

Added member filter

--- pMixins.CodeGenerator/Pipelines/CreateCodeGenerationPlan/Steps/CollectAllMembers.cs
+++ pMixins.CodeGenerator/Pipelines/CreateCodeGenerationPlan/Steps/CollectAllMembers.cs
@@ -16,9 +16,12 @@
 // </copyright>
 //-----------------------------------------------------------------------

+using System;
 using System.Collections.Generic;
 using System.Linq;
+using CopaceticSoftware.CodeGenerator.StarterKit.Extensions;
 using CopaceticSoftware.Common.Patterns;
+using CopaceticSoftware.pMixins.Attributes;
 using CopaceticSoftware.pMixins.CodeGenerator.Infrastructure;
 using CopaceticSoftware.pMixins.CodeGenerator.Pipelines.ResolveAttributes.Infrastructure;
 using ICSharpCode.NRefactory.TypeSystem;
@@ -33,7 +36,11 @@
             {
                 foreach (var mixin in manager.GetAllPMixinAttributes(target))
                 {
-                    var mixinMembers = CollectMemberWrappers(mixin).ToList();
+                    var memberFilter = BuildMemberFilterFunction(
+                        mixin,
+                        manager.CommonState.Context.TypeResolver.Compilation);
+
+                    var mixinMembers = CollectMemberWrappers(mixin, memberFilter).ToList();

                     //Save Members
                     manager.CodeGenerationPlans[target].MixinGenerationPlans[mixin].Members = mixinMembers;
@@ -43,21 +50,26 @@
             return true;
         }

-        private IEnumerable<MemberWrapper> CollectMemberWrappers(pMixinAttributeResolvedResult mixinAttribute)
+        private IEnumerable<MemberWrapper> CollectMemberWrappers(
+            pMixinAttributeResolvedResult mixinAttribute,
+            Func<IMember, bool> memberFilter)
         {
             return
                 //Collect all applicable types
                 mixinAttribute.Mixin.GetAllBaseTypes()
                     .Union(new[] {mixinAttribute.Mixin})
                     //Collect all members
-                    .SelectMany(t => CollectMemberWrappers(t, mixinAttribute));
+                    .SelectMany(t => CollectMemberWrappers(t, mixinAttribute, memberFilter));
         }

-        private IEnumerable<MemberWrapper> CollectMemberWrappers(IType parentType,
-            pMixinAttributeResolvedResult mixinAttribute)
+        private IEnumerable<MemberWrapper> CollectMemberWrappers(
+            IType parentType,
+            pMixinAttributeResolvedResult mixinAttribute,
+            Func<IMember, bool> memberFilter)
         {
             return
                 parentType.GetMembers()
+                    .Where(memberFilter)
                     .Select(m =>
                         new MemberWrapper
                         {
@@ -67,5 +79,29 @@
                         });

         }
+
+        private Func<IMember, bool> BuildMemberFilterFunction(
+            pMixinAttributeResolvedResult mixinAttribute,
+            ICompilation compilation)
+        {
+            var includeInternalMembers =
+                    mixinAttribute.Mixin.GetDefinition().ParentAssembly.Equals(
+                    compilation.MainAssembly);
+
+            var doNotMixinIType =
+                typeof(DoNotMixinAttribute)
+                .ToIType(compilation);
+
+            return new Func<IMember, bool>(
+                member => (
+                            !member.IsPrivate &&
+                            (!member.IsProtected || !mixinAttribute.Mixin.GetDefinition().IsSealed) &&
+                            (!member.IsInternal || includeInternalMembers) &&
+                            !member.FullName.StartsWith("System.Object") &&
+                            !member.IsDecoratedWithAttribute(doNotMixinIType) &&
+                            !member.DeclaringType.IsDecoratedWithAttribute(doNotMixinIType, includeBaseTypes: false)));
+
+
+        }
     }
 }


when adding a mod, it will now give it a unique name (previous packageName + _NEW_ + i++), enforcing always unique.

--- RelicModManager/DatabaseEditor.cs
+++ RelicModManager/DatabaseEditor.cs
@@ -46,9 +46,9 @@

         private void DatabaseEditor_FormClosing(object sender, FormClosingEventArgs e)
         {
-            if(UnsavedModifications)
-            {
-                if(MessageBox.Show("You have unsaved changes, return to editor?","unsaved changes",MessageBoxButtons.YesNo) == DialogResult.Yes)
+            if (UnsavedModifications)
+            {
+                if (MessageBox.Show("You have unsaved changes, return to editor?", "unsaved changes", MessageBoxButtons.YesNo) == DialogResult.Yes)
                 {
                     e.Cancel = true;
                     return;
@@ -70,7 +70,7 @@
             if (DatabaseEditorMode == EditorMode.GlobalDependnecy)
             {
                 DatabaseTreeView.Nodes.Clear();
-                foreach(Dependency d in GlobalDependencies)
+                foreach (Dependency d in GlobalDependencies)
                 {
                     SearchBox.Items.Add(d.packageName);
                     allPackageNames.Add(d.packageName);
@@ -100,13 +100,13 @@
             else if (DatabaseEditorMode == EditorMode.DBO)
             {
                 DatabaseTreeView.Nodes.Clear();
-                foreach(Category cat in ParsedCategoryList)
+                foreach (Category cat in ParsedCategoryList)
                 {
                     SearchBox.Items.Add(cat.name);
                     allPackageNames.Add(cat.name);
                     DatabaseTreeNode catNode = new DatabaseTreeNode(cat, 4);
                     DatabaseTreeView.Nodes.Add(catNode);
-                    foreach(Mod m in cat.mods)
+                    foreach (Mod m in cat.mods)
                     {
                         SearchBox.Items.Add(m.packageName);
                         allPackageNames.Add(m.packageName);
@@ -117,9 +117,9 @@
                         DisplayDatabaseConfigs(modNode, m.configs);
                     }
                 }
-
-            }
-            if(resetUI)
+
+            }
+            if (resetUI)
                 ResetUI();
         }
         private void ResetUI()
@@ -172,7 +172,7 @@
         }
         private void DisplayDatabaseConfigs(DatabaseTreeNode parrent, List<Config> configs)
         {
-            foreach(Config c in configs)
+            foreach (Config c in configs)
             {
                 SearchBox.Items.Add(c.packageName);
                 allPackageNames.Add(c.packageName);
@@ -301,7 +301,7 @@
                 }
                 else if (SelectedDatabaseObject is Config)
                 {
-                    if(ObjectTypeComboBox.SelectedIndex == -1 || ObjectTypeComboBox.SelectedIndex == 0)
+                    if (ObjectTypeComboBox.SelectedIndex == -1 || ObjectTypeComboBox.SelectedIndex == 0)
                     {
                         MessageBox.Show("Invalid Index of config type");
                         return;
@@ -322,7 +322,7 @@
                         cfg.zipFile = ObjectZipFileTB.Text;
                         cfg.devURL = ObjectDevURLTB.Text;
                         cfg.version = ObjectVersionTB.Text;
-                        switch(ObjectTypeComboBox.SelectedIndex)
+                        switch (ObjectTypeComboBox.SelectedIndex)
                         {
                             case 1:
                                 cfg.type = "single1";
@@ -350,7 +350,7 @@
         }
         private List<Mod> ListContainsMod(Mod mod)
         {
-            foreach(Category cat in ParsedCategoryList)
+            foreach (Category cat in ParsedCategoryList)
             {
                 if (cat.mods.Contains(mod))
                     return cat.mods;
@@ -361,14 +361,14 @@
         {
             foreach (Category cat in ParsedCategoryList)
             {
-                foreach(Mod m in cat.mods)
+                foreach (Mod m in cat.mods)
                 {
                     if (m.configs.Contains(cfg) && ListThatContainsConfig == null)
                     {
                         ListThatContainsConfig = m.configs;
                         return;
                     }
-                    if(m.configs.Count > 0)
+                    if (m.configs.Count > 0)
                     {
                         ListContainsConfigRecursive(m.configs, cfg);
                     }
@@ -377,14 +377,14 @@
         }
         private void ListContainsConfigRecursive(List<Config> cfgList, Config cfg)
         {
-            foreach(Config c in cfgList)
-            {
-                if(c.configs.Contains(cfg) && ListThatContainsConfig == null)
+            foreach (Config c in cfgList)
+            {
+                if (c.configs.Contains(cfg) && ListThatContainsConfig == null)
                 {
                     ListThatContainsConfig = c.configs;
                     return;
                 }
-                if(c.configs.Count > 0)
+                if (c.configs.Count > 0)
                 {
                     ListContainsConfigRecursive(c.configs, cfg);
                 }
@@ -460,7 +460,7 @@
             //DatabaseTreeView.SelectedNode.BackColor = Color.Blue;
             //DatabaseTreeView.SelectedNode.ForeColor = Color.Blue;
             DatabaseTreeNode node = (DatabaseTreeNode)DatabaseTreeView.SelectedNode;
-            if(node.GlobalDependency != null)
+            if (node.GlobalDependency != null)
             {
                 SelectedGlobalDependency = node.GlobalDependency;
                 SelectedDependency = null;
@@ -666,7 +666,7 @@
                 {
                     ObjectTypeComboBox.Enabled = true;
                     Config cfg = (Config)SelectedDatabaseObject;
-                    switch(cfg.type)
+                    switch (cfg.type)
                     {
                         case "single":
                             ObjectTypeComboBox.SelectedIndex = 1;
@@ -771,7 +771,7 @@
                 ObjectEndAddressTB.Text = "";

                 ObjectZipFileTB.Enabled = false;
-                ObjectZipFileTB.Text ="";
+                ObjectZipFileTB.Text = "";

                 ObjectDevURLTB.Enabled = false;
                 ObjectDevURLTB.Text = "";
@@ -822,14 +822,14 @@
                 MessageBox.Show("Database Not Loaded");
                 return;
             }
-            if(SelectedCategory != null)
+            if (SelectedCategory != null)
             {
                 MessageBox.Show("Moving categories is not supported");
                 return;
             }
             if (MessageBox.Show("Confirm you wish to move the object?", "Confirm", MessageBoxButtons.YesNo) == DialogResult.No)
                 return;
-            using (DatabaseAdder dba = new DatabaseAdder(DatabaseEditorMode, GlobalDependencies, Dependencies, LogicalDependencies, ParsedCategoryList,true))
+            using (DatabaseAdder dba = new DatabaseAdder(DatabaseEditorMode, GlobalDependencies, Dependencies, LogicalDependencies, ParsedCategoryList, true))
             {
                 dba.ShowDialog();
                 if (dba.DialogResult == DialogResult.OK)
@@ -869,7 +869,7 @@
                             //mod->config
                             Mod modToMove = (Mod)SelectedDatabaseObject;
                             if (dba.SelectedDatabaseObject is Mod)
-                            {
+                            {
                                 Mod Ref = (Mod)dba.SelectedDatabaseObject;
                                 //remove mod from list
                                 List<Mod> ModList = ListContainsMod(modToMove);
@@ -948,7 +948,7 @@
                                 ListContainsConfig(cfgToMove);
                                 if (ListThatContainsConfig != null)
                                 {
-
+
                                     //make move
                                     ListThatContainsConfig.Remove(cfgToMove);
                                 }
@@ -989,7 +989,7 @@

         private void AddEntryButton_Click(object sender, EventArgs e)
         {
-            if(ParsedCategoryList == null || GlobalDependencies == null || Dependencies == null || LogicalDependencies == null)
+            if (ParsedCategoryList == null || GlobalDependencies == null || Dependencies == null || LogicalDependencies == null)
             {
                 MessageBox.Show("Database Not Loaded");
                 return;
@@ -999,7 +999,7 @@
                 MessageBox.Show("Adding categories is not supported");
                 return;
             }
-            using (DatabaseAdder dba = new DatabaseAdder(DatabaseEditorMode, GlobalDependencies, Dependencies, LogicalDependencies, ParsedCategoryList,false))
+            using (DatabaseAdder dba = new DatabaseAdder(DatabaseEditorMode, GlobalDependencies, Dependencies, LogicalDependencies, ParsedCategoryList, false))
             {
                 dba.ShowDialog();
                 if (dba.DialogResult == DialogResult.OK)
@@ -1009,7 +1009,7 @@
                         if (dba.SelectedGlobalDependency == null)
                             return;
                         Dependency newDep = new Dependency();
-                        newDep.packageName = ObjectPackageNameTB.Text;
+                        newDep.packageName = this.GetNewPackageName(ObjectPackageNameTB.Text);
                         newDep.startAddress = ObjectStartAddressTB.Text;
                         newDep.endAddress = ObjectEndAddressTB.Text;
                         newDep.dependencyZipFile = ObjectZipFileTB.Text;
@@ -1028,7 +1028,7 @@
                         if (dba.SelectedDependency == null)
                             return;
                         Dependency newDep = new Dependency();
-                        newDep.packageName = ObjectPackageNameTB.Text;
+                        newDep.packageName = this.GetNewPackageName(ObjectPackageNameTB.Text);
                         newDep.startAddress = ObjectStartAddressTB.Text;
                         newDep.endAddress = ObjectEndAddressTB.Text;
                         newDep.dependencyZipFile = ObjectZipFileTB.Text;
@@ -1048,7 +1048,7 @@
                         if (dba.SelectedLogicalDependency == null)
                             return;
                         LogicalDependnecy newDep = new LogicalDependnecy();
-                        newDep.packageName = ObjectPackageNameTB.Text;
+                        newDep.packageName = this.GetNewPackageName(ObjectPackageNameTB.Text);
                         newDep.startAddress = ObjectStartAddressTB.Text;
                         newDep.endAddress = ObjectEndAddressTB.Text;
                         newDep.dependencyZipFile = ObjectZipFileTB.Text;
@@ -1070,7 +1070,7 @@
                             {
                                 Config cfg = new Config();
                                 cfg.name = ObjectNameTB.Text;
-                                cfg.packageName = ObjectPackageNameTB.Text;
+                                cfg.packageName = this.GetNewPackageName(ObjectPackageNameTB.Text);
                                 cfg.startAddress = ObjectStartAddressTB.Text;
                                 cfg.endAddress = ObjectEndAddressTB.Text;
                                 cfg.zipFile = ObjectZipFileTB.Text;
@@ -1107,7 +1107,7 @@
                                 //make changes
                                 Mod m = new Mod();
                                 m.name = ObjectNameTB.Text;
-                                m.packageName = ObjectPackageNameTB.Text;
+                                m.packageName = this.GetNewPackageName(ObjectPackageNameTB.Text);
                                 m.startAddress = ObjectStartAddressTB.Text;
                                 m.endAddress = ObjectEndAddressTB.Text;
                                 m.zipFile = ObjectZipFileTB.Text;
@@ -1134,7 +1134,7 @@
                             {
                                 Config cfg = new Config();
                                 cfg.name = ObjectNameTB.Text;
-                                cfg.packageName = ObjectPackageNameTB.Text;
+                                cfg.packageName = this.GetNewPackageName(ObjectPackageNameTB.Text);
                                 cfg.startAddress = ObjectStartAddressTB.Text;
                                 cfg.endAddress = ObjectEndAddressTB.Text;
                                 cfg.zipFile = ObjectZipFileTB.Text;
@@ -1175,7 +1175,7 @@
                                     //make changes
                                     Config cfg = new Config();
                                     cfg.name = ObjectNameTB.Text;
-                                    cfg.packageName = ObjectPackageNameTB.Text;
+                                    cfg.packageName = this.GetNewPackageName(ObjectPackageNameTB.Text);
                                     cfg.startAddress = ObjectStartAddressTB.Text;
                                     cfg.endAddress = ObjectEndAddressTB.Text;
                                     cfg.zipFile = ObjectZipFileTB.Text;
@@ -1235,7 +1235,7 @@
             else if (DatabaseEditorMode == EditorMode.Dependency)
             {
                 //check if the dependency is in use first
-                if(DependencyInUse(SelectedDependency.packageName,true))
+                if (DependencyInUse(SelectedDependency.packageName, true))
                 {
                     MessageBox.Show("Cannot remove because it is in use:\n" + InUseSB.ToString());
                 }
@@ -1247,7 +1247,7 @@
             else if (DatabaseEditorMode == EditorMode.LogicalDependency)
             {
                 //check if the dependency is in use first
-                if(DependencyInUse(SelectedLogicalDependency.packageName,false))
+                if (DependencyInUse(SelectedLogicalDependency.packageName, false))
                 {
                     MessageBox.Show("Cannot remove because it is in use:\n" + InUseSB.ToString());
                 }
@@ -1296,9 +1296,9 @@
                     }
                 }
             }
-            foreach(Category c in ParsedCategoryList)
-            {
-                foreach(Dependency d in c.dependencies)
+            foreach (Category c in ParsedCategoryList)
+            {
+                foreach (Dependency d in c.dependencies)
                 {
                     if (d.packageName.Equals(packageName))
                     {
@@ -1306,17 +1306,9 @@
                         InUseSB.Append("Category: " + c.name);
                     }
                 }
-                foreach(Mod m in c.mods)
-                {
-                    foreach(Dependency d in m.dependencies)
-                    {
-                        if(d.packageName.Equals(packageName))
-                        {
-                            InUse = true;
-                            InUseSB.Append("Mod: " + m.packageName + "\n");
-                        }
-                    }
-                    foreach(LogicalDependnecy d in m.logicalDependencies)
+                foreach (Mod m in c.mods)
+                {
+                    foreach (Dependency d in m.dependencies)
                     {
                         if (d.packageName.Equals(packageName))
                         {
@@ -1324,6 +1316,14 @@
                             InUseSB.Append("Mod: " + m.packageName + "\n");
                         }
                     }
+                    foreach (LogicalDependnecy d in m.logicalDependencies)
+                    {
+                        if (d.packageName.Equals(packageName))
+                        {
+                            InUse = true;
+                            InUseSB.Append("Mod: " + m.packageName + "\n");
+                        }
+                    }
                     ProcessConfigsInUse(InUseSB, m.configs, InUse, packageName);
                 }
             }
@@ -1331,9 +1331,9 @@
         }
         private void ProcessConfigsInUse(StringBuilder sb, List<Config> configs, bool InUse, string packageName)
         {
-            foreach(Config c in configs)
-            {
-                foreach(Dependency d in c.dependencies)
+            foreach (Config c in configs)
+            {
+                foreach (Dependency d in c.dependencies)
                 {
                     if (d.packageName.Equals(packageName))
                     {
@@ -1341,7 +1341,7 @@
                         InUseSB.Append("Config: " + c.packageName + "\n");
                     }
                 }
-                foreach(LogicalDependnecy d in c.logicalDependencies)
+                foreach (LogicalDependnecy d in c.logicalDependencies)
                 {
                     if (d.packageName.Equals(packageName))
                     {
@@ -1488,7 +1488,7 @@
                 return;
             }
             int index = Utils.parseInt(AddPictureTB.Text, -1);
-            if(index == -1)
+            if (index == -1)
             {
                 MessageBox.Show("Invalid index in add at positon");
                 return;
@@ -1531,12 +1531,12 @@
             if (MessageBox.Show("Confirm you wish to edit picture entry", "confirm", MessageBoxButtons.YesNo) == DialogResult.No)
                 return;
             Media media = (Media)ObjectPicturesList.SelectedItem;
-            if(PicturesTypeCBox.SelectedIndex == -1 || PicturesTypeCBox.SelectedIndex == 0)
+            if (PicturesTypeCBox.SelectedIndex == -1 || PicturesTypeCBox.SelectedIndex == 0)
             {
                 MessageBox.Show("Invalid entry in Picture Type");
                 return;
             }
-            if(PicturesTypeCBox.SelectedIndex == 1)
+            if (PicturesTypeCBox.SelectedIndex == 1)
             {
                 media.mediaType = MediaType.picture;
             }
@@ -1557,9 +1557,9 @@
             if (lb.DataSource == null)
                 return;
             LogicalDependnecy ld = (LogicalDependnecy)lb.SelectedItem;
-            foreach(LogicalDependnecy d in LogicalDependencies)
-            {
-                if(d.packageName.Equals(ld.packageName))
+            foreach (LogicalDependnecy d in LogicalDependencies)
+            {
+                if (d.packageName.Equals(ld.packageName))
                 {
                     CurrentLogicalDependenciesCB.SelectedItem = d;
                     break;
@@ -1617,7 +1617,7 @@
             if (lb.DataSource == null)
                 return;
             Media med = (Media)lb.SelectedItem;
-            switch(med.mediaType)
+            switch (med.mediaType)
             {
                 case MediaType.picture:
                     PicturesTypeCBox.SelectedIndex = 1;
@@ -1687,7 +1687,7 @@
                 {
                     dtn.EnsureVisible();
                     DatabaseTreeView.SelectedNode = dtn;
-                    DatabaseTreeView_NodeMouseClick(null, new TreeNodeMouseClickEventArgs(dtn,MouseButtons.Left,0,0,0));
+                    DatabaseTreeView_NodeMouseClick(null, new TreeNodeMouseClickEventArgs(dtn, MouseButtons.Left, 0, 0, 0));
                 }
             }
         }
@@ -1812,11 +1812,11 @@
                 return;
             string packageNameSearch = "";
             packageNameSearch = (string)cb.SelectedItem;
-            foreach(DatabaseTreeNode node in DatabaseTreeView.Nodes)
-            {
-                if(node.GlobalDependency != null)
-                {
-                    if(node.GlobalDependency.packageName.Equals(packageNameSearch))
+            foreach (DatabaseTreeNode node in DatabaseTreeView.Nodes)
+            {
+                if (node.GlobalDependency != null)
+                {
+                    if (node.GlobalDependency.packageName.Equals(packageNameSearch))
                     {
                         DatabaseTreeView_NodeMouseClick(DatabaseTreeView, new TreeNodeMouseClickEventArgs(node, MouseButtons.Left, 0, 0, 0));
                     }
@@ -1871,7 +1871,7 @@

         private void DownloadZipfileButton_Click(object sender, EventArgs e)
         {
-            if(ObjectZipFileTB.Text.Equals(""))
+            if (ObjectZipFileTB.Text.Equals(""))
             {
                 MessageBox.Show("Nothing to download");
                 return;
@@ -1880,5 +1880,73 @@
             DatabaseDownloadEditor editor = new DatabaseDownloadEditor(DownloadURL, Path.GetFileName(ObjectZipFileTB.Text));
             editor.Show();
         }
+
+        private bool DuplicatePackageName(List<Dependency> GlobalDependencies, List<Dependency> Dependencies, List<LogicalDependnecy> LogicalDependencies, List<Category> ParsedCategoryList, string PackageName)
+        {
+            bool duplicate = false;
+            foreach (Dependency d in GlobalDependencies)
+            {
+                if (d.packageName.Equals(PackageName))
+                {
+                    duplicate = true;
+                    return duplicate;
+                }
+            }
+            foreach (Dependency d in Dependencies)
+            {
+                if (d.packageName.Equals(PackageName))
+                {
+                    duplicate = true;
+                    return duplicate;
+                }
+            }
+            foreach (LogicalDependnecy d in LogicalDependencies)
+            {
+                if (d.packageName.Equals(PackageName))
+                {
+                    duplicate = true;
+                    return duplicate;
+                }
+            }
+            foreach (Category c in ParsedCategoryList)
+            {
+                foreach (Mod m in c.mods)
+                {
+                    if (m.packageName.Equals(PackageName))
+                    {
+                        duplicate = true;
+                        return duplicate;
+                    }
+                    if (m.configs.Count > 0)
+                    {
+                        duplicate = DuplicatePackageNameConfig(m.configs, PackageName);
+                        if (duplicate)
+                            return duplicate;
+                    }
+                }
+            }
+            return duplicate;
+        }
+
+        private bool DuplicatePackageNameConfig(List<Config> configList, string PackageName)
+        {
+            foreach(Config c in configList)
+            {
+                if(c.packageName.Equals(PackageName))
+                {
+                    return true;
+                }
+            }
+            return false;
+        }
+
+        private string GetNewPackageName(string oldPackageName)
+        {
+            int i = 1;
+            string packageName = oldPackageName + "_NEW_" + i;
+            while (DuplicatePackageName(this.GlobalDependencies, this.Dependencies, this.LogicalDependencies, this.ParsedCategoryList, packageName))
+                packageName = oldPackageName + "_NEW_" + i++;
+            return packageName;
+        }
     }
 }


Update Viktor.cs

Update Viktor.cs

--- AdEvade/AdEvade/Data/Spells/SpecialSpells/Viktor.cs
+++ AdEvade/AdEvade/Data/Spells/SpecialSpells/Viktor.cs
@@ -32,7 +32,7 @@
                 args.SData.Name != null && args.SData.Name == "ViktorDeathRay")

             {
-                  var endpoint = sender.Path.Last();
+                  var endpoint = sender.Path;
             //    var missileDist = End.To2D().Distance(args.Start.To2D());
               //  var delay = missileDist / 1.5f + 600;


//ExFor tag

//ExFor tag

--- ApiExamples/CSharp/ApiExamples/ExMailMergeCustom.cs
+++ ApiExamples/CSharp/ApiExamples/ExMailMergeCustom.cs
@@ -25,6 +25,7 @@
             //ExFor:IMailMergeDataSource.GetValue
             //ExFor:IMailMergeDataSource.GetChildDataSource
             //ExFor:MailMerge.Execute(IMailMergeDataSource)
+            //ExFor:MailMerge.Execute(IMailMergeDataSourceCore)
             //ExSummary:Performs mail merge from a custom data source.
             // Create some data that we will use in the mail merge.
             CustomerList customers = new CustomerList();


Remove /Api/WWW/Directory/{directory} endpoint

No longer used by ASF-ui

--- ArchiSteamFarm/IPC/Controllers/Api/WWWController.cs
+++ ArchiSteamFarm/IPC/Controllers/Api/WWWController.cs
@@ -20,10 +20,7 @@
 // limitations under the License.

 using System;
-using System.Collections.Generic;
 using System.Globalization;
-using System.IO;
-using System.Linq;
 using System.Net;
 using System.Threading.Tasks;
 using ArchiSteamFarm.IPC.Requests;
@@ -34,42 +31,6 @@
 namespace ArchiSteamFarm.IPC.Controllers.Api {
 	[Route("Api/WWW")]
 	public sealed class WWWController : ArchiController {
-		/// <summary>
-		///     Fetches files in given directory relative to WWW root.
-		/// </summary>
-		/// <remarks>
-		///     This is internal API being utilizied by our ASF-ui IPC frontend. You should not depend on existence of any /Api/WWW endpoints as they can disappear and change anytime.
-		/// </remarks>
-		[HttpGet("Directory/{directory:required}")]
-		[ProducesResponseType(typeof(GenericResponse<IReadOnlyCollection<string>>), (int) HttpStatusCode.OK)]
-		[ProducesResponseType(typeof(GenericResponse), (int) HttpStatusCode.BadRequest)]
-		[ProducesResponseType(typeof(GenericResponse), (int) HttpStatusCode.InternalServerError)]
-		public ActionResult<GenericResponse> DirectoryGet(string directory) {
-			if (string.IsNullOrEmpty(directory)) {
-				throw new ArgumentNullException(directory);
-			}
-
-			string directoryPath = Path.Combine(ArchiKestrel.WebsiteDirectory, directory);
-
-			if (!Directory.Exists(directoryPath)) {
-				return BadRequest(new GenericResponse(false, string.Format(CultureInfo.CurrentCulture, Strings.ErrorIsInvalid, directory)));
-			}
-
-			string[] files;
-
-			try {
-				files = Directory.GetFiles(directoryPath);
-			} catch (Exception e) {
-				ASF.ArchiLogger.LogGenericException(e);
-
-				return StatusCode((int) HttpStatusCode.InternalServerError, new GenericResponse(false, string.Format(CultureInfo.CurrentCulture, Strings.ErrorParsingObject, nameof(files)) + Environment.NewLine + e));
-			}
-
-			HashSet<string> result = files.Select(Path.GetFileName).Where(fileName => !string.IsNullOrEmpty(fileName)).ToHashSet(StringComparer.Ordinal)!;
-
-			return Ok(new GenericResponse<IReadOnlyCollection<string>>(result));
-		}
-
 		/// <summary>
 		///     Fetches the most recent GitHub release of ASF project.
 		/// </summary>


fix null reference exception

fix null reference exception

--- EditedTokenLocator/Token.cs
+++ EditedTokenLocator/Token.cs
@@ -30,7 +30,7 @@

 				while (true)
 				{
-					if (current?.Next.PhraseStart != PhraseStart)
+					if (current.Next?.PhraseStart != PhraseStart)
 						return current;

 					current = current.Next;


Segment2Line 메서드 추가

Segment2Line 메서드 추가

--- GCS/Shape.cs
+++ GCS/Shape.cs
@@ -82,16 +82,14 @@
             GUI.DrawLine(sb, Point1, Point2, Border, Color);
         }
     }
-
-
+
     public class Segment : Shape
     {
-        public Vector2 Point1;
-        public Vector2 Point2;
+        public Vector2 Point1 { get; set; }
+        public Vector2 Point2 { get; set; }
         public float Grad { get => (Point2 - Point1).Y / (Point2 - Point1).X; }
         public float Yint => (Point1.Y) - Grad * Point1.X;

-
         public Segment(Vector2 p1, Vector2 p2)
         {
             Point1 = p1;
@@ -101,6 +99,11 @@
         public override void Draw(SpriteBatch sb)
         {
             GUI.DrawLine(sb, Point1, Point2, Border, Color);
+        }
+
+        public Line ToLine()
+        {
+            return new Line(Grad, Yint);
         }
     }


Fix portable install not recognizing itself after importing login session

--- Program.cs
+++ Program.cs
@@ -22,13 +22,14 @@

         public const string VersionTag = "1.13.4.1";

-        public static readonly bool IsPortable = File.Exists("makeportable");

         public static readonly string ProgramPath = AppDomain.CurrentDomain.BaseDirectory;
-        public static readonly string StoragePath = IsPortable ? Path.Combine(ProgramPath, "portable", "storage") : GetDataStoragePath();
+        public static readonly bool IsPortable = File.Exists(Path.Combine(ProgramPath, "makeportable"));

         public static readonly string ScriptPath = Path.Combine(ProgramPath, "scripts");
         public static readonly string PluginPath = Path.Combine(ProgramPath, "plugins");
+
+        public static readonly string StoragePath = IsPortable ? Path.Combine(ProgramPath, "portable", "storage") : GetDataStoragePath();

         public static readonly string PluginDataPath = Path.Combine(StoragePath, "TD_Plugins");
         public static readonly string InstallerPath = Path.Combine(StoragePath, "TD_Updates");


refined handling of ComplexExponential exponents

--- Program.cs
+++ Program.cs
@@ -713,7 +713,16 @@
         public Number Exponent { get; }
         ComplexExponential(Number exponent)
         {
-            Exponent = exponent * new GaussianInteger(0, 1);
+            if (exponent is Fraction)
+            {
+                Fraction exponentFraction = (Fraction)exponent;
+                Exponent = exponentFraction -
+                    new Integer(exponentFraction.Numerator / exponentFraction.Denominator);
+                if (exponentFraction.Numerator < 0)
+                    Exponent += new Integer(1);
+            }
+            else
+                Exponent = exponent;
         }
         public static Number create(Number exponent)
         {
@@ -837,7 +846,7 @@
         }
         public override Number reciprocal()
         {
-            return new ComplexExponential(Exponent.negative());
+            return create(Exponent.negative());
         }
         public override Number exponentiate(Number exponent)
         {
@@ -860,7 +869,8 @@
         }
         public override string ToString()
         {
-            return "e^(" + Exponent.insertString("tau") + ')';
+            Number exponentWith_i = Exponent * new GaussianInteger(0, 1);
+            return "e^(" + exponentWith_i.insertString("tau") + ')';
         }
     }
     class Product : Term
@@ -1293,6 +1303,7 @@
         public NumberList(List<Number> numbers)
         {
             Numbers = numbers;
+            Numbers.Sort();
         }
         protected override Number add(Number number)
         {


clear content

clear content

--- Program.cs
+++ Program.cs
@@ -38,6 +38,12 @@

         var local = Path.Combine(Path.GetDirectoryName(assembly.Location), "Content");

+        try
+        {
+            Directory.Delete(local, recursive: true);
+        }
+        catch
+        { }
         Directory.CreateDirectory(local);

         File.WriteAllText(Path.Combine(local, "bytes.json"), assmJson);


Workaround for deadlock in NuGet library.

--- AudioWorks/src/AudioWorks.Api/ExtensionInstaller.cs
+++ AudioWorks/src/AudioWorks.Api/ExtensionInstaller.cs
@@ -90,8 +90,10 @@
                 using (var tokenSource = new CancellationTokenSource(
                     ConfigurationManager.Configuration.GetValue("AutomaticExtensionDownloadTimeout", 30) * 1000))
                 {
-                    var publishedPackages = await GetPublishedPackagesAsync(logger, tokenSource.Token)
-                        .ConfigureAwait(false);
+                    // Hack - do this on the thread pool to avoid deadlocks
+                    var publishedPackages = await Task.Run(() =>
+                        // ReSharper disable once AccessToDisposedClosure
+                        GetPublishedPackagesAsync(logger, tokenSource.Token), tokenSource.Token).ConfigureAwait(false);

                     var packagesInstalled = false;
                     foreach (var packageMetadata in publishedPackages)


tweak request access route

tweak request access route

--- Battery-Commander.Web/Controllers/HomeController.cs
+++ Battery-Commander.Web/Controllers/HomeController.cs
@@ -53,6 +53,7 @@
             });
         }

+        [Route("~/RequestAccess")]
         public IActionResult RequestAccess()
         {
             return View(new RequestAccessModel
@@ -69,7 +70,7 @@
             });
         }

-        [HttpPost]
+        [Route("~/RequestAccess"), HttpPost]
         public async Task<IActionResult> RequestAccess(RequestAccessModel model)
         {
             // Process request, send email to admin with info


Alterado para adicionar empresa

Alterado para adicionar empresa

--- BesyProject/BesyProject/Views/Empresas/Index.cshtml
+++ BesyProject/BesyProject/Views/Empresas/Index.cshtml
@@ -14,7 +14,7 @@

-        @Html.ActionLink("Criar Empresa", "Create")
+        @Html.ActionLink("Adicionar Empresa", "Create")


Delete temporary GroupType after deleting temporary Group

--- BuildingCoder/BuildingCoder/CmdDuplicateElements.cs
+++ BuildingCoder/BuildingCoder/CmdDuplicateElements.cs
@@ -65,6 +65,8 @@
         Group group = doc.Create.NewGroup( // 2013
           uidoc.Selection.GetElementIds() );

+        GroupType groupType = group.GroupType;
+
         LocationPoint location = group.Location
           as LocationPoint;

@@ -82,6 +84,8 @@
         ICollection<ElementId> eIds
           = newGroup.UngroupMembers(); // 2013

+        doc.Delete2( groupType );
+
         // change the property or parameter values
         // of the member elements as required...


Fade color and alpha are separate but it's pretty ugly right now

--- CardboardControl/Scripts/CardboardControlPointer.cs
+++ CardboardControl/Scripts/CardboardControlPointer.cs
@@ -5,7 +5,10 @@
 	private GameObject pointer;
   private Color targetColor = Color.white;
   private Color previousColor = Color.white;
-  private float fadeCounter = 0f;
+  private float fadeColorCounter = 0f;
+  private float targetAlpha = 1f;
+  private float previousAlpha = 1f;
+  private float fadeAlphaCounter = 0f;

   public GameObject pointerPrefab;
   public LayerMask raycastIgnoreLayer = 1 << Physics.IgnoreRaycastLayer;
@@ -20,18 +23,27 @@
     pointer.GetComponent<Renderer>().material.renderQueue = int.MaxValue;
     pointer.transform.parent = head.transform;
     pointer.layer = LayerMask.NameToLayer("Ignore Raycast");
-    if (startHidden) targetColor.a = 0;
+    if (startHidden) targetAlpha = 0f;
 	}

   void Update() {
-    if (fadeCounter > 0f) {
-      float percentage = (fadeTime - fadeCounter) / fadeTime;
-      Color newColor = Color.Lerp(previousColor, targetColor, percentage);
+    if (fadeColorCounter > 0f || fadeAlphaCounter > 0f) {
+      float colorPercentage = (fadeTime - fadeColorCounter) / fadeTime;
+      float alphaPercentage = (fadeTime - fadeAlphaCounter) / fadeTime;
+
+      Color newColor = Color.Lerp(previousColor, targetColor, colorPercentage);
+      newColor.a = Mathf.Lerp(previousAlpha, targetAlpha, alphaPercentage);
       pointer.GetComponent<Renderer>().material.color = newColor;
-      fadeCounter -= Time.deltaTime;
+
+      fadeColorCounter -= Time.deltaTime;
+      if (fadeColorCounter < 0f) fadeColorCounter = 0f;
+      fadeAlphaCounter -= Time.deltaTime;
+      if (fadeAlphaCounter < 0f) fadeAlphaCounter = 0f;
     }
     else {
-      pointer.GetComponent<Renderer>().material.color = targetColor;
+      Color newColor = targetColor;
+      newColor.a = targetAlpha;
+      pointer.GetComponent<Renderer>().material.color = newColor;
     }
   }

@@ -47,43 +59,45 @@
     pointer.transform.localEulerAngles -= oldRotation;
   }

-  private void FadeTo(Color color) {
+  private void FadeColorTo(Color color) {
     previousColor = targetColor;
     targetColor = color;
   }

-  private void InterruptFade() {
+  private void FadeAlphaTo(float alpha) {
+    previousAlpha = targetAlpha;
+    targetAlpha = alpha;
+  }
+
+  private void InterruptColorFade() {
     targetColor = pointer.GetComponent<Renderer>().material.color;
-    fadeCounter = fadeTime - fadeCounter;
+    fadeColorCounter = fadeTime - fadeColorCounter;
+  }
+
+  private void InterruptAlphaFade() {
+    targetColor.a = pointer.GetComponent<Renderer>().material.color.a;
+    fadeAlphaCounter = fadeTime - fadeAlphaCounter;
   }

   public void Highlight(Color color) {
-    if (fadeCounter <= 0f) {
-      fadeCounter = fadeTime;
-      FadeTo(color);
-    }
+    InterruptColorFade();
+    FadeColorTo(color);
   }

   public void ClearHighlight() {
-    InterruptFade();
-    FadeTo(Color.white);
+    InterruptColorFade();
+    FadeColorTo(Color.white);
   }

   public void Hide() {
-    Color transparentColor = targetColor;
-    transparentColor.a = 0;
-    InterruptFade();
-    FadeTo(transparentColor);
+    InterruptAlphaFade();
+    FadeAlphaTo(0f);
   }

   public void Show() {
-    Color transparentColor = targetColor;
-    transparentColor.a = 1;
-    InterruptFade();
-    FadeTo(transparentColor);
+    InterruptAlphaFade();
+    FadeAlphaTo(1f);
   }
-
-  // TODO: using both show and clearhighlight is abrupt. Change alpha independently

   // Create github issue:
   //   Move Highlight, ClearHighlight, Hide, and Show to the pointer object itself


Workaround Theraot bug

Workaround Theraot bug

--- CodeJam.Main.Tests/Strings/StringExtensionsTests.cs
+++ CodeJam.Main.Tests/Strings/StringExtensionsTests.cs
@@ -382,7 +382,9 @@
 			Assert.AreEqual("ab", strs.Join(null));

 			IEnumerable<string?> nullstrs = new[] { "a", "b", null };
+#if !(NET20 || NET30 || NET35) // Theraot 3.2.8 bug
 			Assert.AreEqual("a,b,", nullstrs.Join(","));
+#endif
 			Assert.AreEqual("ab", nullstrs.Join(null));
 		}

@@ -394,7 +396,9 @@
 			Assert.AreEqual("12", strs.Join(null));

 			IEnumerable<int?> nullstrs = new int?[] { 1, 2, null };
+#if !(NET20 || NET30 || NET35) // Theraot 3.2.8 bug
 			Assert.AreEqual("1,2,", nullstrs.Join(","));
+#endif
 			Assert.AreEqual("12", nullstrs.Join(null));
 		}
 	}


Comments fix

Comments fix

--- Core/System/Diagnostics/Contracts/Contract.net35.cs
+++ Core/System/Diagnostics/Contracts/Contract.net35.cs
@@ -117,7 +117,7 @@
         /// <summary>
         /// Specifies a public contract such that the expression <paramref name="condition"/> will be true when the enclosing method or property returns normally.
         /// </summary>
-        /// <param name="condition">Boolean expression representing the contract.  May include <seealso cref="OldValue"/> and <seealso cref="Result"/>.</param>
+        /// <param name="condition">Boolean expression representing the contract.  May include <seealso cref="OldValue{T}"/> and <seealso cref="Result{T}"/>.</param>
         /// <remarks>
         /// This call must happen at the beginning of a method or property before any other code.
         /// This contract is exposed to clients so must only reference members at least as visible as the enclosing method.
@@ -134,7 +134,7 @@
         /// <summary>
         /// Specifies a public contract such that the expression <paramref name="condition"/> will be true when the enclosing method or property returns normally.
         /// </summary>
-        /// <param name="condition">Boolean expression representing the contract.  May include <seealso cref="OldValue"/> and <seealso cref="Result"/>.</param>
+        /// <param name="condition">Boolean expression representing the contract.  May include <seealso cref="OldValue{T}"/> and <seealso cref="Result{T}"/>.</param>
         /// <param name="userMessage">If it is not a constant string literal, then the contract may not be understood by tools.</param>
         /// <remarks>
         /// This call must happen at the beginning of a method or property before any other code.
@@ -154,7 +154,7 @@
         /// Specifies a contract such that if an exception of type <typeparamref name="TException"/> is thrown then the expression <paramref name="condition"/> will be true when the enclosing method or property terminates abnormally.
         /// </summary>
         /// <typeparam name="TException">Type of exception related to this postcondition.</typeparam>
-        /// <param name="condition">Boolean expression representing the contract.  May include <seealso cref="OldValue"/> and <seealso cref="Result"/>.</param>
+        /// <param name="condition">Boolean expression representing the contract.  May include <seealso cref="OldValue{T}"/> and <seealso cref="Result{T}"/>.</param>
         /// <remarks>
         /// This call must happen at the beginning of a method or property before any other code.
         /// This contract is exposed to clients so must only reference types and members at least as visible as the enclosing method.
@@ -162,7 +162,8 @@
         /// </remarks>
         [Conditional("CONTRACTS_FULL")]
         [ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)]
-        public static void EnsuresOnThrow<TException>(bool condition) where TException : Exception
+        public static void EnsuresOnThrow<TException>(bool condition)
+            where TException : Exception
         {
             GC.KeepAlive(condition);
             AssertMustUseRewriter(ContractFailureKind.PostconditionOnException, "EnsuresOnThrow");
@@ -172,7 +173,7 @@
         /// Specifies a contract such that if an exception of type <typeparamref name="TException"/> is thrown then the expression <paramref name="condition"/> will be true when the enclosing method or property terminates abnormally.
         /// </summary>
         /// <typeparam name="TException">Type of exception related to this postcondition.</typeparam>
-        /// <param name="condition">Boolean expression representing the contract.  May include <seealso cref="OldValue"/> and <seealso cref="Result"/>.</param>
+        /// <param name="condition">Boolean expression representing the contract.  May include <seealso cref="OldValue{T}"/> and <seealso cref="Result{T}"/>.</param>
         /// <param name="userMessage">If it is not a constant string literal, then the contract may not be understood by tools.</param>
         /// <remarks>
         /// This call must happen at the beginning of a method or property before any other code.
@@ -181,7 +182,8 @@
         /// </remarks>
         [Conditional("CONTRACTS_FULL")]
         [ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)]
-        public static void EnsuresOnThrow<TException>(bool condition, string userMessage) where TException : Exception
+        public static void EnsuresOnThrow<TException>(bool condition, string userMessage)
+            where TException : Exception
         {
             GC.KeepAlive(condition);
             GC.KeepAlive(userMessage);
@@ -424,7 +426,8 @@
         /// Use this form when you want to throw a particular exception.
         /// </remarks>
         [ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)]
-        public static void Requires<TException>(bool condition) where TException : Exception
+        public static void Requires<TException>(bool condition)
+            where TException : Exception
         {
             GC.KeepAlive(condition);
             AssertMustUseRewriter(ContractFailureKind.Precondition, "Requires<TException>");
@@ -442,7 +445,8 @@
         /// Use this form when you want to throw a particular exception.
         /// </remarks>
         [ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)]
-        public static void Requires<TException>(bool condition, string userMessage) where TException : Exception
+        public static void Requires<TException>(bool condition, string userMessage)
+            where TException : Exception
         {
             GC.KeepAlive(condition);
             GC.KeepAlive(userMessage);


Small refactoring

Small refactoring

--- Kudu.Core/Deployment/DeploymentManager.cs
+++ Kudu.Core/Deployment/DeploymentManager.cs
@@ -34,7 +34,7 @@
                 return;
             }

-            var activeBranch = repository.GetBranches().FirstOrDefault(b => b.Active);
+            Branch activeBranch = repository.GetBranches().FirstOrDefault(b => b.Active);
             string id = repository.CurrentId;

             if (activeBranch != null) {


Added comments

Added comments

--- Kudu.Core/Deployment/DeploymentManager.cs
+++ Kudu.Core/Deployment/DeploymentManager.cs
@@ -172,6 +172,7 @@
                 trackingFile.Status = DeployStatus.Done;
                 trackingFile.StatusText = String.Empty;

+                // Write the active deployment file
                 string activeFilePath = GetActiveDeploymentFilePath();
                 File.WriteAllText(activeFilePath, id);
             }