don't store journal data for partial backups

--- Duplicati/Library/Main/Operation/BackupHandler.cs
+++ Duplicati/Library/Main/Operation/BackupHandler.cs
@@ -230,15 +230,18 @@
                         return false;
                     });

-                    // store journal data in database
-                    var data = journalService.VolumeDataList.Where(p => p.JournalData != null).Select(p => p.JournalData).ToList();
-                    if (data.Any())
-                    {
-                        // always record change journal data for current fileset (entry may be dropped later if nothing is uploaded)
-                        await database.CreateChangeJournalDataAsync(data);
-
-                        // update the previous fileset's change journal entry to resume at this point in case nothing was backed up
-                        await database.UpdateChangeJournalDataAsync(data, lastfilesetid);
+                    // store journal data in database, unless job is being canceled
+                    if (!token.IsCancellationRequested)
+                    {
+                        var data = journalService.VolumeDataList.Where(p => p.JournalData != null).Select(p => p.JournalData).ToList();
+                        if (data.Any())
+                        {
+                            // always record change journal data for current fileset (entry may be dropped later if nothing is uploaded)
+                            await database.CreateChangeJournalDataAsync(data);
+
+                            // update the previous fileset's change journal entry to resume at this point in case nothing was backed up
+                            await database.UpdateChangeJournalDataAsync(data, lastfilesetid);
+                        }
                     }
                 }


Corrected version

Corrected version

--- CompositionImageLoader/Properties/AssemblyInfo.cs
+++ CompositionImageLoader/Properties/AssemblyInfo.cs
@@ -24,6 +24,6 @@
 // You can specify all the values or you can default the Build and Revision Numbers
 // by using the '*' as shown below:
 // [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
+[assembly: AssemblyVersion("0.1.0.0")]
+[assembly: AssemblyFileVersion("0.1.0.0")]
 [assembly: ComVisible(false)]


Get pushed systems from EDSM in a thread.

--- EDDiscovery/Trilateration/TrilaterationControl.cs
+++ EDDiscovery/Trilateration/TrilaterationControl.cs
@@ -77,7 +77,9 @@
             PopulateSuggestedSystems();
             //PopulateClosestSystems();

-            ViewPushedSystems();
+
+            Thread ViewPushedSystemsThread = new Thread(ViewPushedSystems) { Name = "EDSM get pushed systems" };
+            ViewPushedSystemsThread.Start();

         }

@@ -584,11 +586,15 @@
             }
         }

+        // Runs as a thread.
         private void ViewPushedSystems()
         {
             List<String> systems = edsm.GetPushedSystems();

-            dataGridViewClosestSystems.Rows.Clear();
+            this.BeginInvoke(new MethodInvoker(() =>
+            {
+                dataGridViewClosestSystems.Rows.Clear();
+            }));

             foreach (String system in systems)
             {
@@ -596,8 +602,11 @@
                 if (star == null)
                     star = new SystemClass(system);

-                var index = dataGridViewClosestSystems.Rows.Add(system);
-                dataGridViewClosestSystems[0, index].Tag = star;
+                this.BeginInvoke(new MethodInvoker(() =>
+                {
+                    var index = dataGridViewClosestSystems.Rows.Add(system);
+                    dataGridViewClosestSystems[0, index].Tag = star;
+                }));
             }


Fix inventory UI not showing entities (#5981)

* Update inventory UI on init

* Add resolve pattern

* Update Content.Client/Inventory/ClientInventorySystem.cs

Co-authored-by: Paul Ritter <4a1a203ad1e9200b11a4f0b9ac509a92b9403efe@googlemail.com>

* Fix errors

Co-authored-by: Paul Ritter <4a1a203ad1e9200b11a4f0b9ac509a92b9403efe@googlemail.com>

--- Content.Client/Inventory/ClientInventorySystem.cs
+++ Content.Client/Inventory/ClientInventorySystem.cs
@@ -17,6 +17,7 @@
 using Robust.Client.UserInterface.Controls;
 using Robust.Client.UserInterface.CustomControls;
 using Robust.Shared.Configuration;
+using Robust.Shared.Containers;
 using Robust.Shared.GameObjects;
 using Robust.Shared.Input;
 using Robust.Shared.Input.Binding;
@@ -85,23 +86,30 @@

         private void OnDidUnequip(EntityUid uid, ClientInventoryComponent component, DidUnequipEvent args)
         {
-            if (component.SlotButtons.TryGetValue(args.Slot, out var buttons))
-            {
-                foreach (var button in buttons)
-                {
-                    _itemSlotManager.SetItemSlot(button, null);
-                }
-            }
+            UpdateComponentUISlot(uid, args.Slot, null, component);
         }

         private void OnDidEquip(EntityUid uid, ClientInventoryComponent component, DidEquipEvent args)
         {
-            if (component.SlotButtons.TryGetValue(args.Slot, out var buttons))
-            {
-                foreach (var button in buttons)
-                {
-                    _itemSlotManager.SetItemSlot(button, args.Equipment);
-                }
+            UpdateComponentUISlot(uid, args.Slot, args.Equipment, component);
+        }
+
+        private void UpdateComponentUISlot(EntityUid uid, string slot, EntityUid? item, ClientInventoryComponent? component = null)
+        {
+            if (!Resolve(uid, ref component))
+                return;
+
+            if (!component.SlotButtons.TryGetValue(slot, out var buttons))
+                return;
+
+            UpdateUISlot(buttons, item);
+        }
+
+        private void UpdateUISlot(List<ItemSlotButton> buttons, EntityUid? entity)
+        {
+            foreach (var button in buttons)
+            {
+                _itemSlotManager.SetItemSlot(button, entity);
             }
         }

@@ -165,6 +173,17 @@
             if (!TryGetUIElements(uid, out var window, out var bottomLeft, out var bottomRight, out var topQuick,
                     component))
                 return;
+
+            if (TryComp<ContainerManagerComponent>(uid, out var containerManager))
+            {
+                foreach (var (slot, buttons) in component.SlotButtons)
+                {
+                    if (!TryGetSlotEntity(uid, slot, out var entity, component, containerManager))
+                        continue;
+
+                    UpdateUISlot(buttons, entity);
+                }
+            }

             component.InventoryWindow = window;
             component.BottomLeftButtons = bottomLeft;


Add enumeration values for other card types

--- CreditCardRange/CreditCardRange/CreditCardType.cs
+++ CreditCardRange/CreditCardRange/CreditCardType.cs
@@ -45,5 +45,107 @@
         /// </summary>
         [Description("Visa")]
         Visa,
+
+        /// <summary>
+        /// Bankcard cards.
+        /// </summary>
+        [Description("Bankcard")]
+        Bankcard,
+
+        /// <summary>
+        /// China Union Pay cards.
+        /// </summary>
+        [Description("China Union Pay")]
+        ChinaUnionPay,
+
+        /// <summary>
+        /// Diners Club Carte Blanche cards.
+        /// </summary>
+        [Description("Diners Club Carte Blanche")]
+        DCCarteBlanche,
+
+        /// <summary>
+        /// Diners Club enRoute cards.
+        /// </summary>
+        [Description("Diners Club enRoute")]
+        DCEnRoute,
+
+        /// <summary>
+        /// Diners Club International cards.
+        /// </summary>
+        [Description("Diners Club International")]
+        DCInternational,
+
+        /// <summary>
+        /// Diners Club US and Canada cards.
+        /// </summary>
+        [Description("Diners Club US and Canada")]
+        DCUSCan,
+
+        /// <summary>
+        /// InterPayment cards.
+        /// </summary>
+        [Description("InterPayment")]
+        InterPayment,
+
+        /// <summary>
+        /// InstaPayment cards.
+        /// </summary>
+        [Description("InstaPayment")]
+        InstaPayment,
+
+        /// <summary>
+        /// JCB cards.
+        /// </summary>
+        [Description("JCB")]
+        JCB,
+
+        /// <summary>
+        /// Laser cards.
+        /// </summary>
+        [Description("Laser")]
+        Laser,
+
+        /// <summary>
+        /// Maestro cards.
+        /// </summary>
+        [Description("Maestro")]
+        Maestro,
+
+        /// <summary>
+        /// Dankort cards.
+        /// </summary>
+        [Description("Dankort")]
+        Dankort,
+
+        /// <summary>
+        /// Solo cards.
+        /// </summary>
+        [Description("Solo")]
+        Solo,
+
+        /// <summary>
+        /// Switch cards.
+        /// </summary>
+        [Description("Switch")]
+        Switch,
+
+        /// <summary>
+        /// UATP cards.
+        /// </summary>
+        [Description("UATP")]
+        UATP,
+
+        /// <summary>
+        /// Verve cards.
+        /// </summary>
+        [Description("Verve")]
+        Verve,
+
+        /// <summary>
+        /// Cardguard cards.
+        /// </summary>
+        [Description("Cardguard EAD BG ILS")]
+        Cardguard,
     }
 }


string interpolation 中の条件演算子

string interpolation 中の条件演算子

--- Csharp6/Csharp6/Misc/StringInterpolationSample.cs
+++ Csharp6/Csharp6/Misc/StringInterpolationSample.cs
@@ -36,6 +36,16 @@
 }}
 ""
 ";
+
+            {
+                var data = new[] { 1, 2, 3 };
+                var s = $"{string.Join(", ", data)} => {string.Join(", ", data.Select(i => i * i))}";
+                Console.WriteLine(s);
+            }
+            {
+                //var s1 = $"p = {p == null ? "null" : p.ToString()}"; // エラー
+                var s2 = $"p = {(p == null ? "null" : p.ToString())}"; // 1段 () でくくればOK
+            }
         }
     }
 }


Add some named bodies added in 3.3

Add some named bodies added in 3.3

--- EliteDangerous/EliteDangerous/BodyDesignations.cs
+++ EliteDangerous/EliteDangerous/BodyDesignations.cs
@@ -1974,6 +1974,15 @@
             { "Lambda Aquarii", new Dictionary<string, string> {
                 { "Taylor Dale", "Lambda Aquarii 8" },
             } },
+            { "Trapezium Sector AF-Z c1", new Dictionary<string, string> {
+                { "Mike Meister", "Trapezium Sector AF-Z c1 A 10" },
+            } },
+            { "HIP 63835", new Dictionary<string, string> {
+                { "Josie Rosa", "HIP 63835 CD 8" },
+            } },
+            { "4 Arietis", new Dictionary<string, string> {
+                { "Ziva", "4 Arietis 3 a" },
+            } },
         };

         public struct DesigMap


コメント削除

コメント削除

--- DotNetUtility/DotNetUtility/DateTimeExtensions.cs
+++ DotNetUtility/DotNetUtility/DateTimeExtensions.cs
@@ -70,22 +70,5 @@
             var days = DateTime.DaysInMonth(dt.Year, dt.Month);
             return new DateTime(dt.Year, dt.Month, days);
         }
-
-        /**
-         * TODO : 祝日関連の実装
-         *
-         * パラメータの日付が祝日かどうか判定するメソッド。
-         * 指定月の祝日（DateTime）の一覧を取得するメソッド。
-         * 振替休日も考慮。
-         *
-         * 課題点：
-         *  祝日の管理方法。ハードコーディングか？ＤＢのマスタから取得するか？
-         *  ハードコーディングしてしまうと、その都度コードをメンテナンスをしなければならない。
-         *  DBのマスタから取得する場合、マスタがないと実行できない。
-         *
-         * 結論：
-         *  インターフェイスとなるクラスを作ってパラメータとし、双方実現できるロジックにする
-         */
-
     }
 }


Update AccountController.cs

Update AccountController.cs

Translating some error messages to english (or attempting to).

--- DurandalAuth.Web/Controllers/AccountController.cs
+++ DurandalAuth.Web/Controllers/AccountController.cs
@@ -210,14 +210,14 @@
                 && ticket.Properties.ExpiresUtc.HasValue
                 && ticket.Properties.ExpiresUtc.Value < DateTimeOffset.UtcNow))
             {
-                return BadRequest("Error de inicio de sesin externo.");
+                return BadRequest("Failed to login to the external provider.");
             }

             ExternalLoginData externalData = ExternalLoginData.FromIdentity(ticket.Identity);

             if (externalData == null)
             {
-                return BadRequest("El inicio de sesin externo ya est asociado con una cuenta.");
+                return BadRequest("This external login is already associated with an account.");
             }

             IdentityResult result = await UserManager.AddLoginAsync(User.Identity.GetUserId(),
@@ -514,7 +514,7 @@

                 if (ModelState.IsValid)
                 {
-                    // No hay ningn error ModelState disponible para enviarse, devuelva un BadRequest vaco.
+                    // No hay ning�n error ModelState disponible para enviarse, devuelva un BadRequest vac�o.
                     return BadRequest();
                 }

@@ -582,7 +582,7 @@

                 if (strengthInBits % bitsPerByte != 0)
                 {
-                    throw new ArgumentException("strengthInBits se debe dividir uniformemente por 8.", "strengthInBits");
+                    throw new ArgumentException("strengthInBits should be divisible by 8.", "strengthInBits");
                 }

                 int strengthInBytes = strengthInBits / bitsPerByte;
@@ -595,4 +595,4 @@

         #endregion
     }
