Add delete option to the right-click menu (#6770)

Add delete option to the right-click menu

Co-authored-by: Dean Herbert <1db828bcd41de75377dce59825af73ae7fca5651@ppy.sh>

--- osu.Game/Screens/Edit/Compose/Components/SelectionHandler.cs
+++ osu.Game/Screens/Edit/Compose/Components/SelectionHandler.cs
@@ -80,8 +80,7 @@
             switch (action.ActionMethod)
             {
                 case PlatformActionMethod.Delete:
-                    foreach (var h in selectedBlueprints.ToList())
-                        placementHandler.Delete(h.DrawableObject.HitObject);
+                    deleteSelected();
                     return true;
             }

@@ -142,6 +141,12 @@
             }

             UpdateVisibility();
+        }
+
+        private void deleteSelected()
+        {
+            foreach (var h in selectedBlueprints.ToList())
+                placementHandler.Delete(h.DrawableObject.HitObject);
         }

         #endregion
@@ -234,7 +239,8 @@
                             createHitSampleMenuItem("Clap", HitSampleInfo.HIT_CLAP),
                             createHitSampleMenuItem("Finish", HitSampleInfo.HIT_FINISH)
                         }
-                    }
+                    },
+                    new OsuMenuItem("Delete", MenuItemType.Destructive, deleteSelected),
                 };
             }
         }


Catch E_ABORT when accessing currentUser recipient name too. Resolves #909

--- src/OutlookGoogleCalendarSync/OutlookOgcs/OutlookNew.cs
+++ src/OutlookGoogleCalendarSync/OutlookOgcs/OutlookNew.cs
@@ -220,8 +220,6 @@
                         delay++;
                     }
                 }
-                if (Settings.Instance.OutlookGalBlocked) log.Debug("GAL is no longer blocked!");
-                Settings.Instance.OutlookGalBlocked = false;

                 //Issue 402
                 log.Debug("Getting active window inspector");
@@ -229,8 +227,21 @@
                 inspector = (Inspector)OutlookOgcs.Calendar.ReleaseObject(inspector);
                 log.Debug("Done.");

-                currentUserSMTP = GetRecipientEmail(currentUser);
-                currentUserName = currentUser.Name;
+                try {
+                    currentUserSMTP = GetRecipientEmail(currentUser);
+                    currentUserName = currentUser.Name;
+                } catch (System.Exception ex) {
+                    if (OGCSexception.GetErrorCode(ex) == "0x80004004") { //E_ABORT
+                        log.Warn("Corporate policy or possibly anti-virus is blocking access to GAL.");
+                    } else OGCSexception.Analyse(ex);
+                    log.Warn("OGCS is unable to interogate CurrentUser from Outlook.");
+                    Settings.Instance.OutlookGalBlocked = true;
+                    return oNS;
+                }
+                if (Settings.Instance.OutlookGalBlocked) {
+                    log.Debug("GAL is no longer blocked!");
+                    Settings.Instance.OutlookGalBlocked = false;
+                }
             } finally {
                 currentUser = (Recipient)OutlookOgcs.Calendar.ReleaseObject(currentUser);
                 if (releaseNamespace) oNS = (NameSpace)OutlookOgcs.Calendar.ReleaseObject(oNS);


Restore ESC cancellation

Restore ESC cancellation

--- src/Package/Impl/Repl/Commands/ReplCommandController.cs
+++ src/Package/Impl/Repl/Commands/ReplCommandController.cs
@@ -13,7 +13,6 @@
 using Microsoft.R.Editor.Completions;
 using Microsoft.R.Editor.Document;
 using Microsoft.R.Editor.Formatting;
-using Microsoft.R.Host.Client.Session;
 using Microsoft.VisualStudio.Language.Intellisense;
 using Microsoft.VisualStudio.R.Package.Commands;
 using Microsoft.VisualStudio.R.Package.Expansions;
@@ -166,6 +165,7 @@

             // If session is reading user input, do not terminate it
             if (!Workflow.RSession.IsReadingUserInput) {
+                Workflow.Operations.ClearPendingInputs();
                 Workflow.Shell.PostCommand(RGuidList.RCmdSetGuid, RPackageCommandId.icmdInterruptR);
             }


diagnosing in parallel enabled

diagnosing in parallel enabled

--- src/Peachpie.CodeAnalysis/Compilation/SourceCompiler.cs
+++ src/Peachpie.CodeAnalysis/Compilation/SourceCompiler.cs
@@ -32,6 +32,8 @@

         readonly Worklist<BoundBlock> _worklist;

+        public bool ConcurrentBuild => _compilation.Options.ConcurrentBuild;
+
         private SourceCompiler(PhpCompilation compilation, PEModuleBuilder moduleBuilder, bool emittingPdb, DiagnosticBag diagnostics, CancellationToken cancellationToken)
         {
             Contract.ThrowIfNull(compilation);
@@ -49,17 +51,32 @@
             // semantic model
         }

-        void WalkMethods(Action<SourceRoutineSymbol> action)
-        {
-            // DEBUG
-            _compilation.SourceSymbolCollection.AllRoutines.ForEach(action);
-
-            // TODO: methodsWalker.VisitNamespace(_compilation.SourceModule.GlobalNamespace)
-        }
-
-        void WalkTypes(Action<SourceTypeSymbol> action)
-        {
-            _compilation.SourceSymbolCollection.GetTypes().Foreach(action);
+        void WalkMethods(Action<SourceRoutineSymbol> action, bool allowParallel = false)
+        {
+            var routines = _compilation.SourceSymbolCollection.AllRoutines;
+
+            if (ConcurrentBuild && allowParallel)
+            {
+                Parallel.ForEach(routines, action);
+            }
+            else
+            {
+                routines.ForEach(action);
+            }
+        }
+
+        void WalkTypes(Action<SourceTypeSymbol> action, bool allowParallel = false)
+        {
+            var types = _compilation.SourceSymbolCollection.GetTypes();
+
+            if (ConcurrentBuild && allowParallel)
+            {
+                Parallel.ForEach(types, action);
+            }
+            else
+            {
+                types.ForEach(action);
+            }
         }

         /// <summary>
@@ -154,7 +171,7 @@

         internal void DiagnoseMethods()
         {
-            this.WalkMethods(DiagnoseRoutine);
+            this.WalkMethods(DiagnoseRoutine, allowParallel: true);
         }

         private void DiagnoseRoutine(SourceRoutineSymbol routine)
@@ -166,7 +183,16 @@

         internal void DiagnoseFiles()
         {
-            _compilation.SourceSymbolCollection.GetFiles().ForEach(DiagnoseFile);
+            var files = _compilation.SourceSymbolCollection.GetFiles();
+
+            if (ConcurrentBuild)
+            {
+                Parallel.ForEach(files, DiagnoseFile);
+            }
+            else
+            {
+                files.ForEach(DiagnoseFile);
+            }
         }

         private void DiagnoseFile(SourceFileSymbol file)
@@ -176,7 +202,7 @@

         private void DiagnoseTypes()
         {
-            this.WalkTypes(DiagnoseType);
+            this.WalkTypes(DiagnoseType, allowParallel: true);
         }

         private void DiagnoseType(SourceTypeSymbol type)
@@ -267,8 +293,8 @@
             // 1. Bind Syntax & Symbols to Operations (CFG)
             //   a. construct CFG, bind AST to Operation
             //   b. declare table of local variables
-            compiler.WalkMethods(compiler.EnqueueRoutine);
-            compiler.WalkTypes(compiler.EnqueueFieldsInitializer);
+            compiler.WalkMethods(compiler.EnqueueRoutine, allowParallel: true);
+            compiler.WalkTypes(compiler.EnqueueFieldsInitializer, allowParallel: true);

             // 2. Analyze Operations
             //   a. type analysis (converge type - mask), resolve symbols


PP9-9676: fix build

PP9-9676: fix build

--- src/Picturepark.SDK.V1.Contract/Partials/ShareDetail.cs
+++ src/Picturepark.SDK.V1.Contract/Partials/ShareDetail.cs
@@ -26,8 +26,7 @@
                     {
                         ContentId = i.Id,
                         OutputFormatIds = i.Outputs.Select(output => output.OutputFormatId).ToArray()
-                    }).ToArray(),
-                Template = Template
+                    }).ToArray()
             };

             update?.Invoke(result);


Cleanup

Cleanup

--- src/SimpleSoft.Database.Migrator/MigratorHostBuilder.cs
+++ src/SimpleSoft.Database.Migrator/MigratorHostBuilder.cs
@@ -151,9 +151,7 @@
             var serviceProvider = ServiceProviderBuilder(serviceCollection, loggerFactory);

             if (_configurationHandlers.Count == 0)
-            {
                 logger.LogWarning("Configuration handlers collection is empty. Default configurations will be used...");
-            }
             else
             {
                 logger.LogDebug(


Fix .Value() extension methods

Fix .Value() extension methods

--- src/Umbraco.ModelsBuilder/PublishedElementExtensions.cs
+++ src/Umbraco.ModelsBuilder/PublishedElementExtensions.cs
@@ -2,9 +2,11 @@
 using System.Linq.Expressions;
 using System.Reflection;
 using Umbraco.Core.Models.PublishedContent;
-using Umbraco.Web;
+using Umbraco.ModelsBuilder;

-namespace Umbraco.ModelsBuilder
+// same namespace as original Umbraco.Web PublishedElementExtensions
+// ReSharper disable once CheckNamespace
+namespace Umbraco.Web
 {
     /// <summary>
     /// Provides extension methods to models.
@@ -14,13 +16,14 @@
         /// <summary>
         /// Gets the value of a property.
         /// </summary>
-        public static TValue Value<TModel, TValue>(this TModel model, Expression<Func<TModel, TValue>> property, string culture = ".", string segment = ".")
+        public static TValue Value<TModel, TValue>(this TModel model, Expression<Func<TModel, TValue>> property, string culture = null, string segment = null, Fallback fallback = default, TValue defaultValue = default)
             where TModel : IPublishedElement
         {
             var alias = GetAlias(model, property);
-            return model.Value<TValue>(alias, culture, segment);
+            return model.Value<TValue>(alias, culture, segment, fallback, defaultValue);
         }

+        // fixme that one should be public so ppl can use it
         private static string GetAlias<TModel, TValue>(TModel model, Expression<Func<TModel, TValue>> property)
         {
             if (property.NodeType != ExpressionType.Lambda)


Fix GetTargetNames bug where it would return the Grouped Targets name rather than the target.Identifier when target.FullName is not required.

Add Test for GetTargetNames.

--- src/components/Microsoft.Fx.Portability/TargetMapper.cs
+++ src/components/Microsoft.Fx.Portability/TargetMapper.cs
@@ -134,22 +134,33 @@
                     if (includeVersion)
                         yield return group.Single().FullName;
                     else
-                        yield return GetAlias(group.Key);
+                        yield return group.Key;
                 }
                 else
                 {
                     foreach (var target in group)
                     {
                         // We need to reverse map the identifier from the service (if we have a map defined).
-                        yield return new FrameworkName(GetAlias(target.Identifier), target.Version).FullName;
+                        yield return new FrameworkName(target.Identifier, target.Version).FullName;
                     }
                 }
             }
         }

         /// <summary>
-        /// Performas name to alias mapping
-        /// </summary>
+        /// Performs name to grouped-target (alias) mapping
+        /// </summary>
+        /// <example>
+        /// If there are Grouped Targets, like:
+        /// Available Grouped Targets:
+        /// - Mobile (Windows, Windows Phone, Xamarin.Android, Xamarin.iOS)
+        ///
+        /// Then:
+        /// GetAlias(".NET Framework") will return ".NET Framework"
+        /// GetAlias("Windows") will return "Mobile"
+        /// GetAlias("Windows Phone") will return "Mobile"
+        ///
+        /// </example>
         /// <param name="targetName">Official target name</param>
         public string GetAlias(string targetName)
         {


reversed breaking change

reversed breaking change

--- src/Dhgms.GripeWithRoslyn.Analyzer.UnitTests/Analyzers/UseTypeofInsteadOfTypeGetTypeAnalyzerTest.cs
+++ src/Dhgms.GripeWithRoslyn.Analyzer.UnitTests/Analyzers/UseTypeofInsteadOfTypeGetTypeAnalyzerTest.cs
@@ -24,7 +24,7 @@
         {
             public void MethodName()
             {
-                ASCIIEncoding.GetBytes(testValue, 0, 0);
+                System.Type.GetType(""System.String"");
             }
         }
     }";


More logix for CSV

More logix for CSV

--- source/CoordinateConversion/ArcMapAddinCoordinateConversion/ViewModels/CollectTabViewModel.cs
+++ source/CoordinateConversion/ArcMapAddinCoordinateConversion/ViewModels/CollectTabViewModel.cs
@@ -250,7 +250,7 @@
                     {
                         string csvName = System.IO.Path.GetFileName(path);
                         string folderName = System.IO.Path.GetDirectoryName(path);
-                        string tempFile = folderName + csvName;
+                        string tempFile = System.IO.Path.Combine(folderName, csvName);

                         var aiPoints = CoordinateAddInPoints.ToList();

@@ -261,7 +261,7 @@
                         foreach (var point in aiPoints)
                         {
                             csvExport.AddRow();
-                            csvExport["Coordinate"] = point.Text;
+                            csvExport["Coordinates"] = point.Text;
                         }
                         csvExport.ExportToFile(tempFile);


forgot to register the envelope

forgot to register the envelope

--- src/EventStore/EventStore.Core/Services/RequestManager/Managers/TwoPhaseRequestManagerBase.cs
+++ src/EventStore/EventStore.Core/Services/RequestManager/Managers/TwoPhaseRequestManagerBase.cs
@@ -36,6 +36,7 @@
             _bus = bus;
             _awaitingCommit = commitCount;
             _awaitingPrepare = prepareCount;
+            _publishEnvelope = new PublishEnvelope(bus);
         }


There should always be one last submesh

There should always be one last submesh

--- InWorldz.PrimExporter/InWorldz.PrimExporter.ExpLib/ImportExport/BabylonJSONPrimFaceCombiner.cs
+++ InWorldz.PrimExporter/InWorldz.PrimExporter.ExpLib/ImportExport/BabylonJSONPrimFaceCombiner.cs
@@ -103,6 +103,17 @@
                 }
             }

