Saved the sound cards in the config file

git-svn-id: 6b7e1e5d0861e268462ba7828ef63c1bcab52a9b@919 d3cde5d6-82b8-4669-8b62-43054d6781d8

--- SDRSharp/MainForm.cs
+++ SDRSharp/MainForm.cs
@@ -356,7 +356,9 @@
             #region Audio devices

             var defaultIndex = 0;
+            var savedIndex = -1;
             var devices = AudioDevice.GetDevices(DeviceDirection.Input);
+            var savedDeviceName = Utils.GetStringSetting("inputDevice", string.Empty);
             for (var i = 0; i < devices.Count; i++)
             {
                 inputDeviceComboBox.Items.Add(devices[i]);
@@ -364,14 +366,19 @@
                 {
                     defaultIndex = i;
                 }
+                if (devices[i].ToString() == savedDeviceName)
+                {
+                    savedIndex = i;
+                }
             }
             if (inputDeviceComboBox.Items.Count > 0)
             {
-                inputDeviceComboBox.SelectedIndex = defaultIndex;
+                inputDeviceComboBox.SelectedIndex = savedIndex >= 0 ? savedIndex : defaultIndex;
             }

             defaultIndex = 0;
             devices = AudioDevice.GetDevices(DeviceDirection.Output);
+            savedDeviceName = Utils.GetStringSetting("outputDevice", string.Empty);
             for (int i = 0; i < devices.Count; i++)
             {
                 outputDeviceComboBox.Items.Add(devices[i]);
@@ -379,16 +386,17 @@
                 {
                     defaultIndex = i;
                 }
+                if (devices[i].ToString() == savedDeviceName)
+                {
+                    savedIndex = i;
+                }
             }
             if (outputDeviceComboBox.Items.Count > 0)
             {
-                outputDeviceComboBox.SelectedIndex = defaultIndex;
-            }
-
-            _streamControl.AudioGain = 30.0f;
+                outputDeviceComboBox.SelectedIndex = savedIndex >= 0 ? savedIndex : defaultIndex;
+            }
+
             _streamControl.BufferNeeded += ProcessBuffer;
-
-            sampleRateComboBox.SelectedIndex = 7;

             #endregion

@@ -733,6 +741,8 @@
             Utils.SaveSetting("vfo", (long) frequencyNumericUpDown.Value);
             Utils.SaveSetting("fftDisplayOffset", fftOffsetTrackBar.Value);
             Utils.SaveSetting("fftDisplayRange", fftRangeTrackBar.Value);
+            Utils.SaveSetting("inputDevice", inputDeviceComboBox.SelectedItem);
+            Utils.SaveSetting("outputDevice", outputDeviceComboBox.SelectedItem);
         }

         #endregion


Prevent silent NullReferenceException.

Prevent silent NullReferenceException.

--- src/VsChromium/Features/SourceExplorerHierarchy/NodeViewModel.cs
+++ src/VsChromium/Features/SourceExplorerHierarchy/NodeViewModel.cs
@@ -82,6 +82,9 @@
     }

     private void AppendFullPath(StringBuilder sb) {
+      if (string.IsNullOrEmpty(this.Name))
+        return;
+
       if (PathHelpers.IsAbsolutePath(this.Name)) {
         sb.Append(this.Name);
         return;
@@ -98,6 +101,9 @@
     }

     private void AppendRelativePath(StringBuilder sb) {
+      if (string.IsNullOrEmpty(this.Name))
+        return;
+
       if (PathHelpers.IsAbsolutePath(this.Name))
         return;


Update StructuredLogger.

Update StructuredLogger.

--- src/StructuredLogger/StructuredLogger.cs
+++ src/StructuredLogger/StructuredLogger.cs
@@ -40,7 +40,7 @@
             {
                 try
                 {
-                    projectImportsCollector = new ProjectImportsCollector(_logFile);
+                    projectImportsCollector = new ProjectImportsCollector(_logFile, createFile: false);
                 }
                 catch (Exception ex)
                 {
@@ -102,17 +102,11 @@

             if (projectImportsCollector != null)
             {
-                var archiveFilePath = projectImportsCollector.ArchiveFilePath;
+                var bytes = projectImportsCollector.GetAllBytes();
+                construction.Build.SourceFilesArchive = bytes;

                 projectImportsCollector.Close();
                 projectImportsCollector = null;
-
-                if (File.Exists(archiveFilePath))
-                {
-                    var bytes = File.ReadAllBytes(archiveFilePath);
-                    construction.Build.SourceFilesArchive = bytes;
-                    File.Delete(archiveFilePath);
-                }
             }

             if (SaveLogToDisk)


Set API-Key in Web request headers to avoid HTTP authentication

Fixes #13

--- src/SyncTrayzor/Pages/ViewerViewModel.cs
+++ src/SyncTrayzor/Pages/ViewerViewModel.cs
@@ -95,6 +95,13 @@
                 Process.Start(request.Url);
                 return true;
             }
+
+            // See https://github.com/canton7/SyncTrayzor/issues/13
+            // and https://github.com/cefsharp/CefSharp/issues/534#issuecomment-60694502
+            var headers = request.Headers;
+            headers["X-API-Key"] += this.syncThingManager.ApiKey;
+            request.Headers = headers;
+
             return false;
         }


Removed .* from end of namespace spec in call to LocalizationManage.Create

--- Glyssen/Program.cs
+++ Glyssen/Program.cs
@@ -404,7 +404,7 @@
 				typeof(SIL.Localizer)
 					.GetMethods(BindingFlags.Static | BindingFlags.Public)
 					.Where(m => m.Name == "GetString"),
-				"SIL.Windows.Forms.*", "SIL.DblBundle");
+				"SIL.Windows.Forms", "SIL.DblBundle");
 		}

 		/// <summary>


Don't dispose of the ISession instance by default

- Since ISession is a pretty heavyweight object that has a Singleton-like lifestyle, we probably don't want to take on the burden of disposing it
- Allow consumer to specify in constructor but default to false

--- src/AspNet.Identity.Cassandra/AspNet.Identity.Cassandra/Store/CassandraUserStore.cs
+++ src/AspNet.Identity.Cassandra/AspNet.Identity.Cassandra/Store/CassandraUserStore.cs
@@ -20,6 +20,7 @@
         private static readonly Task CompletedTask = TrueTask;

         private readonly ISession _session;
+        private readonly bool _disposeOfSession;

         // Reusable prepared statements, lazy evaluated
         private readonly AsyncLazy<PreparedStatement> _createUserByUserName;
@@ -44,9 +45,10 @@
         private readonly AsyncLazy<PreparedStatement> _addClaim;
         private readonly AsyncLazy<PreparedStatement> _removeClaim;

-        public CassandraUserStore(ISession session)
+        public CassandraUserStore(ISession session, bool disposeOfSession = false)
         {
             _session = session;
+            _disposeOfSession = disposeOfSession;

             // TODO:  Currently broken because no attributes on POCOs
             // _session.GetTable<CassandraUser>().CreateIfNotExists();
@@ -636,7 +638,8 @@

         protected void Dispose(bool disposing)
         {
-            _session.Dispose();
+            if (_disposeOfSession)
+                _session.Dispose();
         }

         public void Dispose()


Updated the MbUnit samples with some recent type renaming.

--- src/MbUnit/Samples/MbUnit.Samples/ContractVerifiers/Accessor/SampleAccessor.Test.cs
+++ src/MbUnit/Samples/MbUnit.Samples/ContractVerifiers/Accessor/SampleAccessor.Test.cs
@@ -53,11 +53,11 @@
             // By default, that contract property is 'true'; but it is always ignored for non-nullable types.
             AcceptNullValue = false,

-            // Incompetent values are expected to be rejected by the tested property setter.
-            // You can provided lists of incompetent values with the type of the exception
+            // Invalid values are expected to be rejected by the tested property setter.
+            // You can provided lists of invalid values with the type of the exception
             // which is expected to be thrown. In the example below, sending an empty string should
             // cause an ArgumentException.
-            IncompetentValues =
+            InvalidValues =
             {
                 { typeof(ArgumentException), String.Empty },
             }
@@ -89,8 +89,8 @@
                 return o;
             },