-}+}


Fix #67

Fix #67

--- FFImageLoading.Shared/Work/ImageLoaderTaskBase.cs
+++ FFImageLoading.Shared/Work/ImageLoaderTaskBase.cs
@@ -129,7 +129,7 @@
 						}
 						catch (Exception ex2)
 						{
-							Logger.Error("An error occured", ex);
+							Logger.Error("An error occured", ex2);
 							ex = ex2;
 						}
 					};


Fixed a bug where the delete transfer connection request copy was incorrect

--- src/SFA.DAS.EAS.Web/Views/TransferConnectionInvitations/Deleted.cshtml
+++ src/SFA.DAS.EAS.Web/Views/TransferConnectionInvitations/Deleted.cshtml
@@ -14,7 +14,7 @@

Connection request deleted

-
 You have successfully deleted this transfer request.

+
 You have successfully deleted this connection request.

What next?


Change to the text and make it so that the invitations link is visible again

--- src/SFA.DAS.EmployerApprenticeshipsService.Web/Views/Home/Index.cshtml
+++ src/SFA.DAS.EmployerApprenticeshipsService.Web/Views/Home/Index.cshtml
@@ -79,17 +79,18 @@

Invitiations

-        @if (Model.Data.Invitations == 1)
+        @if (Model.Data.Invitations == 0)
         {

-
You have @Model.Data.Invitations pending invitations to employer accounts.
-

+
You currently have no invitations to levy accounts. But you can contact your account admin to request an invitation.

         }
         else
         {

-
You currently have @(Model.Data.Invitations > 1 ? Model.Data.Invitations.ToString() : "no") invitations to levy accounts. But you can contact your account admin to request an invitation.

+

+                    You have @Model.Data.Invitations pending invitation@(Model.Data.Invitations==1?"":"s") to employer accounts.
+

                 View Invitations

         }


Handle unexpected errors (#41597)

Handle unexpected errors (#41597)

--- src/Servers/Kestrel/Transport.Sockets/src/Internal/SocketConnection.cs
+++ src/Servers/Kestrel/Transport.Sockets/src/Internal/SocketConnection.cs
@@ -231,7 +231,11 @@
                         return false;
                     }

-                    return true;
+                    // This is unexpected.
+                    error = result.SocketError;
+                    SocketsLog.ConnectionError(_logger, this, error);
+
+                    return false;
                 }
             }
         }


shortened sorting

shortened sorting

--- EightPuzzle/EightPuzzle/ActionByWeightComparer.cs
+++ EightPuzzle/EightPuzzle/ActionByWeightComparer.cs
@@ -19,9 +19,7 @@

             // these are simply to keep a stable search order
             if (result == 0) result = -x.VisitedNodeId.CompareTo(y.VisitedNodeId);
-            if (result == 0) result = x.Move.From.CompareTo(y.Move.From);
-            if (result == 0) result = x.Move.To.CompareTo(y.Move.To);
-
+            if (result == 0) result = x.Depth.CompareTo(y.Depth);
             return result;
         }
     }


Added search endpoint (#574)

Added search endpoint (#574)

--- EmpleoDotNet.WebApi/Controllers/JobsController.cs
+++ EmpleoDotNet.WebApi/Controllers/JobsController.cs
@@ -45,6 +45,39 @@

             return Json(response);
         }
+
+
+
+        [Route("api/jobs/search/")]
+        [HttpGet]
+        public IHttpActionResult Search(string keyword = "", bool isRemote = false, int page = 1, int pageSize = 2)
+        {
+
+            var pagingParameters = new JobOpportunityPagingParameter();
+            pagingParameters.Keyword = keyword;
+            pagingParameters.IsRemote = isRemote;
+            pagingParameters.Page = page;
+            pagingParameters.PageSize = pageSize;
+
+            // We should really take advantage of the fact that we have a PagedList
+            var opportunities = _jobsService.GetAllJobOpportunitiesPagedByFilters(pagingParameters);
+
+            var jobCards = GetJobCards(opportunities);
+
+
+            var response = new JobCardListResponse()
+            {
+                Jobs = jobCards,
+                PageSize = opportunities.PageSize,
+                PageNumber = opportunities.PageNumber,
+                PagesCount = opportunities.PageCount,
+                TotalItemCount = opportunities.TotalItemCount
+            };
+
+            return Json(response);
+        }
+
+
         [Route("api/jobs/detail/{id}")]
         [HttpGet]
         public IHttpActionResult Detail(string id)


removed redundant test case

removed redundant test case

--- src/SupaCharge.UnitTests/Core/Collections/Extensions/ElementsAtTest.cs
+++ src/SupaCharge.UnitTests/Core/Collections/Extensions/ElementsAtTest.cs
@@ -8,18 +8,6 @@
 namespace SupaCharge.UnitTests.Core.Collections.Extensions {
   [TestFixture]
   public class ElementsAtTest: BaseTestCase {
-    [Test]
-    public void TestElementsAt() {
-      var ary = new[] { "a", "b", "c" };
-
-      Assert.That(ary.ElementsAt(), Is.EqualTo(new string[0]));
-      Assert.That(ary.ElementsAt(0), Is.EqualTo(new[] { "a" }));
-      Assert.That(ary.ElementsAt(0, 1), Is.EqualTo(new[] { "a", "b" }));
-      Assert.That(ary.ElementsAt(0, 1, 2), Is.EqualTo(new[] { "a", "b", "c" }));
-      Assert.That(ary.ElementsAt(0, 1, 0), Is.EqualTo(new[] { "a", "b", "a" }));
-      Assert.That(ary.ElementsAt(0, 1, 0, 0, 1, 0, 1), Is.EqualTo(new[] { "a", "b", "a", "a", "b", "a", "b" }));
-    }
-
     [TestCase(new int[0], new string[0])]
     [TestCase(new [] {0}, new [] {"a"})]
     [TestCase(new[] { 0, 0 }, new[] { "a", "a" })]


Remove unused stopwatch (#7878)

Remove unused stopwatch (#7878)

--- src/System.Management.Automation/engine/runtime/CompiledScriptBlock.cs
+++ src/System.Management.Automation/engine/runtime/CompiledScriptBlock.cs
@@ -159,9 +159,10 @@

         private void ReallyCompile(bool optimize)
         {
+#if LEGACYTELEMETRY
             var sw = new Stopwatch();
             sw.Start();
-
+#endif
             if (!IsProductCode && SecuritySupport.IsProductBinary(((Ast)_ast).Extent.File))
             {
                 this.IsProductCode = true;


Fix formatting

Fix formatting

--- src/Tools/ExternalAccess/RazorTest/RazorPredefinedProviderNameTests.cs
+++ src/Tools/ExternalAccess/RazorTest/RazorPredefinedProviderNameTests.cs
@@ -46,7 +46,7 @@
             Assert.True(failureMessage.Length == passLength, failureMessage.ToString());
         }

-        private static ImmutableDictionary<string,string> GetPredefinedNamesFromType(Type namesType)
+        private static ImmutableDictionary<string, string> GetPredefinedNamesFromType(Type namesType)
         {
             return namesType.GetFields(BindingFlags.DeclaredOnly | BindingFlags.Static | BindingFlags.Public)
                 .Where(field => field.FieldType == typeof(string))


Use specific exception type in unit tests Use `System.IO.FileNotFoundException` instead of `System.Exception`.

--- src/UnitTests/GitHub.App/ViewModels/PullRequestDetailViewModelTests.cs
+++ src/UnitTests/GitHub.App/ViewModels/PullRequestDetailViewModelTests.cs
@@ -388,7 +388,7 @@
                     existingPrBranch: "pr/123");
                 await target.Load(CreatePullRequest());

-                await Assert.ThrowsAsync<Exception>(() => target.Pull.ExecuteAsyncTask(null));
+                await Assert.ThrowsAsync<FileNotFoundException>(() => target.Pull.ExecuteAsyncTask(null));
                 Assert.Equal("Pull threw", target.OperationError);
             }
         }
@@ -491,7 +491,7 @@
                     existingPrBranch: "pr/123");
                 await target.Load(CreatePullRequest());

-                await Assert.ThrowsAsync<Exception>(() => target.Push.ExecuteAsyncTask(null));
+                await Assert.ThrowsAsync<FileNotFoundException>(() => target.Push.ExecuteAsyncTask(null));
                 Assert.Equal("Push threw", target.OperationError);
             }
         }


Convert invariant culture decimals

Convert invariant culture decimals

--- model/Models/Table.cs
+++ model/Models/Table.cs
@@ -289,6 +289,10 @@
 					return DateTime.Parse(val, CultureInfo.InvariantCulture);
 				case "int":
 					return int.Parse(val);
+				case "float":
+					return Double.Parse(val, CultureInfo.InvariantCulture);
+				case "decimal":
+					return Decimal.Parse(val, CultureInfo.InvariantCulture);
 				case "uniqueidentifier":
 					return new Guid(val);
 				case "binary":


Update FreezePanes.cs

Update FreezePanes.cs

--- Examples/CSharp/Worksheets/Display/FreezePanes.cs
+++ Examples/CSharp/Worksheets/Display/FreezePanes.cs
@@ -8,6 +8,7 @@
     {
         public static void Main(string[] args)
         {
+            //ExStart:1
             // The path to the documents directory.
             string dataDir = Aspose.Cells.Examples.Utils.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);

@@ -29,7 +30,7 @@

             //Closing the file stream to free all resources
             fstream.Close();
-
+            //ExEnd:1
         }
     }
-}+}


added additional verification.

added additional verification.

--- FunctionalWeapon/FunctionalWeapon/Monads/Maybe.cs
+++ FunctionalWeapon/FunctionalWeapon/Monads/Maybe.cs
@@ -35,7 +35,7 @@

         public static readonly Maybe<T> None = new Maybe<T>();