+            //create the final material/submesh
+            SubMeshes.Add(
+                new SubmeshDesc
+                {
+                    MaterialIndex = lastMat,
+                    VerticesStart = vertStart,
+                    VerticesCount = deduplicatedVertices.Count - vertStart,
+                    IndexStart = indexStart,
+                    IndexCount = newIndexes.Count - indexStart
+                });
+
             //dump the new vertices, normals and UVs
             Vertices.AddRange(deduplicatedVertices.SelectMany(v => new[] { v.Item1.X, v.Item1.Y, v.Item1.Z }));
             Normals.AddRange(deduplicatedVertices.SelectMany(v => new[] { v.Item3.X, v.Item3.Y, v.Item3.Z }));


extended responsible tests

extended responsible tests

--- Tests.Unit.Core.ApplicationServices/ApplicationServices/Contract/ItContractWriteServiceTest.cs
+++ Tests.Unit.Core.ApplicationServices/ApplicationServices/Contract/ItContractWriteServiceTest.cs
@@ -628,7 +628,7 @@
             {
                 OrganizationUnitUuid = ((Guid?)A<Guid>()).AsChangedValue(),
                 Signed = A<bool>().AsChangedValue(),
-                SignedAt = ((DateTime?)A<DateTime>()).AsChangedValue(),
+                SignedAt = A<DateTime?>().AsChangedValue(),
                 SignedBy = A<string>().AsChangedValue()
             };
             var (organizationUuid, parameters, createdContract, transaction) = SetupCreateScenarioPrerequisites(responsible: responsible);
@@ -640,7 +640,33 @@
             var result = _sut.Create(organizationUuid, parameters);

             //Assert
-            //TODO: Assertions
+            Assert.True(result.Ok);
+            var contract = result.Value;
+            Assert.Equal(responsible.OrganizationUnitUuid.NewValue, contract.ResponsibleOrganizationUnit?.Uuid);
+            Assert.Equal(responsible.Signed.NewValue, contract.IsSigned);
+            Assert.Equal(responsible.SignedAt.NewValue, contract.SignedDate);
+            Assert.Equal(responsible.SignedBy.NewValue, contract.ContractSigner);
+            AssertTransactionCommitted(transaction);
+        }
+
+        [Fact]
+        public void Cannot_Create_With_Responsible_If_Responsible_Unit_Does_Not_Exist_On_Contract_Organization()
+        {
+            //Arrange
+            var responsible = new ItContractResponsibleDataModificationParameters()
+            {
+                OrganizationUnitUuid = ((Guid?)A<Guid>()).AsChangedValue(),
+            };
+            var (organizationUuid, parameters, createdContract, transaction) = SetupCreateScenarioPrerequisites(responsible: responsible);
+            var existingUnit = new OrganizationUnit() { Uuid = Guid.NewGuid() };
+            createdContract.Organization.OrgUnits.Add(existingUnit);
+
+            //Act
+            var result = _sut.Create(organizationUuid, parameters);
+
+            //Assert
+            Assert.True(result.Failed);
+            AssertFailureWithKnownErrorDetails(result, "UUID of responsible organization unit does not match an organization unit on this contract's organization", OperationFailure.BadInput,transaction);
         }

         private (Guid? procurementStrategyUuid, Guid? purchaseTypeUuid, ItContractProcurementModificationParameters parameters) CreateProcurementParameters(bool withStrategy, bool withPurchase, bool withPlan)


Fixing stream position

Fixing stream position

--- Xamarin.Forms.GoogleMaps/Xamarin.Forms.GoogleMaps.iOS/Extensions/BitmapDescriptorExtensions.cs
+++ Xamarin.Forms.GoogleMaps/Xamarin.Forms.GoogleMaps.iOS/Extensions/BitmapDescriptorExtensions.cs
@@ -15,6 +15,7 @@
                 case BitmapDescriptorType.Bundle:
                     return UIImage.FromBundle(self.BundleName);
                 case BitmapDescriptorType.Stream:
+                    self.Stream.Position = 0;
                     return UIImage.LoadFromData(NSData.FromStream(self.Stream));
                 case BitmapDescriptorType.AbsolutePath:
                     return UIImage.FromFile(self.AbsolutePath);


Use a recent timestamp for Asset API smoke test

The API has a restriction (to be documented soon) that the read time
must be on/after 2018-10-2. With this change, that will always be
the case.

--- apis/Google.Cloud.Asset.V1Beta1/Google.Cloud.Asset.V1Beta1.SmokeTests/AssetServiceSmokeTest.cs
+++ apis/Google.Cloud.Asset.V1Beta1/Google.Cloud.Asset.V1Beta1.SmokeTests/AssetServiceSmokeTest.cs
@@ -50,7 +50,7 @@
             {
                 ParentAsProjectName = new ProjectName(projectId),
                 ContentType = ContentType.Resource,
-                ReadTimeWindow = new TimeWindow { StartTime = DateTime.UtcNow.AddDays(-30).ToTimestamp() },
+                ReadTimeWindow = new TimeWindow { StartTime = DateTime.UtcNow.AddDays(-1).ToTimestamp() },
             };

             // Call API method


Bank import now has a longer timeout after last detected file activity before starting import.

--- Assets/Plugins/Editor/FMOD/EventManager.cs
+++ Assets/Plugins/Editor/FMOD/EventManager.cs
@@ -19,11 +19,16 @@
         const string StringBankExtension = "strings.bank";
         const string BankExtension = "bank";

+        const int FilePollTimeSeconds = 5;
+
+        // How many seconds to wait since last file activity to start the import
+        const int CountdownTimerReset = 15 / FilePollTimeSeconds;
+
         static int countdownTimer;

         static void ClearCache()
         {
-            countdownTimer = 1;
+            countdownTimer = CountdownTimerReset;
             eventCache.StringsBankWriteTime = DateTime.MinValue;
             eventCache.EditorBanks.Clear();
             eventCache.EditorEvents.Clear();
@@ -109,13 +114,13 @@
             // Use the string bank timestamp as a marker for the most recent build of any bank because it gets exported every time
             if (File.GetLastWriteTime(stringBankPath) == eventCache.StringsBankWriteTime)
             {
-                countdownTimer = 1;
+                countdownTimer = CountdownTimerReset;
                 return;
             }

             if (EditorUtils.IsFileOpenByStudio(stringBankPath))
             {
-                countdownTimer = 1;
+                countdownTimer = CountdownTimerReset;
                 return;
             }

@@ -124,7 +129,7 @@
             EditorUtils.CheckResult(EditorUtils.System.loadBankFile(stringBankPath, FMOD.Studio.LOAD_BANK_FLAGS.NORMAL, out stringBank));
             if (stringBank == null)
             {
-                countdownTimer = 1;
+                countdownTimer = CountdownTimerReset;
                 return;
             }

@@ -159,7 +164,7 @@

                 if (!File.Exists(bankPath))
                 {
-                    countdownTimer = 1;
+                    countdownTimer = CountdownTimerReset;
                     return;
                 }

@@ -168,7 +173,7 @@
                 {
                     if (EditorUtils.IsFileOpenByStudio(bankPath))
                     {
-                        countdownTimer = 1;
+                        countdownTimer = CountdownTimerReset;
                         return;
                     }
                     continue;
@@ -178,7 +183,7 @@
                 {
                     if (EditorUtils.IsFileOpenByStudio(bankPath))
                     {
-                        countdownTimer = 1;
+                        countdownTimer = CountdownTimerReset;
                         return;
                     }
                 }
@@ -240,6 +245,7 @@
                 var bankPath = Directory.GetFiles(defaultBankFolder, bankFileName);
                 if (bankPath.Length == 0)
                 {
+                    Debug.LogError(String.Format("FMOD Studio: Expected to find {0}, events may be missing from project", bankFileName));
                     continue;
                 }

@@ -383,6 +389,7 @@
             }
             else
             {
+                Debug.LogError(String.Format("FMOD Studio: Unable to load {0}: {1}", bankRef.Name, FMOD.Error.String(bankRef.LoadResult)));
                 eventCache.StringsBankWriteTime = DateTime.MinValue;
             }
         }
@@ -395,7 +402,7 @@

         static EventManager()
 	    {
-            countdownTimer = 1;
+            countdownTimer = CountdownTimerReset;
             EditorUserBuildSettings.activeBuildTargetChanged += BuildTargetChanged;
             EditorApplication.update += Update;
         }
@@ -533,7 +540,7 @@
                 lastCheckTime = Time.realtimeSinceStartup;
             }

-            if (lastCheckTime + 1 < Time.realtimeSinceStartup)
+            if (lastCheckTime + FilePollTimeSeconds < Time.realtimeSinceStartup)
             {
                 UpdateCache();
                 lastCheckTime = Time.realtimeSinceStartup;


Fix null refs that occured in the OSSL API when the LSL API was requested and wasn't found yet.

--- Aurora/AuroraDotNetEngine/APIs/OSSL_Api.cs
+++ Aurora/AuroraDotNetEngine/APIs/OSSL_Api.cs
@@ -2139,15 +2139,16 @@
         public LSL_List osGetPrimitiveParams(LSL_Key prim, LSL_List rules)
         {
             ScriptProtection.CheckThreatLevel(ThreatLevel.High, "osGetPrimitiveParams", m_host, "OSSL");
-
-
+
+            InitLSL ();
             return m_LSL_Api.GetLinkPrimitiveParamsEx(prim, rules);
         }

         public void osSetPrimitiveParams(LSL_Key prim, LSL_List rules)
         {
             ScriptProtection.CheckThreatLevel(ThreatLevel.High, "osSetPrimitiveParams", m_host, "OSSL");
-
+
+            InitLSL ();
             m_LSL_Api.SetPrimitiveParamsEx(prim, rules);
         }

@@ -2251,6 +2252,7 @@

         public DateTime osRezObject(string inventory, LSL_Types.Vector3 pos, LSL_Types.Vector3 vel, LSL_Types.Quaternion rot, int param, LSL_Integer isRezAtRoot, LSL_Integer doRecoil, LSL_Integer SetDieAtEdge, LSL_Integer CheckPos)
         {
+            InitLSL ();
             return m_LSL_Api.llRezPrim(inventory, pos, vel, rot, param, isRezAtRoot == 1, doRecoil == 1, SetDieAtEdge == 1, CheckPos == 1);
         }


fix important bug in RecordKeyType_RawBytes.CompareToPeer

--- Bend/LayerManager/Records/RecordKeyType.cs
+++ Bend/LayerManager/Records/RecordKeyType.cs
@@ -194,6 +194,7 @@
                     return -1;
                 }
                 compare_result = this.value[pos].CompareTo(conv_target.value[pos]);