-            // You can define several sets of incompetent values for each type of exception.
-            IncompetentValues =
+            // You can define several sets of invalid values for each type of exception.
+            InvalidValues =
             {
                 { typeof(ArgumentException), DateTime.MinValue, DateTime.MaxValue },
                 { typeof(ArgumentOutOfRangeException), DateTime.Now.AddDays(1), new DateTime(9000, 1, 1) }


Remove no longer valid comment

Remove no longer valid comment

--- src/Microsoft.NetCore.Analyzers/UnitTests/Runtime/TestForNaNCorrectlyTests.Fixer.cs
+++ src/Microsoft.NetCore.Analyzers/UnitTests/Runtime/TestForNaNCorrectlyTests.Fixer.cs
@@ -4,7 +4,6 @@

 using System.Threading.Tasks;
 using Xunit;
-// Use the security verifiers since this diagnostic is reported in generated code
 using VerifyCS = Test.Utilities.CSharpCodeFixVerifier<
     Microsoft.NetCore.Analyzers.Runtime.TestForNaNCorrectlyAnalyzer,
     Microsoft.NetCore.CSharp.Analyzers.Runtime.CSharpTestForNaNCorrectlyFixer>;


Update Agent.OSVersion support for .net 5 and later (#3186)

The .net runtime changed the way the OS version is returned and it does
not longer return the Darwin kernel version but the produce version, for
reference: https://github.com/dotnet/runtime/pull/36029

--- src/Microsoft.VisualStudio.Services.Agent/Capabilities/AgentCapabilitiesProvider.cs
+++ src/Microsoft.VisualStudio.Services.Agent/Capabilities/AgentCapabilitiesProvider.cs
@@ -98,8 +98,15 @@
        // https://en.wikipedia.org/wiki/Darwin_%28operating_system%29
        // with Big Sur Apple made the jump from 10.* to 11.* that means that
        // the version reported from that point is 20.1.0.0 for 11.0.1
-        private static string GetDarwinVersionString() {
+        private static string GetDarwinVersionString()
+        {
+            // from .net 5 onwards the runtime returns the product version instead of the darwin kernel version
             var version = Environment.OSVersion.Version;
+            if (Environment.Version.Major >= 5)
+            {
+                return $"{version.Major}.{version.Minor}";
+            }
+
             if (version.Major < 5)
             {
                 return "10.0";


Updated PropertyRenameAndIgnoreSerializerContractResolver

--- src/NJsonSchema/Infrastructure/PropertyRenameAndIgnoreSerializerContractResolver.cs
+++ src/NJsonSchema/Infrastructure/PropertyRenameAndIgnoreSerializerContractResolver.cs
@@ -17,14 +17,14 @@
     /// JsonConvert resolver that allows to ignore and rename properties for given types.
     public class PropertyRenameAndIgnoreSerializerContractResolver : DefaultContractResolver
     {
-        private readonly Dictionary<Type, HashSet<string>> _ignores;
-        private readonly Dictionary<Type, Dictionary<string, string>> _renames;
+        private readonly Dictionary<string, HashSet<string>> _ignores;
+        private readonly Dictionary<string, Dictionary<string, string>> _renames;

         /// Initializes a new instance of the <see cref="PropertyRenameAndIgnoreSerializerContractResolver"/> class.
         public PropertyRenameAndIgnoreSerializerContractResolver()
         {
-            _ignores = new Dictionary<Type, HashSet<string>>();
-            _renames = new Dictionary<Type, Dictionary<string, string>>();
+            _ignores = new Dictionary<string, HashSet<string>>();
+            _renames = new Dictionary<string, Dictionary<string, string>>();
         }

         /// Ignore the given property/properties of the given type.
@@ -32,11 +32,11 @@
         /// <param name="jsonPropertyNames">One or more JSON properties to ignore.</param>
         public void IgnoreProperty(Type type, params string[] jsonPropertyNames)
         {
-            if (!_ignores.ContainsKey(type))
-                _ignores[type] = new HashSet<string>();
+            if (!_ignores.ContainsKey(type.FullName))
+                _ignores[type.FullName] = new HashSet<string>();

             foreach (var prop in jsonPropertyNames)
-                _ignores[type].Add(prop);
+                _ignores[type.FullName].Add(prop);
         }

         /// Rename a property of the given type.
@@ -45,10 +45,10 @@
         /// <param name="newJsonPropertyName">The new JSON property name.</param>
         public void RenameProperty(Type type, string propertyName, string newJsonPropertyName)
         {
-            if (!_renames.ContainsKey(type))
-                _renames[type] = new Dictionary<string, string>();
+            if (!_renames.ContainsKey(type.FullName))
+                _renames[type.FullName] = new Dictionary<string, string>();

-            _renames[type][propertyName] = newJsonPropertyName;
+            _renames[type.FullName][propertyName] = newJsonPropertyName;
         }

         /// Creates a Newtonsoft.Json.Serialization.JsonProperty for the given System.Reflection.MemberInfo.
@@ -77,17 +77,15 @@

         private bool IsIgnored(Type type, string jsonPropertyName)
         {
-            if (!_ignores.ContainsKey(type))
+            if (!_ignores.ContainsKey(type.FullName))
                 return false;

-            return _ignores[type].Contains(jsonPropertyName);
+            return _ignores[type.FullName].Contains(jsonPropertyName);
         }

         private bool IsRenamed(Type type, string jsonPropertyName, out string newJsonPropertyName)
         {
-            Dictionary<string, string> renames;
-
-            if (!_renames.TryGetValue(type, out renames) || !renames.TryGetValue(jsonPropertyName, out newJsonPropertyName))
+            if (!_renames.TryGetValue(type.FullName, out var renames) || !renames.TryGetValue(jsonPropertyName, out newJsonPropertyName))
             {
                 newJsonPropertyName = null;
                 return false;


Workaround to unblock the TFS->dotnet/corert integrations for now

[tfs-changeset: 1665647]

--- src/System.Private.TypeLoader/src/Internal/Runtime/TypeLoader/CallConverterThunk.cs
+++ src/System.Private.TypeLoader/src/Internal/Runtime/TypeLoader/CallConverterThunk.cs
@@ -118,6 +118,9 @@

         static unsafe CallConverterThunk()
         {
+#if PLATFORM_UNIX
+            // TODO
+#else
             CallingConventionConverter_GetStubs(out ReturnVoidReturnThunk, out ReturnIntegerPointReturnThunk, out CommonInputThunkStub
 #if CALLDESCR_FPARGREGSARERETURNREGS
 #else
@@ -131,7 +134,9 @@
             {
                 CallingConventionConverter_SpecifyCommonStubData((IntPtr)commonStubData);
             }
-#endif
+#endif //_TARGET_ARM_
+
+#endif // PLATFORM_UNIX
         }

         internal static bool GetByRefIndicatorAtIndex(int index, bool[] lookup)


WWT.Providers: fix the Mandelbrot service

When organizing the namespaces of everything, I broke this because the
`colors.map` resource file stopped loading. It seems that directory
separators are translated into periods when resource files are attached
to assemblies.

--- src/WWT.Providers/Services/Mandelbrot.cs
+++ src/WWT.Providers/Services/Mandelbrot.cs
@@ -76,7 +76,7 @@
         {
             var c = new Color[256];

-            using (var stream = typeof(MandelProvider).Assembly.GetManifestResourceStream(typeof(Mandelbrot), "colors.map"))
+            using (var stream = typeof(Mandelbrot).Assembly.GetManifestResourceStream(typeof(Mandelbrot), "Services.colors.map"))
             using (var sr = new StreamReader(stream))
             {
                 var lines = new List<string>();


noobfix

noobfix

--- pvp/Assets/Scripts/Planet.cs
+++ pvp/Assets/Scripts/Planet.cs
@@ -72,7 +72,7 @@
 		float damage = rocket.Damage();
 		mHealth -= damage;

-		for (int i=4; i>(int)mHealth/20; i--) {
+		for (int i=4; i>=(int)mHealth/20; i--) {
 			moons[i].SetActive(false);
 		}


red: remove injection of example values into step names

--- src/Xbehave.Execution/ScenarioInvoker.cs
+++ src/Xbehave.Execution/ScenarioInvoker.cs
@@ -97,33 +97,14 @@
         }

         private static string GetStepDisplayName(
-            string scenarioDisplayName,
-            int stepNumber,
-            bool isBackgroundStep,
-            string stepNameFormat,
-            IEnumerable<object> scenarioMethodArguments)
-        {
-            string stepName;
-            try
-            {
-                stepName = string.Format(
+            string scenarioDisplayName, int stepNumber, bool isBackgroundStep, string stepText) =>
+                string.Format(
                     CultureInfo.InvariantCulture,
-                    stepNameFormat ?? string.Empty,
-                    (scenarioMethodArguments ?? Enumerable.Empty<object>()).Select(argument => argument ?? "null").ToArray());
-            }
-            catch (FormatException)
-            {
-                stepName = stepNameFormat;
-            }
-
-            return string.Format(
-                CultureInfo.InvariantCulture,
-                "{0} [{1}] {2}{3}",
-                scenarioDisplayName,
-                stepNumber.ToString("D2", CultureInfo.InvariantCulture),
-                isBackgroundStep ? "(Background) " : string.Empty,
-                stepName);
-        }
+                    "{0} [{1}] {2}{3}",
+                    scenarioDisplayName,
+                    stepNumber.ToString("D2", CultureInfo.InvariantCulture),
+                    isBackgroundStep ? "(Background) " : string.Empty,
+                    stepText);

         private object CreateScenarioClass()
         {
@@ -241,8 +222,7 @@
                     this.scenario.DisplayName,
                     ++stepNumber,
                     stepNumber <= backGroundStepDefinitions.Count,
-                    stepDefinition.Text,
-                    this.scenarioMethodArguments);
+                    stepDefinition.Text);

                 var step = new Step(this.scenario, stepDisplayName);

@@ -314,12 +294,7 @@
                     summary.Failed++;
                     summary.Total++;

-                    var stepDisplayName = GetStepDisplayName(
-                        this.scenario.DisplayName,
-                        ++stepNumber,
-                        false,
-                        "(Teardown)",
-                        this.scenarioMethodArguments);
+                    var stepDisplayName = GetStepDisplayName(this.scenario.DisplayName, ++stepNumber, false, "(Teardown)");

                     this.messageBus.Queue(
                         new Step(this.scenario, stepDisplayName),


Better switiching

Better switiching


Avoid lock to update _projectToDependencyNodeTargetIdentifier

Fixes #54135

--- src/VisualStudio/Core/Def/Implementation/ProjectSystem/VisualStudioWorkspaceImpl.cs
+++ src/VisualStudio/Core/Def/Implementation/ProjectSystem/VisualStudioWorkspaceImpl.cs
@@ -74,7 +74,7 @@
         private ImmutableDictionary<ProjectId, IVsHierarchy?> _projectToHierarchyMap = ImmutableDictionary<ProjectId, IVsHierarchy?>.Empty;
         private ImmutableDictionary<ProjectId, Guid> _projectToGuidMap = ImmutableDictionary<ProjectId, Guid>.Empty;
         private readonly Dictionary<ProjectId, string?> _projectToMaxSupportedLangVersionMap = new();
-        private readonly Dictionary<ProjectId, string> _projectToDependencyNodeTargetIdentifier = new();
+        private ImmutableDictionary<ProjectId, string> _projectToDependencyNodeTargetIdentifier = ImmutableDictionary<ProjectId, string>.Empty;

         /// <summary>
         /// A map to fetch the path to a rule set file for a project. This right now is only used to implement
@@ -1305,10 +1305,9 @@

         internal string? TryGetDependencyNodeTargetIdentifier(ProjectId projectId)
         {
-            lock (_gate)
-            {
-                return _projectToDependencyNodeTargetIdentifier.GetValueOrDefault(projectId, defaultValue: null);
-            }
+            // This doesn't take a lock since _projectToDependencyNodeTargetIdentifier is immutable
+            _projectToDependencyNodeTargetIdentifier.TryGetValue(projectId, out var identifier);
+            return identifier;
         }

         internal override void SetDocumentContext(DocumentId documentId)
@@ -1590,7 +1589,8 @@
                 _projectToHierarchyMap = _projectToHierarchyMap.Remove(projectId);
                 _projectToGuidMap = _projectToGuidMap.Remove(projectId);
                 _projectToMaxSupportedLangVersionMap.Remove(projectId);
-                _projectToDependencyNodeTargetIdentifier.Remove(projectId);
+                // _projectToDependencyNodeTargetIdentifier needs to be updated with ImmutableInterlocked since it can be mutated outside the lock
+                ImmutableInterlocked.TryRemove(ref _projectToDependencyNodeTargetIdentifier, projectId, out _);
                 _projectToRuleSetFilePath.Remove(projectId);

                 foreach (var (projectName, projects) in _projectSystemNameToProjectsMap)
@@ -1994,12 +1994,13 @@
             }
         }

+        [PerformanceSensitive("https://github.com/dotnet/roslyn/issues/54135", AllowLocks = false)]
         internal void SetDependencyNodeTargetIdentifier(ProjectId projectId, string targetIdentifier)
         {
-            lock (_gate)
-            {
-                _projectToDependencyNodeTargetIdentifier[projectId] = targetIdentifier;
-            }
+            ImmutableInterlocked.Update(
+                ref _projectToDependencyNodeTargetIdentifier,
+                static (map, arg) => map.SetItem(arg.projectId, arg.targetIdentifier),
+                (projectId, targetIdentifier));
         }

         internal void RefreshProjectExistsUIContextForLanguage(string language)


Simplified using directive comparer

Simplified using directive comparer

--- src/Workspaces/CSharp/Portable/Utilities/UsingsAndExternAliasesDirectiveComparer.cs
+++ src/Workspaces/CSharp/Portable/Utilities/UsingsAndExternAliasesDirectiveComparer.cs
@@ -29,6 +29,31 @@
             _tokenComparer = tokenComparer;
         }

+        private enum UsingKind
+        {
+            Extern,
+            Namespace,
+            UsingStatic,
+            Alias
+        }
+
+        private static UsingKind GetUsingKind(UsingDirectiveSyntax usingDirective, ExternAliasDirectiveSyntax externDirective)
+        {
+            if (externDirective != null)
+            {
+                return UsingKind.Extern;
+            }
+            if (usingDirective.Alias != null)
+            {
+                return UsingKind.Alias;
+            }
+            if (usingDirective.StaticKeyword.IsKind(SyntaxKind.StaticKeyword))
+            {
+                return UsingKind.UsingStatic;
+            }
+            return UsingKind.Namespace;
+        }
+
         public int Compare(SyntaxNode directive1, SyntaxNode directive2)
         {
             if (directive1 == directive2)
@@ -41,17 +66,8 @@
             var extern1 = directive1 as ExternAliasDirectiveSyntax;
             var extern2 = directive2 as ExternAliasDirectiveSyntax;

-            var directive1IsExtern = extern1 != null;
-            var directive2IsExtern = extern2 != null;
-
-            var directive1IsNamespace = using1 != null && using1.Alias == null && !using1.StaticKeyword.IsKind(SyntaxKind.StaticKeyword);
-            var directive2IsNamespace = using2 != null && using2.Alias == null && !using2.StaticKeyword.IsKind(SyntaxKind.StaticKeyword);
-
-            var directive1IsUsingStatic = using1 != null && using1.StaticKeyword.IsKind(SyntaxKind.StaticKeyword);
-            var directive2IsUsingStatic = using2 != null && using2.StaticKeyword.IsKind(SyntaxKind.StaticKeyword);
-
-            var directive1IsAlias = using1 != null && using1.Alias != null;
-            var directive2IsAlias = using2 != null && using2.Alias != null;
+            var directive1Kind = GetUsingKind(using1, extern1);
+            var directive2Kind = GetUsingKind(using2, extern2);

             // different types of usings get broken up into groups.
             //  * externs
@@ -59,46 +75,22 @@
             //  * using statics
             //  * aliases

-            if (directive1IsExtern && !directive2IsExtern)
+            if (directive1Kind < directive2Kind)
             {
                 return -1;
             }
-            else if (directive2IsExtern && !directive1IsExtern)
-            {
-                return 1;
-            }
-            else if (directive1IsNamespace && !directive2IsNamespace)
-            {
-                return -1;
-            }
-            else if (directive2IsNamespace && !directive1IsNamespace)
-            {
-                return 1;
-            }
-            else if (directive1IsUsingStatic && !directive2IsUsingStatic)
-            {
-                return -1;
-            }
-            else if (directive2IsUsingStatic && !directive1IsUsingStatic)
-            {
-                return 1;
-            }
-            else if (directive1IsAlias && !directive2IsAlias)
-            {
-                return -1;
-            }
-            else if (directive2IsAlias && !directive1IsAlias)
+            if (directive1Kind > directive2Kind)
             {
                 return 1;
             }

             // ok, it's the same type of using now.
-            if (directive1IsExtern)
+            if (directive1Kind == UsingKind.Extern)
             {
                 // they're externs, sort by the alias
                 return _tokenComparer.Compare(extern1.Identifier, extern2.Identifier);
             }
-            else if (directive1IsAlias)
+            if (directive1Kind == UsingKind.Alias)
             {
                 var aliasComparisonResult = _tokenComparer.Compare(using1.Alias.Name.Identifier, using2.Alias.Name.Identifier);

@@ -107,15 +99,11 @@
                     // They both use the same alias, so compare the names.
                     return _nameComparer.Compare(using1.Name, using2.Name);
                 }
-                else
-                {
-                    return aliasComparisonResult;
-                }
+
+                return aliasComparisonResult;
             }
-            else
-            {
-                return _nameComparer.Compare(using1.Name, using2.Name);
-            }
+
+            return _nameComparer.Compare(using1.Name, using2.Name);
         }
     }
 }


Properly deserialize null Ids.

Properly deserialize null Ids.

--- src/Workspaces/Remote/ServiceHub/Shared/RoslynJsonConverter.SolutionIdConverters.cs
+++ src/Workspaces/Remote/ServiceHub/Shared/RoslynJsonConverter.SolutionIdConverters.cs
@@ -10,8 +10,13 @@
     {
         private abstract class WorkspaceIdJsonConverter<T> : BaseJsonConverter<T>
         {
-            protected (Guid, string) ReadFromJsonObject(JsonReader reader)
+            protected (Guid, string)? ReadFromJsonObject(JsonReader reader)
             {
+                if (reader.TokenType == JsonToken.Null)
+                {
+                    return null;
+                }
+
                 Contract.ThrowIfFalse(reader.TokenType == JsonToken.StartObject);

                 var (id, debugName) = ReadIdAndName(reader);
@@ -51,8 +56,8 @@
         {
             protected override SolutionId ReadValue(JsonReader reader, JsonSerializer serializer)
             {
-                var (id, debugName) = ReadFromJsonObject(reader);
-                return SolutionId.CreateFromSerialized(id, debugName);
+                (Guid id, string debugName)? tuple = ReadFromJsonObject(reader);
+                return tuple == null ? null : SolutionId.CreateFromSerialized(tuple.Value.id, tuple.Value.debugName);
             }

             protected override void WriteValue(JsonWriter writer, SolutionId solutionId, JsonSerializer serializer)
@@ -63,8 +68,8 @@
         {
             protected override ProjectId ReadValue(JsonReader reader, JsonSerializer serializer)
             {
-                var (id, debugName) = ReadFromJsonObject(reader);
-                return ProjectId.CreateFromSerialized(id, debugName);
+                (Guid id, string debugName)? tuple = ReadFromJsonObject(reader);
+                return tuple == null ? null : ProjectId.CreateFromSerialized(tuple.Value.id, tuple.Value.debugName);
             }

             protected override void WriteValue(JsonWriter writer, ProjectId projectId, JsonSerializer serializer)
@@ -75,6 +80,11 @@
         {
             protected override DocumentId ReadValue(JsonReader reader, JsonSerializer serializer)
             {
+                if (reader.TokenType == JsonToken.Null)
+                {
+                    return null;
+                }
+
                 Contract.ThrowIfFalse(reader.TokenType == JsonToken.StartObject);

                 var projectId = ReadProperty<ProjectId>(serializer, reader);


Fixed justification

Fixed justification

--- test/FubarDev.FtpServer.Tests/PathTests.cs
+++ test/FubarDev.FtpServer.Tests/PathTests.cs
@@ -46,7 +46,7 @@
         [InlineData("a", "//a")]
         public void TestRootRemovalNonWindows(string expected, string input)
         {
-            Skip.If(RuntimeEnvironment.OperatingSystemPlatform == Platform.Windows, "Works only on Windows");
+            Skip.If(RuntimeEnvironment.OperatingSystemPlatform == Platform.Windows, "Works only on non-Windows platforms");
             Assert.Equal(expected, input.RemoveRoot());
         }
     }


remove of selectedparameters approach

remove of selectedparameters approach

--- src/gui/UUM.Controls/ViewModels/RepositoryViewModel.cs
+++ src/gui/UUM.Controls/ViewModels/RepositoryViewModel.cs
@@ -49,12 +49,12 @@
          #region Property: SelectedParameters

         public static readonly PropertyData SelectedParametersProperty =
-            RegisterProperty("SelectedParameters", typeof (ObservableCollection<IParameters>));
+            RegisterProperty("SelectedParameters", typeof (IParameters),null);

-
-        public ObservableCollection<IParameters> SelectedParameters
+        [Model]
+        public IParameters SelectedParameters
         {
-            get { return GetValue<ObservableCollection<IParameters>>(SelectedParametersProperty); }
+            get { return GetValue<IParameters>(SelectedParametersProperty); }
             private set { SetValue(SelectedParametersProperty, value); }
         }
 		#endregion


refs #18 Allow to access IMemberListItemViewModel from outside

--- Application/MatchGenerator/ViewModel/IMemberListItemViewModel.cs
+++ Application/MatchGenerator/ViewModel/IMemberListItemViewModel.cs
@@ -6,7 +6,7 @@

 namespace MatchGenerator.ViewModel
 {
-	interface IMemberListItemViewModel
+	public interface IMemberListItemViewModel
 	{
 	}
 }


fixed defect in number being displayed for total tickets.

--- Commencement/Controllers/ViewModels/RegistrationDataViewModel.cs
+++ Commencement/Controllers/ViewModels/RegistrationDataViewModel.cs
@@ -54,7 +54,7 @@
                                       RegistrationPetitionsApproved = a.RegistrationPetitions.Where(b => b.IsApproved).Count(),
                                       ExtraTicketPetitionsSubmitted = a.RegistrationParticipations.Where(b => b.ExtraTicketPetition != null).Count(),
                                       ExtraTicketPetitionsApproved = a.RegistrationParticipations.Where(b => b.ExtraTicketPetition != null && b.ExtraTicketPetition.IsApproved).Count(),
-                                      TicketsPavilion = a.TotalTickets,
+                                      TicketsPavilion = a.TicketCount,
                                       TicketsBallroom = a.TicketStreamingCount,
                                       TicketsByPetition = a.RegistrationParticipations.Where(b => b.ExtraTicketPetition != null && b.ExtraTicketPetition.IsApprovedCompletely).Sum(b => b.ExtraTicketPetition.TotalTickets)
                                   }).ToList();


Updated NoRedirectMarker

Updated NoRedirectMarker

--- IdentityModel/Thinktecture.IdentityModel/Web/NoRedirectMarker.cs
+++ IdentityModel/Thinktecture.IdentityModel/Web/NoRedirectMarker.cs
@@ -1,10 +1,5 @@
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using System.Linq;
+using System.Collections;
 using System.Net.Http;
-using System.Text;
-using System.Threading.Tasks;
 using System.Web;
 using Thinktecture.IdentityModel.Constants;

@@ -24,7 +19,7 @@

         public static void TrySet()
         {
-            SetNoRedirectMarkerOnContext(true, overrideValue: false);
+            SetNoRedirectMarkerOnContext(value: true, overrideValue: false);
         }

         public static void TrySet(HttpRequestMessage request)
@@ -34,7 +29,7 @@

         public static void UnSet()
         {
-            SetNoRedirectMarkerOnContext(false, overrideValue: true);
+            SetNoRedirectMarkerOnContext(value: false, overrideValue: true);
         }

         public static void UnSet(HttpRequestMessage request)
@@ -65,7 +60,7 @@
             return null;
         }

-        private static bool SetNoRedirectMarkerOnContext(bool value, bool overrideValue = false)
+        private static bool SetNoRedirectMarkerOnContext(bool value, bool overrideValue)
         {
             if (HttpContext.Current != null)
             {
@@ -76,9 +71,9 @@
             return false;
         }

-        private static void SetNoRedirectMarkerOnContextOrMessage(HttpRequestMessage request, bool value, bool overrideValue = false)
+        private static void SetNoRedirectMarkerOnContextOrMessage(HttpRequestMessage request, bool value, bool overrideValue)
         {
-            if (!SetNoRedirectMarkerOnContext(overrideValue))
+            if (!SetNoRedirectMarkerOnContext(value, overrideValue))
             {
                 if (request.Properties.ContainsKey("MS_HttpContext") && request.Properties["MS_HttpContext"] != null)
                 {
@@ -88,25 +83,25 @@
             }
         }

-        private static void SetNoRedirectMarkerOnItemsCollection(IDictionary items, bool value, bool overrideValue = false)
+        private static void SetNoRedirectMarkerOnItemsCollection(IDictionary items, bool value, bool overrideValue)
         {
             if (items == null)
             {
                 return;
             }

-            var marker = items[Internal.NoRedirectLabel];
-
             if (overrideValue)
             {
-                marker = value;
+                items[Internal.NoRedirectLabel] = value;
                 return;
             }
             else
             {
+                var marker = items[Internal.NoRedirectLabel];
+
                 if (marker == null)
                 {
-                    marker = value;
+                    items[Internal.NoRedirectLabel] = value;
                 }
             }
         }


Add basic TestCreateRootScenePresence() regression test

--- OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAgentTests.cs
+++ OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAgentTests.cs
@@ -53,48 +53,60 @@
     /// Scene presence tests
     /// </summary>
     [TestFixture]
-    public class ScenePresenceAgentTests
+    public class ScenePresenceAgentTests : OpenSimTestCase
     {
-        public Scene scene, scene2, scene3;
-        public UUID agent1, agent2, agent3;
-        public static Random random;
-        public ulong region1,region2,region3;
-        public AgentCircuitData acd1;
-        public SceneObjectGroup sog1, sog2, sog3;
-        public TestClient testclient;
-
-        [TestFixtureSetUp]
-        public void Init()
+//        public Scene scene, scene2, scene3;
+//        public UUID agent1, agent2, agent3;
+//        public static Random random;
+//        public ulong region1, region2, region3;
+//        public AgentCircuitData acd1;
+//        public TestClient testclient;
+
+//        [TestFixtureSetUp]
+//        public void Init()
+//        {
+////            TestHelpers.InMethod();
+////
+////            SceneHelpers sh = new SceneHelpers();
+////
+////            scene = sh.SetupScene("Neighbour x", UUID.Random(), 1000, 1000);
+////            scene2 = sh.SetupScene("Neighbour x+1", UUID.Random(), 1001, 1000);
+////            scene3 = sh.SetupScene("Neighbour x-1", UUID.Random(), 999, 1000);
+////
+////            ISharedRegionModule interregionComms = new LocalSimulationConnectorModule();
+////            interregionComms.Initialise(new IniConfigSource());
+////            interregionComms.PostInitialise();
+////            SceneHelpers.SetupSceneModules(scene, new IniConfigSource(), interregionComms);
+////            SceneHelpers.SetupSceneModules(scene2, new IniConfigSource(), interregionComms);
+////            SceneHelpers.SetupSceneModules(scene3, new IniConfigSource(), interregionComms);
+//
+////            agent1 = UUID.Random();
+////            agent2 = UUID.Random();
+////            agent3 = UUID.Random();
+//
+////            region1 = scene.RegionInfo.RegionHandle;
+////            region2 = scene2.RegionInfo.RegionHandle;
+////            region3 = scene3.RegionInfo.RegionHandle;
+//        }
+
+        [Test]
+        public void TestCreateRootScenePresence()
         {
             TestHelpers.InMethod();
-
-            SceneHelpers sh = new SceneHelpers();
-
-            scene = sh.SetupScene("Neighbour x", UUID.Random(), 1000, 1000);
-            scene2 = sh.SetupScene("Neighbour x+1", UUID.Random(), 1001, 1000);
-            scene3 = sh.SetupScene("Neighbour x-1", UUID.Random(), 999, 1000);
-
-            ISharedRegionModule interregionComms = new LocalSimulationConnectorModule();
-            interregionComms.Initialise(new IniConfigSource());
-            interregionComms.PostInitialise();
-            SceneHelpers.SetupSceneModules(scene, new IniConfigSource(), interregionComms);
-            SceneHelpers.SetupSceneModules(scene2, new IniConfigSource(), interregionComms);
-            SceneHelpers.SetupSceneModules(scene3, new IniConfigSource(), interregionComms);
-
-            agent1 = UUID.Random();
-            agent2 = UUID.Random();
-            agent3 = UUID.Random();
-            random = new Random();
-            sog1 = SceneHelpers.CreateSceneObject(1, agent1);
-            scene.AddSceneObject(sog1);
-            sog2 = SceneHelpers.CreateSceneObject(1, agent1);
-            scene.AddSceneObject(sog2);
-            sog3 = SceneHelpers.CreateSceneObject(1, agent1);
-            scene.AddSceneObject(sog3);
-
-            region1 = scene.RegionInfo.RegionHandle;
-            region2 = scene2.RegionInfo.RegionHandle;
-            region3 = scene3.RegionInfo.RegionHandle;
+//            TestHelpers.EnableLogging();
+
+            UUID spUuid = TestHelpers.ParseTail(0x1);
+
+            TestScene scene = new SceneHelpers().SetupScene();
+            SceneHelpers.AddScenePresence(scene, spUuid);
+
+            Assert.That(scene.AuthenticateHandler.GetAgentCircuitData(spUuid), Is.Not.Null);
+            Assert.That(scene.AuthenticateHandler.GetAgentCircuits().Count, Is.EqualTo(1));
+
+            ScenePresence sp = scene.GetScenePresence(spUuid);
+            Assert.That(sp, Is.Not.Null);
+            Assert.That(sp.IsChildAgent, Is.False);
+            Assert.That(sp.UUID, Is.EqualTo(spUuid));
         }

         [Test]
@@ -105,9 +117,6 @@

             TestScene scene = new SceneHelpers().SetupScene();
             ScenePresence sp = SceneHelpers.AddScenePresence(scene, TestHelpers.ParseTail(0x1));
-
-            Assert.That(scene.AuthenticateHandler.GetAgentCircuitData(sp.UUID), Is.Not.Null);
-            Assert.That(scene.AuthenticateHandler.GetAgentCircuits().Count, Is.EqualTo(1));

             scene.IncomingCloseAgent(sp.UUID);

@@ -266,99 +275,99 @@
         // but things are synchronous among them. So there should be
         // 3 threads in here.
         //[Test]
-        public void T021_TestCrossToNewRegion()
-        {
-            TestHelpers.InMethod();
-
-            scene.RegisterRegionWithGrid();
-            scene2.RegisterRegionWithGrid();
-
-            // Adding child agent to region 1001
-            string reason;
-            scene2.NewUserConnection(acd1,0, out reason);
-            scene2.AddNewClient(testclient, PresenceType.User);
-
-            ScenePresence presence = scene.GetScenePresence(agent1);
-            presence.MakeRootAgent(new Vector3(0,unchecked(Constants.RegionSize-1),0), true);
-
-            ScenePresence presence2 = scene2.GetScenePresence(agent1);
-
-           // Adding neighbour region caps info to presence2
-
-            string cap = presence.ControllingClient.RequestClientInfo().CapsPath;
-            presence2.AddNeighbourRegion(region1, cap);
-
-            Assert.That(presence.IsChildAgent, Is.False, "Did not start root in origin region.");
-            Assert.That(presence2.IsChildAgent, Is.True, "Is not a child on destination region.");
-
-            // Cross to x+1
-            presence.AbsolutePosition = new Vector3(Constants.RegionSize+1,3,100);
-            presence.Update();
-
-            EventWaitHandle wh = new EventWaitHandle (false, EventResetMode.AutoReset, "Crossing");
-
-            // Mimicking communication between client and server, by waiting OK from client
-            // sent by TestClient.CrossRegion call. Originally, this is network comm.
-            if (!wh.WaitOne(5000,false))
-            {
-                presence.Update();
-                if (!wh.WaitOne(8000,false))
-                    throw new ArgumentException("1 - Timeout waiting for signal/variable.");
-            }
-
-            // This is a TestClient specific method that fires OnCompleteMovementToRegion event, which
-            // would normally be fired after receiving the reply packet from comm. done on the last line.
-            testclient.CompleteMovement();
-
-            // Crossings are asynchronous
-            int timer = 10;
-
-            // Make sure cross hasn't already finished
-            if (!presence.IsInTransit && !presence.IsChildAgent)
-            {
-                // If not and not in transit yet, give it some more time
-                Thread.Sleep(5000);
-            }
-
-            // Enough time, should at least be in transit by now.
-            while (presence.IsInTransit && timer > 0)
-            {
-                Thread.Sleep(1000);
-                timer-=1;
-            }
-
-            Assert.That(timer,Is.GreaterThan(0),"Timed out waiting to cross 2->1.");
-            Assert.That(presence.IsChildAgent, Is.True, "Did not complete region cross as expected.");
-            Assert.That(presence2.IsChildAgent, Is.False, "Did not receive root status after receiving agent.");
-
-            // Cross Back
-            presence2.AbsolutePosition = new Vector3(-10, 3, 100);
-            presence2.Update();
-
-            if (!wh.WaitOne(5000,false))
-            {
-                presence2.Update();
-                if (!wh.WaitOne(8000,false))
-                    throw new ArgumentException("2 - Timeout waiting for signal/variable.");
-            }
-            testclient.CompleteMovement();
-
-            if (!presence2.IsInTransit && !presence2.IsChildAgent)
-            {
-                // If not and not in transit yet, give it some more time
-                Thread.Sleep(5000);
-            }
-
-            // Enough time, should at least be in transit by now.
-            while (presence2.IsInTransit && timer > 0)
-            {
-                Thread.Sleep(1000);
-                timer-=1;
-            }
-
-            Assert.That(timer,Is.GreaterThan(0),"Timed out waiting to cross 1->2.");
-            Assert.That(presence2.IsChildAgent, Is.True, "Did not return from region as expected.");
-            Assert.That(presence.IsChildAgent, Is.False, "Presence was not made root in old region again.");
-        }
+//        public void T021_TestCrossToNewRegion()
+//        {
+//            TestHelpers.InMethod();
+//
+//            scene.RegisterRegionWithGrid();
+//            scene2.RegisterRegionWithGrid();
+//
+//            // Adding child agent to region 1001
+//            string reason;
+//            scene2.NewUserConnection(acd1,0, out reason);
+//            scene2.AddNewClient(testclient, PresenceType.User);
+//
+//            ScenePresence presence = scene.GetScenePresence(agent1);
+//            presence.MakeRootAgent(new Vector3(0,unchecked(Constants.RegionSize-1),0), true);
+//
+//            ScenePresence presence2 = scene2.GetScenePresence(agent1);
+//
+//           // Adding neighbour region caps info to presence2
+//
+//            string cap = presence.ControllingClient.RequestClientInfo().CapsPath;
+//            presence2.AddNeighbourRegion(region1, cap);
+//
+//            Assert.That(presence.IsChildAgent, Is.False, "Did not start root in origin region.");
+//            Assert.That(presence2.IsChildAgent, Is.True, "Is not a child on destination region.");
+//
+//            // Cross to x+1
+//            presence.AbsolutePosition = new Vector3(Constants.RegionSize+1,3,100);
+//            presence.Update();
+//
+//            EventWaitHandle wh = new EventWaitHandle (false, EventResetMode.AutoReset, "Crossing");
+//
+//            // Mimicking communication between client and server, by waiting OK from client
+//            // sent by TestClient.CrossRegion call. Originally, this is network comm.
+//            if (!wh.WaitOne(5000,false))
+//            {
+//                presence.Update();
+//                if (!wh.WaitOne(8000,false))
+//                    throw new ArgumentException("1 - Timeout waiting for signal/variable.");
+//            }
+//
+//            // This is a TestClient specific method that fires OnCompleteMovementToRegion event, which
+//            // would normally be fired after receiving the reply packet from comm. done on the last line.
+//            testclient.CompleteMovement();
+//
+//            // Crossings are asynchronous
+//            int timer = 10;
+//
+//            // Make sure cross hasn't already finished
+//            if (!presence.IsInTransit && !presence.IsChildAgent)
+//            {
+//                // If not and not in transit yet, give it some more time
+//                Thread.Sleep(5000);
+//            }
+//
+//            // Enough time, should at least be in transit by now.
+//            while (presence.IsInTransit && timer > 0)
+//            {
+//                Thread.Sleep(1000);
+//                timer-=1;
+//            }
+//
+//            Assert.That(timer,Is.GreaterThan(0),"Timed out waiting to cross 2->1.");
+//            Assert.That(presence.IsChildAgent, Is.True, "Did not complete region cross as expected.");
+//            Assert.That(presence2.IsChildAgent, Is.False, "Did not receive root status after receiving agent.");
+//
+//            // Cross Back
+//            presence2.AbsolutePosition = new Vector3(-10, 3, 100);
+//            presence2.Update();
+//
+//            if (!wh.WaitOne(5000,false))
+//            {
+//                presence2.Update();
+//                if (!wh.WaitOne(8000,false))
+//                    throw new ArgumentException("2 - Timeout waiting for signal/variable.");
+//            }
+//            testclient.CompleteMovement();
+//
+//            if (!presence2.IsInTransit && !presence2.IsChildAgent)
+//            {
+//                // If not and not in transit yet, give it some more time
+//                Thread.Sleep(5000);
+//            }
+//
+//            // Enough time, should at least be in transit by now.
+//            while (presence2.IsInTransit && timer > 0)
+//            {
+//                Thread.Sleep(1000);
+//                timer-=1;
+//            }
+//
+//            Assert.That(timer,Is.GreaterThan(0),"Timed out waiting to cross 1->2.");
+//            Assert.That(presence2.IsChildAgent, Is.True, "Did not return from region as expected.");
+//            Assert.That(presence.IsChildAgent, Is.False, "Presence was not made root in old region again.");
+//        }
     }
 }


MS-700 Added support for external transactions to Dapper.SimpleSave.

--- PS.Mothership.Services/Dapper.SimpleSave/SimpleSaveExtensions.cs
+++ PS.Mothership.Services/Dapper.SimpleSave/SimpleSaveExtensions.cs
@@ -13,44 +13,63 @@
         public static void Update<T>(
             this IDbConnection connection,
             T oldObject,
-            T newObject)
+            T newObject,
+            IDbTransaction transaction = null)
         {
             var builder = new TransactionBuilder(_dtoMetadataCache);
             var scripts = builder.BuildUpdateScripts(oldObject, newObject);

-            using (var transaction = connection.BeginTransaction())
+            if (transaction == null)
             {
-                try
+                using (var myTransaction = connection.BeginTransaction())
                 {
-                    for (int index = 0, count = scripts.Count; index < count; ++index)
+                    try
                     {
-                        var script = scripts[index];
-
-                        ResolvePrimaryKeyValues<T>(script);
-
-                        ExecuteCommandForScript<T>(
-                            connection,
-                            transaction,
-                            script);
+                        ExecuteScripts<T>(connection, scripts, myTransaction);
+                        myTransaction.Commit();
                     }
-                    transaction.Commit();
+                    catch (Exception)
+                    {
+                        myTransaction.Rollback();
+                        throw;
+                    }
                 }
-                catch (Exception)
-                {
-                    transaction.Rollback();
-                    throw;
-                }
+            }
+            else
+            {
+                ExecuteScripts<T>(connection, scripts, transaction);
             }
         }

-        public static void Create<T>(this IDbConnection connection, T obj)
+        private static void ExecuteScripts<T>(IDbConnection connection, IList<Script> scripts, IDbTransaction transaction)
         {
-            Update(connection, default(T), obj);
+            for (int index = 0, count = scripts.Count; index < count; ++index)
+            {
+                var script = scripts[index];
+
+                ResolvePrimaryKeyValues<T>(script);
+
+                ExecuteCommandForScript<T>(
+                    connection,
+                    transaction,
+                    script);
+            }
         }

-        public static void Delete<T>(this IDbConnection connection, T obj)
+        public static void Create<T>(
+            this IDbConnection connection,
+            T obj,
+            IDbTransaction transaction = null)
         {
-            Update(connection, obj, default(T));
+            Update(connection, default(T), obj, transaction);
+        }
+
+        public static void Delete<T>(
+            this IDbConnection connection,
+            T obj,
+            IDbTransaction transaction = null)
+        {
+            Update(connection, obj, default(T), transaction);
         }

         private static void ExecuteCommandForScript<T>(


Implement Vector3 properties and methods


Fix GetPointColor for VGA

Fix GetPointColor for VGA

--- source/Cosmos.HAL2/Drivers/Video/VGADriver.cs
+++ source/Cosmos.HAL2/Drivers/Video/VGADriver.cs
@@ -1,4 +1,4 @@
-//#define COSMOSDEBUG
+//#define COSMOSDEBUG
 using System;
 using System.Collections.Generic;
 using System.Drawing;
@@ -694,7 +694,7 @@
             mDebugger.Send($"GetPixel720x480x4({aX},{aY})");

             uint offset = (uint)(aX / 8 + (PixelWidth / 8) * aY);
-
+            int pixelOffset = (int)(7 - aX % 8);
             uint pmask = 1;

             uint color = 0;
@@ -703,7 +703,8 @@
             {
                 SetPlane(p);

-                if (_IO.VGAMemoryBlock.Bytes[offset] == 255)
+                var v = _IO.VGAMemoryBlock.Bytes[offset];
+                if ((v & (1 << pixelOffset)) != 0)
                 {
                     color += pmask;
                 }
@@ -711,7 +712,7 @@
                 pmask <<= 1;
             }

-            return color;
+            return (uint)_Palette[color].ToArgb();
         }

         /// <summary>


Remove a debug line.

Remove a debug line.

--- source/SharpFlame.Gui/Sections/TexturesTab.cs
+++ source/SharpFlame.Gui/Sections/TexturesTab.cs
@@ -346,11 +346,9 @@
                 Y = (int)(Math.Ceiling ((double)tileset.Tiles.Count / TextureCount.X))
             };

-            Console.WriteLine ("Test xy:{0}, size:{1}, csize:{2}", TextureCount, scrollTextureView.Size, scrollTextureView.ClientSize);
             if (TextureCount.Y * 64 >= scrollTextureView.Size.Height)
             {
-                // TODO: See how thick the scroll is on winforms and mac, 20px seems to be right on GTK.
-                glSize = GLSurface.GLSize = new Size(scrollTextureView.ClientSize.Width - 20, TextureCount.Y * 64);
+                glSize = GLSurface.GLSize = new Size(scrollTextureView.ClientSize.Width, TextureCount.Y * 64);
             }
             else
             {


Print the nb of configurations in the profiler tag

--- Sharpmake/Project.cs
+++ Sharpmake/Project.cs
@@ -1818,7 +1818,7 @@

                 XResourcesImg.Resolve(SourceRootPath, resolver);

-                using (builder.CreateProfilingScope("ResolveConfs"))
+                using (builder.CreateProfilingScope("ResolveConfs (" + Configurations.Count + ")"))
                 {
                     // Resolve Configuration
                     foreach (Project.Configuration conf in Configurations)


Update MusicXmlParser.cs

Update MusicXmlParser.cs

Accidental in Note. It's not defined in specification, but it's used.


Corrected AssemblyInfo

Corrected AssemblyInfo

--- projects/Epicycle.Graphics_cs/Properties/AssemblyInfo.cs
+++ projects/Epicycle.Graphics_cs/Properties/AssemblyInfo.cs
@@ -5,11 +5,11 @@
 // General Information about an assembly is controlled through the following
 // set of attributes. Change these attribute values to modify the information
 // associated with an assembly.
-[assembly: AssemblyTitle("Metaqube.Graphics_cs")]
+[assembly: AssemblyTitle("Epicycle.Graphics_cs")]
 [assembly: AssemblyDescription("")]
 [assembly: AssemblyConfiguration("")]
 [assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("Metaqube.Graphics_cs")]
+[assembly: AssemblyProduct("Epicycle.Graphics_cs")]
 [assembly: AssemblyCopyright("Copyright ©  2014")]
 [assembly: AssemblyTrademark("")]
 [assembly: AssemblyCulture("")]


Fix EventHub extension tests (#22439)

Fix EventHub extension tests (#22439)


Fixing unit test

Fixing unit test

Facade properties on SystemWeb are no longer removable

--- tests/Microsoft.Owin.Host.SystemWeb.Tests/CallEnvironment/AspNetEnvironmentTests.cs
+++ tests/Microsoft.Owin.Host.SystemWeb.Tests/CallEnvironment/AspNetEnvironmentTests.cs
@@ -227,12 +227,5 @@
             {
             }
         }
-
-        [Fact]
-        public void EmptyEnvironmentShouldBeClearable()
-        {
-            _env.Clear();
-            _env.Count.ShouldBe(0);
-        }
     }
 }


Fix GetObjectForNativeVariant test issue. It should roundtrip the actual object instead of IntPtr. Also add proper variant clean up code.

NOTE that I had to keep Marshal.IUnknownForObject call to force COM initialization.

--- tests/src/Interop/MarshalAPI/GetObjectForNativeVariant/GetObjectForNativeVariant.cs
+++ tests/src/Interop/MarshalAPI/GetObjectForNativeVariant/GetObjectForNativeVariant.cs
@@ -59,6 +59,15 @@
         Assert.Throws<ArgumentNullException>(() => Marshal.GetObjectForNativeVariant<int>(IntPtr.Zero));
     }

+    [DllImport(@"oleaut32.dll", SetLastError = true, CallingConvention = CallingConvention.StdCall)]
+    static extern Int32 VariantClear(IntPtr pvarg);
+
+    private static void DeleteVariant(IntPtr pVariant)
+    {
+        VariantClear(pVariant);
+        Marshal.FreeHGlobal(pVariant);
+    }
+
     public static void Decimal()
     {
         Variant v = new Variant();
@@ -66,6 +75,8 @@
         Marshal.GetNativeVariantForObject(3.14m, pNative);
         decimal d = Marshal.GetObjectForNativeVariant<decimal>(pNative);
         Assert.AreEqual(3.14m, d);
+
+        DeleteVariant(pNative);
     }

     public static void PrimitiveType()
@@ -75,6 +86,8 @@
         Marshal.GetNativeVariantForObject<ushort>(99, pNative);
         ushort actual = Marshal.GetObjectForNativeVariant<ushort>(pNative);
         Assert.AreEqual(99, actual);
+
+        DeleteVariant(pNative);
     }

     public static void StringType()
@@ -84,6 +97,8 @@
         Marshal.GetNativeVariantForObject<string>("99", pNative);
         string actual = Marshal.GetObjectForNativeVariant<string>(pNative);
         Assert.AreEqual("99", actual);
+
+        DeleteVariant(pNative);
     }

     public static void DoubleType()
@@ -93,21 +108,30 @@
         Marshal.GetNativeVariantForObject<double>(3.14, pNative);
         double actual = Marshal.GetObjectForNativeVariant<double>(pNative);
         Assert.AreEqual(3.14, actual);
+
+        DeleteVariant(pNative);
     }

     public static void IUnknownType()
     {
         Variant v = new Variant();
-        IntPtr pObj = Marshal.GetIUnknownForObject(new object());
+        object obj = new object();
+
+        // Technically we don't need this - but this is necessary for forcing
+        // COM initialization
+        IntPtr pUnk = Marshal.GetIUnknownForObject(obj);
         IntPtr pNative = Marshal.AllocHGlobal(Marshal.SizeOf(v));
-        Marshal.GetNativeVariantForObject<IntPtr>(pObj, pNative);
-        IntPtr pActualObj = Marshal.GetObjectForNativeVariant<IntPtr>(pNative);
-        Assert.AreEqual(pObj, pActualObj);
+        Marshal.GetNativeVariantForObject<object>(obj, pNative);
+        object actual = Marshal.GetObjectForNativeVariant<object>(pNative);
+        Assert.AreEqual(obj, actual);
+        Marshal.Release(pUnk);
+
+        DeleteVariant(pNative);
     }

     public static int Main(String[] unusedArgs)
     {
-        //IUnknownType();
+        IUnknownType();
         DoubleType();
         StringType();
         PrimitiveType();


Added missed parameter

Added missed parameter

--- Source/Liath.BigSpace.DataAccess/Implementations/SolarSystems.cs
+++ Source/Liath.BigSpace.DataAccess/Implementations/SolarSystems.cs
@@ -36,6 +36,7 @@
 				cmd.AddParameter("MaxX", DbType.Int64, maxX);
 				cmd.AddParameter("MinY", DbType.Int64, minY);
 				cmd.AddParameter("MaxY", DbType.Int64, maxY);
+                cmd.AddParameter("Z", DbType.Int64, 0);

 				using (var dr = cmd.ExecuteReader())
 				{


[Toolkit.Game] Fixed unbinding of event handlers from previous control when switching game context in Desktop/WinForms platform.

--- Source/Toolkit/SharpDX.Toolkit.Game/Desktop/GameWindowDesktop.cs
+++ Source/Toolkit/SharpDX.Toolkit.Game/Desktop/GameWindowDesktop.cs
@@ -267,10 +267,26 @@
         /// <inheritdoc />
         internal override void Switch(GameContext context)
         {
+            // unbind event handlers from previous control
+            Control.MouseEnter -= GameWindowForm_MouseEnter;
+            Control.MouseLeave -= GameWindowForm_MouseLeave;
+
+            gameForm = Control as RenderForm;
+            if (gameForm != null)
+            {
+                gameForm.AppActivated -= OnActivated;
+                gameForm.AppDeactivated -= OnDeactivated;
+                gameForm.UserResized -= OnClientSizeChanged;
+            }
+            else
+            {
+                Control.Resize -= OnClientSizeChanged;
+            }
+
+            // setup and bind event handlers to new control
             Initialize(context);

             startRenderLoopAction = RunNextRenderLoop; // reset the start render loop delegate
-
             controller.ExitRenderLoop(); // exit the current render loop
         }


Error in EnumerableTypes

Error in EnumerableTypes

--- TimeLog.Api.Documentation/Views/Reporting/EnumerableTypes.cshtml
+++ TimeLog.Api.Documentation/Views/Reporting/EnumerableTypes.cshtml
@@ -25,7 +25,10 @@

Minutes (2)

Days (3)

Km (4)

-
Pieces (5)

+
Pieces (6)

+
Liters (7)

+
Meters (8)

+
Kilograms (9)

Registration Type


Clean up using statements

Clean up using statements

--- Weingartner.Json.Migration.Spec/VerifyingJsonDataMigratorSpec.cs
+++ Weingartner.Json.Migration.Spec/VerifyingJsonDataMigratorSpec.cs
@@ -5,7 +5,6 @@
 using Newtonsoft.Json;
 using Newtonsoft.Json.Linq;
 using Xunit;
-using Weingartner.Json.Migration.Common;

 namespace Weingartner.Json.Migration.Spec
 {


Bumped version number to 1.0.1

Bumped version number to 1.0.1


New version.

New version.


re-enables test for getting included documents

--- src/DocumentDbTests/Bugs/Bug_2224_Include_needs_to_respect_Take_and_Skip_in_main_body.cs
+++ src/DocumentDbTests/Bugs/Bug_2224_Include_needs_to_respect_Take_and_Skip_in_main_body.cs
@@ -85,35 +85,35 @@
             list.Count.ShouldBe(1);
         }

-        // [Fact] -- JDM to come back to this
-        // public async Task Bug_2258_get_all_related_documents()
-        // {
-        //     var tenant1 = new Tenant2();
-        //     var tenant2 = new Tenant2();
-        //     var tenant3 = new Tenant2();
-        //
-        //     theSession.Store(tenant1, tenant2, tenant3);
-        //
-        //     await theSession.SaveChangesAsync();
-        //
-        //     var user1 = new User2 { TenantIds = new List<Guid> { tenant1.Id, tenant2.Id, tenant3.Id } };
-        //     theSession.Store(user1);
-        //     await theSession.SaveChangesAsync();
-        //
-        //     theSession.Logger = new TestOutputMartenLogger(_output);
-        //
-        //     var tenants = new Dictionary<Guid, Tenant2>();
-        //     var user = await theSession
-        //         .Query<User2>()
-        //         .Include(x => x.TenantIds, tenants)
-        //         .SingleOrDefaultAsync(x => x.Id == user1.Id);
-        //
-        //     user.Id.ShouldBe(user1.Id);
-        //     tenants.Count.ShouldBe(3);
-        //     tenants.ContainsKey(tenant1.Id).ShouldBeTrue();
-        //     tenants.ContainsKey(tenant2.Id).ShouldBeTrue();
-        //     tenants.ContainsKey(tenant3.Id).ShouldBeTrue();
-        // }
+        [Fact]
+        public async Task Bug_2258_get_all_related_documents()
+        {
+            var tenant1 = new Tenant2();
+            var tenant2 = new Tenant2();
+            var tenant3 = new Tenant2();
+
+            theSession.Store(tenant1, tenant2, tenant3);
+
+            await theSession.SaveChangesAsync();
+
+            var user1 = new User2 { TenantIds = new List<Guid> { tenant1.Id, tenant2.Id, tenant3.Id } };
+            theSession.Store(user1);
+            await theSession.SaveChangesAsync();
+
+            theSession.Logger = new TestOutputMartenLogger(_output);
+
+            var tenants = new Dictionary<Guid, Tenant2>();
+            var user = await theSession
+                .Query<User2>()
+                .Include(x => x.TenantIds, tenants)
+                .SingleOrDefaultAsync(x => x.Id == user1.Id);
+
+            user.Id.ShouldBe(user1.Id);
+            tenants.Count.ShouldBe(3);
+            tenants.ContainsKey(tenant1.Id).ShouldBeTrue();
+            tenants.ContainsKey(tenant2.Id).ShouldBeTrue();
+            tenants.ContainsKey(tenant3.Id).ShouldBeTrue();
+        }

         [Fact]
         public async Task include_with_pagination()


Comment

Comment

--- SurveyCount/Form1.cs
+++ SurveyCount/Form1.cs
@@ -14,12 +14,14 @@
     public partial class Form1 : Form
     {
         private Dictionary<string, int> result = new Dictionary<string, int>();
+
         public Form1()
         {
             InitializeComponent();
             Form1_Resize(null, null);
         }

+        //Do Count
         private void button1_Click(object sender, EventArgs e)
         {
             if (string.IsNullOrEmpty(richTextBox1.Text))
@@ -55,6 +57,7 @@
             richTextBox1.Clear();
         }

+        //Save Result
         private void saveFileSToolStripMenuItem_Click(object sender, EventArgs e)
         {
             if (listBox1.Items.Count == 0)
@@ -79,6 +82,7 @@
             }
         }

+        //Resize and Reposition Form Elements
         private void Form1_Resize(object sender, EventArgs e)
         {
             int i = (this.Width - 40) / 2;
@@ -89,6 +93,7 @@
             button1.Location = new Point(button1.Location.X, richTextBox1.Location.Y + richTextBox1.Height + 10);
         }

+        //Import Text File
         private void openFileOToolStripMenuItem_Click(object sender, EventArgs e)
         {
             OpenFileDialog ofd = new OpenFileDialog();
@@ -102,11 +107,13 @@
             }
         }

+        //Exit
         private void exitEToolStripMenuItem_Click(object sender, EventArgs e)
         {
             this.Close();
         }

+        //Reset
         private void clearRToolStripMenuItem_Click(object sender, EventArgs e)
         {
             richTextBox1.Clear();


small fixes

small fixes

--- src/Features/CSharp/Portable/CodeFixes/AddExplicitCast/AddExplicitCastCodeFixProvider.cs
+++ src/Features/CSharp/Portable/CodeFixes/AddExplicitCast/AddExplicitCastCodeFixProvider.cs
@@ -51,8 +51,8 @@
             var syntaxFacts = document.GetRequiredLanguageService<ISyntaxFactsService>();
             var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);

-            var span = diagnostic.Location.SourceSpan;
-            var targetNode = root.FindToken(span.Start).GetAncestors<ExpressionSyntax>().FirstOrDefault(n => n.Span.Contains(span));
+            var targetNode = root.FindNode(diagnostic.Location.SourceSpan, getInnermostNodeForTie: true)
+                .GetAncestorsOrThis<ExpressionSyntax>().FirstOrDefault();
             if (targetNode != null)
             {
                 var hasSolution = GetTypeInfo(semanticModel, root, targetNode, cancellationToken, out var nodeType, out var potentialConversionTypes);
@@ -140,7 +140,6 @@
                 mutablePotentialConversionTypes.Add(targetNodeInfo.ConvertedType);
             }

-            var textSpan = targetNode.GetLocation().SourceSpan;
             if (targetNode.GetAncestors<ArgumentSyntax>().FirstOrDefault() is ArgumentSyntax targetArgument &&
                 targetArgument.Parent is ArgumentListSyntax argumentList && argumentList.Parent is SyntaxNode invocationNode) // invocation node could be Invocation Expression, Object Creation, Base Constructor...
             {
@@ -150,8 +149,7 @@

                 foreach (var candidcateSymbol in candidateSymbols)
                 {
-                    var methodSymbol = candidcateSymbol as IMethodSymbol;
-                    if (methodSymbol == null)
+                    if (!(candidcateSymbol is IMethodSymbol methodSymbol))
                     {
                         continue;
                     }
@@ -193,7 +191,7 @@
             // For cases like object creation expression. for example:
             // Derived d = [||]new Base();
             // It is always invalid except the target node has explicit conversion operator.
-            // filter function is going to filter the cases that is invalid
+            // filter function is going to filter the cases that are invalid
             var nodeType = targetNodeType;
             Func<ITypeSymbol, bool> filter = (targetNodeConversionType =>
             {
@@ -205,7 +203,7 @@
                 return commonConversion.Exists;
             });

-            potentialConversionTypes = mutablePotentialConversionTypes.Where<ITypeSymbol>(filter).ToImmutableArray();
+            potentialConversionTypes = mutablePotentialConversionTypes.Where(filter).ToImmutableArray();
             return !potentialConversionTypes.IsEmpty;
         }

@@ -239,7 +237,6 @@
                 var nameSyntax = arguments[i].NameColon?.Name;
                 if (nameSyntax != null)
                 {
-                    var param = arguments[i].DetermineParameter(semanticModel, allowParams: true, cancellationToken);
                     var name = nameSyntax.ToString();
                     var found = false;
                     for (var j = 0; j < parameters.Length; j++)
@@ -292,23 +289,14 @@
             return Array.TrueForAll(matchedTypes, (item => item));
         }

-
-        private static SyntaxNode? TryGetTargetNode(SyntaxNode root, TextSpan span)
-        {
-            var ancestors = root.FindToken(span.Start).GetAncestors<SyntaxNode>();
-
-            var node = ancestors.FirstOrDefault(n => n.Span.Contains(span));
-            return node;
-        }
-
         protected override async Task FixAllAsync(
             Document document, ImmutableArray<Diagnostic> diagnostics,
             SyntaxEditor editor, CancellationToken cancellationToken)
         {
             var root = await document.GetRequiredSyntaxRootAsync(cancellationToken).ConfigureAwait(false);
-
             var targetNodes = diagnostics.SelectAsArray(
-                d => TryGetTargetNode(root, d.Location.SourceSpan) is ExpressionSyntax node ? node : null);
+                d => root.FindNode(d.Location.SourceSpan, getInnermostNodeForTie: true)
+                         .GetAncestorsOrThis<ExpressionSyntax>().FirstOrDefault());

             await editor.ApplyExpressionLevelSemanticEditsAsync(
                 document, targetNodes,
@@ -343,8 +331,8 @@

         private sealed class InheritanceDistanceComparer : IComparer<ITypeSymbol>
         {
-            private ITypeSymbol baseType;
-            private SemanticModel semanticModel;
+            private readonly ITypeSymbol _baseType;
+            private readonly SemanticModel _semanticModel;

             private int GetInheritanceDistance(ITypeSymbol baseType, ITypeSymbol? derivedType)
             {
@@ -367,17 +355,17 @@
             public int Compare(ITypeSymbol x, ITypeSymbol y)
             {
                 // if the node has the explicit conversion operator, then it has the shortest distance
-                var x_dist = semanticModel.Compilation.ClassifyCommonConversion(baseType, x).IsUserDefined ?
-                    0 : GetInheritanceDistance(baseType, x);
-                var y_dist = semanticModel.Compilation.ClassifyCommonConversion(baseType, y).IsUserDefined ?
-                    0 : GetInheritanceDistance(baseType, y);
+                var x_dist = _semanticModel.Compilation.ClassifyCommonConversion(_baseType, x).IsUserDefined ?
+                    0 : GetInheritanceDistance(_baseType, x);
+                var y_dist = _semanticModel.Compilation.ClassifyCommonConversion(_baseType, y).IsUserDefined ?
+                    0 : GetInheritanceDistance(_baseType, y);
                 return x_dist.CompareTo(y_dist);
             }

             public InheritanceDistanceComparer(SemanticModel semanticModel, ITypeSymbol baseType)
             {
-                this.semanticModel = semanticModel;
-                this.baseType = baseType;
+                _semanticModel = semanticModel;
+                _baseType = baseType;
             }
         }
     }


Fixed a merge error

Fixed a merge error

--- HoardeGame/Main.cs
+++ HoardeGame/Main.cs
@@ -125,6 +125,7 @@
             graphics.IsFullScreen = settingsService.Settings.FullScreen;
             graphics.ApplyChanges();

+            if (arguments.FirstOrDefault(s => s.ToLower() == "-skipmenu") != null)
             {
                 StateManager.Push(MainMenu);
                 StateManager.Push(SinglePlayer);


补全企业微信获取员工详情缺失字段

补全企业微信获取员工详情缺失字段

--- src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/MailList/Member/MemberResult.cs
+++ src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/MailList/Member/MemberResult.cs
@@ -1,12 +1,11 @@
-/*----------------------------------------------------------------
+/*----------------------------------------------------------------
     Copyright (C) 2022 Senparc
-
+
     文件名：MemberResult.cs
     文件功能描述：成员接口返回结果
-
-
+
     创建标识：Senparc - 20150313
-
+
     修改标识：Senparc - 20150313
     修改描述：整理接口

@@ -30,9 +29,9 @@

 ----------------------------------------------------------------*/

-using System.Collections.Generic;
 using Senparc.Weixin.Entities;
 using Senparc.Weixin.Work.AdvancedAPIs.MailList.Member;
+using System.Collections.Generic;

 namespace Senparc.Weixin.Work.AdvancedAPIs.MailList
 {
@@ -42,32 +41,37 @@
     public class GetMemberResult : WorkJsonResult
     {
         /// <summary>
-        /// 员工UserID
+        /// 员工UserID
         /// </summary>
         public string userid { get; set; }
+
         /// <summary>
         /// 成员名称
         /// </summary>
         public string name { get; set; }
+
         /// <summary>
         /// 成员所属部门id列表
         /// </summary>
         public long[] department { get; set; }
+
         /// <summary>
         /// 部门内的排序值，默认为0。数量必须和department一致，数值越大排序越前面。值范围是[0, 2^32)
         /// </summary>
         public int[] order { get; set; }
+
         /// <summary>
         /// 职位信息
         /// </summary>
         public string position { get; set; }
+
         /// <summary>
         /// 手机号码
         /// </summary>
         public string mobile { get; set; }

         /// <summary>
-        /// 性别。gender=0表示男，=1表示女
+        /// 性别。gender=0表示男，=1表示女
         /// </summary>
         public int gender { get; set; }

@@ -77,29 +81,50 @@
         public string email { get; set; }

         /// <summary>
+        /// 企业邮箱
+        /// </summary>
+        public string biz_mail { get; set; }
+
+        /// <summary>
         /// 上级字段，标识是否为上级。第三方暂不支持
         /// </summary>
         public int[] is_leader_in_dept { get; set; }
+
+        /// <summary>
+        /// 直属上级
+        /// </summary>
+        public string[] direct_leader { get; set; }
+
         /// <summary>
         /// 头像url。注：小图将url最后的"/0"改成"/64"
         /// </summary>
         public string avatar { get; set; }
+
+        /// <summary>
+        /// 成员别名。长度1~32个utf8（非必须） ### https://work.weixin.qq.com/api/doc#90000/90135/90195
+        /// </summary>
+        public string alias { get; set; }
+
         /// <summary>
         /// 激活状态: 1=已激活，2=已禁用，4=未激活，5=退出企业。 已激活代表已激活企业微信或已关注微信插件。未激活代表既未激活企业微信又未关注微信插件。
         /// </summary>
         public int status { get; set; }
+
         /// <summary>
         /// 座机。第三方暂不支持
         /// </summary>
         public string telephone { get; set; }
+
         /// <summary>
         /// 英文名。第三方暂不支持
         /// </summary>
         public string english_name { get; set; }
+
         /// <summary>
         /// 全局唯一。对于同一个服务商，不同应用获取到企业内同一个成员的open_userid是相同的，最多64个字节。仅第三方应用可获取
         /// </summary>
         public string open_userid { get; set; }
+
         /// <summary>
         /// 主部门
         /// </summary>
@@ -109,10 +134,12 @@
         /// 扩展属性
         /// </summary>
         public Extattr extattr { get; set; }
+
         /// <summary>
         /// 启用/禁用成员，第三方不可获取。1表示启用成员，0表示禁用成员
         /// </summary>
         public int enable { get; set; }
+
         /// <summary>
         /// 关注微信插件的状态: 1=已关注，0=未关注
         /// </summary>
@@ -122,6 +149,22 @@
         /// 员工个人二维码，扫描可添加为外部联系人(注意返回的是一个url，可在浏览器上打开该url以展示二维码)；第三方仅通讯录应用可获取
         /// </summary>
         public string qr_code { get; set; }
+
+        /// <summary>
+        /// 成员对外属性，字段详情见对外属性：
+        /// <seealso cref="http://work.weixin.qq.com/api/doc#13450"/>
+        /// </summary>
+        public External_Profile external_profile { get; set; }
+
+        /// <summary>
+        /// 对外职务
+        /// </summary>
+        public string external_position { get; set; }
+
+        /// <summary>
+        /// 地址。长度最大128个字符
+        /// </summary>
+        public string address { get; set; }
     }

     public class GetDepartmentMemberResult : WorkJsonResult
@@ -141,16 +184,17 @@
         /// 员工UserID
         /// </summary>
         public string userid { get; set; }
+
         /// <summary>
         /// 成员名称
         /// </summary>
         public string name { get; set; }
+
         /// <summary>
         /// 成员所属部门
         /// </summary>
         public long[] department { get; set; }
     }
-

     /// <summary>
     /// 获取部门成员(详情)返回结果
@@ -180,5 +224,4 @@
         public string[] invalidparty { get; set; }
         public string[] invalidtag { get; set; }
     }
-
 }


add App.Ready event

add App.Ready event

--- TCC.Core/App.xaml.cs
+++ TCC.Core/App.xaml.cs
@@ -30,6 +30,8 @@
 {
     public partial class App
     {
+        public static event Action ReadyEvent;
+
         private static bool _restarted;
         private static bool _running;
         private static Mutex _mutex;
@@ -148,7 +150,8 @@
             SplashScreen.CloseWindowSafe();

             // ----------------------------
-            ChatManager.Instance.AddTccMessage($"{AppVersion} ready.");
+            Log.Chat($"{AppVersion} ready.");
+            ReadyEvent?.Invoke();

             if (!Beta && Settings.BetaNotification && UpdateManager.IsBetaNewer())
                 Log.N("TCC beta available", SR.BetaAvailable,


TMR 1.3.0.0

TMR 1.3.0.0

--- TMR/ClientHandler.cs
+++ TMR/ClientHandler.cs
@@ -1,65 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
-using System.Net.Sockets;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace TMR
-{
-	class ClientHandler : IDisposable
-	{
-		private Socket _sock;
-
-		private MessageEventHandler _onmsg;
-
-		private bool isRun = false;
-
-		public ClientHandler(Socket sock, MessageEventHandler msgevt)
-		{
-			_sock = sock;
-
-			_onmsg = msgevt;
-		}
-
-		public void Start()
-		{
-			NetworkStream stream = null;
-			StreamReader sr = null;
-
-			stream = new NetworkStream(_sock);
-			sr = new StreamReader(stream, Encoding.UTF8);
-
-			isRun = true;
-
-			while (isRun)
-			{
-				try
-				{
-					byte[] buffer = Utility.Receive(_sock);
-					int len = buffer.Length;
-
-					if (!isRun) return;
-
-					if (_onmsg != null)
-						_onmsg(new MessageEventArgs(new Message(Encoding.UTF8.GetString(buffer, 0, len))));
-				}
-				catch
-				{
-					break;
-				}
-			}
-		}
-
-		public void Stop()
-		{
-			isRun = false;
-		}
-
-		public void Dispose()
-		{
-			_sock.Close();
-		}
-	}
-}


Removed ApiListTest

Removed ApiListTest

--- Tests/ApiListTest.cs
+++ Tests/ApiListTest.cs
@@ -1,202 +0,0 @@
-#if LESSTHAN_NET35
-extern alias nunitlinq;
-#endif
-
-#if NET20 || NET30 || NET35 || NET40 || NET45 || NETCOREAPP2_0 || NETCOREAPP2_1
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Net;
-using System.Reflection;
-using NUnit.Framework;
-using Theraot.Collections;
-using Theraot.Collections.Specialized;
-using Theraot.Core;
-
-namespace APIList
-{
-    [TestFixture]
-    public static class ApiListTest
-    {
-        [Test]
-        [Category("Performance")]
-        public static void Test()
-        {
-            var version = "2.1";
-            var skippedNamespaces = new []
-            {
-                "System.Xml",
-                "System.Data",
-                "System.Net",
-                "System.IO",
-                "System.Drawing",
-                "System.Runtime.Serialization",
-                "System.Security.Cryptography"
-            };
-            // ---
-            var url = $"https://raw.githubusercontent.com/dotnet/standard/master/docs/versions/netstandard{version}_ref.md";
-            var text = new WebClient().DownloadString(url);
-            var parser = new StringProcessor(text);
-            var keywords = new []
-            {
-                "class",
-                "static class",
-                "abstract class",
-                "sealed class",
-                "struct",
-                "enum",
-                "interface"
-            };
-            var entryAssembly = typeof(ApiListTest).Assembly;
-            var entryAssemblyName = entryAssembly.GetName();
-            var assemblyNameComparer = new CustomEqualityComparer<AssemblyName>
-            (
-                (left, right) => left.FullName == right.FullName,
-                name => name.FullName.GetHashCode()
-            );
-            var assemblyDictionary = new Dictionary<AssemblyName, Assembly>(assemblyNameComparer)
-            {
-                {entryAssemblyName, entryAssembly}
-            };
-            var loadedAssemblies = GraphHelper.ExploreBreadthFirstGraph
-            (
-                entryAssemblyName,
-                assemblyName =>
-                {
-                    Assembly assembly = GetAssembly(assemblyName, assemblyDictionary);
-                    return assembly.GetReferencedAssemblies();
-                },
-                assemblyNameComparer
-            );
-            var types = loadedAssemblies.SelectMany
-            (
-                assemblyName => GetAssembly(assemblyName, assemblyDictionary).GetTypes()
-            );
-            var lookup = new ProgressiveLookup<string, Type>(types.GroupProgressiveBy(type => type.FullName));
-            parser.SkipUntilAfter("```C#");
-            while (!parser.EndOfString)
-            {
-                parser.SkipWhile(CharHelper.IsClassicWhitespace);
-                if (parser.Read("namespace"))
-                {
-                    parser.SkipWhile(CharHelper.IsClassicWhitespace);
-                    var @namespace = parser.ReadUntil(CharHelper.IsClassicWhitespace);
-                    var includeNamespace = true;
-                    foreach (var skippedNamespace in skippedNamespaces)
-                    {
-                        if (@namespace.StartsWith(skippedNamespace))
-                        {
-                            includeNamespace = false;
-                            break;
-                        }
-                    }
-                    parser.SkipWhile(CharHelper.IsClassicWhitespace);
-                    parser.Read("{");
-                    parser.SkipWhile(CharHelper.IsClassicWhitespace);
-                    while (true)
-                    {
-                        if (parser.Read("public"))
-                        {
-                            parser.SkipWhile(CharHelper.IsClassicWhitespace);
-                            if (parser.Read("delegate"))
-                            {
-                                parser.SkipWhile(CharHelper.IsClassicWhitespace);
-                                parser.SkipUntil(CharHelper.IsClassicWhitespace);
-                                parser.SkipWhile(CharHelper.IsClassicWhitespace);
-                                ReadType(parser, @namespace, lookup, includeNamespace);
-                                parser.ReadUntil(new[] {'\n', '\r', '{'});
-                                if (parser.Peek('\n') || parser.Peek('\r'))
-                                {
-                                    continue;
-                                }
-                            }
-                            else if (parser.Read(keywords) != null)
-                            {
-                                parser.SkipWhile(CharHelper.IsClassicWhitespace);
-                                ReadType(parser, @namespace, lookup, includeNamespace);
-                            }
-                            var count = 0;
-                            do
-                            {
-                                if (parser.ReadUntil(new[] {'{', '}'}) == null)
-                                {
-                                    break;
-                                }
-                                if (parser.Read() == '{')
-                                {
-                                    count++;
-                                }
-                                else
-                                {
-                                    count--;
-                                }
-                            } while (count != 0);
-                        }
-                        parser.SkipWhile(CharHelper.IsClassicWhitespace);
-                        if (parser.Read("}"))
-                        {
-                            break;
-                        }
-                    }
-                }
-                parser.Read("```");
-            }
-        }
-
-        private static void ReadType(StringProcessor parser, string @namespace, ProgressiveLookup<string, Type> lookup, bool includeNamespace)
-        {
-            var typeName = string.Empty;
-            while (true)
-            {
-                typeName += parser.ReadWhile(char.IsLetterOrDigit);
-                if (parser.Read("_"))
-                {
-                    typeName += "_";
-                }
-                else
-                {
-                    break;
-                }
-            }
-            var generic = parser.Read("<");
-            if (generic)
-            {
-                var genericArgsCount = parser.ReadUntil(">").CountItemsWhere(chr => chr == ',') + 1;
-                parser.Read(">");
-                if (includeNamespace)
-                {
-                    ProcessType($"{@namespace}.{typeName}`{genericArgsCount}", lookup);
-                }
-            }
-            else
-            {
-                if (includeNamespace)
-                {
-                    ProcessType($"{@namespace}.{typeName}", lookup);
-                }
-            }
-        }
-
-        private static Assembly GetAssembly(AssemblyName assemblyName, Dictionary<AssemblyName, Assembly> assemblyDictionary)
-        {
-            if (!assemblyDictionary.TryGetValue(assemblyName, out var assembly))
-            {
-                assembly = Assembly.Load(assemblyName);
-                assemblyDictionary.Add(assemblyName, assembly);
-            }
-            return assembly;
-        }
-
-        private static void ProcessType(string typeName, ProgressiveLookup<string, Type> lookup)
-        {
-            var types = lookup[typeName];
-            if (!types.Any())
-            {
-                Console.WriteLine(typeName);
-            }
-        }
-    }
-}
-
-#endif


Fixed horizontal offset in grid rendering

--- TimeBeam/Timeline.cs
+++ TimeBeam/Timeline.cs
@@ -227,7 +227,7 @@
       }

       // Draw a vertical grid. Every 10 ticks, we place a line.
-      for( int x = 0; x < Width; x += 10 ) {
+      for( int x = (int)_renderingOffset.X; x < Width; x += 10 ) {
         int alpha = GridAlpha;
         // Every 60 ticks, we put a brighter line.
         if( x % 60 == 0 ) {


Usability changes for the find bar: Using shorter text and smaller icons

Fixed bug #483297, changed the icons to Gtk.Arrows to save space, made the
button text shorter and set the entry widget to expand/use more space.

--- Tomboy/NoteWindow.cs
+++ Tomboy/NoteWindow.cs
@@ -753,10 +753,10 @@
 			entry.Changed += OnFindEntryChanged;
 			entry.Activated += OnFindEntryActivated;
 			entry.Show ();
-			PackStart (entry, false, false, 0);
+			PackStart (entry, true, true, 0);

 			prev_button = new Gtk.Button (Catalog.GetString ("_Previous"));
-			prev_button.Image = new Gtk.Image (Gtk.Stock.GoBack, Gtk.IconSize.Menu);
+			prev_button.Image = new Gtk.Arrow (Gtk.ArrowType.Left, Gtk.ShadowType.None);
 			prev_button.Relief = Gtk.ReliefStyle.None;
 			prev_button.Sensitive = false;
 			prev_button.FocusOnClick = false;
@@ -764,8 +764,8 @@
 			prev_button.Show ();
 			PackStart (prev_button, false, false, 0);

-			next_button = new Gtk.Button (Catalog.GetString ("Find _Next"));
-			next_button.Image = new Gtk.Image (Gtk.Stock.GoForward, Gtk.IconSize.Menu);
+			next_button = new Gtk.Button (Catalog.GetString ("_Next"));
+			next_button.Image = new Gtk.Arrow (Gtk.ArrowType.Right, Gtk.ShadowType.None);
 			next_button.Relief = Gtk.ReliefStyle.None;
 			next_button.Sensitive = false;
 			next_button.FocusOnClick = false;


synchronization support

synchronization support

--- wp8/KursnaListaSolution/MSC.Phone.Shared/Implementation/PhoneStorageCacheService.cs
+++ wp8/KursnaListaSolution/MSC.Phone.Shared/Implementation/PhoneStorageCacheService.cs
@@ -5,6 +5,7 @@
 using System.IO;
 using System.Linq;
 using System.Text;
+using System.Threading;
 using System.Threading.Tasks;
 using Windows.Storage;

@@ -28,34 +29,43 @@

         public async Task PutAsync(string key, object value)
         {
+            var mut = new Mutex(true, key);
+            mut.WaitOne();
             try
             {
                 var localFolder = ApplicationData.Current.LocalFolder;
                 var storageFile = await localFolder.CreateFileAsync(
-                    key, CreationCollisionOption.ReplaceExisting).AsTask().ConfigureAwait(false);
+                    key, CreationCollisionOption.ReplaceExisting);
                 var json = JsonConvert.SerializeObject(value);

-                using (var writer = new StreamWriter(await storageFile.OpenStreamForWriteAsync().ConfigureAwait(false)))
+                using (var writer = new StreamWriter(await storageFile.OpenStreamForWriteAsync()))
                 {
-                    await writer.WriteAsync(json).ConfigureAwait(false);
+                    await writer.WriteAsync(json);
                 }
             }
             catch
             {
             }
+            finally
+            {
+                mut.ReleaseMutex();
+            }
         }

         public async Task<ICacheItem<T>> GetAsync<T>(string key)
         {
+            var mut = new Mutex(true, key);
+            mut.WaitOne();
             try
             {
                 var localFolder = ApplicationData.Current.LocalFolder;
-                var file = await localFolder.GetFileAsync(key).AsTask().ConfigureAwait(false);
+
+                var file = await localFolder.GetFileAsync(key);

                 var json = "";
-                using (var reader = new StreamReader(await file.OpenStreamForReadAsync().ConfigureAwait(false)))
+                using (var reader = new StreamReader(await file.OpenStreamForReadAsync()))
                 {
-                    json = await reader.ReadToEndAsync().ConfigureAwait(false);
+                    json = await reader.ReadToEndAsync();
                 }

                 return new CacheItem<T>(JsonConvert.DeserializeObject<T>(json), file.DateCreated.UtcDateTime);
@@ -63,6 +73,10 @@
             catch
             {
                 return new CacheItem<T>(default(T), DateTime.MinValue);
+            }
+            finally
+            {
+                mut.ReleaseMutex();
             }
         }


PackageManager UI Stability #FIX: The PackageManager UI can no longer crash during initialization due to launching the same background worker twice.

--- DualityEditorPlugins/PackageManagerFrontend/TreeModels/PackageRepositoryTreeModel.cs
+++ DualityEditorPlugins/PackageManagerFrontend/TreeModels/PackageRepositoryTreeModel.cs
@@ -29,6 +29,7 @@
 		private		BackgroundWorker				itemIconLoader		= null;
 		private		ConcurrentQueue<BaseItem>		itemsToRead			= new ConcurrentQueue<BaseItem>();
 		private		ConcurrentQueue<BaseItem>		itemsToGetIcon		= new ConcurrentQueue<BaseItem>();
+		private		object							workerLock			= new object();
 		private		object							itemLock			= new object();
 		private		bool							requireFullSort		= false;
 		private		IComparer<BaseItem>				sortComparer		= null;
@@ -57,7 +58,7 @@
 		}
 		public bool IsBusy
 		{
-			get { return this.itemRetriever.IsBusy || this.itemInfoLoader.IsBusy; }
+			get { return this.itemRetriever.IsBusy || this.itemInfoLoader.IsBusy || this.itemIconLoader.IsBusy; }
 		}

 		#pragma warning disable 67  // Event never used
@@ -135,7 +136,7 @@
 		/// </summary>
 		public virtual void ApplyChanges()
 		{
-			this.RunBackgroundWorkers();
+			this.RunLoadInfoWorkers();
 		}

 		public IEnumerable GetChildren(TreePath treePath)
@@ -145,10 +146,8 @@
 			if (parentItem == null)
 			{
 				// Start retrieving all the items from out source asynchronously
-				if (this.items.Count == 0 && !this.itemRetriever.IsBusy)
-				{
-					this.itemRetriever.RunWorkerAsync();
-				}
+				if (this.items.Count == 0)
+					this.RunWorker(this.itemRetriever);

 				// Determine which items to display and return them
 				List<BaseItem> displayedItems = new List<BaseItem>();
@@ -164,6 +163,7 @@
 						displayedItems.Add(item);
 					}
 				}
+
 				return displayedItems;
 			}

@@ -185,12 +185,12 @@
 		/// <summary>
 		/// Wakes info and icon loaders to read online item data.
 		/// </summary>
-		protected void RunBackgroundWorkers()
-		{
-			if (!this.itemInfoLoader.IsBusy && !this.itemsToRead.IsEmpty)
-				this.itemInfoLoader.RunWorkerAsync();
-			if (!this.itemIconLoader.IsBusy && !this.itemsToGetIcon.IsEmpty)
-				this.itemIconLoader.RunWorkerAsync();
+		protected void RunLoadInfoWorkers()
+		{
+			if (!this.itemsToRead.IsEmpty)
+				this.RunWorker(this.itemInfoLoader);
+			if (!this.itemsToGetIcon.IsEmpty)
+				this.RunWorker(this.itemIconLoader);
 		}
 		protected BaseItem GetItem(string packageId, Version packageVersion)
 		{
@@ -214,7 +214,7 @@
 			}

 			// Wake info and icon loaders to read online item data
-			this.RunBackgroundWorkers();
+			this.RunLoadInfoWorkers();
 		}
 		protected void RemoveItem(BaseItem item)
 		{
@@ -300,6 +300,18 @@
 			}
 		}

+		private void RunWorker(BackgroundWorker worker)
+		{
+			if (!worker.IsBusy)
+			{
+				lock (this.workerLock)
+				{
+					if (!worker.IsBusy)
+						worker.RunWorkerAsync();
+				}
+			}
+		}
+
 		private void Worker_RetrieveItems(object sender, DoWorkEventArgs e)
 		{
 			// Create items within the model
@@ -332,7 +344,7 @@
 			}

 			// Wake info and icon loaders to read online item data
-			this.RunBackgroundWorkers();
+			this.RunLoadInfoWorkers();
 		}
 		private void Worker_ReadItemData(object sender, DoWorkEventArgs e)
 		{


Moving the Thickness property

Moving the Thickness property

--- ExtendedCells/ExtendedCells/ExtendedCells.Forms.Plugin.Abstractions/TwoColumnCell.cs
+++ ExtendedCells/ExtendedCells/ExtendedCells.Forms.Plugin.Abstractions/TwoColumnCell.cs
@@ -19,6 +19,15 @@
       }
     }

+    public static readonly BindableProperty ThicknessProperty =
+     BindableProperty.Create("Thickness", typeof(Thickness), typeof(TwoColumnCell), default(Thickness));
+
+    public Thickness Thickness
+    {
+      get { return (Thickness)GetValue(ThicknessProperty); }
+      set { SetValue(ThicknessProperty, value); }
+    }
+
     public static readonly BindableProperty LeftColumnWidthProperty =
     BindableProperty.Create("LeftColumnWidth", typeof(GridLength), typeof(TextCell), default(GridLength));

@@ -47,15 +56,6 @@
       {
         SetValue(RightColumnWidthProperty, value);
       }
-    }
-
-    public static readonly BindableProperty ThicknessProperty =
-      BindableProperty.Create("Thickness", typeof(Thickness), typeof(TwoColumnCell), default(Thickness));
-
-    public Thickness Thickness
-    {
-      get { return (Thickness)GetValue(ThicknessProperty); }
-      set { SetValue(ThicknessProperty, value); }
     }

     #region LeftText


fix: predefined column type in migration (#53)

--- Google.Cloud.EntityFrameworkCore.Spanner/Migrations/SpannerMigrationsSqlGenerator.cs
+++ Google.Cloud.EntityFrameworkCore.Spanner/Migrations/SpannerMigrationsSqlGenerator.cs
@@ -272,7 +272,7 @@
             builder
                 .Append(Dependencies.SqlGenerationHelper.DelimitIdentifier(name))
                 .Append(" ")
-                .Append(GetCorrectedColumnType(GetColumnType(schema, table, name, operation, model)));
+                .Append(GetCorrectedColumnType(operation.ColumnType ?? GetColumnType(schema, table, name, operation, model)));

             if (!operation.IsNullable)
             {