-        internal T Value
+        public T Value
         {
             get
             {
@@ -56,14 +56,18 @@

         public static Maybe<A> Bind<T, A>(this Maybe<T> maybe, Func<T, A> func)
         {
-            return func == null || maybe == null || maybe.IsNone
+            if (func == null) throw new ArgumentNullException("func");
+
+            return maybe == null || maybe.IsNone
                 ? Maybe<A>.None
                 : func(maybe.Value).ToMaybe();
         }

         public static Maybe<A> Bind<T, A>(this Maybe<T> maybe, Func<T, Maybe<A>> func)
         {
-            return func == null || maybe == null || maybe.IsNone
+            if (func == null) throw new ArgumentNullException("func");
+
+            return maybe == null || maybe.IsNone
                 ? Maybe<A>.None
                 : func(maybe.Value);
         }


minor

minor

--- src/biz.dfch.CS.Abiquo.Client.Tests/v1/AbiquoClientIntegrationTests.cs
+++ src/biz.dfch.CS.Abiquo.Client.Tests/v1/AbiquoClientIntegrationTests.cs
@@ -658,7 +658,7 @@

         [TestMethod]
         [TestCategory("SkipOnTeamCity")]
-        public void DeployVirtualMachineWithForceAndWaitForCompletionDeploysAbiquoVirtualMachineAndReturnsCompletedTask()
+        public void DeployVirtualMachineWithForceAndWaitForCompletionDeploysAbiquoVirtualMachineAndReturnsSuccessfullyCompletedTask()
         {
             // Arrange
             var abiquoClient = AbiquoClientFactory.GetByVersion(AbiquoClientFactory.ABIQUO_CLIENT_VERSION_V1);
@@ -707,7 +707,7 @@

         [TestMethod]
         [TestCategory("SkipOnTeamCity")]
-        public void DeployVirtualMachineWithWaitForCompletionDeploysAbiquoVirtualMachineAndReturnsCompletedTask()
+        public void DeployVirtualMachineWithWaitForCompletionDeploysAbiquoVirtualMachineAndReturnsSuccessfullyCompletedTask()
         {
             // Arrange
             var abiquoClient = AbiquoClientFactory.GetByVersion(AbiquoClientFactory.ABIQUO_CLIENT_VERSION_V1);


Rebuild of solution

Rebuild of solution

--- HELLION.DataStructures/Properties/AssemblyInfo.cs
+++ HELLION.DataStructures/Properties/AssemblyInfo.cs
@@ -32,5 +32,5 @@
 // You can specify all the values or you can default the Build and Revision Numbers
 // by using the '*' as shown below:
 // [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("0.0.2.123")]
-[assembly: AssemblyFileVersion("0.0.2.123")]
+[assembly: AssemblyVersion("0.0.2.124")]
+[assembly: AssemblyFileVersion("0.0.2.124")]


Drag drop is now checked every 100 milliseconds instead of 250 in game.


Replace collection name and create if not exists

Signed-off-by: Jonas.VanderBiest <35a2c6fae61f8077aab61faa4019722abf05093c@vanderbiest.be>

--- src/identity.documentdb/IdentityCloudContext.cs
+++ src/identity.documentdb/IdentityCloudContext.cs
@@ -91,7 +91,8 @@
         private bool _disposed = false;

         public IdentityCloudContext() :
-            this(Constants.DocumentCollectionIds.UsersCollection, Constants.DocumentCollectionIds.RolesCollection) { }
+            this(Constants.DocumentCollectionIds.UsersCollection, Constants.DocumentCollectionIds.RolesCollection)
+        { }

         /// <summary>
         /// Creates a new context using specific collection names
@@ -104,11 +105,12 @@
                 ConfigurationManager.AppSettings[Constants.AppSettingsKeys.DatabaseNameKey],
                 null, usersCollectionName, rolesCollectionName)
         {
-
+
         }

         public IdentityCloudContext(string uri, string authKey, string database, ConnectionPolicy policy = null) :
-            this(uri, authKey, database, policy, Constants.DocumentCollectionIds.UsersCollection, Constants.DocumentCollectionIds.RolesCollection) { }
+            this(uri, authKey, database, policy, Constants.DocumentCollectionIds.UsersCollection, Constants.DocumentCollectionIds.RolesCollection)
+        { }

         public IdentityCloudContext(string uri, string authKey, string database, ConnectionPolicy policy, string usersCollection, string rolesCollection)
         {
@@ -137,12 +139,7 @@
             Task[] tasks = new Task[2] {
             new TaskFactory().StartNew(() =>
                 {
-                    var uc = _client.CreateDocumentCollectionQuery(_db.CollectionsLink)
-                        .Where(c => c.Id == Constants.DocumentCollectionIds.UsersCollection)
-                        .ToList()
-                        .FirstOrDefault();
-                    if (uc == null)
-                    {
+
                         _userDocumentCollection.IndexingPolicy.IndexingMode = IndexingMode.Lazy;
                         _userDocumentCollection.IndexingPolicy.IncludedPaths.Add(new IncludedPath()
                         {
@@ -176,24 +173,17 @@
                                  new HashIndex(DataType.String)
                              }
                         });
-                        var ucTask = _client.CreateDocumentCollectionAsync(_db.SelfLink, _userDocumentCollection);
+
+                        var ucTask = _client.CreateDocumentCollectionIfNotExistsAsync(_db.SelfLink, _userDocumentCollection);
                         ucTask.Wait();
-                        uc = ucTask.Result;
-                    }
+                        var uc = ucTask.Result;
                     UserDocumentCollection = uc;
                 }),
             new TaskFactory().StartNew(() =>
                 {
-                    var rc = _client.CreateDocumentCollectionQuery(_db.CollectionsLink)
-                        .Where(c => c.Id == Constants.DocumentCollectionIds.RolesCollection)
-                        .ToList()
-                        .FirstOrDefault();
-                    if (rc == null)
-                    {
-                        var rcTask = _client.CreateDocumentCollectionAsync(_db.SelfLink, _roleDocumentCollection);
+                        var rcTask = _client.CreateDocumentCollectionIfNotExistsAsync(_db.SelfLink, _roleDocumentCollection);
                         rcTask.Wait();
-                        rc = rcTask.Result;
-                    }
+                        var rc = rcTask.Result;
                     RoleDocumentCollection = rc;
                 })
             };


Fixed spellings of "required"

Fixed spellings of "required"

--- Languages/IronPython/IronPython/Hosting/Python.cs
+++ Languages/IronPython/IronPython/Hosting/Python.cs
@@ -81,7 +81,7 @@

         /// <summary>
         /// Creates a new ScriptRuntime and returns the ScriptEngine for IronPython. If
-        /// the ScriptRuntime is requierd it can be acquired from the Runtime property
+        /// the ScriptRuntime is required it can be acquired from the Runtime property
         /// on the engine.
         /// </summary>
         public static ScriptEngine/*!*/ CreateEngine() {
@@ -90,7 +90,7 @@

         /// <summary>
         /// Creates a new ScriptRuntime with the specified options and returns the
-        /// ScriptEngine for IronPython. If the ScriptRuntime is requierd it can be
+        /// ScriptEngine for IronPython. If the ScriptRuntime is required it can be
         /// acquired from the Runtime property on the engine.
         /// </summary>
         public static ScriptEngine/*!*/ CreateEngine(IDictionary<string, object> options) {
@@ -101,7 +101,7 @@

         /// <summary>
         /// Creates a new ScriptRuntime and returns the ScriptEngine for IronPython. If
-        /// the ScriptRuntime is requierd it can be acquired from the Runtime property
+        /// the ScriptRuntime is required it can be acquired from the Runtime property
         /// on the engine.
         ///
         /// The remote ScriptRuntime may be manipulated from the local domain but
@@ -113,7 +113,7 @@

         /// <summary>
         /// Creates a new ScriptRuntime with the specified options and returns the
-        /// ScriptEngine for IronPython. If the ScriptRuntime is requierd it can be
+        /// ScriptEngine for IronPython. If the ScriptRuntime is required it can be
         /// acquired from the Runtime property on the engine.
         ///
         /// The remote ScriptRuntime may be manipulated from the local domain but


+Format

+Format

--- Library/Software/WpfPreferredControls/Grid/Col.cs
+++ Library/Software/WpfPreferredControls/Grid/Col.cs
@@ -33,5 +33,7 @@
         public string Caption { get; set; }

         public string Tooltip { get; set; }
+
+        public string Format { get; set; }
     }
 }


Fix Eliminar Cliente

Fix Eliminar Cliente

Eliminar cliente elimina tambien las facturas asociadas a las
instalaciones que tiene el cliente en cascada.

--- LimpiezasPalmeralForms/Cliente/EliminarCliente.cs
+++ LimpiezasPalmeralForms/Cliente/EliminarCliente.cs
@@ -65,7 +65,7 @@
         private void buttonEliminar_Click(object sender, EventArgs e)
         {
             string mensaje = "¿Estás seguro que deseas eliminar el cliente con NIF: " +
-            textBoxNIF.Text + " y nombre: " + textBoxNombre.Text + " y todas sus instalaciones ?";
+            textBoxNIF.Text + " y nombre: " + textBoxNombre.Text + ", todas sus instalaciones y las facturas asociadas a este?";
             string titulo = "Eliminando Cliente";
             MessageBoxButtons botones = MessageBoxButtons.YesNo;
             DialogResult resultado;
@@ -91,8 +91,20 @@
             {
                 if (i.Cliente.Nif == nif)
                 {
+                    eliminarFacturasInstalacion(i.Id);
                     instalacion.Eliminar(i.Id);
                 }
+            }
+        }
+
+        private void eliminarFacturasInstalacion(string instalacion)
+        {
+            IList<FacturaEN> lista = new List<FacturaEN>();
+            FacturaCEN factura = new FacturaCEN();
+            lista = factura.ObtenerFacturasInstalacion(instalacion);
+            foreach (FacturaEN f in lista)
+            {
+                factura.Eliminar(f.Id);
             }
         }


Add method GetAllServerInfos

Add method GetAllServerInfos

It automatically continues querying the API to feed the IEnumerable,
because: https://github.com/maniaplanet/maniaplanet-ws-sdk/issues/2

--- ManiaNet.ManiaPlanet/WebServices/ServersClient.cs
+++ ManiaNet.ManiaPlanet/WebServices/ServersClient.cs
@@ -21,6 +21,60 @@
         public ServersClient([NotNull] string username, [NotNull] string password)
             : base(username, password)
         { }
+
+        /// <summary>
+        /// Iterates through all <see cref="ServerInfo"/>s, starting at 0. Empty when the information couldn't be found.
+        /// <para/>
+        /// Only use this if you really know what you're doing. It will possibly iterate through *ALL* ManiaPlanet servers.
+        /// </summary>
+        /// <param name="stepSize">The size of each badge of ServerInfos that is downloaded.</param>
+        /// <param name="retries">The maximum number of retries when the information couldn't be found.</param>
+        /// <returns>All ServerInfos. Null when the information couldn't be found.</returns>
+        [UsedImplicitly]
+        public IEnumerable<ServerInfo> GetAllServerInfos(uint stepSize = 30, uint retries = 3)
+        {
+            if (stepSize == 0)
+                yield break;
+
+            var baseQuery = "/servers/index.json?length=" + stepSize + "&offset=";
+
+            var shouldQuery = true;
+            uint offset = 0;
+            uint retried = 0;
+            var pendingServerInfos = new Stack<ServerInfo>();
+            var runningQuery = execute(RequestType.Get, baseQuery + offset);
+
+            while (shouldQuery || pendingServerInfos.Count > 0)
+            {
+                if (shouldQuery && pendingServerInfos.Count == 0)
+                {
+                    var response = runningQuery.Result;
+                    var result = response == null ? null : jsonSerializer.Deserialize<ServerInfo[]>(new JsonTextReader(new StringReader(response)));
+
+                    if (result != null)
+                    {
+                        if (result.Length < stepSize)
+                            shouldQuery = false;
+
+                        pendingServerInfos = new Stack<ServerInfo>(result);
+                        offset += stepSize;
+                    }
+                    else
+                        retried++;
+                }
+
+                if (shouldQuery && pendingServerInfos.Count < stepSize)
+                {
+                    if (retried < retries)
+                        runningQuery = execute(RequestType.Get, baseQuery + offset);
+                    else
+                        shouldQuery = false;
+                }
+
+                if (pendingServerInfos.Count > 0)
+                    yield return pendingServerInfos.Pop();
+            }
+        }

         /// <summary>
         /// Gets the number of players that favorited the Server given by the login. Null when the information couldn't be found.
@@ -124,6 +178,9 @@
             [CanBeNull, JsonProperty("mapsList")]
             private string[] maps;

+            [JsonProperty("scriptTeam"), UsedImplicitly]
+            private byte? scriptUsesTeamMode;
+
             /// <summary>
             /// Gets the description text of the Server. May be null if the data wasn't complete.
             /// </summary>
@@ -331,12 +388,10 @@
             /// <summary>
             /// Gets whether the Script used by the Server is using team mode or not. May be null if the data wasn't complete.
             /// </summary>
-            [JsonProperty("scriptTeam"), UsedImplicitly]
+            [JsonIgnore, UsedImplicitly]
             public bool? ScriptUsesTeamMode
             {
-                get;
-                [UsedImplicitly]
-                private set;
+                get { return !scriptUsesTeamMode.HasValue ? (bool?)null : Convert.ToBoolean(scriptUsesTeamMode.Value); }
             }

             /// <summary>


Detect Window Phone application version when using the Attach method.

--- Mindscape.Raygun4Net.WindowsPhone/RaygunClient.cs
+++ Mindscape.Raygun4Net.WindowsPhone/RaygunClient.cs
@@ -39,6 +39,7 @@
       _wrapperExceptions = new List<Type>();
       _wrapperExceptions.Add(typeof(TargetInvocationException));

+      SetCallingAssembly(Assembly.GetCallingAssembly());
       Deployment.Current.Dispatcher.BeginInvoke(SendStoredMessages);
     }

@@ -49,6 +50,7 @@
     public RaygunClient()
       : this(RaygunSettings.Settings.ApiKey)
     {
+      SetCallingAssembly(Assembly.GetCallingAssembly());
     }

     private bool ValidateApiKey()
@@ -108,6 +110,7 @@
     {
       Detach();
       _client = new RaygunClient(apiKey);
+      _client.SetCallingAssembly(Assembly.GetCallingAssembly());
       if (Application.Current != null)
       {
         Application.Current.UnhandledException += Current_UnhandledException;
@@ -162,7 +165,6 @@
     /// <param name="args">The <see cref="ApplicationUnhandledExceptionEventArgs"/> containing the exception information.</param>
     public void Send(ApplicationUnhandledExceptionEventArgs args)
     {
-      SetCallingAssembly(Assembly.GetCallingAssembly());
       Send(args, null, null);
     }

@@ -173,7 +175,6 @@
     /// <param name="tags">A list of tags to send with the message.</param>
     public void Send(ApplicationUnhandledExceptionEventArgs args, IList<string> tags)
     {
-      SetCallingAssembly(Assembly.GetCallingAssembly());
       Send(args, tags, null);
     }

@@ -184,7 +185,6 @@
     /// <param name="userCustomData">Custom data to send with the message.</param>
     public void Send(ApplicationUnhandledExceptionEventArgs args, IDictionary userCustomData)
     {
-      SetCallingAssembly(Assembly.GetCallingAssembly());
       Send(args, null, userCustomData);
     }

@@ -196,7 +196,6 @@
     /// <param name="userCustomData">Custom data to send with the message.</param>
     public void Send(ApplicationUnhandledExceptionEventArgs args, IList<string> tags, IDictionary userCustomData)
     {
-      SetCallingAssembly(Assembly.GetCallingAssembly());
       if (!(args.ExceptionObject is ExitException))
       {
         bool handled = args.Handled;
@@ -211,7 +210,6 @@
     /// <param name="exception">The <see cref="Exception"/> to send in the message.</param>
     public void Send(Exception exception)
     {
-      SetCallingAssembly(Assembly.GetCallingAssembly());
       bool calledFromUnhandled = IsCalledFromApplicationUnhandledExceptionHandler();
       Send(exception, null, null, calledFromUnhandled);
     }
@@ -223,7 +221,6 @@
     /// <param name="tags">A list of tags to send with the message.</param>
     public void Send(Exception exception, IList<string> tags)
     {
-      SetCallingAssembly(Assembly.GetCallingAssembly());
       bool calledFromUnhandled = IsCalledFromApplicationUnhandledExceptionHandler();
       Send(exception, tags, null, calledFromUnhandled);
     }
@@ -235,7 +232,6 @@
     /// <param name="userCustomData">Custom data to send with the message.</param>
     public void Send(Exception exception, IDictionary userCustomData)
     {
-      SetCallingAssembly(Assembly.GetCallingAssembly());
       bool calledFromUnhandled = IsCalledFromApplicationUnhandledExceptionHandler();
       Send(exception, null, userCustomData, calledFromUnhandled);
     }
@@ -248,7 +244,6 @@
     /// <param name="userCustomData">Custom data to send with the message.</param>
     public void Send(Exception exception, IList<string> tags, IDictionary userCustomData)
     {
-      SetCallingAssembly(Assembly.GetCallingAssembly());
       bool calledFromUnhandled = IsCalledFromApplicationUnhandledExceptionHandler();
       Send(exception, tags, userCustomData, calledFromUnhandled);
     }
@@ -268,7 +263,6 @@
     /// set to a valid DateTime and as much of the Details property as is available.</param>
     public void Send(RaygunMessage raygunMessage)
     {
-      SetCallingAssembly(Assembly.GetCallingAssembly());
       bool calledFromUnhandled = IsCalledFromApplicationUnhandledExceptionHandler();
       Send(raygunMessage, calledFromUnhandled, false);
     }


Updated title of web page

Updated title of web page

--- ModelMetadataDemo.Web/Views/Shared/_Layout.cshtml
+++ ModelMetadataDemo.Web/Views/Shared/_Layout.cshtml
@@ -12,11 +12,11 @@

-
My MVC Application

+
Model Metadata Extensions Demo

-
+


[TheForest] Switch to “Unnamed” for player name on first connection

--- Games/Unity/Oxide.Game.TheForest/TheForestCore.cs
+++ Games/Unity/Oxide.Game.TheForest/TheForestCore.cs
@@ -157,7 +157,6 @@
         {
             var id = connection.RemoteEndPoint.SteamId.Id.ToString();
             var cSteamId = new CSteamID(connection.RemoteEndPoint.SteamId.Id);
-            var name = SteamFriends.GetFriendPersonaName(cSteamId); // TODO: Does this even work? Might just use "Unnamed"

             // Get IP address from Steam
             P2PSessionState_t sessionState;
@@ -166,7 +165,7 @@
             var ip = string.Concat(remoteIp >> 24 & 255, ".", remoteIp >> 16 & 255, ".", remoteIp >> 8 & 255, ".", remoteIp & 255);

             // Call out and see if we should reject
-            var canLogin = Interface.Call("CanClientLogin", connection) ?? Interface.Call("CanUserLogin", name, id, ip);
+            var canLogin = Interface.Call("CanClientLogin", connection) ?? Interface.Call("CanUserLogin", "Unnamed", id, ip);
             if (canLogin is string || (canLogin is bool && !(bool)canLogin))
             {
                 var coopKickToken = new CoopKickToken
@@ -178,7 +177,7 @@
                 return true;
             }

-            return Interface.Call("OnUserApprove", connection) ?? Interface.Call("OnUserApproved", name, id, ip);
+            return Interface.Call("OnUserApprove", connection) ?? Interface.Call("OnUserApproved", "Unnamed", id, ip);
         }

         /// <summary>


Revert "Closes #18. GetChildren will return collection of IContent."

This reverts commit ce78c1480c7da145fb89284c3cdc22286ae59abc.

--- Geta.EPi.Extensions/ContentReferenceExtensions.cs
+++ Geta.EPi.Extensions/ContentReferenceExtensions.cs
@@ -14,13 +14,13 @@
     public static class ContentReferenceExtensions
     {
         /// <summary>
-        ///     Returns enumeration of child contents of IContent type for provided content reference.
+        ///     Returns enumeration of child contents of PageData type for provided content reference.
         /// </summary>
         /// <param name="contentReference">Content reference for which child contents to get.</param>
-        /// <returns>Enumeration of IContent child content.</returns>
-        public static IEnumerable<IContent> GetChildren(this ContentReference contentReference)
+        /// <returns>Enumeration of PageData child content.</returns>
+        public static IEnumerable<PageData> GetChildren(this ContentReference contentReference)
         {
-            return contentReference.GetChildren<IContent>();
+            return contentReference.GetChildren<PageData>();
         }

         /// <summary>


Corrected tests

Corrected tests

--- HCEngine/HCEngine.UnitTesting/SourceReaderTest.cs
+++ HCEngine/HCEngine.UnitTesting/SourceReaderTest.cs
@@ -50,20 +50,20 @@
             string source = "reading\nthis should\nbe ok";
             ISourceReader reader = new SourceReader();
             reader.Initialize(source);
-            Assert.AreEqual(reader.Line, 1);
-            Assert.AreEqual(reader.Column, 1);
+            Assert.AreEqual(1, reader.Line);
+            Assert.AreEqual(1, reader.Column);
             reader.ReadNext();
-            Assert.AreEqual(reader.Line, 2);
-            Assert.AreEqual(reader.Column, 1);
+            Assert.AreEqual(2, reader.Line);
+            Assert.AreEqual(1, reader.Column);
             reader.ReadNext();
-            Assert.AreEqual(reader.Line, 2);
-            Assert.AreEqual(reader.Column, 6);
+            Assert.AreEqual(2, reader.Line);
+            Assert.AreEqual(6, reader.Column);
             reader.ReadNext();
-            Assert.AreEqual(reader.Line, 3);
-            Assert.AreEqual(reader.Column, 1);
+            Assert.AreEqual(3, reader.Line);
+            Assert.AreEqual(1, reader.Column);
             reader.ReadNext();
-            Assert.AreEqual(reader.Line, 3);
-            Assert.AreEqual(reader.Column, 3);
+            Assert.AreEqual(3, reader.Line);
+            Assert.AreEqual(3, reader.Column;
         }
     }
 }


Add FileInfo.Refresh() to invalid cached Exists/Length

--- src/Adaptive.Aeron/Aeron.cs
+++ src/Adaptive.Aeron/Aeron.cs
@@ -400,7 +400,7 @@
             /// </summary>
             public static readonly string AERON_DIR_PROP_DEFAULT =
                 Path.Combine(IoUtil.TmpDirName(), "aeron-" + Environment.UserName);
-
+
             /// <summary>
             /// Media type used for IPC shared memory from <seealso cref="Publication"/> to <seealso cref="Subscription"/> channels.
             /// </summary>
@@ -442,7 +442,7 @@
             /// Value to represent a sessionId that is not to be used.
             /// </summary>
             public const int NULL_SESSION_ID = -1;
-
+
             /// <summary>
             /// Initial term id to be used when creating an <seealso cref="ExclusivePublication"/>.
             /// </summary>
@@ -542,14 +542,14 @@

                 return this;
             }
-
+
             /// <summary>
             /// Perform a shallow copy of the object.
             /// </summary>
             /// <returns> a shallow copy of the object. </returns>
             public virtual Context Clone()
             {
-                return (Context)MemberwiseClone();
+                return (Context) MemberwiseClone();
             }

             /// <summary>
@@ -1159,6 +1159,8 @@
                         }

                         Sleep(16);
+
+                        cncFile.Refresh();
                     }

                     _cncByteBuffer = IoUtil.MapExistingFile(CncFile(), CncFileDescriptor.CNC_FILE);


Fix:  Resolved conflict on program.cs

Fix:  Resolved conflict on program.cs

--- Heroes.ReplayParser.ConsoleApplication/Program.cs
+++ Heroes.ReplayParser.ConsoleApplication/Program.cs
@@ -15,13 +15,11 @@

             // Attempt to parse the replay
             // Ignore errors can be set to true if you want to attempt to parse currently unsupported replays, such as 'VS AI' or 'PTR Region' replays
-            var replayParseResult = DataParser.ParseReplay(randomReplayFileName, deleteFile: false, ParseOptions.TypicalParsing);
+            var (replayParseResult, replay) = DataParser.ParseReplay(randomReplayFileName, deleteFile: false, ParseOptions.TypicalParsing);

             // If successful, the Replay object now has all currently available information
-            if (replayParseResult.Item1 == DataParser.ReplayParseResult.Success)
+            if (replayParseResult == DataParser.ReplayParseResult.Success)
             {
-                var replay = replayParseResult.Item2;
-
                 Console.WriteLine("Replay Build: " + replay.ReplayBuild);
                 Console.WriteLine("Map: " + replay.Map);
                 foreach (var player in replay.Players.OrderByDescending(i => i.IsWinner))
@@ -30,7 +28,7 @@
                 Console.WriteLine("Press Any Key to Close");
             }
             else
-                Console.WriteLine("Failed to Parse Replay: " + replayParseResult.Item1);
+                Console.WriteLine("Failed to Parse Replay: " + replayParseResult);

             Console.Read();
         }


better show signature

better show signature

--- JustObjectsPrototype/JustObjectsPrototype/Show.cs
+++ JustObjectsPrototype/JustObjectsPrototype/Show.cs
@@ -14,7 +14,7 @@
 			return collection;
 		}