+                pos++;
             }
             return compare_result;
         }


Shave some length

Shave some length

--- Bugsnag.NET.Tests/Request/NoticeBuilder.cs
+++ Bugsnag.NET.Tests/Request/NoticeBuilder.cs
@@ -56,7 +56,7 @@
             }
             catch (Exception ex)
             {
-                throw new Exception("This is the second wrapping exception", ex);
+                throw new Exception("Second wrapping exception", ex);
             }
         }

@@ -69,7 +69,7 @@
             }
             catch (Exception ex)
             {
-                throw new Exception("This is the first wrapping exception", ex);
+                throw new Exception("First wrapping exception", ex);
             }
         }
     }


Added tests for episodes

Added tests for episodes

--- VideoStationTest/VideoStationTests/VideoLibraryListTests.cs
+++ VideoStationTest/VideoStationTests/VideoLibraryListTests.cs
@@ -27,7 +27,7 @@
         [TestMethod]
         public void CanListVideosInLibrary()
         {
-            var result = VideoStation.TvShows;
+            var result = VideoStation.Shows;
             var tvShowsList = result.Data.TvShows.ToList();

             var longest = tvShowsList.OrderByDescending(t => t.Title.Length).First().Title.Length;
@@ -45,7 +45,7 @@
         [TestMethod]
         public void TvShowList_ListContainsShows()
         {
-            var result = VideoStation.TvShows.Data.TvShows.ToArray();
+            var result = VideoStation.Shows.Data.TvShows.ToArray();

             Assert.IsTrue(result.Length > 0);
         }
@@ -53,7 +53,7 @@
         [TestMethod]
         public void TvShowList_ShowsHaveTitles()
         {
-            var result = VideoStation.TvShows.Data.TvShows;
+            var result = VideoStation.Shows.Data.TvShows;

             Assert.IsNotNull(result.First().Title);
         }
@@ -61,7 +61,7 @@
         [TestMethod]
         public void TvShowList_ShowsHaveIds()
         {
-            var result = VideoStation.TvShows.Data.TvShows;
+            var result = VideoStation.Shows.Data.TvShows;

             Assert.IsNotNull(result.First().Id);
         }
@@ -69,7 +69,7 @@
         [TestMethod]
         public void TvShowList_ShouldBeAbleToSort()
         {
-            var result = VideoStation.TvShows.Data.TvShows.ToList();
+            var result = VideoStation.Shows.Data.TvShows.ToList();

             Assert.IsNotNull(result);

@@ -81,5 +81,38 @@
             Assert.IsFalse(resultOrdered.SequenceEqual(result));
             Assert.IsFalse(resultOrderedDesc.SequenceEqual(result));
         }
+
+        [TestMethod]
+        public void TvShowEpisode_ShouldListEpisodesForSeries()
+        {
+            var show = VideoStation.Shows.Data.TvShows.First();
+
+            var tvEpisodes = VideoStation.FindEpisodes(show).Episodes;
+
+            Assert.IsNotNull(tvEpisodes);
+        }
+
+        [TestMethod]
+        public void TvShowEpisode_EpisodeShouldHaveTitle()
+        {
+            var show = VideoStation.Shows.Data.TvShows.First();
+
+            var episode = VideoStation.FindEpisodes(show).Episodes.First();
+
+            Debug.WriteLine(episode.ToString());
+        }
+
+        [TestMethod]
+        public void TvShowEpisode_ShouldHaveShowInformation()
+        {
+            var show = VideoStation.Shows.Data.TvShows.First();
+
+            var episode = VideoStation.FindEpisodes(show).Episodes.First(e => e.Summary != null);
+
+            Debug.WriteLine(show.ToString());
+            Debug.WriteLine(episode.ToString());
+
+            Assert.AreEqual(show, episode.Show);
+        }
     }
 }


Minor cleanup, removed improper constructor and added missing test fixture.

git-svn-id: 6c68d65edd5507bf6b37474e0d155329cbeeff2a@881534 13f79535-47bb-0310-9956-ffa450edef68

--- C#/src/Test/QueryParser/TestQueryParser.cs
+++ C#/src/Test/QueryParser/TestQueryParser.cs
@@ -60,6 +60,7 @@
 {

 	/// <summary> Tests QueryParser.</summary>
+	[TestFixture]
 	public class TestQueryParser:LocalizedTestCase
 	{
         static System.Collections.Hashtable dataTestWithDifferentLocals = new System.Collections.Hashtable();
@@ -113,9 +114,9 @@
 			}
 		}

-		public TestQueryParser(System.String name):base(name, dataTestWithDifferentLocals)
-		{
-		}
+		/*public TestQueryParser(System.String name):base(name, dataTestWithDifferentLocals)
+		{
+		}*/

 		public static Analyzer qpAnalyzer = new QPTestAnalyzer();


add VisualTreeHelperTool

add VisualTreeHelperTool

--- CQControls/Helpers/VisualTreeHelperTool.cs
+++ CQControls/Helpers/VisualTreeHelperTool.cs
@@ -11,19 +11,13 @@
 using Windows.UI.Xaml;

 using Windows.UI.Xaml.Controls;
-
-
+using Windows.UI.Xaml.Media;

 namespace CQControls.Helpers
-
 {
-
     public class VisualTreeHelperTool
-
     {
-
         public static T FindVisualChild<T>(DependencyObject obj) where T : DependencyObject
-
         {

             Queue<DependencyObject> queue = new Queue<DependencyObject>();
@@ -43,33 +37,18 @@
                 {

                     var re = Windows.UI.Xaml.Media.VisualTreeHelper.GetChild(item, i);
-
-
-
+
                     if (re is T)
-
                     {
-
                         return re as T;
-
                     }
-
                     else
-
                     {
-
                         queue.Enqueue(re);
-
                     }
-
                 }
-
             }
-
-
-
             return null;
-
         }

         public static T FindNamedVisualChild<T>(DependencyObject obj, string name) where T : FrameworkElement
@@ -124,6 +103,45 @@

         }

+        public static T FindVisualParent<T>(DependencyObject obj) where T:FrameworkElement
+        {
+            var target = obj as FrameworkElement;
+            if (target == null)
+            {
+                return null;
+            }
+            var parent = VisualTreeHelper.GetParent(target);
+            if(parent is T)
+            {
+                return parent as T;
+            }
+            else
+            {
+                return FindVisualParent<T>(parent);
+            }
+        }
+
+        public static T FindNamedVisualParent<T>(DependencyObject obj,string name) where T : FrameworkElement
+        {
+            var target = obj as FrameworkElement;
+            if (target == null)
+            {
+                return null;
+            }
+            var parent = VisualTreeHelper.GetParent(target) as T;
+
+            if (parent == null)
+            {
+                return null;
+            }
+            else
+            {
+                if (parent.Name == name)
+                    return parent;
+                else
+                    return FindNamedVisualParent<T>(parent,name);
+            }
+        }

         public static VisualStateGroup FindVisualState(FrameworkElement element, string name)


Updated XML Docs.

Updated XML Docs.

--- XmlDoc2CmdletDoc.Core/Extensions/CommentReaderExtensions.cs
+++ XmlDoc2CmdletDoc.Core/Extensions/CommentReaderExtensions.cs
@@ -278,6 +278,14 @@
             return null;
         }