-        public static void With(ICollection<object> objects, Settings settings = null)
+		public static void With(ICollection<object> objects, Settings settings = null)
 		{
 			var windowModel = new MainWindowModel(objects, settings ?? Settings.Default)
 			{


enable Skip test

enable Skip test

--- Kudu.Core.Test/Infrastructure/TestHarnessFacts.cs
+++ Kudu.Core.Test/Infrastructure/TestHarnessFacts.cs
@@ -10,22 +10,14 @@
         [Fact]
         public void SkippedSyncTest()
         {
-            // TeamCity reporting issue, skip if running within TeamCity
-            if (string.IsNullOrEmpty(System.Environment.GetEnvironmentVariable("TEAMCITY_VERSION")))
-            {
-                throw new KuduXunitTestSkippedException("Testing SkippedSyncTest");
-            }
+            throw new KuduXunitTestSkippedException("Testing SkippedSyncTest");
         }

         [Fact]
         public void SkippedAsyncTest()
         {
-            // TeamCity reporting issue, skip if running within TeamCity
-            if (string.IsNullOrEmpty(System.Environment.GetEnvironmentVariable("TEAMCITY_VERSION")))
-            {
-                SkippedAsync().Wait();
-                throw new InvalidOperationException("Should not reach here");
-            }
+            SkippedAsync().Wait();
+            throw new InvalidOperationException("Should not reach here");
         }

         private async Task SkippedAsync()


Scale.Index() fixed for cases where tones in scale is outside the middle octave

--- src/MidiGremlin/Scale.cs
+++ src/MidiGremlin/Scale.cs
@@ -73,7 +73,11 @@

             for (int i = 0; i < _tones.Length; i++)
             {
-                if (_tones[i] == rawTone)
+                Tone toneInScale = (Tone) ((int) _tones[i]%_numberOfTones);
+                if (toneInScale < 0)
+                    toneInScale += _numberOfTones;
+
+                if (toneInScale == rawTone)
                 {
                     return i + (octaveDelta * _numberOfTones); // TODO this isn't should be tone.length??
                 }


Write out partial classes for generated stuff, rather than full classes

fixes #4

--- LINQToTTree/TTreeClassGenerator/ClassGenerator.cs
+++ LINQToTTree/TTreeClassGenerator/ClassGenerator.cs
@@ -9,14 +9,14 @@
 namespace TTreeClassGenerator
 {
     /// <summary>
-    /// Starting from the class interface, generate a class that can be used in LINQ queires.
+    /// Starting from the class interface, generate a class that can be used in LINQ queries.
     /// All classes are generated in a single output file.
     /// </summary>
     public class ClassGenerator
     {
         /// <summary>
         /// GIven an existing file that contains the XML class spec, generate a CS file
-        /// that conatins all the definitions needed. Everything will be burried insize
+        /// that contains all the definitions needed. Everything will be buried inside
         /// the namespaceName.
         /// </summary>
         /// <param name="inputXMLFile"></param>
@@ -57,7 +57,7 @@
                 }
                 else
                 {
-                    Console.WriteLine("INFO: Loading gropuing file '" + xmlFile.FullName + "' for class '" + c.Name + "'.");
+                    Console.WriteLine("INFO: Loading grouping file '" + xmlFile.FullName + "' for class '" + c.Name + "'.");
                     userInfoMap[c.Name] = LoadUserInfoFromXMLFile(xmlFile);
                 }
             }
@@ -283,7 +283,7 @@
                     {
                         ///
                         /// Write out the info class that contains everything needed to process this.
-                        /// We could use attribute programing here, but that takes more code at the other
+                        /// We could use attribute programming here, but that takes more code at the other
                         /// end, so until there is a real reason, we'll do it this way.
                         ///
                         /// This is a kludge until we do more work to fix things with attributes, etc.
@@ -366,12 +366,12 @@

                         if (!cls.IsTopLevelClass)
                         {
-                            output.WriteLine("  public class {0}", rawClassName);
+                            output.WriteLine("  public partial class {0}", rawClassName);
                             output.WriteLine("  {");
                         }
                         else
                         {
-                            output.WriteLine("  public class {0} : IExpressionHolder", rawClassName);
+                            output.WriteLine("  public partial class {0} : IExpressionHolder", rawClassName);
                             output.WriteLine("  {");
                             output.WriteLine("    public Expression HeldExpression {get; private set;}");
                             output.WriteLine("    public {0} (Expression expr) {{ HeldExpression = expr; }}", rawClassName);
@@ -399,7 +399,7 @@
                         output.WriteLine();

                         ///
-                        /// Next, write out the queriable classes so we can actually do the queires
+                        /// Next, write out the queriable classes so we can actually do the queries
                         /// against the trees!
                         ///

@@ -418,7 +418,7 @@
                             output.WriteLine("    {");
                             output.WriteLine("      return new QueriableTTree<{0}>(rootFiles, treeName);", cls.Name.FixupClassName());
                             output.WriteLine("    }");
-                            output.WriteLine("    /// Create a LINQ to TTree interface for a list of urls and optional tree name");
+                            output.WriteLine("    /// Create a LINQ to TTree interface for a list of URLs and optional tree name");
                             output.WriteLine("    public static QueriableTTree<{0}> CreateQueriable (this System.Uri[] rootURLs, string treeName = \"{1}\")", cls.Name.FixupClassName(), cls.Name);
                             output.WriteLine("    {");
                             output.WriteLine("      return new QueriableTTree<{0}>(rootURLs, treeName);", cls.Name.FixupClassName());
@@ -494,7 +494,7 @@
             ///

             output.WriteLine("  [TranslateToClass(typeof({0}))]", translateToName);
-            output.WriteLine("  public class {0}", className);
+            output.WriteLine("  public partial class {0}", className);
             output.WriteLine("  {");

             ///
@@ -546,7 +546,7 @@

             foreach (var grp in tTreeUserInfo.Groups.Where(g => g.Name != "ungrouped"))
             {
-                output.WriteLine("  public class {0}", grp.ClassName);
+                output.WriteLine("  public partial class {0}", grp.ClassName);
                 output.WriteLine("  {");

                 output.WriteLine("#pragma warning disable 0649");


Fixed up the auto-generate functions to make life a bit simpler on the analyzer.

--- LINQToTTree/TTreeClassGenerator/ClassGenerator.cs
+++ LINQToTTree/TTreeClassGenerator/ClassGenerator.cs
@@ -159,11 +159,19 @@
                     /// against the trees!
                     ///

-                    output.WriteLine("  class Queryable{0} : QueriableTTree<{0}>", cls.Name);
+                    output.WriteLine("  /// Helper classes");
+                    output.WriteLine("  static class Queryable{0}", cls.Name);
                     output.WriteLine("  {");
-                    output.WriteLine("    public Queryable{0} (FileInfo rootFile, string treeName = \"{0}\")", cls.Name);
-                    output.WriteLine("              : base (rootFile, treeName)");
-                    output.WriteLine("    {}");
+                    output.WriteLine("    /// Create a LINQ to TTree interface for a file and optional tree name");
+                    output.WriteLine("    public static QueriableTTree<{0}> Create (FileInfo rootFile, string treeName = \"{0}\")", cls.Name);
+                    output.WriteLine("    {");
+                    output.WriteLine("      return new QueriableTTree<{0}>(rootFile, treeName);", cls.Name);
+                    output.WriteLine("    }");
+                    output.WriteLine("    /// Create a LINQ to TTree interface for a list of files and optional tree name");
+                    output.WriteLine("    public static QueriableTTree<{0}> Create (FileInfo[] rootFiles, string treeName = \"{0}\")", cls.Name);
+                    output.WriteLine("    {");
+                    output.WriteLine("      return new QueriableTTree<{0}>(rootFiles, treeName);", cls.Name);
+                    output.WriteLine("    }");
                     output.WriteLine("  }");
                 }


#224 - Fix CORS release allowed origin.

#224 - Fix CORS release allowed origin.

--- src/Money.Api/Startup.cs
+++ src/Money.Api/Startup.cs
@@ -131,7 +131,7 @@
 #if DEBUG
                 p.WithOrigins("http://localhost:48613");
 #else
-                p.WithOrigins("https://api.money.neptuo.com");
+                p.WithOrigins("https://app.money.neptuo.com");
 #endif
                 p.AllowAnyMethod();
                 p.AllowCredentials();


Consolidate hollow operation steps

Consolidate hollow operation steps

--- MatterControl.MeshOperations/HollowOutObject3D.cs
+++ MatterControl.MeshOperations/HollowOutObject3D.cs
@@ -69,7 +69,7 @@

 		public Mesh HollowOut(Mesh inMesh)
 		{
-			// Convert
+			// Convert to DMesh3
 			var mesh = inMesh.ToDMesh3();

 			// Create instance of BoundedImplicitFunction3d interface
@@ -85,7 +85,7 @@
 			// Outer shell
 			var implicitMesh = new DenseGridTrilinearImplicit(levelSet.Grid, levelSet.GridOrigin, levelSet.CellSize);

-			// Inner shell subtracted from outer
+			// Offset shell
 			var insetMesh = GenerateMeshF(
 				new ImplicitOffset3d()
 				{
@@ -94,8 +94,15 @@
 				},
 				128);

-			// Convert
-			return insetMesh.ToMesh();
+			// Convert to PolygonMesh and reverse faces
+			var interior = insetMesh.ToMesh();
+			interior.ReverseFaces();
+
+			// Combine the original mesh with the reversed offset resulting in hollow
+			var combinedMesh = inMesh.Copy(CancellationToken.None);
+			combinedMesh.CopyFaces(interior);
+
+			return combinedMesh;
 		}

 		public override Task Rebuild()
@@ -115,19 +122,9 @@

 					foreach (var sourceItem in SourceContainer.VisibleMeshes())
 					{
-						var originalMesh = sourceItem.Mesh;
-						var combinedMesh = originalMesh.Copy(CancellationToken.None);
-
-						// get the interior mesh and reverse it
-						var interior = HollowOut(originalMesh);
-						interior.ReverseFaces();
-
-						// now add all the faces to the combinedMesh
-						combinedMesh.CopyFaces(interior);
-
 						var newMesh = new Object3D()
 						{
-							Mesh = combinedMesh
+							Mesh = HollowOut(sourceItem.Mesh)
 						};
 						newMesh.CopyProperties(sourceItem, Object3DPropertyFlags.All);
 						this.Children.Add(newMesh);


Run `Capture` matchers of matched `Verify` expr parts

--- src/Moq/Mock.cs
+++ src/Moq/Mock.cs
@@ -349,8 +349,9 @@

 			if (times.Verify(invocationCount))
 			{
-				foreach (var invocation in invocationsToBeMarkedAsVerified)
-				{
+				foreach (var (invocation, part) in invocationsToBeMarkedAsVerified)
+				{
+					part.SetupEvaluatedSuccessfully(invocation);
 					invocation.MarkAsVerified();
 				}
 			}
@@ -452,12 +453,12 @@
 		private static int GetMatchingInvocationCount(
 			Mock mock,
 			LambdaExpression expression,
-			out List<Invocation> invocationsToBeMarkedAsVerified)
+			out List<Pair<Invocation, InvocationShape>> invocationsToBeMarkedAsVerified)
 		{
 			Debug.Assert(mock != null);
 			Debug.Assert(expression != null);

-			invocationsToBeMarkedAsVerified = new List<Invocation>();
+			invocationsToBeMarkedAsVerified = new List<Pair<Invocation, InvocationShape>>();
 			return Mock.GetMatchingInvocationCount(
 				mock,
 				new ImmutablePopOnlyStack<InvocationShape>(expression.Split()),
@@ -469,7 +470,7 @@
 			Mock mock,
 			in ImmutablePopOnlyStack<InvocationShape> parts,
 			HashSet<Mock> visitedInnerMocks,
-			List<Invocation> invocationsToBeMarkedAsVerified)
+			List<Pair<Invocation, InvocationShape>> invocationsToBeMarkedAsVerified)
 		{
 			Debug.Assert(mock != null);
 			Debug.Assert(!parts.Empty);
@@ -488,7 +489,7 @@
 			var count = 0;
 			foreach (var matchingInvocation in mock.MutableInvocations.ToArray().Where(part.IsMatch))
 			{
-				invocationsToBeMarkedAsVerified.Add(matchingInvocation);
+				invocationsToBeMarkedAsVerified.Add(new Pair<Invocation, InvocationShape>(matchingInvocation, part));

 				if (remainingParts.Empty)
 				{


`Dictionary` made public in `IdentifiedElementsDictionary`.

--- Migrant/Utilities/IdentifiedElementsDictionary.cs
+++ Migrant/Utilities/IdentifiedElementsDictionary.cs
@@ -31,27 +31,34 @@
         public IdentifiedElementsDictionary(ObjectWriter writer)
         {
             this.writer = writer;
-            dictionary = new Dictionary<T, int>();
+            Dictionary = new Dictionary<T, int>();
         }

         public int TouchAndWriteId(T element)
         {
             int typeId;
-            if(dictionary.TryGetValue(element, out typeId))
+            if(Dictionary.TryGetValue(element, out typeId))
             {
                 writer.PrimitiveWriter.Write(typeId);
                 return typeId;
             }
-            typeId = nextId++;
-            dictionary.Add(element, typeId);
+            typeId = AddAndAdvanceId(element);
             writer.PrimitiveWriter.Write(typeId);
             element.Write(writer);
             return typeId;
         }

+        public int AddAndAdvanceId(T element)
+        {
+            var typeId = nextId++;
+            Dictionary.Add(element, typeId);
+            return typeId;
+        }
+
+        public Dictionary<T, int> Dictionary { get; private set; }
+
         private int nextId;
         private readonly ObjectWriter writer;
-        private readonly Dictionary<T, int> dictionary;
     }
 }


Fixed double death bug

Fixed double death bug

- Fixed a bug where a player checking a bomb would die two times

--- MinesweeperWithTwitch/Assets/Scripts/Game/Game.cs
+++ MinesweeperWithTwitch/Assets/Scripts/Game/Game.cs
@@ -200,10 +200,7 @@
         if(x >= 0 && x < this.nbSquaresX && y >= 0 && y < this.nbSquaresY && !this.deadUsersTime.ContainsKey(user)) {
             if (command.Equals("check")) {
 				KeyValuePair<int, int> checkValues = this.squares[x, y].Check(new KeyValuePair<int, int>(0, 0), user);
-				// User checked a mine, kill him for some time
-				if(checkValues.Value > 0) {
-					this.KillUser(user, x, y);
-				} else {
+				if(checkValues.Value == 0) {
 					this.IncrementUserScore(user, checkValues.Key);
 					this.NewSquaresChecked(checkValues.Key + checkValues.Value);
 				}


Inline execute tasks when possible

Inline execute tasks when possible

Updated TaskDispatcher comment
Added documentation
Hiding the implementation of IsSuspended for maiboxes
Replaced suspension bool with a bitflag
Initial reentrancy/nonreentrant support

--- src/core/Akka/Dispatch/TaskDispatcher.cs
+++ src/core/Akka/Dispatch/TaskDispatcher.cs
@@ -13,9 +13,4 @@
             Task.Run(run);
         }
     }
-
-        public override string ToString()
-        {
-            return string.Format("(Sender: {0}, Self: {1}, Message: {2})", Sender, Self, Message);
-        }
 }


Remove redundant NULL check in Progress

Remove redundant NULL check in Progress

--- src/Progress.cs
+++ src/Progress.cs
@@ -154,7 +154,7 @@
             if (handler != null)
             {
                 var eventArgs = new ProgressChangedEventArgs(progress, messages);
-                InternalProgressChanged?.Invoke(this, eventArgs);
+                handler.Invoke(this, eventArgs);
             }
         }


Updated Unit test to insert 10 records instead of 50

--- test/Merchello.Tests.IntegrationTests/Services/Product/ProductTests.cs
+++ test/Merchello.Tests.IntegrationTests/Services/Product/ProductTests.cs
@@ -141,7 +141,7 @@
         public void Can_Save_Multiple_Products()
         {
             //// Arrange
-            var expected = 50;
+            var expected = 10;
             var generated = MockProductDataMaker.MockProductCollectionForInserting(expected);

             //// Act


Actual fix to JSON issue (no JSONP callback used to wrap JSON).

--- rss-to-jsonp/Controllers/HomeController.cs
+++ rss-to-jsonp/Controllers/HomeController.cs
@@ -38,7 +38,7 @@
                 title = (string)getElement(rootElements, "title"),
                 updated = (DateTime)getElement(rootElements, "updated"),
                 entries = entries
-            });
+            }, callback;
             result.JsonRequestBehavior = JsonRequestBehavior.AllowGet;
             return result;
         }
@@ -64,7 +64,7 @@
                 description = (string)getElement(rootElements, "description"),
                 lastBuildDate = (DateTime)getElement(rootElements, "lastBuildDate"),
                 entries = entries
-            });
+            }, callback);
             result.JsonRequestBehavior = JsonRequestBehavior.AllowGet;
             return result;
         }


Sample typo fix

Sample typo fix

--- samples/CSharpVsix/CSharpVsix.sharpmake.cs
+++ samples/CSharpVsix/CSharpVsix.sharpmake.cs
@@ -2,7 +2,7 @@
 using System;
 using System.IO;

-namespace CSharpHelloWorld
+namespace CSharpVsix
 {
     [Sharpmake.Generate]
     public class CSharpVsixProject : CSharpProject


GetPartitionHandler DI init in ctor

GetPartitionHandler DI init in ctor

--- Applications/DMT.Partition.Module/Remote/Service/GetPartitionHandler.cs
+++ Applications/DMT.Partition.Module/Remote/Service/GetPartitionHandler.cs
@@ -4,8 +4,10 @@
 using System.IO;
 using System.Linq;
 using System.Text;
+using DMT.Common.Composition;
 using DMT.Common.Extensions;
 using DMT.Common.Rest;
+using DMT.Module.Common;
 using DMT.Partition.Interfaces;

 namespace DMT.Partition.Module.Remote.Service
@@ -16,6 +18,11 @@

         [Import]
         private IPartitionSerializer partitionSerializer;
+
+        public GetPartitionHandler()
+        {
+            CompositionService.Default.InjectOnce(this);
+        }

         public void Handle(Request request, Response response)
         {


修正DataTable生成工具的BUG

修正DataTable生成工具的BUG

--- Assets/GameMain/Scripts/Editor/DataTableGenerator/DataTableGenerator.cs
+++ Assets/GameMain/Scripts/Editor/DataTableGenerator/DataTableGenerator.cs
@@ -292,6 +292,14 @@

                 stringBuilder
                     .AppendFormat("        private KeyValuePair<int, {1}>[] m_{0} = null;", propertyCollection.Name, propertyCollection.LanguageKeyword).AppendLine()
+                    .AppendLine()
+                    .AppendFormat("        public int {0}Count", propertyCollection.Name).AppendLine()
+                    .AppendLine("        {")
+                    .AppendLine("            get")
+                    .AppendLine("            {")
+                    .AppendFormat("                return m_{0}.Length;", propertyCollection.Name).AppendLine()
+                    .AppendLine("            }")
+                    .AppendLine("        }")
                     .AppendLine()
                     .AppendFormat("        public {1} Get{0}(int id)", propertyCollection.Name, propertyCollection.LanguageKeyword).AppendLine()
                     .AppendLine("        {")


Fix combobox from showing all results when should be filtered

Closes #52, Closes #45, Closes #40

--- AutoCompleteTextBox/AutoCompleteTextBox/Editors/AutoCompleteComboBox.cs
+++ AutoCompleteTextBox/AutoCompleteTextBox/Editors/AutoCompleteComboBox.cs
@@ -345,7 +345,8 @@
             {
                 _suggestionsAdapter = new SuggestionsAdapter(this);
             }
-            _suggestionsAdapter.ShowFullCollection();
+            if (SelectedItem != null || String.IsNullOrWhiteSpace(Editor.Text))
+                _suggestionsAdapter.ShowFullCollection();

         }

@@ -534,7 +535,6 @@

             public void GetSuggestions(string searchText)
             {
-                _filter = searchText;
                 _actb.IsLoading = true;
                 // Do not open drop down if control is not focused
                 if (_actb.IsKeyboardFocusWithin)
@@ -542,6 +542,7 @@
                 _actb.ItemsSelector.ItemsSource = null;
                 ParameterizedThreadStart thInfo = GetSuggestionsAsync;
                 Thread th = new Thread(thInfo);
+                _filter = searchText;
                 th.Start(new object[] { searchText, _actb.Provider });
             }
             public void ShowFullCollection()


Used the wrong total column

Used the wrong total column

--- Battery-Commander.Web/Views/Shared/DisplayTemplates/Red1_Perstat.cshtml
+++ Battery-Commander.Web/Views/Shared/DisplayTemplates/Red1_Perstat.cshtml
@@ -89,7 +89,7 @@
             @Html.RouteLink($"{Model.PERSTAT.OnLeaveOrPass.Officer}", "Soldiers.List", new { Unit = Model.Id, Ranks = officers, Status = Soldier.SoldierStatus.OnPass })
             @Html.RouteLink($"{Model.PERSTAT.OnLeaveOrPass.Enlisted}", "Soldiers.List", new { Unit = Model.Id, OnlyEnlisted = true, Status = Soldier.SoldierStatus.OnPass })
             @Html.DisplayFor(_ => Model.PERSTAT.OnLeaveOrPass.Warrant)
-            @Html.RouteLink($"{Model.PERSTAT.Detached.Total}", "Soldiers.List", new { Unit = Model.Id, Status = Soldier.SoldierStatus.OnPass })
+            @Html.RouteLink($"{Model.PERSTAT.OnLeaveOrPass.Total}", "Soldiers.List", new { Unit = Model.Id, Status = Soldier.SoldierStatus.OnPass })

             Line 11
@@ -97,7 +97,7 @@
             @Html.RouteLink($"{Model.PERSTAT.TDY.Officer}", "Soldiers.List", new { Unit = Model.Id, Ranks = officers, Status = Soldier.SoldierStatus.TDY })
             @Html.RouteLink($"{Model.PERSTAT.TDY.Enlisted}", "Soldiers.List", new { Unit = Model.Id, OnlyEnlisted = true, Status = Soldier.SoldierStatus.TDY })
             @Html.DisplayFor(_ => Model.PERSTAT.TDY.Warrant)
-            @Html.RouteLink($"{Model.PERSTAT.Detached.Total}", "Soldiers.List", new { Unit = Model.Id, Status = Soldier.SoldierStatus.TDY })
+            @Html.RouteLink($"{Model.PERSTAT.TDY.Total}", "Soldiers.List", new { Unit = Model.Id, Status = Soldier.SoldierStatus.TDY })

             Line 12
@@ -105,7 +105,7 @@
             @Html.RouteLink($"{Model.PERSTAT.AWOL.Officer}", "Soldiers.List", new { Unit = Model.Id, Ranks = officers, Status = Soldier.SoldierStatus.AWOL })
             @Html.RouteLink($"{Model.PERSTAT.AWOL.Enlisted}", "Soldiers.List", new { Unit = Model.Id, OnlyEnlisted = true, Status = Soldier.SoldierStatus.AWOL })
             @Html.DisplayFor(_ => Model.PERSTAT.AWOL.Warrant)
-            @Html.RouteLink($"{Model.PERSTAT.Detached.Total}", "Soldiers.List", new { Unit = Model.Id, Status = Soldier.SoldierStatus.AWOL })
+            @Html.RouteLink($"{Model.PERSTAT.AWOL.Total}", "Soldiers.List", new { Unit = Model.Id, Status = Soldier.SoldierStatus.AWOL })

             Line 13
@@ -113,7 +113,7 @@
             @Html.RouteLink($"{Model.PERSTAT.RearDetachment.Officer}", "Soldiers.List", new { Unit = Model.Id, Ranks = officers, Status = Soldier.SoldierStatus.RearDetachment })
             @Html.RouteLink($"{Model.PERSTAT.RearDetachment.Enlisted}", "Soldiers.List", new { Unit = Model.Id, OnlyEnlisted = true, Status = Soldier.SoldierStatus.RearDetachment })
             @Html.DisplayFor(_ => Model.PERSTAT.RearDetachment.Warrant)
-            @Html.RouteLink($"{Model.PERSTAT.Detached.Total}", "Soldiers.List", new { Unit = Model.Id, Status = Soldier.SoldierStatus.RearDetachment })
+            @Html.RouteLink($"{Model.PERSTAT.RearDetachment.Total}", "Soldiers.List", new { Unit = Model.Id, Status = Soldier.SoldierStatus.RearDetachment })

             Line 14


Added IM mapping Fixed some Name and Title Mappings

--- CalDavSynchronizer/Implementation/GoogleContacts/ContactEntityMapper.cs
+++ CalDavSynchronizer/Implementation/GoogleContacts/ContactEntityMapper.cs
@@ -54,6 +54,7 @@
     private const string REL_ASSISTANT = "assistant";
     private const string REL_ANNIVERSARY = "anniversary";
     private const string REL_HOMEPAGE = "home-page";
+    private const string REL_WORK = "work";

     private readonly ContactMappingConfiguration _configuration;

@@ -64,41 +65,80 @@

     public Contact Map1To2 (ContactItemWrapper source, Contact target, IEntityMappingLogger logger)
     {
-      target.Name = new Name()
+
+      #region Title/FileAs
+      if (!string.IsNullOrEmpty(source.Inner.FileAs))
+      {
+        target.Title = source.Inner.FileAs;
+      }
+      else if (!string.IsNullOrEmpty(source.Inner.CompanyAndFullName))
+      {
+        target.Title = source.Inner.CompanyAndFullName;
+      }
+      else if (!string.IsNullOrEmpty(source.Inner.FullName))
+      {
+        target.Title = source.Inner.FullName;
+      }
+      else if (!string.IsNullOrEmpty(source.Inner.CompanyName))
+      {
+        target.Title = source.Inner.CompanyName;
+      }
+      else if (!string.IsNullOrEmpty(source.Inner.Email1Address))
+      {
+        target.Title = source.Inner.Email1Address;
+      }
+      #endregion Title/FileAs
+
+      #region Name
+      Name name = new Name()
       {
         GivenName = source.Inner.FirstName,
-        FamilyName = source.Inner.LastName,
-        FullName = source.Inner.FullName,
+        FamilyName = source.Inner.LastName,
         AdditionalName = source.Inner.MiddleName,
         NamePrefix = source.Inner.Title,
         NameSuffix = source.Inner.Suffix,
-      };
-
-      MapEmailAddresses1To2(source.Inner, target, logger);
-
-      if (!string.IsNullOrEmpty(source.Inner.FileAs))
-      {
-        target.Title = source.Inner.FileAs;
-      }
-      else if (!string.IsNullOrEmpty(source.Inner.CompanyAndFullName))
-      {
-        target.Title = source.Inner.CompanyAndFullName;
-      }
-      else if (target.Emails.Count >= 1)
-      {
-        target.Title = target.Emails[0].Address;
-      }
-
-      MapPostalAddresses1To2 (source.Inner, target);
+      };
+
+      //Use the Google's full name to save a unique identifier. When saving the FullName, it always overwrites the Google Title
+      if (!string.IsNullOrEmpty(source.Inner.FullName)) //Only if source.FullName has a value, i.e. not only a company or email contact
+      {
+        name.FullName = source.Inner.FileAs;
+      }
+
+      target.Name = name;
+
+      #endregion Name
+
+      MapEmailAddresses1To2(source.Inner, target, logger);
+
+      MapPostalAddresses1To2(source.Inner, target);

       MapPhoneNumbers1To2 (source.Inner, target);

       target.ContactEntry.Nickname = source.Inner.NickName;
-      target.ContactEntry.Initials = source.Inner.Initials;
-
+      target.ContactEntry.Initials = source.Inner.Initials;
+
+      #region company
       target.Organizations.Clear();
-      if (!string.IsNullOrEmpty(source.Inner.CompanyName) || !string.IsNullOrEmpty(source.Inner.Department) ||
-          !string.IsNullOrEmpty(source.Inner.JobTitle))
+      if (!string.IsNullOrEmpty(source.Inner.Companies))
+      {
+        //Companies are expected to be in form of "[Company]; [Company]".
+        string[] companiesRaw = source.Inner.Companies.Split(';');
+        foreach (string companyRaw in companiesRaw)
+        {
+          Organization company = new Organization();
+          company.Name = (target.Organizations.Count == 0) ? source.Inner.CompanyName : null;
+          company.Title = (target.Organizations.Count == 0) ? source.Inner.JobTitle : null;
+          company.Department = (target.Organizations.Count == 0) ? source.Inner.Department : null;
+          company.Primary = target.Organizations.Count == 0;
+          company.Rel = ContactsRelationships.IsWork;
+          target.Organizations.Add(company);
+        }
+      }
+
+
+      if (target.Organizations.Count == 0 && (!string.IsNullOrEmpty(source.Inner.CompanyName) || !string.IsNullOrEmpty(source.Inner.Department) ||
+          !string.IsNullOrEmpty(source.Inner.JobTitle)))
       {
         target.Organizations.Add (new Organization()
         {
@@ -108,16 +148,17 @@
           Rel = ContactsRelationships.IsWork,
           Primary = true,
         });
-      }
+      }
+      #endregion company
       target.Location = source.Inner.OfficeLocation;

       target.ContactEntry.Websites.Clear();