+        ///
+        /// Obtains a <maml:description> for an <command:inputType> coresponding to a specified parameter that accepts pipeline input.
+        ///
+        /// <param name="commentReader">The comment reader.</param>
+        /// <param name="parameter">The parameter.</param>
+        /// <param name="reportWarning">Used to log any warnings.</param>
+        /// <returns>A <maml:description> for an <command:inputType> for the parameter, or null if no explicit description is available
+        /// for the input type.</returns>
         public static XElement GetInputTypeDescriptionElement(this ICommentReader commentReader, Parameter parameter, ReportWarning reportWarning)
         {
             var parameterMemberInfo = parameter.MemberInfo;
@@ -300,7 +308,7 @@
         /// <param name="commentReader">The comment reader.</param>
         /// <param name="type">The type for which a description is required.</param>
         /// <param name="reportWarning">Used to log any warnings.</param>
-        /// <returns>A description for the type, or an empty description element if no description is available.</returns>
+        /// <returns>A description for the type, or null if no description is available.</returns>
         public static XElement GetTypeDescriptionElement(this ICommentReader commentReader, Type type, ReportWarning reportWarning)
         {
             var commentsElement = commentReader.GetComments(type);
@@ -349,7 +357,7 @@
         /// with the type="<<paramref name="typeAttribute"/>>" attribute will be used to provide content for the description.</para>
         /// </param>
         /// <param name="reportWarning">Used to log any warnings.</param>
-        /// <returns>A description element derived from the XML doc comment, or an empty description element if a description could not be obtained.</returns>
+        /// <returns>A description element derived from the XML doc comment, or null if a description could not be obtained.</returns>
         private static XElement GetMamlDescriptionElementFromXmlDocComment(XElement commentsElement, string typeAttribute, Action<string> reportWarning)
         {
             if (commentsElement != null)


Fixed "Direct" starting tab preference not being saved (thanks Wallbraker)

--- ChargedMinersLauncher/MainForm.Designer.cs
+++ ChargedMinersLauncher/MainForm.Designer.cs
@@ -523,7 +523,6 @@
             this.cStartingTab.Items.AddRange(new object[] {
             "Sign In",
             "Resume",
-            "URL",
             "Direct"});
             this.cStartingTab.Location = new System.Drawing.Point(88, 6);
             this.cStartingTab.Name = "cStartingTab";


Code cleanup - organized methods.

Code cleanup - organized methods.

--- test/Autofac.Test/Core/Resolving/ResolveOperationTests.cs
+++ test/Autofac.Test/Core/Resolving/ResolveOperationTests.cs
@@ -1,6 +1,5 @@
 using System;
 using System.Linq;
-using Autofac.Builder;
 using Autofac.Core;
 using Autofac.Test.Scenarios.Dependencies;
 using Xunit;
@@ -10,24 +9,95 @@
     public class ResolveOperationTests
     {
         [Fact]
-        public void PropertyInjectionPassesNamedParameterOfTheInstanceTypeBeingInjectedOnto()
+        public void ActivatedArgsSuppliesParameters()
         {
-            var capturedparameters = Enumerable.Empty<Parameter>();
+            const int provided = 12;
+            var passed = 0;

+            var builder = new ContainerBuilder();
+            builder.RegisterType<object>()
+                .OnActivated(e => passed = e.Parameters.TypedAs<int>());
+            var container = builder.Build();
+
+            container.Resolve<object>(TypedParameter.From(provided));
+            Assert.Equal(provided, passed);
+        }
+
+        [Fact]
+        public void ActivatingArgsSuppliesParameters()
+        {
+            const int provided = 12;
+            var passed = 0;
+
+            var builder = new ContainerBuilder();
+            builder.RegisterType<object>()
+                .OnActivating(e => passed = e.Parameters.TypedAs<int>());
+            var container = builder.Build();
+
+            container.Resolve<object>(TypedParameter.From(provided));
+            Assert.Equal(provided, passed);
+        }
+
+        [Fact]
+        public void AfterTheOperationIsFinished_ReusingTheTemporaryContextThrows()
+        {
+            IComponentContext ctx = null;
+            var builder = new ContainerBuilder();
+            builder.Register(c =>
+            {
+                ctx = c;
+                return new object();
+            });
+            builder.RegisterInstance("Hello");
+            var container = builder.Build();
+            container.Resolve<string>();
+            container.Resolve<object>();
+            Assert.Throws<ObjectDisposedException>(() => ctx.Resolve<string>());
+        }
+
+        [Fact]
+        public void ChainedOnActivatedEventsAreInvokedWithinASingleResolveOperation()
+        {
+            var builder = new ContainerBuilder();
+
+            var secondEventRaised = false;
+            builder.RegisterType<object>()
+                .Named<object>("second")
+                .OnActivated(e => secondEventRaised = true);
+
+            builder.RegisterType<object>()
+                .OnActivated(e => e.Context.ResolveNamed<object>("second"));
+
+            var container = builder.Build();
+            container.Resolve<object>();
+
+            Assert.True(secondEventRaised);
+        }
+
+        [Fact]
+        public void CtorPropDependencyFactoriesOrder1()
+        {
             var cb = new ContainerBuilder();
-            cb.RegisterType<DependsByProp>().SingleInstance().PropertiesAutowired();
-            cb.Register((context, parameters) =>
-            {
-                capturedparameters = parameters.ToArray();
-                return new DependsByCtor(null);
-            });
+            cb.RegisterType<DependsByCtor>();
+            cb.RegisterType<DependsByProp>().PropertiesAutowired(PropertyWiringOptions.AllowCircularDependencies);

             var c = cb.Build();
-            var existingInstance = new DependsByProp();
-            c.InjectUnsetProperties(existingInstance);
+            Assert.Throws<DependencyResolutionException>(() => c.Resolve<DependsByProp>());
+        }

-            var instanceType = capturedparameters.Named<Type>(ResolutionExtensions.PropertyInjectedInstanceTypeNamedParameter);
-            Assert.Equal(existingInstance.GetType(), instanceType);
+        [Fact]
+        public void CtorPropDependencyFactoriesOrder2()
+        {
+            var cb = new ContainerBuilder();
+            var ac = 0;
+            cb.RegisterType<DependsByCtor>().OnActivating(e => { ac = 2; });
+            cb.RegisterType<DependsByProp>().OnActivating(e => { ac = 1; })
+                .PropertiesAutowired(PropertyWiringOptions.AllowCircularDependencies);
+
+            var c = cb.Build();
+            Assert.Throws<DependencyResolutionException>(() => c.Resolve<DependsByCtor>());
+
+            Assert.Equal(2, ac);
         }

         [Fact]
@@ -61,95 +131,24 @@
         }

         [Fact]
-        public void CtorPropDependencyFactoriesOrder1()
+        public void PropertyInjectionPassesNamedParameterOfTheInstanceTypeBeingInjectedOnto()
         {
+            var capturedparameters = Enumerable.Empty<Parameter>();
+
             var cb = new ContainerBuilder();
-            cb.RegisterType<DependsByCtor>();
-            cb.RegisterType<DependsByProp>().PropertiesAutowired(PropertyWiringOptions.AllowCircularDependencies);
+            cb.RegisterType<DependsByProp>().SingleInstance().PropertiesAutowired();
+            cb.Register((context, parameters) =>
+            {
+                capturedparameters = parameters.ToArray();
+                return new DependsByCtor(null);
+            });

             var c = cb.Build();
-            Assert.Throws<DependencyResolutionException>(() => c.Resolve<DependsByProp>());
-        }
+            var existingInstance = new DependsByProp();
+            c.InjectUnsetProperties(existingInstance);

-        [Fact]
-        public void CtorPropDependencyFactoriesOrder2()
-        {
-            var cb = new ContainerBuilder();
-            var ac = 0;
-            cb.RegisterType<DependsByCtor>().OnActivating(e => { ac = 2; });
-            cb.RegisterType<DependsByProp>().OnActivating(e => { ac = 1; })
-                .PropertiesAutowired(PropertyWiringOptions.AllowCircularDependencies);
-
-            var c = cb.Build();
-            Assert.Throws<DependencyResolutionException>(() => c.Resolve<DependsByCtor>());
-
-            Assert.Equal(2, ac);
-        }
-
-        [Fact]
-        public void ActivatingArgsSuppliesParameters()
-        {
-            const int provided = 12;
-            var passed = 0;
-
-            var builder = new ContainerBuilder();
-            builder.RegisterType<object>()
-                .OnActivating(e => passed = e.Parameters.TypedAs<int>());
-            var container = builder.Build();
-
-            container.Resolve<object>(TypedParameter.From(provided));
-            Assert.Equal(provided, passed);
-        }
-
-        [Fact]
-        public void ActivatedArgsSuppliesParameters()
-        {
-            const int provided = 12;
-            var passed = 0;
-
-            var builder = new ContainerBuilder();
-            builder.RegisterType<object>()
-                .OnActivated(e => passed = e.Parameters.TypedAs<int>());
-            var container = builder.Build();
-
-            container.Resolve<object>(TypedParameter.From(provided));
-            Assert.Equal(provided, passed);
-        }
-
-        [Fact]
-        public void ChainedOnActivatedEventsAreInvokedWithinASingleResolveOperation()
-        {
-            var builder = new ContainerBuilder();
-
-            bool secondEventRaised = false;
-            builder.RegisterType<object>()
-                .Named<object>("second")
-                .OnActivated(e => secondEventRaised = true);
-
-            builder.RegisterType<object>()
-                .OnActivated(e => e.Context.ResolveNamed<object>("second"));
-
-            var container = builder.Build();
-            container.Resolve<object>();
-
-            Assert.True(secondEventRaised);
-        }
-
-        [Fact]
-        public void AfterTheOperationIsFinished_ReusingTheTemporaryContextThrows()
-        {
-            IComponentContext ctx = null;
-            var builder = new ContainerBuilder();
-            builder.Register(c =>
-            {
-                ctx = c;
-                return new object();
-            });
-            builder.RegisterInstance("Hello");
-            var container = builder.Build();
-            container.Resolve<string>();
-            container.Resolve<object>();
-            Assert.Throws<ObjectDisposedException>(() => ctx.Resolve<string>());
+            var instanceType = capturedparameters.Named<Type>(ResolutionExtensions.PropertyInjectedInstanceTypeNamedParameter);
+            Assert.Equal(existingInstance.GetType(), instanceType);
         }
     }
 }


Test fix.

Test fix.

--- test/Inflatable.Tests/Sessions/SessionUsingBaseClasses.cs
+++ test/Inflatable.Tests/Sessions/SessionUsingBaseClasses.cs
@@ -54,15 +54,14 @@
             };
             await TempSession.Save(TempData).ExecuteAsync().ConfigureAwait(false);

-            var TestObject = DbContext<BaseClass1>.CreateQuery().Where(x => x.ID > 3).ToArray();
+            var TestObject = DbContext<BaseClass1>.CreateQuery().Where(x => x.BaseClassValue1 > 2).ToArray();

             var ResultCount = await TempSession.Delete(TestObject).ExecuteAsync().ConfigureAwait(false);
-            Assert.Equal(3, ResultCount);
+            Assert.Equal(2, ResultCount);
             TestObject = DbContext<BaseClass1>.CreateQuery().ToArray();
-            Assert.Equal(3, TestObject.Length);
+            Assert.Equal(4, TestObject.Length);
             Assert.Equal(2, TestObject.OfType<ConcreteClass1>().Count());
-            Assert.Single(TestObject.OfType<ConcreteClass2>());
-            Assert.True(TestObject.All(x => x.ID <= 3));
+            Assert.Equal(2, TestObject.OfType<ConcreteClass2>().Count());
         }

         [Fact]


Refactored PlayerDatabase

Refactored PlayerDatabase

--- PiCross/Domain/PiCross/PlayerDatabase.cs
+++ PiCross/Domain/PiCross/PlayerDatabase.cs
@@ -174,11 +174,11 @@

     internal class PlayerPuzzleInformation : IPlayerPuzzleInformation
     {
-        private readonly Dictionary<PuzzleLibraryEntry, PlayerPuzzleInformationEntry> entries;
+        private readonly Dictionary<int, PlayerPuzzleInformationEntry> entries;

         public PlayerPuzzleInformation()
         {
-            this.entries = new Dictionary<PuzzleLibraryEntry, PlayerPuzzleInformationEntry>();
+            this.entries = new Dictionary<int, PlayerPuzzleInformationEntry>();
         }

         IPlayerPuzzleInformationEntry IPlayerPuzzleInformation.this[IPuzzleLibraryEntry libraryEntry]
@@ -193,12 +193,20 @@
         {
             get
             {
-                if ( !entries.ContainsKey( libraryEntry ) )
+                return this[libraryEntry.UID];
+            }
+        }
+
+        public PlayerPuzzleInformationEntry this[int id]
+        {
+            get
+            {
+                if ( !entries.ContainsKey( id ) )
                 {
-                    entries[libraryEntry] = new PlayerPuzzleInformationEntry();
+                    entries[id] = new PlayerPuzzleInformationEntry();
                 }

-                return entries[libraryEntry];
+                return entries[id];
             }
         }

@@ -215,9 +223,9 @@
             }
             else
             {
-                var libraryEntries = new HashSet<PuzzleLibraryEntry>( this.entries.Keys.Concat( playerPuzzleInformation.entries.Keys ) );
-
-                return libraryEntries.All( entry => this[entry].Equals( playerPuzzleInformation[entry] ) );
+                var ids = new HashSet<int>( this.entries.Keys.Concat( playerPuzzleInformation.entries.Keys ) );
+
+                return ids.All( id => this[id].Equals( playerPuzzleInformation[id] ) );
             }
         }


More conversions functions

More conversions functions

--- Platforms/NGraphics.Mac/ApplePlatform.cs
+++ Platforms/NGraphics.Mac/ApplePlatform.cs
@@ -538,7 +538,26 @@
 		{
 			return new CTFont (font.Name, (nfloat)font.Size);
 		}
+		public static CGColor GetCGColor (this Color color)
+		{
+			return new CGColor ((nfloat)color.Red, (nfloat)color.Green, (nfloat)color.Blue, (nfloat)color.Alpha);
+		}
+		public static Color GetColor (this CGColor color)
+		{
+			var c = color.Components;
+			return Color.FromRGB (c[0], c[1], c[2], c[3]);
+		}
 		#if __IOS__ || __TVOS__