-      if (!string.IsNullOrEmpty (source.Inner.PersonalHomePage))
+      if (!string.IsNullOrEmpty (source.Inner.WebPage)) //ToDo: PersonalHomePage is not considered yet, but also not visible in Outlook
       {
         target.ContactEntry.Websites.Add (new Website()
         {
-          Href = source.Inner.PersonalHomePage,
-          Rel = "home-page",
+          Href = source.Inner.WebPage,
+          Rel = REL_HOMEPAGE,
           Primary = true,
         });
       }
@@ -126,19 +167,10 @@
         target.ContactEntry.Websites.Add(new Website()
         {
           Href = source.Inner.BusinessHomePage,
-          Rel = "work",
+          Rel = REL_WORK,
           Primary = target.ContactEntry.Websites.Count == 0,
         });
-      }
-
-      if (_configuration.MapBirthday && !source.Inner.Birthday.Equals (new DateTime (4501, 1, 1, 0, 0, 0)))
-      {
-        target.ContactEntry.Birthday = source.Inner.Birthday.ToString ("yyyy-MM-dd");
-      }
-      else
-      {
-        target.ContactEntry.Birthday = null;
-      }
+      }

       #region birthday
@@ -228,10 +260,38 @@
       }
       #endregion relations (spouse, child, manager and assistant)