+		public static UIKit.UIColor GetUIColor (this Color color)
+		{
+			return UIKit.UIColor.FromRGBA (color.R, color.G, color.B, color.A);
+		}
+		public static Color GetColor (this UIKit.UIColor color)
+		{
+			nfloat r, g, b, a;
+			color.GetRGBA (out r, out g, out b, out a);
+			return Color.FromRGB (r, g, b, a);
+		}
 		public static UIKit.UIImage GetUIImage (this IImage image)
 		{
 			var c = (CGImageImage)image;


Update FancyBox Bundle to Resolve Load Order Issue

--- Portal.CMS.Web/App_Start/BundleConfig.cs
+++ Portal.CMS.Web/App_Start/BundleConfig.cs
@@ -18,7 +18,7 @@

             bundles.Add(new ScriptBundle("~/Resources/JavaScript/Framework/Global").Include("~/Content/Scripts/Framework/global.js"));

-            bundles.Add(new ScriptBundle("~/Resources/JavaScript/FancyBox").Include("~/Content/Scripts/FancyBox/*.js"));
+            bundles.Add(new ScriptBundle("~/Resources/JavaScript/FancyBox").Include("~/Content/Scripts/FancyBox/jquery.fancybox.js").Include("~/Content/Scripts/FancyBox/jquery.fancybox-thumbs.js").Include("~/Content/Scripts/FancyBox/initialise.js"));

             bundles.Add(new ScriptBundle("~/Resources/JavaScript/C3Graphing").Include("~/Content/Scripts/C3Graphing/c3.min.js").Include("~/Content/Scripts/C3Graphing/d3.min.js"));


Added on more TcpClientConnection test and refactored a couple of others - Using ManualResetEvent to make sure the event is triggered and make sure we don't block for more time than it's necessary

--- tests/NetIRC.Tests/Connection/TcpClientConnectionTests.cs
+++ tests/NetIRC.Tests/Connection/TcpClientConnectionTests.cs
@@ -2,6 +2,7 @@
 using System.Threading.Tasks;
 using Xunit;
 using System.IO;
+using System.Threading;

 namespace NetIRC.Tests.Connection
 {
@@ -15,31 +16,42 @@
         }

         [Fact]
-        public async Task ConnectsToTheServer()
+        public async Task WhenConnected_TriggerConnectedEvent()
         {
+            var pause = new ManualResetEvent(false);
             var connected = false;

             using (var tcpClient = new TcpClientConnection())
             {
-                tcpClient.Connected += (s, e) => connected = true;
-
+                tcpClient.Connected += (s, e) =>
+                {
+                    connected = true;
+                    pause.Set();
+                };
                 await tcpClient.ConnectAsync("127.0.0.1", 6667);

                 await connectionFixture.TcpListener.AcceptTcpClientAsync();
             }

+            Assert.True(pause.WaitOne(100));
+
             Assert.True(connected);
         }

         [Fact]
-        public async Task ReceivesData()
+        public async Task WhenReceivingData_TriggerDataReceivedEvent()
         {
+            var pause = new ManualResetEvent(false);
             var data = "test";
             var dataReceived = string.Empty;

             using (var tcpClient = new TcpClientConnection())
             {
-                tcpClient.DataReceived += (s, e) => dataReceived = e.Data;
+                tcpClient.DataReceived += (s, e) =>
+                {
+                    dataReceived = e.Data;
+                    pause.Set();
+                };
                 await tcpClient.ConnectAsync("127.0.0.1", 6667);

                 using (var server = await connectionFixture.TcpListener.AcceptTcpClientAsync())
@@ -49,16 +61,16 @@
                         await stream.WriteLineAsync(data);
                         await stream.FlushAsync();
                     }
-
-                    while (string.IsNullOrEmpty(dataReceived));
                 }
             }
+
+            Assert.True(pause.WaitOne(100));

             Assert.Equal(data, dataReceived);
         }

         [Fact]
-        public async Task SendsData()
+        public async Task WhenSendingData_ServerShouldReceiveIt()
         {
             var data = "test";
             var dataReceived = string.Empty;
@@ -79,5 +91,35 @@

             Assert.Equal(data, dataReceived);
         }
+
+        [Fact]
+        public async Task WhenServerDisconnects_TrigerDisconnectedEvent()
+        {
+            var pause = new ManualResetEvent(false);
+            var disconnected = false;
+
+            using (var tcpClient = new TcpClientConnection())
+            {
+                tcpClient.Disconnected += (s, e) =>
+                {
+                    disconnected = true;
+                    pause.Set();
+                };
+                await tcpClient.ConnectAsync("127.0.0.1", 6667);
+
+                using (var server = await connectionFixture.TcpListener.AcceptTcpClientAsync())
+                {
+                    using (var stream = new StreamWriter(server.GetStream()))
+                    {
+                        await stream.WriteLineAsync("test");
+                        await stream.FlushAsync();
+                    }
+                }
+            }
+
+            Assert.True(pause.WaitOne(100));
+
+            Assert.True(disconnected);
+        }
     }
 }


Update test cases

Update test cases

--- PublicSuffix.Test/TestCaseSource.cs
+++ PublicSuffix.Test/TestCaseSource.cs
@@ -1,4 +1,5 @@
-using System.Collections.Generic;
+//source https://raw.githubusercontent.com/publicsuffix/list/master/tests/test_psl.txt
+using System.Collections.Generic;

 namespace Brandy.PublicSuffix.Test
 {
@@ -8,11 +9,11 @@

         static TestCaseSource()
         {
-            // Any copyright is dedicated to the Public RegisterableDomain.
-            // http://creativecommons.org/publicdomain/zero/1.0/
+            // Any copyright is dedicated to the Public Domain.
+            // https://creativecommons.org/publicdomain/zero/1.0/

             // null input.
-            //checkPublicSuffix(null, null);
+            checkPublicSuffix(null, null);
             // Mixed case.
             checkPublicSuffix("COM", null);
             checkPublicSuffix("example.COM", "example.com");
@@ -48,10 +49,10 @@
             checkPublicSuffix("a.b.example.uk.com", "example.uk.com");
             checkPublicSuffix("test.ac", "test.ac");
             // TLD with only 1 (wildcard) rule.
-            checkPublicSuffix("cy", null);
-            checkPublicSuffix("c.cy", null);
-            checkPublicSuffix("b.c.cy", "b.c.cy");
-            checkPublicSuffix("a.b.c.cy", "b.c.cy");
+            checkPublicSuffix("mm", null);
+            checkPublicSuffix("c.mm", null);
+            checkPublicSuffix("b.c.mm", "b.c.mm");
+            checkPublicSuffix("a.b.c.mm", "b.c.mm");
             // More complex TLD.
             checkPublicSuffix("jp", null);
             checkPublicSuffix("test.jp", "test.jp");


The GetBranch function now works directly on the path, rather than setting the working copy, so we can pass in files as well as folders

--- Processes/Shared/Shared/Utilities/Svn.cs
+++ Processes/Shared/Shared/Utilities/Svn.cs
@@ -59,7 +59,8 @@
         public static string GetBranch(string workingDirectory)
         {
             // Generate the info
-            Process.Output infoOutput = Process.Start(workingDirectory, "svn", "info");
+            string infoPath = string.Format(@"info ""{0}""", workingDirectory);
+            Process.Output infoOutput = Process.Start(null, "svn", infoPath);
             if (string.IsNullOrWhiteSpace(infoOutput.StdOut) == true)
                 return null;


Solve problem two.

Solve problem two.

--- ProjectEulerLibraryTests/ProblemTests.cs
+++ ProjectEulerLibraryTests/ProblemTests.cs
@@ -12,5 +12,13 @@

             Assert.AreEqual(23, actual);
         }
+
+        [TestMethod]
+        public void SolveProblem2Test()
+        {
+            var actual = Problem.SolveProblem2();
+
+            Assert.AreEqual(4613732, actual);
+        }
     }
 }


cleanup

cleanup

--- Purchasing.Core/Services/IndexService.cs
+++ Purchasing.Core/Services/IndexService.cs
@@ -7,7 +7,6 @@
 using AutoMapper.Internal;
 using Dapper;
 using Nest;
-using NHibernate.Hql.Ast.ANTLR;
 using Purchasing.Core.Domain;
 using Purchasing.Core.Helpers;
 using Purchasing.Core.Queries;


Fixes #145

Fixes #145

Moved instantiation of FeedbackService for APNS to only happen if
FeedbackIntervalMinutes > 0 (timer already only started in this case)

--- PushSharp.Apple/ApplePushService.cs
+++ PushSharp.Apple/ApplePushService.cs
@@ -36,12 +36,13 @@
 		{
 			var appleChannelSettings = channelSettings;
 			cancelTokenSource = new CancellationTokenSource();
-			feedbackService = new FeedbackService();
-			feedbackService.OnFeedbackReceived += feedbackService_OnFeedbackReceived;

 			//allow control over feedback call interval, if set to zero, don't make feedback calls automatically
 			if (appleChannelSettings.FeedbackIntervalMinutes > 0)
 			{
+				feedbackService = new FeedbackService();
+				feedbackService.OnFeedbackReceived += feedbackService_OnFeedbackReceived;
+
 				timerFeedback = new Timer(new TimerCallback((state) =>
 				{
 					try { feedbackService.Run(channelSettings as ApplePushChannelSettings, this.cancelTokenSource.Token); }
@@ -49,7 +50,6 @@

 					//Timer will run first after 10 seconds, then every 10 minutes to get feedback!
 				}), null, TimeSpan.FromSeconds(10), TimeSpan.FromMinutes(appleChannelSettings.FeedbackIntervalMinutes));
-
 			}
 		}


Styled the Report Index page to have tile like buttons for the links. Based off of Workgroup Details page.

--- Purchasing.Web/Views/Report/Index.cshtml
+++ Purchasing.Web/Views/Report/Index.cshtml
@@ -9,18 +9,113 @@
     var hasAdmin = roles.Any(aRoles.Contains);
 }

+@section AdditionalScripts
+{
+
+}
+
+
+@helper ContainerFor(string linkText, string action, bool special = false)
+{
+    if (special)
+    {
+
+

+
+

+
+
@(linkText)

+
+

+
+

+
+    }
+    else
+    {
+
+

+
+

+
+
@(linkText)

+
+

+
+

+
+    }
+}
+
+
 @if (roles.Contains(Role.Codes.DepartmentalAdmin))
 {
-
@Html.ActionLink("Workload Report By Workgroup", "Workload")

-
@Html.ActionLink("Processing Time Report By Workgroup", "ProcessingTime")

-
@Html.ActionLink("Permissions Report", "Permissions")

-
@Html.ActionLink("Orders Summary by Workgroup", "TotalByWorkgroup", new{showAdmin=false})

-
@Html.ActionLink("Orders Summary by Primary Organization", "TotalByPrimaryOrg")

-
@Html.ActionLink("Orders Summary by Vendor", "TotalByVendor")

+

+
+        Reports
+

+            @ContainerFor("Workload Report By Workgroup", "Workload")
+            @ContainerFor("Purchaser Processing Time Report By Workgroup", "ProcessingTime")
+            @ContainerFor("Permissions Report", "Permissions")
+

+
+

+
+

+

+
+        Order Summary Reports By
+

+            @ContainerFor("Workgroup", "TotalByWorkgroup", special: true)
+            @ContainerFor("Primary Organization", "TotalByPrimaryOrg")
+            @ContainerFor("Vendor", "TotalByVendor")
+

+
+

+
+

 }
-

-
-
-


+ missing file extension

+ missing file extension

--- bigdataanalytics-azurefunction/services/DataLakeService.csx
+++ bigdataanalytics-azurefunction/services/DataLakeService.csx
@@ -73,7 +73,7 @@
         string localFolderPath = workingDir + @"uploads\";
         string localFilePath = Path.Combine(localFolderPath, "file2.txt");

-        string remoteFilePath = Path.Combine(_adlsPermittedDir + "/", "newFileFromNewParams");
+        string remoteFilePath = Path.Combine(_adlsPermittedDir + "/", "newFileFromNewParams.txt");
         bool force = true;

         UploadParameters parameters;


CLR bindings: added POWER4 and POWER5 microarchitectures

--- bindings/clr/sources-csharp/library/CpuMicroarchitecture.cs
+++ bindings/clr/sources-csharp/library/CpuMicroarchitecture.cs
@@ -134,6 +134,10 @@
 		/// IBM PowerPC 970 (PowerPC G5).
 		public static readonly CpuMicroarchitecture PowerPC970        = new CpuMicroarchitecture((CpuArchitecture.PowerPC.Id << 24) + (CpuVendor.IBM.Id << 16) + 0x0021);

+		/// IBM POWER 4.
+		public static readonly CpuMicroarchitecture POWER4            = new CpuMicroarchitecture((CpuArchitecture.PowerPC.Id << 24) + (CpuVendor.IBM.Id << 16) + 0x011F);
+		/// IBM POWER 5.
+		public static readonly CpuMicroarchitecture POWER5            = new CpuMicroarchitecture((CpuArchitecture.PowerPC.Id << 24) + (CpuVendor.IBM.Id << 16) + 0x0120);
 		/// IBM POWER 6.
 		public static readonly CpuMicroarchitecture POWER6            = new CpuMicroarchitecture((CpuArchitecture.PowerPC.Id << 24) + (CpuVendor.IBM.Id << 16) + 0x0121);
 		/// IBM POWER 7.


Fix crash then skin is used for 404 and 500 error pages