-
+      #region IMs
+      target.IMs.Clear();
+
+      if (!string.IsNullOrEmpty(source.Inner.IMAddress))
+      {
+        //IMAddress are expected to be in form of ([Protocol]: [Address]; [Protocol]: [Address])
+        string[] imsRaw = source.Inner.IMAddress.Split(';');
+        foreach (string imRaw in imsRaw)
+        {
+          string[] imDetails = imRaw.Trim().Split(':');
+          IMAddress im = new IMAddress();
+          if (imDetails.Length == 1)
+            im.Address = imDetails[0].Trim();
+          else
+          {
+            im.Protocol = imDetails[0].Trim();
+            im.Address = imDetails[1].Trim();
+          }
+
+          //Only add the im Address if not empty (to avoid Google exception "address" empty)
+          if (!string.IsNullOrEmpty(im.Address))
+          {
+            im.Primary = target.IMs.Count == 0;
+            im.Rel = ContactsRelationships.IsHome;
+            target.IMs.Add(im);
+          }
+        }
+      }
+      #endregion IMs

       target.Content = !string.IsNullOrEmpty(source.Inner.Body) ?
-                  System.Security.SecurityElement.Escape (source.Inner.Body) : null;
+                        System.Security.SecurityElement.Escape (source.Inner.Body) : null;

       return target;
     }
@@ -522,18 +582,20 @@
         target.Inner.LastName = source.Name.FamilyName;
         target.Inner.Title = source.Name.NamePrefix;
         target.Inner.Suffix = source.Name.NameSuffix;
-        target.Inner.MiddleName = source.Name.AdditionalName;
+        target.Inner.MiddleName = source.Name.AdditionalName;
+        if (string.IsNullOrEmpty(target.Inner.FullName)) //The Outlook fullName is automatically set, so don't assign it from Google, unless the structured properties were empty
+          target.Inner.FullName = source.Name.FullName;
       }

       if (string.IsNullOrEmpty(target.Inner.FileAs))
       {
         if (!string.IsNullOrEmpty (source.Title))
         {
-          target.Inner.FileAs = source.Title;
+          target.Inner.FileAs = source.Title.Replace("\r\n", "\n").Replace("\n", "\r\n"); //Replace twice to not replace a \r\n by \r\r\n. This is necessary because \r\n are saved as \n only to google and \r\n is saved on Outlook side to separate the single parts of the FullName
         }
         else if (!string.IsNullOrEmpty (source.Name?.FullName))
         {
-          target.Inner.FileAs = source.Name.FullName;
+          target.Inner.FileAs = source.Name.FullName.Replace("\r\n", "\n").Replace("\n", "\r\n"); //Replace twice to not replace a \r\n by \r\r\n. This is necessary because \r\n are saved as \n only to google and \r\n is saved on Outlook side to separate the single parts of the FullName
         }
         else if (source.Organizations.Count > 0 && !string.IsNullOrEmpty (source.Organizations[0].Name))
         {
@@ -572,35 +634,44 @@
       }

       target.Inner.NickName = source.ContactEntry.Nickname;
-      target.Inner.Initials = source.ContactEntry.Initials;
-
-      if (source.Organizations.Count > 0)
-      {
-        target.Inner.CompanyName = source.Organizations[0].Name;
-        target.Inner.Department = source.Organizations[0].Department;
-        target.Inner.JobTitle = source.Organizations[0].Title;
-      }
+      target.Inner.Initials = source.ContactEntry.Initials;
+
+      #region companies
+      target.Inner.Companies = string.Empty;
+      target.Inner.CompanyName = string.Empty;
+      target.Inner.JobTitle = string.Empty;
+      target.Inner.Department = string.Empty;
+      foreach (Organization company in source.Organizations)
+      {
+        if (string.IsNullOrEmpty(company.Name) && string.IsNullOrEmpty(company.Title) && string.IsNullOrEmpty(company.Department))
+          continue;
+
+        if (company.Primary || company.Equals(source.Organizations[0]))
+        {//Per default copy the first company, but if there is a primary existing, use the primary
+          target.Inner.CompanyName = company.Name;
+          target.Inner.JobTitle = company.Title;
+          target.Inner.Department = company.Department;
+        }
+        if (!string.IsNullOrEmpty(target.Inner.Companies))
+          target.Inner.Companies += "; ";
+        target.Inner.Companies += company.Name;
+      }
+      #endregion companies
+      target.Inner.OfficeLocation = source.Location;
+
+      target.Inner.BusinessHomePage = string.Empty;
+      target.Inner.WebPage = string.Empty;
+
+      if (source.ContactEntry.Websites.Count == 1)
+        target.Inner.WebPage = source.ContactEntry.Websites[0].Href;
       else
       {
-        target.Inner.CompanyName = string.Empty;
-        target.Inner.Department = string.Empty;
-        target.Inner.JobTitle = string.Empty;
-      }
-      target.Inner.OfficeLocation = source.Location;
-
-      target.Inner.BusinessHomePage = string.Empty;
-      target.Inner.PersonalHomePage = string.Empty;
-
-      if (source.ContactEntry.Websites.Count == 1)
-        target.Inner.BusinessHomePage = source.ContactEntry.Websites[0].Href;
-      else
-      {
         foreach (var site in source.ContactEntry.Websites)
         {
-          if (site.Primary || site.Rel == "work")
+          if (site.Primary || site.Rel == REL_HOMEPAGE)
+            target.Inner.WebPage = site.Href;
+          else if (site.Rel == REL_WORK)
             target.Inner.BusinessHomePage = site.Href;
-          else
-            target.Inner.PersonalHomePage = site.Href;
         }
       }

@@ -661,7 +732,18 @@
       }
       #endregion relations (spouse, child, manager, assistant)

-
+      #region IM
+      target.Inner.IMAddress = string.Empty;
+      foreach (IMAddress im in source.IMs)
+      {
+        if (!string.IsNullOrEmpty(target.Inner.IMAddress))
+          target.Inner.IMAddress += "; ";
+        if (!string.IsNullOrEmpty(im.Protocol) && !im.Protocol.Equals("None", StringComparison.InvariantCultureIgnoreCase))
+          target.Inner.IMAddress += im.Protocol + ": " + im.Address;
+        else
+          target.Inner.IMAddress += im.Address;
+      }
+      #endregion IM

       target.Inner.Body = source.Content;


refactoring and implemented DecryptFileName

--- Kyru/Core/User.cs
+++ Kyru/Core/User.cs
@@ -2,9 +2,9 @@
 using System.Collections.Generic;
 using System.Collections.ObjectModel;
 using System.IO;
+using System.Security.Cryptography;
 using System.Xml.Serialization;
 using Kyru.Network;
-using System.Security.Cryptography;

 namespace Kyru.Core
 {
@@ -42,7 +42,7 @@
 		/// <param name="kFile">file to add</param>
 		internal void Add(KFile kFile)
 		{
-			throw new NotImplementedException();
+			files.Add(kFile);
 		}

 		/// <summary>
@@ -67,16 +67,18 @@
 		/// <returns>The filename</returns>
 		internal string DecryptFileName(KFile kFile)
 		{
-			throw new NotImplementedException();
+			var rsa = new RSACryptoServiceProvider();
+			rsa.ImportCspBlob(id);
+			return rsa.Decrypt(kFile.EncryptedFileName, true).ToString();
 		}

-		/// <summary>
+		/// <summary> // Question: why not do a normal deserialisation? this would also allow Name to be readonly again.
 		/// Reads the file from the harddisk
 		/// </summary>
 		/// <param name="f">A stream of the file where the object is in</param>
 		public override void Read(FileStream f)
 		{
-			var x = new XmlSerializer(GetType());
+			var x = new XmlSerializer(GetType()); // Question: Why XML?
 			var loaded = (User) x.Deserialize(f);

 			files = loaded.files;
@@ -91,7 +93,7 @@
 		/// <param name="f">A stream of the file</param>
 		public override void Write(FileStream f)
 		{
-			var x = new XmlSerializer(GetType());
+			var x = new XmlSerializer(GetType()); // Question: Why XML?
 			x.Serialize(Console.Out, this);
 		}
 	}


Fix Primes()

Fix Primes()

Now it really emits only the primes...

--- LinqExtensions.cs
+++ LinqExtensions.cs
@@ -44,7 +44,7 @@
             int p = e.First(); //this is prime
             yield return p;

-            foreach (var item in e.Skip(1).Where(x => x % p != 0))
+            foreach (var item in Primes(e.Skip(1).Where(x => x % p != 0)))
                 yield return item;
         }
     }


vector versus concordant

vector versus concordant

--- src/Vector3D.cs
+++ src/Vector3D.cs
@@ -108,7 +108,7 @@
             var dp = this.DotProduct(to);

             // alfa = acos(dp / (|a| |b|))
-            var w = dp / (Length * to.Length);
+            var w = dp / (Length * to.Length);

             return Acos(w);
         }
@@ -124,6 +124,10 @@
             return DotProduct(to) / Length * Normalized();
         }

+        public bool Concordant(Vector3D other)
+        {
+            return DotProduct(other) > 0;
+        }

         public static Vector3D operator +(Vector3D a, Vector3D b)
         {


#148 Upgraded nuget package details.

#148 Upgraded nuget package details.

--- Framework/Ninject/Azure/Cqrs.Ninject.Azure.WebJobs/CqrsWebJobProgram.cs
+++ Framework/Ninject/Azure/Cqrs.Ninject.Azure.WebJobs/CqrsWebJobProgram.cs
@@ -14,17 +14,19 @@
 /// <summary>
 /// Starts the WebJob.
 /// </summary>
-/// <typeparam name="TCoreHost">This should be the <see cref="Type"/> on the class you are writting. See example</typeparam>
 /// <example>
-/// public class MyProgram : CqrsWebJobProgram<MyProgram>
+/// public class MyProgram : CqrsWebJobProgram
 /// {
+///		public static void Main()
+///		{
+///			new MyProgram().Go();
+///		}
 /// }
 /// </example>
-public class CqrsWebJobProgram<TCoreHost> : CqrsNinjectJobHost<Guid, DefaultAuthenticationTokenHelper>
-		where TCoreHost : CoreHost<Guid>, new()
+public class CqrsWebJobProgram : CqrsNinjectJobHost<Guid, DefaultAuthenticationTokenHelper>
 {
 	/// <summary>
-	/// Instantiate a new instance of <see cref="CqrsWebJobProgram{TCoreHost}"/>
+	/// Instantiate a new instance of <see cref="CqrsWebJobProgram"/>
 	/// </summary>
 	public CqrsWebJobProgram()
 	{
@@ -36,9 +38,9 @@
 	/// AzureWebJobsDashboard and AzureWebJobsStorage
 	/// Better yet, add them to your Azure portal so they can be changed at runtime without re-deploying or re-compiling.
 	/// </remarks>
-	public static void Main()
+	public virtual void Go()
 	{
-		CoreHost = new TCoreHost();
+		CoreHost = this;
 		StartHost();
 	}


Added custom DKIM-Signature header folding logic

--- MimeKit/Header.cs
+++ MimeKit/Header.cs
@@ -673,6 +673,117 @@
 			return charset.GetBytes (encoded.ToString ());
 		}

+		static void EncodeDkimLongValue (FormatOptions format, StringBuilder encoded, ref int lineLength, string value)
+		{
+			int startIndex = 0;
+
+			do {
+				int lineLeft = format.MaxLineLength - (lineLength + 1);
+				int index = Math.Max (startIndex + lineLeft, value.Length);
+
+				encoded.Append (value.Substring (startIndex, index - startIndex));
+				lineLength += (index - startIndex);
+
+				if (index == value.Length)
+					break;
+
+				encoded.Append (format.NewLine);
+				encoded.Append ('\t');
+				lineLength = 1;
+
+				startIndex = index + 1;
+			} while (true);
+		}
+
+		static void EncodeDkimHeaderList (FormatOptions format, StringBuilder encoded, ref int lineLength, string value, char delim)
+		{
+			var tokens = value.Split (delim);
+
+			for (int i = 0; i < tokens.Length; i++) {
+				if (i > 0) {
+					encoded.Append (delim);
+					lineLength++;
+				}
+
+				if (lineLength + tokens[i].Length + 1 > format.MaxLineLength) {
+					encoded.Append (format.NewLine);
+					encoded.Append ('\t');
+					lineLength = 1;
+
+					if (tokens[i].Length + 1 > format.MaxLineLength) {
+						EncodeDkimLongValue (format, encoded, ref lineLength, tokens[i]);
+					} else {
+						lineLength += tokens[i].Length;
+						encoded.Append (tokens[i]);
+					}
+				} else {
+					lineLength += tokens[i].Length;
+					encoded.Append (tokens[i]);
+				}
+			}
+		}
+
+		static byte[] EncodeDkimSignatureHeader (ParserOptions options, FormatOptions format, Encoding charset, string field, string value)
+		{
+			var encoded = new StringBuilder (" ");
+			int lineLength = field.Length + 1;
+			int index = 0;
+
+			while (index < value.Length) {
+				while (index < value.Length && IsWhiteSpace (value[index]))
+					index++;
+
+				int startIndex = index;
+				string name;
+				int length;
+
+				while (index < value.Length && value[index] != '=')
+					index++;
+
+				name = value.Substring (startIndex, index - startIndex);
+
+				while (index < value.Length && value[index] != ';')
+					index++;
+
+				if (index < value.Length && value[index] == ';')
+					index++;
+
+				length = index - startIndex;
+
+				if (lineLength + length + 1 > format.MaxLineLength || name == "bh" || name == "b") {
+					encoded.Append (format.NewLine);
+					encoded.Append ('\t');
+					lineLength = 1;
+				} else {
+					encoded.Append (' ');
+					lineLength++;
+				}
+
+				if (length > format.MaxLineLength) {
+					var token = value.Substring (startIndex, length);
+
+					switch (name) {
+					case "v":
+						EncodeDkimHeaderList (format, encoded, ref lineLength, token, '|');
+						break;
+					case "h":
+						EncodeDkimHeaderList (format, encoded, ref lineLength, token, ':');
+						break;
+					default:
+						EncodeDkimLongValue (format, encoded, ref lineLength, token);
+						break;
+					}
+				} else {
+					encoded.Append (value.Substring (startIndex, length));
+					lineLength += length;
+				}
+			}
+
+			encoded.Append (format.NewLine);
+
+			return charset.GetBytes (encoded.ToString ());
+		}
+
 		static byte[] EncodeReferencesHeader (ParserOptions options, FormatOptions format, Encoding charset, string field, string value)
 		{
 			var encoded = new StringBuilder ();
@@ -880,6 +991,8 @@
 				return EncodeContentDisposition (Options, format, encoding, Field, textValue);
 			case HeaderId.ContentType:
 				return EncodeContentType (Options, format, encoding, Field, textValue);
+			case HeaderId.DkimSignature:
+				return EncodeDkimSignatureHeader (Options, format, encoding, Field, textValue);
 			default:
 				return EncodeUnstructuredHeader (Options, format, encoding, Field, textValue);
 			}


fixed View renaming where updating Seg0 would result in a name collision

--- Perfect/Perfect/Commands/AuditViewNamesCommand/AuditViewNamesCommand.cs
+++ Perfect/Perfect/Commands/AuditViewNamesCommand/AuditViewNamesCommand.cs
@@ -12,7 +12,9 @@
 	[Autodesk.Revit.Attributes.Transaction(Autodesk.Revit.Attributes.TransactionMode.Manual)]
 	class AuditViewNamesCommand : IExternalCommand
 	{
+		private String cmdResultMsg = String.Empty;
 		IEnumerable<Viewport> projectViewports; //all viewports in the project, representing all placed views
+		IEnumerable<String> projectViewNames; //all the view names in the project
 		List<View> nonConformingViews = new List<View>(); //all views with a name not matching standards
 		Document dbDoc;

@@ -34,32 +36,36 @@
 		public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
 		{
 			dbDoc = commandData.Application.ActiveUIDocument.Document;
+			projectViewNames = new FilteredElementCollector(dbDoc)
+				.OfCategory(BuiltInCategory.OST_Views)
+				.AsEnumerable()
+				.Select(v => v.Name);
 			projectViewports = new FilteredElementCollector(dbDoc)
-					.OfCategory(BuiltInCategory.OST_Viewports)
-					.AsEnumerable()
-					.Cast<Viewport>();
+				.OfCategory(BuiltInCategory.OST_Viewports)
+				.AsEnumerable()
+				.Cast<Viewport>();
 			IEnumerable<ViewPlan> docViewPlans = new FilteredElementCollector(dbDoc)
-					.OfClass(typeof(ViewPlan))
-					.AsEnumerable()
-					.Cast<ViewPlan>()
-					.Where(v => !v.IsTemplate);
+				.OfClass(typeof(ViewPlan))
+				.AsEnumerable()
+				.Cast<ViewPlan>()
+				.Where(v => !v.IsTemplate);
 			IEnumerable<ViewSection> docViewSections = new FilteredElementCollector(dbDoc)
-					.OfClass(typeof(ViewSection))
-					.AsEnumerable()
-					.Cast<ViewSection>()
-					.Where(v => !v.IsTemplate);
+				.OfClass(typeof(ViewSection))
+				.AsEnumerable()
+				.Cast<ViewSection>()
+				.Where(v => !v.IsTemplate);
 			IEnumerable<View3D> docView3Ds = new FilteredElementCollector(dbDoc)
-					.OfClass(typeof(View3D))
-					.AsEnumerable()
-					.Cast<View3D>()
-					.Where(v => !v.IsTemplate);
+				.OfClass(typeof(View3D))
+				.AsEnumerable()
+				.Cast<View3D>()
+				.Where(v => !v.IsTemplate);
 			IEnumerable<ViewDrafting> docViewDraftings = new FilteredElementCollector(dbDoc)
-					.OfClass(typeof(ViewDrafting))
-					.AsEnumerable()
-					.Cast<ViewDrafting>()
-					.Where(v => !v.IsTemplate);
-
-			String cmdResultMsg = String.Empty;
+				.OfClass(typeof(ViewDrafting))
+				.AsEnumerable()
+				.Cast<ViewDrafting>()
+				.Where(v => !v.IsTemplate);
+
+			cmdResultMsg = String.Empty;
 			List<String> oldName, newName;

 			using (Transaction t = new Transaction(dbDoc, "Standardize View Names"))
@@ -161,12 +167,7 @@
 					}
 					nameUpdate += newName.Last();

-					if (docViewPlan.Name != nameUpdate)
-					{
-						cmdResultMsg += docViewPlan.Name + " => " + nameUpdate + "\n";
-					}
-
-					docViewPlan.Name = nameUpdate;
+					TryRenameView(docViewPlan, nameUpdate);
 				}
 				#endregion Evaluation of ViewPlans

@@ -261,12 +262,7 @@
 					}
 					nameUpdate += newName.Last();

-					if (nameUpdate != docViewSection.Name)
-					{
-						cmdResultMsg += docViewSection.Name + " => " + nameUpdate + "\n";
-					}
-
-					docViewSection.Name = nameUpdate;
+					TryRenameView(docViewSection, nameUpdate);
 				}
 				#endregion Evaluation of ViewSections

@@ -306,12 +302,7 @@
 					}
 					nameUpdate += newName.Last();

-					if (nameUpdate != docViewDrafting.Name)
-					{
-						cmdResultMsg += docViewDrafting.Name + " => " + nameUpdate + "\n";
-					}
-
-					docViewDrafting.Name = nameUpdate;
+					TryRenameView(docViewDrafting, nameUpdate);
 				}
 				#endregion Evaluation of ViewDraftings

@@ -378,12 +369,7 @@
 					}
 					nameUpdate += newName.Last();

-					if (nameUpdate != docView3D.Name)
-					{
-						cmdResultMsg += docView3D.Name + " => " + nameUpdate + "\n";
-					}
-
-					docView3D.Name = nameUpdate;
+					TryRenameView(docView3D, nameUpdate);
 				}
 				#endregion Evaluation of View3Ds

@@ -413,7 +399,7 @@
 		/// <param name="view">A view in the document</param>
 		/// <param name="oldSeg0">The current name of the view</param>
 		/// <returns>The new name of the view, which may be the same as the old name, or null if the view name doesn't match project standards</returns>
-		String GetSeg0(View view, String oldSeg0)
+		private String GetSeg0(View view, String oldSeg0)
 		{
 			if (IsPlaced(view))
 			{
@@ -444,9 +430,14 @@
 			}
 		}

-		String GetPlacedViewPrefix(View v)
-		{
-			Viewport viewport = projectViewports.Where(vp => v.Id == vp.ViewId).FirstOrDefault();
+		/// <summary>
+		/// Generate a string of the format SHEET NUMBER-VIEW NUMBER for a specified view
+		/// </summary>
+		/// <param name="view">A View in the document</param>
+		/// <returns>A string to be used as a prefix to the View Name</returns>
+		private String GetPlacedViewPrefix(View view)
+		{
+			Viewport viewport = projectViewports.Where(vp => view.Id == vp.ViewId).FirstOrDefault();

 			if (null != viewport)
 			{
@@ -456,13 +447,18 @@
 			}
 			else
 			{
-				throw new InvalidOperationException(v.Name + " is not placed on a sheet");
-			}
-		}
-
-		Boolean IsPlaced(View v)
-		{
-			if (projectViewports.Where(vp => v.Id == vp.ViewId).Count() > 0)
+				throw new InvalidOperationException(view.Name + " is not placed on a sheet");
+			}
+		}
+
+		/// <summary>
+		/// Determine whether a View is placed onto a sheet
+		/// </summary>
+		/// <param name="view">A View in the document</param>
+		/// <returns>Whether the View is placed</returns>
+		private Boolean IsPlaced(View view)
+		{
+			if (projectViewports.Where(vp => view.Id == vp.ViewId).Count() > 0)
 			{
 				return true;
 			}
@@ -472,28 +468,32 @@
 			}
 		}

-		//************* View Name utility methods
-		List<String> GetStandardName(View v)
-		{
-			List<String> name = new List<String>();
-			name.Add(GetPlacedViewPrefix(v));
-
-			return name;
-		}
-
-		Boolean HasDefaultName(View v)
-		{
-			if (true)
-			{
-
-			}
-			Regex elevationNameRegex = new Regex(@"Elevation \d - \s");
-			if (elevationNameRegex.IsMatch(v.Name))
-			{
-				return true;
-			}
-
-			return false;
+		/// <summary>
+		/// Generates a new List representing the components of the new View name
+		/// </summary>
+		/// <param name="view">A View in the document</param>
+		/// <returns>A List to represent the components of a new View name, with the first segment entered</returns>
+		private List<String> GetStandardName(View view)
+		{
+			List<String> nameComponents = new List<String>();
+			nameComponents.Add(GetPlacedViewPrefix(view));
+
+			return nameComponents;
+		}
+
+		/// <summary>
+		/// Determine whether a view should be renamed, and if so, set new name. Can only be called within an active transaction.
+		/// </summary>
+		/// <param name="view"></param>
+		/// <param name="newName"></param>
+		private void TryRenameView(View view, String newName)
+		{
+			//skip if the name is already correct or if there is a View name conflict
+			if ((view.Name != newName) && !projectViewNames.Contains(newName))
+			{
+				cmdResultMsg += view.Name + " => " + newName + "\n";
+				view.Name = newName;
+			}
 		}
 	}
 }