Always return 'false' for A11y mode check on 404 and 500 error pages,
as such pages cannot use session state (to #32)

--- R7.Epsilon/components/EpsilonSkinBase.cs
+++ R7.Epsilon/components/EpsilonSkinBase.cs
@@ -4,7 +4,7 @@
 // Author:
 //       Roman M. Yagodin <roman.yagodin@gmail.com>
 //
-// Copyright (c) 2015
+// Copyright (c) 2015-2016 Roman M. Yagodin
 //
 // Permission is hereby granted, free of charge, to any person obtaining a copy
 // of this software and associated documentation files (the "Software"), to deal
@@ -49,10 +49,23 @@

         #endregion

-        private bool A11yEnabled
+        protected bool IsErrorPage
         {
-            get
-            {
+            get {
+                var activeTabId = PortalSettings.ActiveTab.TabID;
+                return activeTabId == PortalSettings.ErrorPage404 || activeTabId == PortalSettings.ErrorPage500;
+            }
+        }
+
+        protected bool A11yEnabled
+        {
+            get {
+
+                // disable A11y mode for 404 and 500 error pages
+                if (IsErrorPage) {
+                    return false;
+                }
+
                 // try to get a11y mode from querystring
                 var a11yParamStr = Request.QueryString ["a11y"];
                 if (!string.IsNullOrWhiteSpace (a11yParamStr))
@@ -70,10 +83,6 @@
                 // return session value
                 var obj = Session ["A11YEnabled"];
                 return obj != null ? (bool) obj : false;
-            }
-            set
-            {
-                Session ["A11YEnabled"] = value;
             }
         }


fix bug in QMakeConf.RemoveValue

fix bug in QMakeConf.RemoveValue

The following raised an exception
    NARF -= zort
if NARF wasn't defined before.

--- Qt4VS2003/QtProjectLib/QMakeConf.cs
+++ Qt4VS2003/QtProjectLib/QMakeConf.cs
@@ -177,14 +177,17 @@
         private void RemoveValue(string key, string valueToRemove)
         {
             int pos;
-            string value = entries[key].ToString();
-            do
+            if (entries.Contains(key))
             {
-                pos = value.IndexOf(valueToRemove);
-                if (pos >= 0)
-                    value = value.Remove(pos, valueToRemove.Length);
-            } while (pos >= 0);
-            entries[key] = value;
+                string value = entries[key].ToString();
+                do
+                {
+                    pos = value.IndexOf(valueToRemove);
+                    if (pos >= 0)
+                        value = value.Remove(pos, valueToRemove.Length);
+                } while (pos >= 0);
+                entries[key] = value;
+            }
         }
     }
 }


added tests for dynamically switching loglevels

--- modules/Common.Logging/test/Common/Common.Logging.Tests/Logging/Simple/CapturingLoggerTests.cs
+++ modules/Common.Logging/test/Common/Common.Logging.Tests/Logging/Simple/CapturingLoggerTests.cs
@@ -28,6 +28,19 @@
     [TestFixture]
     public class CapturingLoggerTests : ILogTestsBase
     {
+        [Test]
+        public void LoggerCanChangeLogLevel()
+        {
+            CapturingLoggerFactoryAdapter adapter = new CapturingLoggerFactoryAdapter();
+            CapturingLogger testLogger = (CapturingLogger) adapter.GetLogger("test");
+            Assert.AreEqual(LogLevel.All, testLogger.CurrentLogLevel);
+            testLogger.Trace("message1");
+            Assert.AreEqual(1, testLogger.LoggerEvents.Count);
+            testLogger.CurrentLogLevel = LogLevel.Debug;
+            testLogger.Trace("message2"); // not logged!
+            Assert.AreEqual("message1", testLogger.LastEvent.MessageObject);
+        }
+
         [Test]
         public void LoggerClearsEvents()
         {


Moved legacy OMC UI event handler from clicked event to IsChecked enabled/disabled events. Now behaves exactly like default. Changed both UI behaviors so that when unselecting an item, all child items are unselected.

--- RelicModManager/ModSelectionList.cs
+++ RelicModManager/ModSelectionList.cs
@@ -339,7 +339,6 @@
             switch (Settings.fontSizeforum)
             {
                 case Settings.FontSize.fontRegular:
-                    //modCheckBox.FontSize = modCheckBox.FontSize + 4;
                     break;
                 case Settings.FontSize.fontLarge:
                     modCheckBox.FontSize = modCheckBox.FontSize + 4;
@@ -403,7 +402,8 @@
                 m.Checked = false;
                 modCheckBox.IsChecked = false;
             }
-            modCheckBox.Click += new System.Windows.RoutedEventHandler(modCheckBoxL_Click);
+            modCheckBox.Checked += modCheckBoxL_Click;
+            modCheckBox.Unchecked += modCheckBoxL_Click;
         }

         void processConfigs(Category c, Mod m, List<Config> configs, System.Windows.Controls.TreeViewItem tvi, bool parentIsMod = false, Config parentConfig = null)
@@ -440,7 +440,6 @@
                     switch (Settings.fontSizeforum)
                     {
                         case Settings.FontSize.fontRegular:
-                            //modCheckBox.FontSize = modCheckBox.FontSize + 4;
                             break;
                         case Settings.FontSize.fontLarge:
                             configControlRB.FontSize = configControlRB.FontSize + 4;
@@ -512,7 +511,8 @@
                         }
                     }
                     //add the handlers at the end
-                    configControlRB.Click += new System.Windows.RoutedEventHandler(configControlRB_Click);
+                    configControlRB.Checked += configControlRB_Click;
+                    configControlRB.Unchecked += configControlRB_Click;
                     configControlRB.MouseDown += new System.Windows.Input.MouseButtonEventHandler(configControlRB_MouseDown);
                     //add it to the mod config list
                     System.Windows.Controls.TreeViewItem configControlTVI = new System.Windows.Controls.TreeViewItem();
@@ -596,7 +596,6 @@
                     switch (Settings.fontSizeforum)
                     {
                         case Settings.FontSize.fontRegular:
-                            //modCheckBox.FontSize = modCheckBox.FontSize + 4;
                             break;
                         case Settings.FontSize.fontLarge:
                             configControlCB.FontSize = configControlCB.FontSize + 4;
@@ -669,7 +668,8 @@
                         }
                     }
                     //add the handlers at the end
-                    configControlCB.Click += new System.Windows.RoutedEventHandler(configControlCB_Click);
+                    configControlCB.Checked += configControlCB_Click;
+                    configControlCB.Unchecked += configControlCB_Click;
                     configControlCB.MouseDown += new System.Windows.Input.MouseButtonEventHandler(configControlCB_MouseDown);
                     //add it to the mod config list
                     System.Windows.Controls.TreeViewItem configControlTVI = new System.Windows.Controls.TreeViewItem();
@@ -726,13 +726,15 @@
                     }
                 }
                 //now it is safe to check the mod we want
-                cb.Click -= modCheckBoxL_Click;
+                cb.Checked -= modCheckBoxL_Click;
+                cb.Unchecked -= modCheckBoxL_Click;
                 cb.IsChecked = true;
                 cb.mod.Checked = true;
-                cb.Click += modCheckBoxL_Click;
-            }
+                cb.Checked += modCheckBoxL_Click;
+                cb.Unchecked += modCheckBoxL_Click;
+            }
+            //check the mod in memory database
             m.Checked = (bool)cb.IsChecked;
-
             //this section deals with enabling the configs, if there are any
             if (m.configs.Count == 0)
                 return;
@@ -751,7 +753,7 @@
             {
                 System.Windows.Controls.Control c = (System.Windows.Controls.Control)item.Header;
                 Config cfg = null;
-                if (c is ConfigWPFRadioButton)
+                if ((c is ConfigWPFRadioButton) && m.Checked)
                 {
                     ConfigWPFRadioButton cbox = (ConfigWPFRadioButton)c;
                     cfg = cbox.config;
@@ -770,16 +772,27 @@
                                 cfg = c2r.config;
                                 if (cfg.enabled)
                                 {
-                                    c2r.Click -= configControlRB_Click;
                                     c2r.IsChecked = true;
                                     cfg.Checked = true;
-                                    configControlRB_Click(c2r, null);
-                                    c2r.Click += configControlRB_Click;
                                     break;
                                 }
                             }
                         }
                     }
+                }
+                else if ((c is ConfigWPFRadioButton) && !m.Checked)
+                {
+                    ConfigWPFRadioButton tempRB = (ConfigWPFRadioButton)c;
+                    cfg = tempRB.config;
+                    cfg.Checked = false;
+                    tempRB.IsChecked = false;
+                }
+                else if ((c is ConfigWPFCheckBox) && !m.Checked)
+                {
+                    ConfigWPFCheckBox tempRB = (ConfigWPFCheckBox)c;
+                    cfg = tempRB.config;
+                    cfg.Checked = false;
+                    tempRB.IsChecked = false;
                 }
             }
         }
@@ -802,22 +815,16 @@
                 {
                     ModWPFCheckBox c = (ModWPFCheckBox)parenttvi.Header;
                     c.IsChecked = true;
-                    c.mod.Checked = true;
-                    modCheckBoxL_Click(c, null);
                 }
                 else if (parenttvi.Header is ConfigWPFCheckBox)
                 {
                     ConfigWPFCheckBox c = (ConfigWPFCheckBox)parenttvi.Header;
                     c.IsChecked = true;
-                    c.mod.Checked = true;
-                    configControlCB_Click(c, null);
                 }
                 else if (parenttvi.Header is ConfigWPFRadioButton)
                 {
                     ConfigWPFRadioButton c = (ConfigWPFRadioButton)parenttvi.Header;
                     c.IsChecked = true;
-                    c.mod.Checked = true;
-                    configControlRB_Click(c, null);
                 }
             }
             //process the subconfigs
@@ -853,19 +860,38 @@
                             Config subc = subRB.config;
                             if ((bool)subRB.IsEnabled && subc.enabled)
                             {
+                                subc.Checked = true;
                                 subRB.IsChecked = true;
-                                subc.Checked = true;
                                 break;
                             }
                         }
                     }
                 }
             }
+            else if (cfg.configs.Count > 0 && !cfg.Checked)
+            {
+                foreach (Config c in cfg.configs)
+                {
+                    if (c.type.Equals("single") || c.type.Equals("single1") || c.type.Equals("multi"))
+                    {
+                        c.Checked = false;
+                        if(c.configUIComponent is ConfigWPFCheckBox)
+                        {
+                            ConfigWPFCheckBox tempCB = (ConfigWPFCheckBox)c.configUIComponent;
+                            tempCB.IsChecked = false;
+                        }
+                        else if (c.configUIComponent is ConfigWPFRadioButton)
+                        {
+                            ConfigWPFRadioButton tempCB = (ConfigWPFRadioButton)c.configUIComponent;
+                            tempCB.IsChecked = false;
+                        }
+                    }
+                }
+            }
         }
         //when a dropdown legacy combobox is index changed
         void configControlDDALL_SelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e)
         {
-
             ConfigWPFComboBox cb = (ConfigWPFComboBox)sender;
             if (!loadingConfig)
             {
@@ -879,22 +905,16 @@
                     {
                         ModWPFCheckBox c = (ModWPFCheckBox)parenttvi.Header;
                         c.IsChecked = true;
-                        c.mod.Checked = true;
-                        modCheckBoxL_Click(c, null);
                     }
                     else if (parenttvi.Header is ConfigWPFCheckBox)
                     {
                         ConfigWPFCheckBox c = (ConfigWPFCheckBox)parenttvi.Header;
                         c.IsChecked = true;
-                        c.mod.Checked = true;
-                        configControlCB_Click(c, null);
                     }
                     else if (parenttvi.Header is ConfigWPFRadioButton)
                     {
                         ConfigWPFRadioButton c = (ConfigWPFRadioButton)parenttvi.Header;
                         c.IsChecked = true;
-                        c.mod.Checked = true;
-                        configControlRB_Click(c, null);
                     }
                 }
             }
@@ -931,17 +951,13 @@
                     if (item.Header is ConfigWPFRadioButton)
                     {
                         ConfigWPFRadioButton rb = (ConfigWPFRadioButton)item.Header;
-                        if ((bool)rb.IsEnabled && (bool)rb.IsChecked)
-                        {
-                            rb.Click -= configControlRB_Click;
+                        if ((bool)rb.IsEnabled && (bool)rb.IsChecked && (!rb.Equals(cb)))
+                        {
+                            rb.config.Checked = false;
                             rb.IsChecked = false;
-                            rb.Click += configControlRB_Click;
-                            rb.config.Checked = false;
-                        }
-                    }
-                }
-                cb.IsChecked = true;
-                cb.config.Checked = true;
+                        }
+                    }
+                }
             }
             cfg.Checked = (bool)cb.IsChecked;
             //propagate the check if required
@@ -952,22 +968,16 @@
                 {
                     ModWPFCheckBox c = (ModWPFCheckBox)parenttvi.Header;
                     c.IsChecked = true;
-                    c.mod.Checked = true;
-                    modCheckBoxL_Click(c, null);
                 }
                 else if (parenttvi.Header is ConfigWPFCheckBox)
                 {
                     ConfigWPFCheckBox c = (ConfigWPFCheckBox)parenttvi.Header;
                     c.IsChecked = true;
-                    c.mod.Checked = true;
-                    configControlCB_Click(c, null);
                 }
                 else if (parenttvi.Header is ConfigWPFRadioButton)
                 {
                     ConfigWPFRadioButton c = (ConfigWPFRadioButton)parenttvi.Header;
                     c.IsChecked = true;
-                    c.mod.Checked = true;
-                    configControlRB_Click(c, null);
                 }
             }
             //process the subconfigs
@@ -1003,11 +1013,30 @@
                             Config subc = subRB.config;
                             if ((bool)subRB.IsEnabled && subc.enabled)
                             {
+                                subc.Checked = true;
                                 subRB.IsChecked = true;
-                                subc.Checked = true;
-                                configControlRB_Click(subRB, null);
                                 break;
                             }
+                        }
+                    }
+                }
+            }
+            else if (cfg.configs.Count > 0 && !cfg.Checked)
+            {
+                foreach (Config c in cfg.configs)
+                {
+                    if (c.type.Equals("single") || c.type.Equals("single1") || c.type.Equals("multi"))
+                    {
+                        c.Checked = false;
+                        if (c.configUIComponent is ConfigWPFCheckBox)
+                        {
+                            ConfigWPFCheckBox tempCB = (ConfigWPFCheckBox)c.configUIComponent;
+                            tempCB.IsChecked = false;
+                        }
+                        else if (c.configUIComponent is ConfigWPFRadioButton)
+                        {
+                            ConfigWPFRadioButton tempCB = (ConfigWPFRadioButton)c.configUIComponent;
+                            tempCB.IsChecked = false;
                         }
                     }
                 }
@@ -1565,6 +1594,15 @@
             }
             //toggle the mod in memory, enabled or disabled
             m.Checked = cb.Checked;
+            //toggle the mod panel color
+            if (cb.Checked)
+            {
+                modPanel.BackColor = Color.BlanchedAlmond;
+            }
+            else
+            {
+                modPanel.BackColor = Settings.getBackColor();
+            }
             //this deals with enabling the componets and triggering the handlers
             if (m.configs.Count == 0)
                 return;
@@ -1581,12 +1619,18 @@
             //the first one is always the mod checkbox
             //the second one is always the config panel
             Panel configPanel = (Panel)modPanel.Controls[1];
-            if (cb.Checked) configPanel.BackColor = Color.BlanchedAlmond;
-            else configPanel.BackColor = Settings.getBackColor();
+            if (cb.Checked)
+            {
+                configPanel.BackColor = Color.BlanchedAlmond;
+            }
+            else
+            {
+                configPanel.BackColor = Settings.getBackColor();
+            }
             foreach (Control cc in configPanel.Controls)
             {
                 Config cfg = null;
-                if (cc is ConfigFormRadioButton)
+                if ((cc is ConfigFormRadioButton) && m.Checked)
                 {
                     ConfigFormRadioButton ccRB = (ConfigFormRadioButton)cc;
                     cfg = ccRB.config;
@@ -1615,6 +1659,22 @@
                         }
                     }
                 }
+                else if ((cc is ConfigFormRadioButton) && !m.Checked)
+                {
+                    ConfigFormRadioButton tempRB = (ConfigFormRadioButton)cc;
+                    cfg = tempRB.config;
+                    cfg.Checked = false;
+                    //setting checked to false should trigger the checked handler
+                    tempRB.Checked = false;
+                }
+                else if ((cc is ConfigFormCheckBox) && !m.Checked)
+                {
+                    ConfigFormCheckBox tempRB = (ConfigFormCheckBox)cc;
+                    cfg = tempRB.config;
+                    cfg.Checked = false;
+                    //setting checked to false should trigger the checked handler
+                    tempRB.Checked = false;
+                }
             }
         }

@@ -1689,6 +1749,26 @@
                     }
                 }
             }
+            else if (cfg.configs.Count > 0 && !cb.Checked)
+            {
+                foreach (Config c in cfg.configs)
+                {
+                    if (c.type.Equals("single") || c.type.Equals("single1") || c.type.Equals("multi"))
+                    {
+                        c.Checked = false;
+                        if (c.configUIComponent is ConfigFormCheckBox)
+                        {
+                            ConfigFormCheckBox tempCB = (ConfigFormCheckBox)c.configUIComponent;
+                            tempCB.Checked = false;
+                        }
+                        else if (c.configUIComponent is ConfigFormRadioButton)
+                        {
+                            ConfigFormRadioButton tempCB = (ConfigFormRadioButton)c.configUIComponent;
+                            tempCB.Checked = false;
+                        }
+                    }
+                }
+            }
             //trigger the panel color change
             if (cfg.configs.Count > 0)
             {
@@ -1862,6 +1942,26 @@
                             ConfigFormRadioButton subRB = (ConfigFormRadioButton)c.configUIComponent;
                             subRB.Checked = true;
                             break;
+                        }
+                    }
+                }
+            }
+            else if (cfg.configs.Count > 0 && !rb.Checked)
+            {
+                foreach (Config c in cfg.configs)
+                {
+                    if (c.type.Equals("single") || c.type.Equals("single1") || c.type.Equals("multi"))
+                    {
+                        c.Checked = false;
+                        if (c.configUIComponent is ConfigFormCheckBox)
+                        {
+                            ConfigFormCheckBox tempCB = (ConfigFormCheckBox)c.configUIComponent;
+                            tempCB.Checked = false;
+                        }
+                        else if (c.configUIComponent is ConfigFormRadioButton)
+                        {
+                            ConfigFormRadioButton tempCB = (ConfigFormRadioButton)c.configUIComponent;
+                            tempCB.Checked = false;
                         }
                     }
                 }
@@ -2162,6 +2262,7 @@
                 modTabGroups.Enabled = true;
                 */
                 //but still do a resize i guess
+                loadingConfig = false;
                 ModSelectionList_SizeChanged(null, null);
             }
         }


log exceptions

log exceptions

--- ReadingList/Modules/ReadingListModule.cs
+++ ReadingList/Modules/ReadingListModule.cs
@@ -98,6 +98,7 @@
 				}
 				catch(Exception ex)
 				{
+					m_logger.Error(ex.ToString());
 					response = Response.AsJson(ex.ToString());
 					response.StatusCode = HttpStatusCode.InternalServerError;
 					return response;
@@ -137,6 +138,7 @@
 				}
 				catch (Exception ex)
 				{
+					m_logger.Error(ex.ToString());
 					response = Response.AsJson(ex.ToString());
 					response.StatusCode = HttpStatusCode.InternalServerError;
 					return response;


Fix AppVeyor build

Fix AppVeyor build

--- Rebus.AdoNet.Tests/SagaPersisterTests.cs
+++ Rebus.AdoNet.Tests/SagaPersisterTests.cs
@@ -186,7 +186,7 @@
 		public void OneTimeSetup()
 		{
 			_factory = new AdoNetConnectionFactory(ConnectionString, ProviderName);
-			_manager = new AdoNetUnitOfWorkManager(_factory);
+			_manager = new AdoNetUnitOfWorkManager(_factory, (fact, cont) => new AdoNetUnitOfWork(fact, cont));
 		}


Prevent warning.

Prevent warning.

--- Assets/Teak/Teak.cs
+++ Assets/Teak/Teak.cs
@@ -482,6 +482,7 @@

     Teak()
     {
+        mAttributionId = null;
         mTeakCache = new TeakCache();
         this.InstallDate = new DateTime(1970, 1, 1, 0, 0, 0, 0).AddSeconds(mTeakCache.InstallDate);


Add FixedEdge to Triangle3d.

Add FixedEdge to Triangle3d.

--- common/Storyboarding3d/Triangle3d.cs
+++ common/Storyboarding3d/Triangle3d.cs
@@ -28,7 +28,8 @@
         public override IEnumerable<CommandGenerator> CommandGenerators { get { yield return Generator0; yield return Generator1; } }

         private int edgeIndex = 0;
-
+        public int FixedEdge = -1;
+
         public override void GenerateSprite(StoryboardLayer layer)
         {
             sprite0 = sprite0 ?? layer.CreateSprite(SpritePath, OsbOrigin.BottomLeft);
@@ -38,6 +39,9 @@
         public override void GenerateStates(double time, CameraState cameraState, Object3dState object3dState)
         {
             var wvp = object3dState.WorldTransform * cameraState.ViewProjection;
+
+            if (FixedEdge >= 0)
+                edgeIndex = FixedEdge;

             Vector4 vector0, vector1, vector2;
             switch (edgeIndex)
@@ -60,41 +64,21 @@
                 default: throw new InvalidOperationException();
             }

+            var cross = (vector2.X - vector0.X) * (vector1.Y - vector0.Y)
+                - (vector2.Y - vector0.Y) * (vector1.X - vector0.X);
+
+            if (cross > 0)
+            {
+                if (Generator0.EndState != null) Generator0.EndState.Opacity = 0;
+                if (Generator1.EndState != null) Generator1.EndState.Opacity = 0;
+                return;
+            }
+
             var bitmap = StoryboardObjectGenerator.Current.GetMapsetBitmap(sprite0.GetTexturePathAt(time));

             var switchedEdge = false;
             for (var i = 0; i < 3; i++)
             {
-                var cross = (vector2.X - vector0.X) * (vector1.Y - vector0.Y)
-                    - (vector2.Y - vector0.Y) * (vector1.X - vector0.X);
-
-                if (cross > 0)
-                {
-                    if (Generator0.EndState != null)
-                        Generator0.Add(new CommandGenerator.State()
-                        {
-                            Time = time,
-                            Position = Generator0.EndState.Position,
-                            Scale = Generator0.EndState.Scale,
-                            Rotation = Generator0.EndState.Rotation,
-                            Color = object3dState.Color,
-                            Opacity = 0,
-                            Additive = Additive,
-                        });
-                    if (Generator1.EndState != null)
-                        Generator1.Add(new CommandGenerator.State()
-                        {
-                            Time = time,
-                            Position = Generator1.EndState.Position,
-                            Scale = Generator1.EndState.Scale,
-                            Rotation = Generator1.EndState.Rotation,
-                            Color = object3dState.Color,
-                            Opacity = 0,
-                            Additive = Additive,
-                            FlipH = true,
-                        });
-                    break;
-                }

                 var delta = vector2.Xy - vector0.Xy;
                 var deltaLength = delta.Length;
@@ -104,6 +88,13 @@
                 var dot = Vector2.Dot(normalizedDelta, delta2);
                 if (dot <= 0 || dot > deltaLength)
                 {
+                    if (FixedEdge >= 0)
+                    {
+                        if (Generator0.EndState != null) Generator0.EndState.Opacity = 0;
+                        if (Generator1.EndState != null) Generator1.EndState.Opacity = 0;
+                        break;
+                    }
+
                     var temp = vector0;
                     vector0 = vector1;
                     vector1 = vector2;


Only add output assemblies for Unity solutions

--- resharper/resharper-unity/src/Debugger/Host/Rider/UnityDebuggerOutputAssembliesProviderHost.cs
+++ resharper/resharper-unity/src/Debugger/Host/Rider/UnityDebuggerOutputAssembliesProviderHost.cs
@@ -8,6 +8,7 @@
 using JetBrains.Metadata.Utils;
 using JetBrains.ProjectModel;
 using JetBrains.ReSharper.Host.Features.Debugger.Utils;
+using JetBrains.ReSharper.Plugins.Unity.ProjectModel;
 using JetBrains.ReSharper.Resources.Shell;
 using JetBrains.Util;

@@ -36,6 +37,12 @@

         public Task<IReadOnlyList<DebuggerOutputAssemblyInfo>> GetOutputAssembliesInfoAsync(Lifetime lifetime)
         {
+            if (!mySolution.HasUnityReference())
+            {
+                return Task.FromResult<IReadOnlyList<DebuggerOutputAssemblyInfo>>(
+                    EmptyList<DebuggerOutputAssemblyInfo>.Instance);
+            }
+
             return lifetime.StartBackgroundRead(() =>
                 (IReadOnlyList<DebuggerOutputAssemblyInfo>) GetOutputAssembliesInfoInternal()
                     .ToList());


View インスタンスが何度も作られないよう修正

View インスタンスが何度も作られないよう修正

--- SaveResponsePlugin/SaveResponsePlugin.cs
+++ SaveResponsePlugin/SaveResponsePlugin.cs
@@ -19,15 +19,18 @@
     [ExportMetadata("Author", "@veigr")]
     public class SaveResponsePlugin : IPlugin, ITool
     {
-        private readonly ToolViewModel _vm = new ToolViewModel
+        private readonly ToolView v = new ToolView
         {
-            Writer = new ResponseFileWriter(KanColleClient.Current.Proxy)
+            DataContext = new ToolViewModel
+            {
+                Writer = new ResponseFileWriter(KanColleClient.Current.Proxy)
+            }
         };

         public void Initialize() {}

         public string Name => "SaveResponse";

-        public object View => new ToolView {DataContext = _vm};
+        public object View => this.v;
     }
 }


GoogleStackdriverTargetSnippets - Added nlog_jsonPayload snippet

--- apis/Google.Cloud.Logging.NLog/Google.Cloud.Logging.NLog.Snippets/GoogleStackdriverTargetSnippets.cs
+++ apis/Google.Cloud.Logging.NLog/Google.Cloud.Logging.NLog.Snippets/GoogleStackdriverTargetSnippets.cs
@@ -34,6 +34,7 @@

         public GoogleStackdriverTargetSnippets(NLogSnippetFixture fixture) => _fixture = fixture;

+        // Resource: nlog-jsonPayload.xml nlog_jsonPayload
         // Resource: nlog-jsonTemplate.xml nlog_jsonTemplate

         [Fact]


Replace VersionHeader constants by properties


remove unnecessary code.

remove unnecessary code.

--- src/Features/Core/Portable/CodeFixes/PreferFrameworkType/PreferFrameworkTypeCodeFixProvider.cs
+++ src/Features/Core/Portable/CodeFixes/PreferFrameworkType/PreferFrameworkTypeCodeFixProvider.cs
@@ -61,11 +61,6 @@
         protected override bool IncludeDiagnosticDuringFixAll(FixAllState state, Diagnostic diagnostic)
             => diagnostic.Properties[EquivalenceKey] == state.CodeActionEquivalenceKey;

-        protected override bool IncludeDiagnosticDuringFixAll(Diagnostic diagnostic)
-        {
-            return base.IncludeDiagnosticDuringFixAll(diagnostic);
-        }
-
         private class PreferFrameworkTypeCodeAction : CodeAction.DocumentChangeAction
         {
             public PreferFrameworkTypeCodeAction(


Improved error handling

Improved error handling

--- src/NMultiTool.Library/Module/Commands/ConvertAllSvgToIco/ConvertAllSvgToIcoCommandProvider.cs
+++ src/NMultiTool.Library/Module/Commands/ConvertAllSvgToIco/ConvertAllSvgToIcoCommandProvider.cs
@@ -16,11 +16,11 @@
         private readonly IProcessProvider _processProvider;
         private readonly ILog _logger;

-        public ConvertAllSvgToIcoCommandProvider(IIconInfoProvider iconInfoProvider,
-            IImageMagicProvider imageMagicProvider,
-            IInkscapeProvider inkscapeProvider,
-            IProcessProvider processProvider,
-            ILog logger
+        public ConvertAllSvgToIcoCommandProvider(IIconInfoProvider iconInfoProvider,
+            IImageMagicProvider imageMagicProvider,
+            IInkscapeProvider inkscapeProvider,
+            IProcessProvider processProvider,
+            ILog logger
         )
         {
             _iconInfoProvider = iconInfoProvider;
@@ -30,22 +30,30 @@
             _logger = logger;
         }

-        public int ConvertAllSvgToIco(string folder, bool recursive, bool refresh, int[] sizes, int maxDegreeOfParallelism)
+        public int ConvertAllSvgToIco(string folder, bool recursive, bool refresh, int[] sizes,
+            int maxDegreeOfParallelism)
         {
             var resultCode = 0;
-            var iconInfos = _iconInfoProvider.GetIconInfos(folder,recursive,sizes);
+            var iconInfos = _iconInfoProvider.GetIconInfos(folder, recursive, sizes);
             var parallelOptions = new ParallelOptions() {MaxDegreeOfParallelism = maxDegreeOfParallelism};
             Parallel.ForEach(iconInfos, parallelOptions, (iconInfo, state) =>
             {
-                var isupdated = ConvertSvgToPngs(iconInfo, sizes, refresh);
-                var iconFileExists = iconInfo.IconFile.Exists;
-                if (isupdated || !iconFileExists || refresh)
+                try
                 {
-                    _imageMagicProvider.CreateIconFromPngFiles(iconInfo);
+                    var isupdated = ConvertSvgToPngs(iconInfo, sizes, refresh);
+                    var iconFileExists = iconInfo.IconFile.Exists;
+                    if (isupdated || !iconFileExists || refresh)
+                    {
+                        _imageMagicProvider.CreateIconFromPngFiles(iconInfo);
+                    }
+                    else
+                    {
+                        _logger.Info("Up to date: " + iconInfo.IconFile.FullName);
+                    }
                 }
-                else
+                catch (Exception ex)
                 {
-                    _logger.Info("Up to date: " + iconInfo.IconFile.FullName);
+                    _logger.Error(ex.Message);
                 }
             });
             return resultCode;


Somehow fixes threading issue causing crash

Previously would crash after leaving an offline map, but only if the user switched the basemap. The code was clearly wrong so it should be removed, but I'd like to investigate further to better understand why and how it caused the problem it did.

--- src/OfflineWorkflowsSample/OfflineWorkflowsSample/ViewModels/Browsing/LocalContentViewModel.cs
+++ src/OfflineWorkflowsSample/OfflineWorkflowsSample/ViewModels/Browsing/LocalContentViewModel.cs
@@ -31,8 +31,6 @@
                     // Ignored - not a valid map package
                 }
             }
-
-            RaisePropertyChanged(nameof(Items));
         }
     }
 }


ソートのベンチマークテストを削除

ソートのベンチマークテストを削除

--- test/ListsTest.cs
+++ test/ListsTest.cs
@@ -1,7 +1,6 @@
 using Extensions;
 using NUnit.Framework;
 using System;
-using System.Diagnostics;

 namespace Roku.Tests
 {
@@ -86,29 +85,6 @@
                 (10, "q"),
             };

-            var sw = new Stopwatch();
-            sw.Restart();
-            foreach (var x in Lists.Range(0, 10000))
-            {
-                xs.ToList().Sort(new Comparison<(int, string)>((x, y) => x.Item1 - y.Item1));
-            }
-            var rap1 = sw.ElapsedMilliseconds;
-            sw.Restart();
-            foreach (var x in Lists.Range(0, 10000))
-            {
-                var sort = xs.Sort((x, y) => x.Item1 - y.Item1);
-            }
-            var rap2 = sw.ElapsedMilliseconds;
-            sw.Restart();
-            foreach (var x in Lists.Range(0, 10000))
-            {
-                var sort = xs.StableSort((x, y) => x.Item1 - y.Item1).ToList();
-            }
-            var rap3 = sw.ElapsedMilliseconds;
-
-            Assert.IsTrue(rap1 < rap2);
-            Assert.IsTrue(rap2 < rap3);
-
             var unstable_sort = xs.Sort((x, y) => x.Item1 - y.Item1);
             var stable_sort = xs.StableSort((x, y) => x.Item1 - y.Item1).ToList();


Removed instance creation.

Removed instance creation.

--- tests/Microsoft.IdentityModel.Protocol.Extensions.Tests/OpenIdConnectProtocolValidatorTests.cs
+++ tests/Microsoft.IdentityModel.Protocol.Extensions.Tests/OpenIdConnectProtocolValidatorTests.cs
@@ -73,7 +73,6 @@
         [Description("Tests: Publics")]
         public void OpenIdConnectProtocolValidator_Publics()
         {
-            OpenIdConnectProtocolValidator validator = new OpenIdConnectProtocolValidator();
             ClaimsIdentity identity = new ClaimsIdentity();
         }

@@ -86,7 +85,6 @@
             ValidateNonce(jwt: IdentityUtilities.CreateJwtSecurityToken(),  nonce: null, ee: ExpectedException.ArgumentNullException());
             ValidateNonce(jwt: IdentityUtilities.CreateJwtSecurityToken(), nonce: OpenIdConnectProtocolValidator.GenerateNonce(), ee: new ExpectedException(typeof(OpenIdConnectProtocolInvalidNonceException)));

-            OpenIdConnectProtocolValidator validator = new OpenIdConnectProtocolValidator();
             ClaimsIdentity identity = new ClaimsIdentity();
         }


* Added support for batch colorize * FIxed not colorizing in two-column layout

--- Assets/RainbowFolders/Editor/Menu/RainbowFoldersProjectContextMenu.cs
+++ Assets/RainbowFolders/Editor/Menu/RainbowFoldersProjectContextMenu.cs
@@ -16,6 +16,7 @@
 using UnityEngine;
 using Borodar.RainbowFolders.Editor.Settings;
 using UnityEditor;
+using System.Linq;

 namespace Borodar.RainbowFolders.Editor
 {
@@ -57,16 +58,21 @@

         public static void Colorize(FolderColors color)
         {
-            WarnAboutTwoColumnLayout();
+            Selection.assetGUIDs.ToList().ForEach(
+                assetGuid =>
+                {
+                    var assetPath = AssetDatabase.GUIDToAssetPath(assetGuid);
+                    if (AssetDatabase.IsValidFolder(assetPath))
+                    {
+                        var folder = AssetDatabase.LoadAssetAtPath<DefaultAsset>(assetPath);
+                        ColorizeFolder(color, folder);
+                    }
+                }
+            );
+        }

-            var selectedObj = Selection.activeObject;
-            if (selectedObj == null)
-            {
-                Debug.LogWarning("Cannot apply color from the left column of the project view." +
-                                 "Please right click the folder in the right column if you are using two-column layout");
-                return;
-            }
-
+        private static void ColorizeFolder(FolderColors color, Object selectedObj)
+        {
             if (!(selectedObj is DefaultAsset))
             {
                 Debug.LogWarning(WARNING_MSG);
@@ -91,13 +97,5 @@
                 settings.RemoveAllByPath(path);
             }
         }
-
-        private static void WarnAboutTwoColumnLayout()
-        {
-            if (RainbowFoldersEditorUtility.IsLastSelectedProjectViewInTwoColumnLayout())
-            {
-                Debug.LogWarning("Please remember to perform colorizing on the folder in the right column of the project view");
-            }
-        }
     }
 }


Pick up parallax multipliers for tilemap rendering

--- Engines/FlatRedBallAddOns/FlatRedBall.TileGraphics/FlatRedBall.TileGraphics/MapDrawableBatch.cs
+++ Engines/FlatRedBallAddOns/FlatRedBall.TileGraphics/FlatRedBall.TileGraphics/MapDrawableBatch.cs
@@ -608,6 +608,9 @@

                 toReturn.RegisterName(quad.Name, tileIndex);
             }
+
+            toReturn.ParallaxMultiplierX = reducedLayerInfo.ParallaxMultiplierX;
+            toReturn.ParallaxMultiplierY = reducedLayerInfo.ParallaxMultiplierY;

             return toReturn;
         }