Initial docs for IService interface

Initial docs for IService interface

--- winsvc/IService.cs
+++ winsvc/IService.cs
@@ -4,19 +4,17 @@
 using winsvc.Flags;
 using winsvc.Structs;

+#pragma warning disable 1584,1711,1572,1581,1580
+
 namespace winsvc
 {
     public interface IService : IDisposable
     {
-        void Delete();
-
-        void Start();
-        void Start(string[] serviceArgVectors);
-
-        void Control(SERVICE_CONTROL control);
-        void ControlEx(SERVICE_CONTROL control, ref SERVICE_CONTROL_STATUS_REASON_PARAMS reason);
-
-        QUERY_SERVICE_CONFIG QueryServiceConfig();
+        /// <summary>
+        /// Get or set the description  of the service.
+        /// </summary>
+        /// <exception cref="Win32Exception">Thrown if the underlying API call fails.</exception>
+        string Description { get; set; }

         void ChangeServiceConfig(
             SERVICE_TYPE       serviceType,
@@ -31,12 +29,21 @@
             string     displayName
         );

+        void Control(SERVICE_CONTROL control);
+
+        void ControlEx(SERVICE_CONTROL control, ref SERVICE_CONTROL_STATUS_REASON_PARAMS reason);
+
+        void Delete();
+
+        IEnumerable<ENUM_SERVICE_STATUS> EnumDependentServices(SERVICE_STATE_FLAGS states);
+
+        QUERY_SERVICE_CONFIG QueryServiceConfig();
+
         SERVICE_STATUS QueryServiceStatus();

         SERVICE_STATUS_PROCESS QueryServiceStatusEx();

-        IEnumerable<ENUM_SERVICE_STATUS> EnumDependentServices(SERVICE_STATE_FLAGS states);
-
-        string Description { get; set; }
+        void Start();
+        void Start(string[] serviceArgVectors);
     }
 }


Refactor

Refactor

--- NewWave.Core/Score.cs
+++ NewWave.Core/Score.cs
@@ -71,13 +71,13 @@
 			// (we don't need to unroll percussion because it
 			// doesn't have any issue with overlapping notes)
 			var channel = Channel.Channel1;
-			var unrolledInstruments = new List<UnrolledInstrument>();
+			var renderedInstruments = new List<RenderedInstrument>();
 			foreach (var instrumentTrack in _instrumentTracks)
 			{
-				unrolledInstruments.Add(new UnrolledInstrument
+				renderedInstruments.Add(new RenderedInstrument
 				{
 					Channel = channel,
-					Notes = Unroll(instrumentTrack.Notes).ToList()
+					Notes = Unroll(instrumentTrack.Notes).Select(n => new MidiNote(n.StartInTicks(StandardMidiTicksPerBeat), n.LengthInTicks(StandardMidiTicksPerBeat), n.Pitch, n.Velocity)).ToList()
 				});

 				t.Insert(0, new ChannelMessage(ChannelCommand.ProgramChange, (int)channel, (int)instrumentTrack.Instrument));
@@ -105,30 +105,19 @@
 			}

 			// Create events for unrolled instrument tracks
-			foreach (var unrolledInstrument in unrolledInstruments)
-			{
-				var renderedInstrument = new RenderedInstrument
-				{
-					Channel = unrolledInstrument.Channel,
-					Notes = unrolledInstrument.Notes.Select(n => new MidiNote(
-						TickBuffer + n.StartInTicks(StandardMidiTicksPerBeat),
-						n.LengthInTicks(StandardMidiTicksPerBeat),
-						n.Pitch,
-						n.Velocity)).ToList()
-				};
-
+			foreach (var renderedInstrument in renderedInstruments)
+			{
 				foreach (var note in renderedInstrument.Notes)
 				{
-					t.Insert(note.Start, new ChannelMessage(ChannelCommand.NoteOn, (int)unrolledInstrument.Channel, (int)note.Pitch, (int)note.Velocity));
-
-					var note1 = note;
-					if (!renderedInstrument.Notes.Any(e => e.Pitch == note1.Pitch && e.Start == note1.End))
+					t.Insert(note.Start, new ChannelMessage(ChannelCommand.NoteOn, (int)renderedInstrument.Channel, (int)note.Pitch, (int)note.Velocity));
+
+					if (!renderedInstrument.Notes.Any(e => e.Pitch == note.Pitch && e.Start == note.End))
 					{
 						// NOTE: You cannot have NoteOff and NoteOn events for the same pitch
 						// on the same tick. NoteOff gets priority and the second note will not
 						// be played. So if two notes collide, don't write the NoteOff command
 						// for the first one.
-						t.Insert(note.End, new ChannelMessage(ChannelCommand.NoteOff, (int)unrolledInstrument.Channel, (int)note.Pitch, (int)note.Velocity));
+						t.Insert(note.End, new ChannelMessage(ChannelCommand.NoteOff, (int)renderedInstrument.Channel, (int)note.Pitch, (int)note.Velocity));
 					}
 				}
 			}
@@ -233,12 +222,6 @@

 		#region Private classes

-		private struct UnrolledInstrument
-		{
-			public Channel Channel;
-			public List<Note> Notes;
-		}
-
 		private struct RenderedInstrument
 		{
 			public Channel Channel;
@@ -247,10 +230,10 @@

 		private struct MidiNote
 		{
-			public int Start;
-			public int End;
-			public Pitch Pitch;
-			public Velocity Velocity;
+			public readonly int Start;
+			public readonly int End;
+			public readonly Pitch Pitch;
+			public readonly Velocity Velocity;

 			public MidiNote(int start, int length, Pitch pitch, Velocity velocity)
 			{


Added volume information.

Added volume information.

--- NtApiDotNet/NtFile.cs
+++ NtApiDotNet/NtFile.cs
@@ -1272,6 +1272,90 @@
         }
     }

+    [Flags]
+    public enum FileSystemAttributes : uint
+    {
+        CaseSensitiveSearch = 0x00000001,
+        CasePreservedNames = 0x00000002,
+        UnicodeOnDisk = 0x00000004,
+        PersistentAcls = 0x00000008,
+        FileCompression = 0x00000010,
+        VolumeQuotas = 0x00000020,
+        SupportsSparseFiles = 0x00000040,
+        SupportsReparsePoints = 0x00000080,
+        SupportsRemoteStorage = 0x00000100,
+        ReturnsCleanupResultInfo = 0x00000200,
+        SupportsPosixUnlinkRename = 0x00000400,
+        Available00000800 = 0x00000800,
+        Available00001000 = 0x00001000,
+        Available00002000 = 0x00002000,
+        Available00004000 = 0x00004000,
+        VolumeIsCompressed = 0x00008000,
+        SupportsObjectIds = 0x00010000,
+        SupportsEncryption = 0x00020000,
+        NamedStreams = 0x00040000,
+        ReadOnlyVolume = 0x00080000,
+        SequentialWriteOnce = 0x00100000,
+        SupportsTransactions = 0x00200000,
+        SupportsHardLinks = 0x00400000,
+        SupportsExtendedAttributes = 0x00800000,
+        SupportsOpenByFileId = 0x01000000,
+        SupportsUsnJournal = 0x02000000,
+        SupportsIntegrityStreams = 0x04000000,
+        SupportsBlockRefcounting = 0x08000000,
+        SupportsSparseVdl = 0x10000000,
+        DaxVolume = 0x20000000,
+        SupportsGhosting = 0x40000000,
+        Available80000000 = 0x80000000,
+    }
+
+    [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode), DataStart("FileSystemName")]
+    public struct FileFsAttributeInformation
+    {
+        public FileSystemAttributes FileSystemAttributes;
+        public int MaximumComponentNameLength;
+        public int FileSystemNameLength;
+        public char FileSystemName;
+    }
+
+    [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode), DataStart("VolumeLabel")]
+    public struct FileFsVolumeInformation
+    {
+        public LargeIntegerStruct VolumeCreationTime;
+        public uint VolumeSerialNumber;
+        public int VolumeLabelLength;
+        [MarshalAs(UnmanagedType.I1)]
+        public bool SupportsObjects;
+        public char VolumeLabel;
+    }
+
+    public sealed class FileSystemVolumeInformation
+    {
+        public FileSystemAttributes Attributes { get; }
+        public int MaximumComponentLength { get; }
+        public string Name { get; }
+        public DateTime CreationTime { get; }
+        public uint SerialNumber { get; }
+        public string Label { get; }
+        bool SupportsObjects { get; }
+
+        internal FileSystemVolumeInformation(SafeStructureInOutBuffer<FileFsAttributeInformation> attr_info,
+            SafeStructureInOutBuffer<FileFsVolumeInformation> vol_info)
+        {
+            var attr_info_res = attr_info.Result;
+            var vol_info_res = vol_info.Result;
+            Attributes = attr_info_res.FileSystemAttributes;
+            MaximumComponentLength = attr_info_res.MaximumComponentNameLength;
+            Name = attr_info.Data.ReadUnicodeString(attr_info_res.FileSystemNameLength / 2);
+
+            CreationTime = DateTime.FromFileTime(vol_info_res.VolumeCreationTime.QuadPart);
+            SerialNumber = vol_info_res.VolumeSerialNumber;
+            SupportsObjects = vol_info_res.SupportsObjects;
+            Label = vol_info.Data.ReadUnicodeString(vol_info_res.VolumeLabelLength / 2);
+        }
+    }
+
+
 #pragma warning restore 1591

     /// <summary>
@@ -1290,7 +1374,7 @@
             OpenResult = io_status != null ? (FileOpenResult)io_status.Information.ToInt32() : FileOpenResult.Opened;
         }

-        internal NtFile(SafeKernelObjectHandle handle)
+        internal NtFile(SafeKernelObjectHandle handle)
             : this(handle, null)
         {
         }
@@ -1337,7 +1421,7 @@
             IoStatus iostatus = new IoStatus();
             byte[] buffer = ea_buffer?.ToByteArray();
             return NtSystemCalls.NtCreateFile(out SafeKernelObjectHandle handle, desired_access, obj_attributes, iostatus, null, FileAttributes.Normal,
-                share_access, disposition, open_options,
+                share_access, disposition, open_options,
                 buffer, buffer != null ? buffer.Length : 0).CreateResult(throw_on_error, () => CreateFileObject(handle, iostatus));
         }

@@ -1609,7 +1693,7 @@
         {
             return buffer != null ? (int)buffer.ByteLength : 0;
         }
-
+
         private delegate NtStatus IoControlFunction(SafeKernelObjectHandle FileHandle,
                                                     SafeKernelObjectHandle Event,
                                                     IntPtr ApcRoutine,
@@ -1621,7 +1705,7 @@
                                                     IntPtr OutputBuffer,
                                                     int OutputBufferLength);

-        private async Task<int> IoControlGenericAsync(IoControlFunction func,
+        private async Task<int> IoControlGenericAsync(IoControlFunction func,
                         NtIoControlCode control_code, SafeBuffer input_buffer, SafeBuffer output_buffer, CancellationToken token)
         {
             using (var linked_cts = CancellationTokenSource.CreateLinkedTokenSource(token, _cts.Token))
@@ -1629,7 +1713,7 @@
                 using (NtAsyncResult result = new NtAsyncResult(this))
                 {
                     NtStatus status = await result.CompleteCallAsync(func(Handle, result.EventHandle, IntPtr.Zero, IntPtr.Zero, result.IoStatusBuffer,
-                        control_code.ToInt32(), GetSafePointer(input_buffer), GetSafeLength(input_buffer),
+                        control_code.ToInt32(), GetSafePointer(input_buffer), GetSafeLength(input_buffer),
                         GetSafePointer(output_buffer), GetSafeLength(output_buffer)), linked_cts.Token);
                     if (status == NtStatus.STATUS_PENDING)
                     {
@@ -1901,7 +1985,7 @@
         /// <param name="open_options">File open options</param>
         /// <param name="throw_on_error">True to throw an exception on error.</param>
         /// <returns>The NT status code and object result.</returns>
-        public static NtResult<NtFile> Open(ObjectAttributes obj_attributes, FileAccessRights desired_access,
+        public static NtResult<NtFile> Open(ObjectAttributes obj_attributes, FileAccessRights desired_access,
             FileShareMode share_access, FileOpenOptions open_options, bool throw_on_error)
         {
             IoStatus iostatus = new IoStatus();
@@ -1911,7 +1995,7 @@

         internal static NtResult<NtObject> FromName(ObjectAttributes object_attributes, AccessMask desired_access, bool throw_on_error)
         {
-            return Open(object_attributes, desired_access.ToSpecificAccess<FileAccessRights>(), FileShareMode.Read | FileShareMode.Delete,
+            return Open(object_attributes, desired_access.ToSpecificAccess<FileAccessRights>(), FileShareMode.Read | FileShareMode.Delete,
                 FileOpenOptions.None, throw_on_error).Cast<NtObject>();
         }

@@ -1959,7 +2043,7 @@
         /// <param name="open_options">File open options</param>
         /// <returns>The opened file</returns>
         /// <exception cref="NtException">Thrown on error.</exception>
-        public static NtFile Open(string path, NtObject root, FileAccessRights desired_access,
+        public static NtFile Open(string path, NtObject root, FileAccessRights desired_access,
             FileShareMode shared_access, FileOpenOptions open_options)
         {
             return Open(path, root, desired_access, shared_access, open_options, true).Result;
@@ -1975,7 +2059,7 @@
         /// <exception cref="NtException">Thrown on error.</exception>
         public static NtFile Open(string path, NtObject root, FileAccessRights desired_access)
         {
-            return Open(path, root, desired_access,
+            return Open(path, root, desired_access,
                 FileShareMode.Read | FileShareMode.Delete, FileOpenOptions.None);
         }

@@ -2022,7 +2106,7 @@
                 return NtFileUtils.FileIdToString(internal_info.IndexNumber.QuadPart);
             }
         }
-
+
         /// <summary>
         /// Get or set the attributes of a file.
         /// </summary>
@@ -2209,7 +2293,7 @@
                         buffer.Length, file_info).ToNtException();
             }
         }
-
+
         private void DoLinkRename(FileInformationClass file_info, string linkname, NtFile root)
         {
             DoLinkRename(file_info, linkname, root, true);
@@ -2465,7 +2549,7 @@
         /// <param name="file_mask">A file name mask (such as *.txt). Can be null.</param>
         /// <param name="type_mask">Indicate what entries to return.</param>
         /// <returns>The list of files which can be access.</returns>
-        public IEnumerable<NtFile> QueryAccessibleFiles(FileAccessRights desired_access, FileShareMode share_access,
+        public IEnumerable<NtFile> QueryAccessibleFiles(FileAccessRights desired_access, FileShareMode share_access,
             FileOpenOptions open_options, string file_mask, FileTypeMask type_mask)
         {
             using (var list = new DisposableList<NtFile>())
@@ -2523,7 +2607,7 @@
                 using (NtAsyncResult result = new NtAsyncResult(this))
                 {
                     NtStatus status = result.CompleteCall(NtSystemCalls.NtQueryDirectoryFile(Handle, result.EventHandle,
-                        IntPtr.Zero, IntPtr.Zero, result.IoStatusBuffer, buffer, buffer.Length,
+                        IntPtr.Zero, IntPtr.Zero, result.IoStatusBuffer, buffer, buffer.Length,
                         FileInformationClass.FileDirectoryInformation, false, mask, true));

                     while (status.IsSuccess())
@@ -2744,7 +2828,7 @@
             using (NtAsyncResult result = new NtAsyncResult(this))
             {
                 result.CompleteCall(NtSystemCalls.NtLockFile(Handle, result.EventHandle, IntPtr.Zero,
-                    IntPtr.Zero, result.IoStatusBuffer, new LargeInteger(offset),
+                    IntPtr.Zero, result.IoStatusBuffer, new LargeInteger(offset),
                     new LargeInteger(size), 0, fail_immediately, exclusive)).ToNtException();
             }
         }
@@ -2804,7 +2888,7 @@
         public void Unlock(long offset, long size)
         {
             IoStatus io_status = new IoStatus();
-            NtSystemCalls.NtUnlockFile(Handle, io_status,
+            NtSystemCalls.NtUnlockFile(Handle, io_status,
                 new LargeInteger(offset), new LargeInteger(size), 0).ToNtException();
         }

@@ -2940,6 +3024,38 @@
             }
         }

+        private SafeStructureInOutBuffer<T> QueryVolume<T>(FsInformationClass info_class) where T : new()
+        {
+            SafeStructureInOutBuffer<T> ret = null;
+            NtStatus status = NtStatus.STATUS_BUFFER_TOO_SMALL;
+            try
+            {
+                int length = Marshal.SizeOf(typeof(T)) + 128;
+                while (true)
+                {
+                    ret = new SafeStructureInOutBuffer<T>(length, false);
+                    IoStatus io_status = new IoStatus();
+                    status = NtSystemCalls.NtQueryVolumeInformationFile(Handle, io_status, ret, ret.Length, info_class);
+                    if (status.IsSuccess())
+                        break;
+
+                    if ((status != NtStatus.STATUS_BUFFER_OVERFLOW) && (status != NtStatus.STATUS_INFO_LENGTH_MISMATCH))
+                        throw new NtException(status);
+                    ret.Close();
+                    length *= 2;
+                }
+            }
+            finally
+            {
+                if (ret != null && !status.IsSuccess())
+                {
+                    ret.Close();
+                    ret = null;
+                }
+            }
+            return ret;
+        }
+
         private T QueryFileFixed<T>(FileInformationClass info_class) where T : new()
         {
             return QueryFileFixed<T>(info_class, true).Result;
@@ -3000,7 +3116,7 @@
             using (var buffer = new SafeStructureInOutBuffer<FileNameInformation>(32 * 1024, true))
             {
                 IoStatus status = new IoStatus();
-                NtSystemCalls.NtQueryInformationFile(Handle,
+                NtSystemCalls.NtQueryInformationFile(Handle,
                     status, buffer, buffer.Length, info_class).ToNtException();
                 char[] result = new char[buffer.Result.NameLength / 2];
                 buffer.Data.ReadArray(0, result, 0, result.Length);
@@ -3170,7 +3286,7 @@
         /// <summary>
         /// Oplock the file exclusively (no other users can access the file).
         /// </summary>
-            public void OplockExclusive()
+        public void OplockExclusive()
         {
             RequestOplock(OplockRequestLevel.Level1);
         }
@@ -3233,7 +3349,7 @@
         public EaBuffer GetEa()
         {
             int ea_size = 1024;
-            while(true)
+            while (true)
             {
                 IoStatus io_status = new IoStatus();
                 byte[] buffer = new byte[ea_size];
@@ -3467,7 +3583,7 @@
                     }
                     break;
                 }
-            }
+            }
         }

         /// <summary>
@@ -3662,7 +3778,7 @@

             foreach (var entry in QueryDirectoryInfo(null, FileTypeMask.DirectoriesOnly))
             {
-                if (!VisitFileEntry(entry.FileName, entry.IsDirectory,
+                if (!VisitFileEntry(entry.FileName, entry.IsDirectory,
                     f => f.VisitAccessibleFiles(visitor, desired_access, share_access, open_options, recurse, max_depth, file_mask, type_mask),
                         FileDirectoryAccessRights.ListDirectory.ToFileAccessRights(), FileShareMode.Read | FileShareMode.Delete,
                     (open_options & FileOpenOptions.OpenForBackupIntent) | FileOpenOptions.OpenReparsePoint))
@@ -3806,5 +3922,22 @@
                 }
             }
         }
+
+        /// <summary>
+        /// Get filesystem and volume information.
+        /// </summary>
+        public FileSystemVolumeInformation VolumeInformation
+        {
+            get
+            {
+                using (var attr_info = QueryVolume<FileFsAttributeInformation>(FsInformationClass.FileFsAttributeInformation))
+                {
+                    using (var vol_info = QueryVolume<FileFsVolumeInformation>(FsInformationClass.FileFsVolumeInformation))
+                    {
+                        return new FileSystemVolumeInformation(attr_info, vol_info);
+                    }
+                }
+            }
+        }
     }
 }


Updated detection of userfuncs in NumCIL

--- bridge/NumCIL/NumCIL.cphVB/VEM.cs
+++ bridge/NumCIL/NumCIL.cphVB/VEM.cs
@@ -40,12 +40,12 @@
         /// <summary>
         /// ID for the user-defined reduce operation
         /// </summary>
-        private long m_reduceFunctionId = 0;
+        private readonly long m_reduceFunctionId;

         /// <summary>
         /// ID for the user-defined random operation
         /// </summary>
-        private long m_randomFunctionId = 0;
+        private readonly long m_randomFunctionId;

         /// <summary>
         /// Lookup table for all created userfunc structures
@@ -97,27 +97,31 @@
             if (e != PInvoke.cphvb_error.CPHVB_SUCCESS)
                 throw new cphVBException(e);

+            //The exception only happens with the debugger attached
+            long id = 0;
             try
             {
-                e = m_childs[0].reg_func(null, "cphvb_reduce", ref m_reduceFunctionId);
+                //Since the current implementation of reduce in cphvb is slow,
+                // it can be disabled by an environment variable
+                if (Environment.GetEnvironmentVariable("CPHVB_MANAGED_REDUCE") == null)
+                {
+                    e = m_childs[0].reg_func(null, "cphvb_reduce", ref id);
+                    if (e != PInvoke.cphvb_error.CPHVB_SUCCESS)
+                        id = 0;
+                }
+            }
+            catch { id = 0; }
+            m_reduceFunctionId = id;
+
+            id = 0;
+            try
+            {
+                e = m_childs[0].reg_func(null, "cphvb_random", ref id);
                 if (e != PInvoke.cphvb_error.CPHVB_SUCCESS)
-                    throw new cphVBException(e);
-            }
-            catch
-            {
-                m_reduceFunctionId = 0;
-            }
-
-            try
-            {
-                e = m_childs[0].reg_func(null, "cphvb_random", ref m_randomFunctionId);
-                if (e != PInvoke.cphvb_error.CPHVB_SUCCESS)
-                    throw new cphVBException(e);
-            }
-            catch
-            {
-                m_randomFunctionId = 0;
-            }
+                    id = 0;
+            }
+            catch { id = 0; }
+            m_randomFunctionId = id;
         }

         /// <summary>


CoalescerTest 클래스에서 불필요한 테스트 케이스를 삭제합니다.

--- tests/Flip.Tests/CoalescerTest.cs
+++ tests/Flip.Tests/CoalescerTest.cs
@@ -27,6 +27,18 @@
         }

         [Theory, AutoData]
+        public void CoalesceUsesLeftPropertyValueIfLeftPropertyValueIsNotNull(
+            User left, User right)
+        {
+            var sut = Coalescer<User>.Default;
+
+            User actual = sut.Coalesce(left, right);
+
+            actual.Should().NotBeSameAs(left);
+            actual.ShouldBeEquivalentTo(left);
+        }
+
+        [Theory, AutoData]
         public void CoalesceUsesRightPropertyValueIfLeftPropertyValueIsNull(
             Guid id, string userName, string bio, string email, string website)
         {
@@ -40,32 +52,5 @@
             actual.ShouldBeEquivalentTo(
                 new User(id, userName, bio, email) { Website = website });
         }
-
-        [Theory, AutoData]
-        public void CoalesceUsesLeftPropertyValueIfRightPropertyValueIsNull(
-            Guid id, string userName, string bio, string email, string website)
-        {
-            var left = new User(id, userName, bio, email);
-            left.Website = website;
-            var right = new User(id, userName, null, null);
-            var sut = Coalescer<User>.Default;
-
-            User actual = sut.Coalesce(left, right);
-
-            actual.ShouldBeEquivalentTo(
-                new User(id, userName, bio, email) { Website = website });
-        }
-
-        [Theory, AutoData]
-        public void CoalesceUsesLeftPropertyValueIfLeftPropertyValueIsNotNull(
-            User left, User right)
-        {
-            var sut = Coalescer<User>.Default;
-
-            User actual = sut.Coalesce(left, right);
-
-            actual.Should().NotBeSameAs(left);
-            actual.ShouldBeEquivalentTo(left);
-        }
     }
 }


still trying to get these stable

still trying to get these stable

--- test/Ocelot.IntegrationTests/RaftTests.cs
+++ test/Ocelot.IntegrationTests/RaftTests.cs
@@ -45,21 +45,7 @@
             _builders = new List<IWebHost>();
             _threads = new List<Thread>();
         }
-
-        public void Dispose()
-        {
-            foreach (var builder in _builders)
-            {
-                builder?.Dispose();
-            }
-
-            foreach (var peer in _peers.Peers)
-            {
-                File.Delete(peer.HostAndPort.Replace("/","").Replace(":",""));
-                File.Delete($"{peer.HostAndPort.Replace("/","").Replace(":","")}.db");
-            }
-        }
-
+
         [Fact]
         public void should_persist_command_to_five_servers()
         {
@@ -417,10 +403,33 @@

             foreach (var peer in _peers.Peers)
             {
+                File.Delete(peer.HostAndPort.Replace("/", "").Replace(":", ""));
+                File.Delete($"{peer.HostAndPort.Replace("/", "").Replace(":", "")}.db");
                 var thread = new Thread(() => GivenAServerIsRunning(peer.HostAndPort));
                 thread.Start();
                 _threads.Add(thread);
             }
         }
+
+        public void Dispose()
+        {
+            foreach (var builder in _builders)
+            {
+                builder?.Dispose();
+            }
+
+            foreach (var peer in _peers.Peers)
+            {
+                try
+                {
+                    File.Delete(peer.HostAndPort.Replace("/", "").Replace(":", ""));
+                    File.Delete($"{peer.HostAndPort.Replace("/", "").Replace(":", "")}.db");
+                }
+                catch (Exception e)
+                {
+                    Console.WriteLine(e);
+                }
+            }
+        }
     }
 }


'handling COM errors properly in receiveResponseXML/OnResponseMessage'

--- paraquick-qbwc/QbWcService.cs
+++ paraquick-qbwc/QbWcService.cs
@@ -241,41 +241,50 @@
                     //bad tickets will recur in getLastError and be logged there
                     if (efSession != null)
                     {
-                        //deserialize response and process success/error
-                        RsMsgSet rsMsgSet = new RsMsgSet();
-                        QBXML qbxml=rsMsgSet.Deserialize(responseXml);
-
-                        //TODO update paraquick entities based on response type
-                        foreach (var rsMsg in rsMsgSet)
-                        {
-                            var efMessage = efSession.ParaquickMessages.Where(m => m.RequestId == rsMsg.requestID).FirstOrDefault();
-
-                            if (efMessage != null)
+                        //COM error?
+                        if (hResult == null)
+                        {
+
+                            //deserialize response and process success/error
+                            RsMsgSet rsMsgSet = new RsMsgSet();
+                            QBXML qbxml = rsMsgSet.Deserialize(responseXml);
+
+                            //TODO update paraquick entities based on response type
+                            foreach (var rsMsg in rsMsgSet)
                             {
-                                ServiceUtils.Response(db, efMessage, rsMsg);
-
-                                //allow implementor to do something with response
-                                OnResponse(db, efMessage, rsMsg);
-
-                                if (rsMsg.statusCode != "0")
+                                var efMessage = efSession.ParaquickMessages.Where(m => m.RequestId == rsMsg.requestID).FirstOrDefault();
+
+                                if (efMessage != null)
+                                {
+                                    ServiceUtils.Response(db, efMessage, rsMsg);
+
+                                    //allow implementor to do something with response
+                                    OnResponse(db, efMessage, rsMsg);
+
+                                    if (rsMsg.statusCode != "0")
+                                    {
+                                        //TODO stop on errors?
+                                    }
+
+                                }
+                                else
                                 {
                                     //TODO stop on errors?
+                                    Error(db, efSession, $"Can't find request ({rsMsg.requestID})");
                                 }

                             }
-                            else
-                            {
-                                //TODO stop on errors?
-                                Error(db, efSession, $"Can't find request ({rsMsg.requestID})");
-                            }
-
-                        }
-
-
-                        //TODO StopOnErrors? do we stop on errors here (return -1) or keep going?
-                        //report "%" - completed messages/total messages for session
-                        int pctComplete= ServiceUtils.CalculatePercentComplete(db, efSession);
-                        return pctComplete;
+
+
+                            //TODO StopOnErrors? do we stop on errors here (return -1) or keep going?
+                            //report "%" - completed messages/total messages for session
+                            int pctComplete = ServiceUtils.CalculatePercentComplete(db, efSession);
+                            return pctComplete;
+                        }
+                        else
+                        {
+                            Error(db, efSession, $"COM Error {hResult.Format()}");
+                        }
                     }

                 }


Tweak repel disc velocity inheritance.

Tweak repel disc velocity inheritance.

--- game/server/weapons/disc.repel.cs
+++ game/server/weapons/disc.repel.cs
@@ -34,10 +34,9 @@
 		%muzzleSpeed = %projectile.muzzleVelocity;

 		%muzzleVector = %player.getMuzzleVector(%slot);
-		%objectVelocity = %player.getVelocity();
 		%muzzleVelocity = VectorAdd(
 			VectorScale(%muzzleVector,  %muzzleSpeed),
-			VectorScale(%objectVelocity, %projectile.velInheritFactor));
+			VectorScale(%player.getVelocity(), %projectile.velInheritFactor));

 		// create the disc...
 		%disc = new (NortDisc)() {
@@ -96,7 +95,7 @@
 	muzzleVelocity		= 30;
     maxVelocity         = 75;
     acceleration        = 4;
-	velInheritFactor	= 1.0;
+	velInheritFactor	= 0.5;

 	armingDelay			= 0*1000;
 	lifetime				= 10*1000;


Removed duplicate logging

Removed duplicate logging

--- CopaceticSoftware.CodeGenerator.StarterKit/Infrastructure/VisualStudioSolution/SolutionManager.cs
+++ CopaceticSoftware.CodeGenerator.StarterKit/Infrastructure/VisualStudioSolution/SolutionManager.cs
@@ -296,10 +296,6 @@
             if (eventArgs is VisualStudioClassEventArgs && !(eventArgs as VisualStudioClassEventArgs).IsCSharpFile())
                 return;

-            _log.InfoFormat("Queued Event [{0}] from [{1}]",
-                eventArgs.GetDebugString(),
-                null == sender ? "null" : sender.ToString());
-
             lock (EventQueueLock)
             {
                 _pendingVisualStudioEvents.Add(eventArgs);


Improved DateTimeTypeDrawer

Improved DateTimeTypeDrawer

--- Entitas.Unity/Assets/Entitas.Unity/VisualDebugging/Entity/Editor/TypeDrawer/DateTimeTypeDrawer.cs
+++ Entitas.Unity/Assets/Entitas.Unity/VisualDebugging/Entity/Editor/TypeDrawer/DateTimeTypeDrawer.cs
@@ -8,8 +8,14 @@
             return type == typeof(DateTime);
         }

+        // Note: This is a very basic implementation. The ToString() method conversion will cut off milliseconds.
         public object DrawAndGetNewValue(Type type, string fieldName, object value, Entity entity, int index, IComponent component) {
-            return DateTime.Parse(EditorGUILayout.TextField(fieldName, value.ToString()));
+            var dateString = value.ToString();
+            var newDateString = EditorGUILayout.TextField(fieldName, dateString);
+
+            return newDateString != dateString
+                        ? DateTime.Parse(newDateString)
+                        : value;
         }
     }
 }


Updated due to the naming refactoring on NVelocity

git-svn-id: bab0c2de90ee11a20376049c2cdee62584491f34@4563 73e77b4c-caa6-f847-a29a-24ab75ae54b6

--- MonoRail/Castle.MonoRail.Framework.Views.NVelocity/CustomDirectives/AbstractComponentDirective.cs
+++ MonoRail/Castle.MonoRail.Framework.Views.NVelocity/CustomDirectives/AbstractComponentDirective.cs
@@ -89,9 +89,9 @@
 			 if (componentName.StartsWith("$"))
 			 {
 				String nodeContent = compNameNode.Literal.Trim('"', '\'');
-				SimpleNode inlineNode = rsvc.Parse(new StringReader(nodeContent), context.CurrentTemplateName, false);
-
-				inlineNode.Init(context, rsvc);
+				SimpleNode inlineNode = runtimeServices.Parse(new StringReader(nodeContent), context.CurrentTemplateName, false);
+
+				inlineNode.Init(context, runtimeServices);
 				componentName = (String) Evaluate(inlineNode, context);
 			}

@@ -283,9 +283,9 @@

 				if (parts.Length == 2 && parts[1].IndexOf("$") != -1)
 				{
-					SimpleNode inlineNode = rsvc.Parse(new StringReader(parts[1]), context.CurrentTemplateName, false);
-
-					inlineNode.Init(context, rsvc);
+					SimpleNode inlineNode = runtimeServices.Parse(new StringReader(parts[1]), context.CurrentTemplateName, false);
+
+					inlineNode.Init(context, runtimeServices);

 					entries[parts[0]] = Evaluate(inlineNode, context);
 				}
@@ -409,7 +409,7 @@

 		private Template GetTemplate(String viewToRender, String encoding)
 		{
-			return rsvc.GetTemplate(viewToRender, encoding);
+			return runtimeServices.GetTemplate(viewToRender, encoding);
 		}

 		private String ExtractEncoding(IInternalContextAdapter context)
@@ -424,7 +424,7 @@
 			}
 			else
 			{
-				encoding = (String) rsvc.GetProperty(RuntimeConstants.INPUT_ENCODING);
+				encoding = (String) runtimeServices.GetProperty(RuntimeConstants.INPUT_ENCODING);
 			}

 			return encoding;
@@ -434,7 +434,7 @@
 		{
 			Object[] templateStack = context.TemplateNameStack;

-			if (templateStack.Length >= rsvc.GetInt(RuntimeConstants.PARSE_DIRECTIVE_MAXDEPTH, 20))
+			if (templateStack.Length >= runtimeServices.GetInt(RuntimeConstants.PARSE_DIRECTIVE_MAXDEPTH, 20))
 			{
 				StringBuilder path = new StringBuilder();


added ReceivedPayments tests

added ReceivedPayments tests

--- WhenItsDone/Tests/LibTests/WhenItsDone.Data.Tests/WhenItsDoneDbContextTests/Constructor_Should.cs
+++ WhenItsDone/Tests/LibTests/WhenItsDone.Data.Tests/WhenItsDoneDbContextTests/Constructor_Should.cs
@@ -299,5 +299,44 @@

             Assert.That(clientsProperty.PropertyType, Is.EqualTo(typeof(IDbSet<PhotoItem>)));
         }
+
+        [Test]
+        public void ShouldCreateAValidInstance_WithReceivedPaymentsProperty()
+        {
+            var whenItsDoneDbContext = new WhenItsDoneDbContext();
+
+            var propertyName = "ReceivedPayments";
+            var bindingFlags = BindingFlags.Public | BindingFlags.Instance;
+
+            var clientsProperty = whenItsDoneDbContext.GetType().GetProperty(propertyName, bindingFlags);
+
+            Assert.That(clientsProperty, Is.Not.Null);
+        }
+
+        [Test]
+        public void ShouldCreateAValidInstance_WithReceivedPaymentsVirtualProperty()
+        {
+            var whenItsDoneDbContext = new WhenItsDoneDbContext();
+
+            var propertyName = "ReceivedPayments";
+            var bindingFlags = BindingFlags.Public | BindingFlags.Instance;
+
+            var clientsProperty = whenItsDoneDbContext.GetType().GetProperty(propertyName, bindingFlags);
+
+            Assert.That(clientsProperty.GetGetMethod().IsVirtual, Is.True);
+        }
+
+        [Test]
+        public void ShouldCreateAValidInstance_WithReceivedPaymentsVirtualProperty_OfTypeIDbSetReceivedPayments()
+        {
+            var whenItsDoneDbContext = new WhenItsDoneDbContext();
+
+            var propertyName = "ReceivedPayments";
+            var bindingFlags = BindingFlags.Public | BindingFlags.Instance;
+
+            var clientsProperty = whenItsDoneDbContext.GetType().GetProperty(propertyName, bindingFlags);
+
+            Assert.That(clientsProperty.PropertyType, Is.EqualTo(typeof(IDbSet<ReceivedPayment>)));
+        }
     }
 }


Update ExpressionEvaluator.cs

Update ExpressionEvaluator.cs

--- 6502.Net/ExpressionEvaluator.cs
+++ 6502.Net/ExpressionEvaluator.cs
@@ -509,8 +509,7 @@
                     if (CharEncoding != null)
                         convert = CharEncoding(b).ToString();
                     return convert;
-                },
-                IgnoreCase ? RegexOptions.IgnoreCase : RegexOptions.None);
+                });
             }

             expression = ReplaceSymbols(expression);


Add new LINQ operators

Add new LINQ operators

--- samples/code-samples/Queries/Program.cs
+++ samples/code-samples/Queries/Program.cs
@@ -105,6 +105,9 @@
             // Query with Intra-document Joins
             QueryWithJoins(collection.SelfLink);

+            // Query with string, math and array operators
+            QueryWithStringMathAndArrayOperators(collection.SelfLink);
+
             // Query with parameterized SQL using SqlQuerySpec
             QueryWithSqlQuerySpec(collection.SelfLink);

@@ -478,7 +481,7 @@
             }

             // LINQ
-            results = client.CreateDocumentQuery<Family>(collectionLink)
+            familiesChildrenAndPets = client.CreateDocumentQuery<Family>(collectionLink)
                     .SelectMany(family => family.Children
                     .SelectMany(child => child.Pets
                     .Select(pet => new
@@ -518,6 +521,33 @@
             {
                 Console.WriteLine(JsonConvert.SerializeObject(item));
             }
+        }
+
+        private static void QueryWithStringMathAndArrayOperators(string collectionLink)
+        {
+            // Find all families where the lastName starts with "An" -> should return the Andersens
+            IQueryable<Family> results = client.CreateDocumentQuery<Family>(collectionLink, "SELECT * FROM family WHERE STARTSWITH(family.LastName, 'An')");
+            Assert("Expected only 1 family", results.AsEnumerable().Count() == 1);
+
+            // Same query in LINQ. You can also use other operators like string.Contains(), string.EndsWith(), string.Trim(), etc.
+            results = client.CreateDocumentQuery<Family>(collectionLink).Where(family => family.LastName.StartsWith("An"));
+            Assert("Expected only 1 family", results.AsEnumerable().Count() == 1);
+
+            // Round down numbers using FLOOR
+            IQueryable<int> numericResults = client.CreateDocumentQuery<int>(collectionLink, "SELECT VALUE FLOOR(family.Children[0].Grade) FROM family");
+            Assert("Expected grades [5, 2]", numericResults.AsEnumerable().SequenceEqual(new [] { 5, 8 }));
+
+            // Same query in LINQ. You can also use other Math operators
+            numericResults = client.CreateDocumentQuery<Family>(collectionLink).Select(family => (int)Math.Round((double)family.Children[0].Grade));
+            Assert("Expected grades [5, 2]", numericResults.AsEnumerable().SequenceEqual(new[] { 5, 8 }));
+
+            // Get number of children using ARRAY_LENGTH
+            numericResults = client.CreateDocumentQuery<int>(collectionLink, "SELECT VALUE ARRAY_LENGTH(family.Children) FROM family");
+            Assert("Expected children count [1, 2]", numericResults.AsEnumerable().SequenceEqual(new[] { 1, 2 }));
+
+            // Same query in LINQ
+            numericResults = client.CreateDocumentQuery<Family>(collectionLink).Select(family => family.Children.Count());
+            Assert("Expected children count [1, 2]", numericResults.AsEnumerable().SequenceEqual(new[] { 1, 2 }));
         }

         private static async Task QueryWithPagingAsync(string collectionLink)


make ctrl+g general navigation key

make ctrl+g general navigation key

--- code/Configuration/UserStates/UserStateStandardConfiguraion.cs
+++ code/Configuration/UserStates/UserStateStandardConfiguraion.cs
@@ -35,13 +35,13 @@

 			var navs = new [] { "Home", "PageUp", "End", "Next", "Up", "Left", "Down", "Right" };
 			var navKeys = KeyboardConstants.CombineKeysWithStandardModifiers(navs);
+			navKeys.Add("G, Control");

 			if (commandLineArgs.UseVisualStudioNavigation)
 			{
 				navKeys.AddRange(KeyboardConstants.CombineKeysWithStandardModifiers(new[] {"F3", "F12"}));
 				navKeys.AddRange(KeyboardConstants.KeysCombinedWithCodeModifiers(new[] {"T", "F6", "F7", "F8"}));

-				navKeys.Add("G, Control");

 				navKeys.AddRange(KeyboardConstants.KeysCombinedWithControlAndShiftControl(new[] { "OemMinus", "Tab", "I" }));


On ease curve reset, set default ease values

--- APAnimatorComponent/PathData.cs
+++ APAnimatorComponent/PathData.cs
@@ -385,6 +385,8 @@
         public void ResetEaseCurve() {
             easeCurve = new AnimationCurve();
             UpdateCurveWithAddedKeys(EaseCurve);
+            // Set default value for each key.
+            UpdateEaseCurveValues(DefaultEaseCurveValue);
         }

         public void ResetPath() {


Dev OK

Dev OK

--- Ada/AdaBot/Dialogs/AdaDialog.cs
+++ Ada/AdaBot/Dialogs/AdaDialog.cs
@@ -41,7 +41,7 @@
             context.Wait(MessageReceived);
             message = $"Je suis constamment en apprentissage, je vais demander à mes créateurs de m'apprendre ta phrase ;)";
             await context.PostAsync(message);
-            context.Wait(MessageReceived);
+            context.Wait(MessageReceived);
         }

         [LuisIntent("SayHello")]


Tested returning multiple PDF labels.

Tested returning multiple PDF labels.

--- Agvise.Api.Tests/ApiUnitTest.cs
+++ Agvise.Api.Tests/ApiUnitTest.cs
@@ -27,7 +27,7 @@
         [TestMethod]
         public void TestGetSampleSubmissionLabels()
         {
-            byte[] bytes = client.GetSampleSubmissionLabels(new List<long>() { 202083 });
+            byte[] bytes = client.GetSampleSubmissionLabels(new List<long>() { 202083, 202111 });
             Assert.IsTrue(bytes.Length > 0);
             string path = Path.Combine(System.Environment.CurrentDirectory, Guid.NewGuid().ToString() + ".pdf");
             File.WriteAllBytes(path, bytes);


Fix misspelling

Fix misspelling


no logs switch description update

no logs switch description update

--- AppCompatCacheParser/Program.cs
+++ AppCompatCacheParser/Program.cs
@@ -118,7 +118,7 @@
             _fluentCommandLineParser.Setup(arg => arg.NoTransLogs)
                 .As("nl")
                 .WithDescription(
-                    "When true, look for and process transaction log files for dirty hives. Default is FALSE").SetDefault(false);
+                    "When true, ignore transaction log files for dirty hives. Default is FALSE").SetDefault(false);

             var header =
                 $"AppCompatCache Parser version {Assembly.GetExecutingAssembly().GetName().Version}" +


Use the Room object as the sender instead of the Websocket

--- Assets/Plugins/Colyseus/Room.cs
+++ Assets/Plugins/Colyseus/Room.cs
@@ -95,13 +95,13 @@

 			this.connection.OnClose += (object sender, EventArgs e) => {
 				if (this.OnLeave != null) {
-					this.OnLeave.Invoke (sender, e);
+					this.OnLeave.Invoke (this, e);
 				}
 			};

 			this.connection.OnError += (object sender, ErrorEventArgs e) => {
 				if (this.OnError != null) {
-					this.OnError.Invoke(sender, e);
+					this.OnError.Invoke(this, e);
 				}
 			};


Add frame counter

Add frame counter

--- Assets/Scripts/DosBox/DosBox.cs
+++ Assets/Scripts/DosBox/DosBox.cs
@@ -55,6 +55,7 @@
 	private int oldFramesCount;
 	private Queue<int> previousFramesCount = new Queue<int>();
 	private Queue<float> previousFrameTime = new Queue<float>();
+	private int frameCounter;

 	private float lastDelay;
 	private Timer delayCounter = new Timer();
@@ -436,7 +437,7 @@

 				BoxInfo.Append("Timer 1", "{0}.{1:D2}", TimeSpan.FromSeconds(InternalTimer1 / 60), InternalTimer1 % 60);
 				BoxInfo.Append("Timer 2", "{0}.{1:D2}", TimeSpan.FromSeconds(internalTimer2 / 60), internalTimer2 % 60);
-				BoxInfo.Append("FPS/Delay", "{0}; {1} ms", calculatedFps, Mathf.FloorToInt(lastDelay * 1000));
+				BoxInfo.Append("FPS/Frame/Delay", "{0}; {1}; {2} ms", calculatedFps, frameCounter, Mathf.FloorToInt(lastDelay * 1000));
 				BoxInfo.Append("Total delay", "{0:D2}:{1:D2}:{2:D2}.{3:D3} ", totalDelayTS.Hours, totalDelayTS.Minutes, totalDelayTS.Seconds, totalDelayTS.Milliseconds);
 			}

@@ -505,10 +506,11 @@
 			//check how much frames elapsed since last time
 			int diff;
 			if (frames >= oldFramesCount)
-				diff = frames - oldFramesCount; //eg: 15 - 20
+				diff = frames - oldFramesCount; //eg: 20 - 15
 			else
 				diff = fps - oldFramesCount + frames; //special case: eg: 60 - 58 + 3
 			oldFramesCount = frames;
+			frameCounter += diff;

 			if(delayCounter.Elapsed >= 0.1f) //100ms
 			{


Pass creativeId to the Reply constructor

--- Assets/Teak/TeakNotification.cs
+++ Assets/Teak/TeakNotification.cs
@@ -251,7 +251,7 @@
     /// @cond hide_from_doxygen
     private void SafePerformCallback(string method, System.Action<Reply> callback, string data, string status, string creativeId) {
         try {
-            callback(new Reply(status, data, null));
+            callback(new Reply(status, data, creativeId));
         } catch (Exception e) {
             Dictionary<string, object> extras = new Dictionary<string, object>();
             extras["data"] = data;


Unwrap complex if as switch

Unwrap complex if as switch

--- CPPCheckPlugin/ICodeAnalyzer.cs
+++ CPPCheckPlugin/ICodeAnalyzer.cs
@@ -135,12 +135,19 @@

 		protected string suppressionsFilePathByScope(SuppressionScope scope, string projectBasePath = null, string projectName = null)
 		{
-			if (scope == SuppressionScope.suppressThisTypeOfMessagesGlobally || scope == SuppressionScope.suppressAllMessagesThisFileGlobally || scope == SuppressionScope.suppressThisMessageGlobally)
-				return globalSuppressionsFilePath();
-			if (scope == SuppressionScope.suppressThisMessageSolutionWide || scope == SuppressionScope.suppressThisTypeOfMessagesSolutionWide || scope == SuppressionScope.suppressAllMessagesThisFileSolutionWide)
-				return solutionSuppressionsFilePath();
-			else
-				return projectSuppressionsFilePath(projectBasePath, projectName);
+			switch (scope)
+			{
+				case SuppressionScope.suppressThisMessageGlobally:
+				case SuppressionScope.suppressThisTypeOfMessagesGlobally:
+				case SuppressionScope.suppressAllMessagesThisFileGlobally:
+					return globalSuppressionsFilePath();
+				case SuppressionScope.suppressThisMessageSolutionWide:
+				case SuppressionScope.suppressThisTypeOfMessagesSolutionWide:
+				case SuppressionScope.suppressAllMessagesThisFileSolutionWide:
+					return solutionSuppressionsFilePath();
+				default:
+					return projectSuppressionsFilePath(projectBasePath, projectName);
+			}
 		}

 		private void abortThreadIfAny()


Add properties to Swapchain

Add properties to Swapchain

--- CSGL.Vulkan/Vulkan/Swapchain.cs
+++ CSGL.Vulkan/Vulkan/Swapchain.cs
@@ -37,6 +37,12 @@
         public Surface Surface { get; private set; }
         public Device Device { get; private set; }
         public IList<Image> Images { get; private set; }
+        public VkExtent2D Extent { get; private set; }
+        public VkFormat Format { get; private set; }
+        public VkPresentModeKHR PresentMode { get; private set; }
+        public VkColorSpaceKHR ColorSpace { get; private set; }
+        public VkImageUsageFlags Usage { get; private set; }
+        public VkSharingMode SharingMode { get; private set; }

         public VkSwapchainKHR Native {
             get {
@@ -106,6 +112,13 @@
                 var result = Device.Commands.createSwapchain(Device.Native, ref info, Device.Instance.AllocationCallbacks, out swapchain);
                 if (result != VkResult.Success) throw new SwapchainException(string.Format("Error creating swapchain: {0}", result));
             }
+
+            Format = info.imageFormat;
+            Extent = info.imageExtent;
+            PresentMode = info.presentMode;
+            ColorSpace = info.imageColorSpace;
+            Usage = info.imageUsage;
+            SharingMode = info.imageSharingMode;
         }

         public VkResult AcquireNextImage(ulong timeout, Semaphore semaphore, Fence fence, out uint index) {


Added hook call for InvasionNPCSpawn

Added hook call for InvasionNPCSpawn

--- tdsm-api/Callbacks/NPCCallback.cs
+++ tdsm-api/Callbacks/NPCCallback.cs
@@ -32,7 +32,14 @@

         public static void OnInvasionNPCSpawn(int x, int y)
         {
+            var ctx = new HookContext();
+            var args = new HookArgs.InvasionNPCSpawn()
+            {
+                X = x,
+                Y = y
+            };

+            HookPoints.InvasionNPCSpawn.Invoke(ref ctx, ref args);
         }
     }
 }


Updated comment for clarity

Updated comment for clarity

No longer going to use a primary and abbreviated title.

--- CkanDotNet.Api/Model/Package.cs
+++ CkanDotNet.Api/Model/Package.cs
@@ -33,7 +33,7 @@
         public string Name { get; set; }

         /// <summary>
-        /// Gets the primary title
+        /// Gets the dataset title
         /// </summary>
         public string Title { get; set; }


allow startKey and endKey

allow startKey and endKey

--- CouchTrafficClient/QueryBase.cs
+++ CouchTrafficClient/QueryBase.cs
@@ -63,25 +63,31 @@
         public abstract string Run();
     private string Server { get { return "http://52.10.252.48:5984/"; } }

-        /// <summary>
-        /// Query a view from our CouchDB Server, returning a Dictionary of keys to values!
-        /// </summary>
-        /// <param name="designDocumentName">Name of the Design that the View lives within.</param>
-        /// <param name="viewName">Name of the View that you would like to query.</param>
-        /// <param name="keys">Optional list of keys to query the view for.</param>
-        /// <returns></returns>
+    /// <summary>
+    /// Query a view from our CouchDB Server, returning a Dictionary of keys to values!
+    /// </summary>
+    /// <param name="designDocumentName">Name of the Design that the View lives within.</param>
+    /// <param name="viewName">Name of the View that you would like to query.</param>
+    /// <param name="keys">Optional list of keys to query the view for.</param>
+
+    /// <returns></returns>
     public MultiValueDictionary Query(string designDocumentName, string viewName, IList<object> keys = null, string db = "traffic")
     {
-        dynamic queryResult = InternalQuery(designDocumentName, viewName, keys, db);
-        IList<object> a = queryResult.rows;
-        var result = new MultiValueDictionary();
-        foreach (dynamic data in a)
-        {
-            result.Add(data.key == null ? QueryNullResult : data.key.ToString(), data.value);
-        }
-        return result;
+        return InternalQuery(designDocumentName, viewName, null, null, keys, db);
     }
-    private ExpandoObject InternalQuery(string designDocumentName, string viewName, IList<object> keys = null, string db = "traffic")
+    /// <summary>
+    /// Query a view from our CouchDB Server, returning a Dictionary of keys to values!
+    /// </summary>
+    /// <param name="designDocumentName">Name of the Design that the View lives within.</param>
+    /// <param name="viewName">Name of the View that you would like to query.</param>
+    /// <param name="startKey">Optional list of startkeys to query the view for.</param>
+    /// <param name="endKey">Optional list of endkeys to query the view for.</param>
+    /// <returns></returns>
+    public MultiValueDictionary Query(string designDocumentName, string viewName, object startKey, object endKey, string db = "traffic")
+    {
+        return InternalQuery(designDocumentName, viewName, startKey, endKey, null, db);
+    }
+    private MultiValueDictionary InternalQuery(string designDocumentName, string viewName, object startKey = null, object endKey = null, IList<object> keys = null, string db = "traffic")
     {
         try
         {
@@ -90,14 +96,34 @@
             {
                 keyString = string.Format("?keys={0}&group=true", Uri.EscapeDataString(JsonConvert.SerializeObject(keys)));
             }
+            else if (startKey != null && endKey != null)
+            {
+                keyString = string.Format("?startkey={0}&endkey={1}&group=true", Uri.EscapeDataString(JsonConvert.SerializeObject(startKey)), Uri.EscapeDataString(JsonConvert.SerializeObject(endKey)));
+            }
+            else if (startKey != null)
+            {
+                keyString = string.Format("?startkey={0}&group=true", Uri.EscapeDataString(JsonConvert.SerializeObject(startKey)));
+            }
+            else if (endKey != null)
+            {
+                keyString = string.Format("?endkey={0}&group=true", Uri.EscapeDataString(JsonConvert.SerializeObject(endKey)));
+            }
             var url = Server + db + "/_design/" + designDocumentName + "/_view/" + viewName + keyString;
+            dynamic queryResult;
             using (WebClient wc = new WebClient())
             {
                 wc.Encoding = System.Text.Encoding.UTF8;
                 wc.Headers["User-Agent"] = "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 2.0.50727; .NET4.0C; .NET4.0E)";
                 string str = wc.DownloadString(url);
-                return JsonConvert.DeserializeObject<ExpandoObject>(str);
+                queryResult = JsonConvert.DeserializeObject<ExpandoObject>(str);
             }
+            IList<object> a = queryResult.rows;
+            var result = new MultiValueDictionary();
+            foreach (dynamic data in a)
+            {
+                result.Add(data.key == null ? QueryNullResult : data.key.ToString(), data.value);
+            }
+            return result;
         }
         catch (Exception e)
         {


Revert "Test CFS failure"

Revert "Test CFS failure"

This reverts commit 6d1b9be7fd4d5a482ac04dd9f01e0fe051bde2ff.

--- osu.Game/OsuGame.cs
+++ osu.Game/OsuGame.cs
@@ -1,3 +1,6 @@
+// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
+// See the LICENCE file in the repository root for full licence text.
+
 using System;
 using System.Collections.Generic;
 using System.Diagnostics;


Remove unnecessary region and make methods public

--- osu.Game/OsuGame.cs
+++ osu.Game/OsuGame.cs
@@ -119,13 +119,11 @@

         private ScheduledDelegate scoreLoad;

-        #region chat link actions
-
-        internal void OpenChannel(string channelName) => chat.OpenChannel(chat.AvailableChannels.Find(c => c.Name == channelName));
-
-        internal void ShowBeatmapSet(int setId) => beatmapSetOverlay.ShowBeatmapSet(setId);
-
-        internal void LoadEditorTimestamp()
+        public void OpenChannel(string channelName) => chat.OpenChannel(chat.AvailableChannels.Find(c => c.Name == channelName));
+
+        public void ShowBeatmapSet(int setId) => beatmapSetOverlay.ShowBeatmapSet(setId);
+
+        public void LoadEditorTimestamp()
         {
             notifications.Post(new SimpleNotification
             {
@@ -134,7 +132,7 @@
             });
         }

-        internal void LoadSpectatorScreen()
+        public void LoadSpectatorScreen()
         {
             notifications.Post(new SimpleNotification
             {
@@ -143,7 +141,7 @@
             });
         }

-        internal void JoinMultiplayerMatch(int matchId)
+        public void JoinMultiplayerMatch(int matchId)
         {
             notifications.Post(new SimpleNotification
             {
@@ -151,8 +149,6 @@
                 Icon = FontAwesome.fa_life_saver,
             });
         }
-
-        #endregion

         protected void LoadScore(Score s)
         {


Fix import logic again

Fix import logic again

--- osu.Game/OsuGame.cs
+++ osu.Game/OsuGame.cs
@@ -311,7 +311,7 @@

             void loadScore()
             {
-                if (!menuScreen.IsCurrentScreen())
+                if (!menuScreen.IsCurrentScreen() || Beatmap.Disabled)
                 {
                     menuScreen.MakeCurrent();
                     this.Delay(500).Schedule(loadScore, out scoreLoad);


use user ID overload when its supposed to be used

Co-authored-by: Salman Ahmed <a7afa2b28823372a757eb860a4c7da8b68c3cb44@gmail.com>

--- osu.Game/OsuGame.cs
+++ osu.Game/OsuGame.cs
@@ -329,7 +329,11 @@
                     break;

                 case LinkAction.OpenUserProfile:
-                    ShowUser(link.Argument);
+                    if (int.TryParse(link.Argument, out var userId))
+                        ShowUser(userId);
+                    else
+                        ShowUser(link.Argument);
+
                     break;

                 case LinkAction.OpenWiki:


Added missing registration for ColumnBlock

--- core/Piranha/App.cs
+++ core/Piranha/App.cs
@@ -220,6 +220,7 @@

             // Compose block types
             Instance._blocks.Register<Extend.Blocks.AudioBlock>();
+            Instance._blocks.Register<Extend.Blocks.ColumnBlock>();
             Instance._blocks.Register<Extend.Blocks.HtmlBlock>();
             //Instance._blocks.Register<Extend.Blocks.HtmlColumnBlock>();
             Instance._blocks.Register<Extend.Blocks.ImageBlock>();


Add a timebox test

Add a timebox test

--- src/EditorFeatures/CSharpTest/Completion/CompletionProviders/TypeImportCompletionProviderTests.cs
+++ src/EditorFeatures/CSharpTest/Completion/CompletionProviders/TypeImportCompletionProviderTests.cs
@@ -1253,6 +1253,32 @@
             await VerifyCustomCommitProviderAsync(markup, "MyClass", expectedCodeAfterCommit, sourceCodeKind: kind);
         }

+        [Fact, Trait(Traits.Feature, Traits.Features.Completion)]
+        [WorkItem(36624, "https://github.com/dotnet/roslyn/issues/36624")]
+        public async Task DoNotShowImportItemsIfTimeout()
+        {
+            // Set timeout to 0 so it always timeout
+            AbstractTypeImportCompletionProvider.TimeoutInMilliseconds = 0;
+
+            var file1 = $@"
+namespace NS1
+{{
+    public class Bar
+    {{}}
+}}";
+            var file2 = @"
+namespace NS2
+{
+    class C
+    {
+         $$
+    }
+}";
+
+            var markup = CreateMarkupForSingleProject(file2, file1, LanguageNames.CSharp);
+            await VerifyTypeImportItemIsAbsentAsync(markup, "Bar", inlineDescription: "NS1");
+        }
+
         private static void AssertRelativeOrder(List<string> expectedTypesInRelativeOrder, ImmutableArray<CompletionItem> allCompletionItems)
         {
             var hashset = new HashSet<string>(expectedTypesInRelativeOrder);


Compat: Disallow boxing return type conversion by CreateDelegate() (#4653)

On CoreCLR,

   MethodInfo m = ..."Moo"..;
   m.CreateDelegate(typeof(Func<Object>))

   static int Moo() => 7;

throws an ArgumentException regarding a mismatching signature.

On Project N, the CreateDelegate() succeeds. But the celebration
turns into tears as soon as you invoke the delegate
as the hoped for boxing never occurs. Instead you get an unboxed
integer stored into a variable that expects an object reference.

--- src/System.Private.Reflection.Core/src/System/Reflection/Runtime/MethodInfos/RuntimeMethodInfo.cs
+++ src/System.Private.Reflection.Core/src/System/Reflection/Runtime/MethodInfos/RuntimeMethodInfo.cs
@@ -377,8 +377,16 @@
             MethodInfo invokeMethod = runtimeDelegateType.GetInvokeMethod();

             // Make sure the return type is assignment-compatible.
-            if (!IsAssignableFrom(executionEnvironment, invokeMethod.ReturnParameter.ParameterType, this.ReturnParameter.ParameterType))
+            Type expectedReturnType = ReturnParameter.ParameterType;
+            Type actualReturnType = invokeMethod.ReturnParameter.ParameterType;
+            if (!IsAssignableFrom(executionEnvironment, actualReturnType, expectedReturnType))
                 return null;
+            if (expectedReturnType.IsValueType && !actualReturnType.IsValueType)
+            {
+                // For value type returning methods, conversions between enums and primitives are allowed (and screened by the above call to IsAssignableFrom)
+                // but conversions to Object or interfaces implemented by the value type are not.
+                return null;
+            }

             IList<ParameterInfo> delegateParameters = invokeMethod.GetParametersNoCopy();
             IList<ParameterInfo> targetParameters = this.GetParametersNoCopy();


Use UnityWebRequest result comparisons (#51)

Co-authored-by: Jan Ivar Z. Carlsen <9f791933b998b9910abfd7689174a80db60363ca@outlook.com>

--- source/PluginDev/Assets/Extensions/CloudOnce/Providers/GooglePlayGames/GooglePlayGamesCloudProvider.cs
+++ source/PluginDev/Assets/Extensions/CloudOnce/Providers/GooglePlayGames/GooglePlayGamesCloudProvider.cs
@@ -414,11 +414,15 @@

         private IEnumerator DownloadPlayerImage(string url)
         {
-#if UNITY_2017_1_OR_NEWER
+#if UNITY_2017_2_OR_NEWER
             using (var request = UnityWebRequestTexture.GetTexture(url))
             {
                 yield return request.SendWebRequest();
+#if UNITY_2020_1_OR_NEWER
+                if (request.result == UnityWebRequest.Result.ConnectionError || request.result == UnityWebRequest.Result.ProtocolError)
+#else
                 if (request.isNetworkError || request.isHttpError)
+#endif
                 {
                     yield break;
                 }


Tests for multiple conversions. Different invocation fixes.

--- src/EditorFeatures/CSharpTest/Completion/CompletionProviders/OperatorIndexerCompletionProviderTests.cs
+++ src/EditorFeatures/CSharpTest/Completion/CompletionProviders/OperatorIndexerCompletionProviderTests.cs
@@ -102,6 +102,36 @@
 ", "(float)");
         }

+        [Fact, Trait(Traits.Feature, Traits.Features.Completion)]
+        [WorkItem(47511, "https://github.com/dotnet/roslyn/issues/47511")]
+
+        public async Task ExplicitUserDefinedConversionIsSuggestedForAllExplicitConversionsToOtherTypesAndNotForImplicitConversions()
+        {
+            var items = await GetCompletionItemsAsync(@"
+public class C
+{
+    public static explicit operator float(C c) => 0;
+    public static explicit operator int(C c) => 0;
+
+    public static explicit operator C(float f) => new C();
+    public static implicit operator C(string s) => new C();
+    public static implicit operator string(C c) => "";
+}
+
+public class Program
+{
+    public void Main()
+    {
+        var c = new C();
+        c.$$
+    }
+}
+", SourceCodeKind.Regular);
+            Assert.Collection(items,
+                i => Assert.Equal("(float)", i.DisplayText),
+                i => Assert.Equal("(int)", i.DisplayText));
+        }
+
         [WpfFact, Trait(Traits.Feature, Traits.Features.Completion)]
         [WorkItem(47511, "https://github.com/dotnet/roslyn/issues/47511")]
         public async Task ExplicitUserDefinedConversionIsApplied()
@@ -136,5 +166,46 @@
 }
 ");
         }
-    }
-}
+
+        [WpfTheory, Trait(Traits.Feature, Traits.Features.Completion)]
+        [WorkItem(47511, "https://github.com/dotnet/roslyn/issues/47511")]
+        [InlineData("c.$$", "((float)c).$$")]
+        [InlineData("c.$$;", "((float)c).$$;")]
+        [InlineData("var f = c.$$;", "var f = ((float)c).$$;")]
+        [InlineData("c?.$$", "((float)c)?.$$")]
+        [InlineData("((C)c).$$", "((float)((C)c)).$$")]
+        [InlineData("(true ? c : c).$$", "((float)(true ? c : c)).$$")]
+        public async Task ExplicitUserDefinedConversionIsAppliedForDifferentInvcations(string invocation, string fixedCode)
+        {
+            await VerifyCustomCommitProviderAsync($@"
+public class C
+{{
+    public static explicit operator float(C c) => 0;
+}}
+
+public class Program
+{{
+    public void Main()
+    {{
+        var c = new C();
+        {invocation}
+    }}
+}}
+", "(float)", @$"
+public class C
+{{
+    public static explicit operator float(C c) => 0;
+}}
+
+public class Program
+{{
+    public void Main()
+    {{
+        var c = new C();
+        {fixedCode}
+    }}
+}}
+");
+        }
+    }
+}


fix invalid token

fix invalid token


Clean up

Clean up

--- OpenStardriveServer.UnitTests/Domain/Systems/Defense/WarheadLauncher/WarheadLauncherSystemTests.cs
+++ OpenStardriveServer.UnitTests/Domain/Systems/Defense/WarheadLauncher/WarheadLauncherSystemTests.cs
@@ -1,4 +1,3 @@
-using System;
 using OpenStardriveServer.Domain.Systems;
 using OpenStardriveServer.Domain.Systems.Defense.WarheadLauncher;
 using OpenStardriveServer.Domain.Systems.Standard;


now disposing all UpdateManagers

now disposing all UpdateManagers

--- Drachenhorn.Desktop/App.xaml.cs
+++ Drachenhorn.Desktop/App.xaml.cs
@@ -326,6 +326,8 @@
                     this.Shutdown();
                 });

+            mgr.Dispose();
+
             var thread = new Thread(()  => UpdateSquirrel());
             thread.IsBackground = true;
             thread.Start();


Organize SQLiteDBClass into regions

Organize SQLiteDBClass into regions

--- EDDiscovery/DB/SQLiteDBClass.cs
+++ EDDiscovery/DB/SQLiteDBClass.cs
@@ -368,37 +368,27 @@

     public static class SQLiteDBClass
     {
+        #region Private properties / fields
         private static DbProviderFactory _factory;
-        public static DbProviderFactory DbFactory
-        {
-            get
-            {
-                if (_factory == null)
-                {
-                    _factory = new SQLiteFactory();
-                }
-                return _factory;
-            }
-        }
-
-        public static DbConnection CreateCN()
-        {
-            lock (lockDBInit)                                           // one at a time chaps
-            {
-                if (_factory == null)                                        // first one to ask for a connection sets the db up
-                {
-                    InitializeDatabase();
-                }
-            }
-
-            DbConnection cn = DbFactory.CreateConnection();
-            cn.ConnectionString = constring;
-            return cn;
-        }
-
         private static Object lockDBInit = new Object();                    // lock to sequence construction
         private static string constring;                                           // connection string to use..
-
+        #endregion
+
+        #region Public properties
+        public static DbProviderFactory DbFactory
+        {
+            get
+            {
+                if (_factory == null)
+                {
+                    _factory = new SQLiteFactory();
+                }
+                return _factory;
+            }
+        }
+        #endregion
+
+        #region Database Initialization
         private static void InitializeDatabase()
         {
             string dbfile = GetSQLiteDBFile();
@@ -714,6 +704,23 @@

             PerformUpgrade(conn, 19, true, true, new[] { query1, query2, query3, query4 });
         }
+        #endregion
+
+            #region Database access
+        public static DbConnection CreateCN()
+        {
+            lock (lockDBInit)                                           // one at a time chaps
+            {
+                if (_factory == null)                                        // first one to ask for a connection sets the db up
+                {
+                    InitializeDatabase();
+                }
+            }
+
+            DbConnection cn = DbFactory.CreateConnection();
+            cn.ConnectionString = constring;
+            return cn;
+        }

         ///----------------------------
         /// STATIC code helpers for other DB classes
@@ -765,7 +772,9 @@
                 throw;
             }
         }
-
+        #endregion
+
+        #region Settings
         ///----------------------------
         /// STATIC functions for discrete values

@@ -1107,6 +1116,6 @@
                 return false;
             }
         }
-
+        #endregion
     }
 }


bug fixing in Precompiler

bug fixing in Precompiler

--- cscs/Precompiler.cs
+++ cscs/Precompiler.cs
@@ -655,27 +655,16 @@
                 return m_depth + "var " + functionName;
             }
             bool firstString = tokens[0].Contains("\"");
-            bool secondString = true;
-            for (int i = 1; i < tokens.Count; i++)
-            {
-                string token = tokens[i];
-                Variable.VarType type = GetVariableType(token);
-                if (type != Variable.VarType.NONE)
-                {
-                    secondString = type != Variable.VarType.NUMBER;
-                    break;
-                }
-            }
             string expr = m_depth;
-            string param1 = firstString ? "string" : "double";
-            string param2 = secondString ? "string" : "double";
+
+            string param = firstString ? "string" : "double";
             if (!firstString)
             {
-                expr += "List<" + param2 + "> " + functionName + " = new List<" + param2 + "> ();\n";
+                expr += "List<" + param + "> " + functionName + " = new List<" + param + "> ();\n";
             }
             else
             {
-                expr += "Dictionary<string," + param2 + "> " + functionName + " = new Dictionary<string," + param2 + "> ();\n";
+                expr += "Dictionary<string," + param + "> " + functionName + " = new Dictionary<string," + param + "> ();\n";
             }

             int position = -1;
@@ -724,7 +713,22 @@
                 {
                     token = ProcessElIf(token);
                 }
-                result += token;
+
+                if (token == "new")
+                {
+                    var argsStr = "";
+                    for (int i = id + 1; i < tokens.Count; i++)
+                    {
+                        argsStr += tokens[i].Trim().Replace("\"", "\\\"");
+                    }
+                    string tempFunc = GetCSCSFunction(argsStr, token);
+                    id = tokens.Count - 1;
+                    result = tempFunc + result + " __current;";
+                }
+                else
+                {
+                    result += token;
+                }
                 return token;
             }
             if (Array.IndexOf(Constants.ACTIONS, token) >= 0)
@@ -792,7 +796,7 @@
             int paramEnd = functionName.LastIndexOf(Constants.END_ARG);
             if (paramEnd < 0)
             {
-                paramEnd = functionName.IndexOf("=");
+                paramEnd = functionName.IndexOf('=');
             }
             if (paramEnd >= 0)
             {
@@ -865,6 +869,30 @@
                 sb.AppendLine("    __action =\"\";");
             }

+            sb.AppendLine(GetCSCSFunction(argsStr,  functionName, ch));
+
+            token = sb.ToString();
+            if (tokens.Count >= 3 && tokens[1] == "=" && !string.IsNullOrWhiteSpace(result))
+            {
+                result = token + result + " __current;\n";
+                newVarAdded = true;
+            }
+            else
+            {
+                result += token;
+            }
+
+            return token;
+        }
+
+        string GetCSCSFunction(string argsStr, string functionName, char ch = '(')
+        {
+            StringBuilder sb = new StringBuilder();
+            if (!string.IsNullOrWhiteSpace(argsStr) && argsStr.Last() == '"' && argsStr.First() == '"')
+            {
+                argsStr = "\\\"" + argsStr.Substring(1, argsStr.Length - 2) + "\\\"";
+            }
+
             sb.AppendLine("    __argsStr =\"" + argsStr + "\";");
             sb.AppendLine("    __script = new ParsingScript(__argsStr);");
             sb.AppendLine("    __func = new ParserFunction(__script, \"" + functionName + "\", '" + ch + "', ref __action);");
@@ -878,19 +906,7 @@
             {
                 sb.AppendLine("    __current = __func.GetValue(__script).AsString();");
             }
-
-            token = sb.ToString();
-            if (tokens.Count >= 3 && tokens[1] == "=" && !string.IsNullOrWhiteSpace(result))
-            {
-                result = token + result + " __current;\n";
-                newVarAdded = true;
-            }
-            else
-            {
-                result += token;
-            }
-
-            return token;
+            return sb.ToString();
         }

         bool ProcessArray(string paramName, string functionName, ref string result)
@@ -911,7 +927,7 @@
         {
             arrayName = paramName;
             arrayArg = "";
-            int paramStart = paramName.IndexOf("[");
+            int paramStart = paramName.IndexOf('[');
             if (paramStart > 0)
             {
                 arrayName = paramName.Substring(0, paramStart);
@@ -924,7 +940,7 @@
         {
             arrayName = mappingName = paramName;
             arrayArg = "";
-            int paramStart = paramName.IndexOf("[");
+            int paramStart = paramName.IndexOf('[');
             if (paramStart > 0)
             {
                 arrayName = paramName.Substring(0, paramStart);


set working directory

set working directory

--- EyeInTheSky/Commands/Version.cs
+++ EyeInTheSky/Commands/Version.cs
@@ -30,7 +30,9 @@
                                             UseShellExecute = false,
                                             RedirectStandardOutput = true,
                                             FileName = "git",
-                                            Arguments = "describe"
+                                            Arguments = "describe",
+                                            WorkingDirectory = bindir
+
                                         }
                                 };
                 p.Start();


Added cheating routine which will randomly attempt to cheat if compiled with CHEAT_RANDOM

--- FEClient/Forms/ReceiveDialog.cs
+++ FEClient/Forms/ReceiveDialog.cs
@@ -29,6 +29,11 @@
         private bool _terminated;
         private bool receiveTerminated;
         private string newName;
+#if CHEAT_RANDOM
+        private int count;
+        private readonly int cheatat;
+#endif
+

         public ReceiveDialog(NotifyRequestEventArgs startObj)
         {
@@ -65,6 +70,12 @@
             _logWriter.WriteLine("Local Public Key");
             _logWriter.WriteLine(Rsa.PublicKey);

+#if CHEAT_RANDOM
+            _logWriter.WriteLine("Also attempting to cheat using RANDOM");
+            cheatat = NotMyCode.RandomNumber.Value(500, 1500);
+            _logWriter.WriteLine("Cheating at " + cheatat);
+#endif
+

             saveFileDialog.FileName = _fileName;
             saveFileDialog.DefaultExt = new FileInfo(_fileName).Extension;
@@ -88,6 +99,20 @@
             }
             _logWriter.WriteLineAsync("Received Key: " + e.Key);
             _dict.Push(e.Key);
+
+#if CHEAT_RANDOM
+            if(count++ == cheatat)
+            {
+                _logWriter.WriteLineAsync("Attempting to cheat using last given code");
+                Invoke ((MethodInvoker) delegate
+                {
+                    progressLabel.Text = "Attempting to cheat!";
+                    Decrypt();
+                });
+
+            return;
+            }
+#endif
             e.HasSet = true;

             Invoke((MethodInvoker) delegate


Adds syntax sugar for token refresh

Adds syntax sugar for token refresh

--- Fitbit.Portable/FitbitClient.cs
+++ Fitbit.Portable/FitbitClient.cs
@@ -56,7 +56,6 @@
             ConfigureTokenManager(tokenManager);

             CreateHttpClientForOAuth2();
-
         }

         /// <summary>
@@ -94,6 +93,11 @@
         {
             AuthenticationHeaderValue authenticationHeaderValue = new AuthenticationHeaderValue("Bearer", this.AccessToken.Token);
             this.HttpClient.DefaultRequestHeaders.Authorization = authenticationHeaderValue;
+        }
+
+        public async Task<OAuth2AccessToken> RefreshOAuth2Token()
+        {
+            return await this.TokenManager.RefreshToken(this);
         }

         /// <summary>


Just a warning

Just a warning

--- Cirrious/Location/Cirrious.MvvmCross.Plugins.Location.WindowsPhone/MvxWindowsPhoneGeoLocationWatcher.cs
+++ Cirrious/Location/Cirrious.MvvmCross.Plugins.Location.WindowsPhone/MvxWindowsPhoneGeoLocationWatcher.cs
@@ -88,6 +88,8 @@
             coords.Speed = coordinate.Speed;
             coords.Accuracy = coordinate.HorizontalAccuracy;
             coords.AltitudeAccuracy = coordinate.VerticalAccuracy;
+
+#warning Heading needed?

             return position;
         }


Well done, latest commit destroyed the functionality.

--- wallabag/wallabag.Shared/App.xaml.cs
+++ wallabag/wallabag.Shared/App.xaml.cs
@@ -3,6 +3,8 @@
 using Windows.ApplicationModel.Activation;
 using Windows.UI.Xaml;
 using Windows.UI.Xaml.Controls;
+using Windows.UI.Xaml.Media.Animation;
+using Windows.UI.Xaml.Navigation;

 namespace wallabag
 {


Improvements related with connection (#314)

--- nanoFramework.Tools.DebugLibrary.Shared/WireProtocol/Engine.cs
+++ nanoFramework.Tools.DebugLibrary.Shared/WireProtocol/Engine.cs
@@ -158,9 +158,9 @@
         public ConnectionSource ConnectionSource { get => _connectionSource; set => _connectionSource = value; }
 #pragma warning restore S2292 // Trivial properties should be auto-implemented

-        public bool IsConnectedTonanoCLR => _connectionSource == ConnectionSource.nanoCLR;
-
-        public bool IsConnectedTonanoBooter => _connectionSource == ConnectionSource.nanoBooter;
+        public bool IsConnectedTonanoCLR => IsConnected && _connectionSource == ConnectionSource.nanoCLR;
+
+        public bool IsConnectedTonanoBooter => IsConnected && _connectionSource == ConnectionSource.nanoBooter;

         public bool IsTargetBigEndian { get; internal set; }

@@ -445,6 +445,8 @@
                     return false;
                 }

+                Thread.Sleep(10);
+
                 // get state flags to set
                 Commands.DebuggingExecutionChangeConditions.State stateFlagsToSet = Commands.DebuggingExecutionChangeConditions.State.SourceLevelDebugging;

@@ -959,6 +961,9 @@
             if (_state.SetValue(EngineState.Value.Stopping, false))
             {
                 StopProcessing();
+
+                // need to reset flag
+                _connectionSource = ConnectionSource.Unknown;

                 IsConnected = false;

@@ -1804,6 +1809,8 @@
                     log?.Report($"ERROR: No activity detected from device after reboot...");

                     rebootSuccessful = false;
+
+                    ConnectionSource = ConnectionSource.Unknown;
                 }
             }
 #if DEBUG


made default data json instead of xml

made default data json instead of xml

--- scylla-todo/scylla-todo/Global.asax.cs
+++ scylla-todo/scylla-todo/Global.asax.cs
@@ -1,4 +1,6 @@
 using System;
+using System.Diagnostics.CodeAnalysis;
+using System.Linq;
 using System.Web;
 using System.Web.Http;
 using Autofac;
@@ -12,14 +14,25 @@
 		protected void Application_Start(object sender, EventArgs e)
 		{
 			ConfigureRouteMapping();
-
+			ConfigureFormatters();
 			ConfigureDependencyInjectionContainer();
 		}

+		private static void ConfigureFormatters()
+		{
+			var appXmlType = GlobalConfiguration.Configuration.Formatters.XmlFormatter.SupportedMediaTypes.FirstOrDefault(t => t.MediaType == "application/xml");
+			GlobalConfiguration.Configuration.Formatters.XmlFormatter.SupportedMediaTypes.Remove(appXmlType);
+		}
+
+		[SuppressMessage("ReSharper", "RedundantArgumentNameForLiteralExpression")]
+		[SuppressMessage("ReSharper", "RedundantArgumentName")]
 		private static void ConfigureRouteMapping()
 		{
 			GlobalConfiguration.Configuration.Routes
-				.MapHttpRoute("Default", "{controller}/{id}", new {id = RouteParameter.Optional});
+				.MapHttpRoute(
+					name: "Default",
+					routeTemplate: "api/{controller}/{id}",
+					defaults: new {id = RouteParameter.Optional});
 		}

 		private static void ConfigureDependencyInjectionContainer()


add property to gameobject

add property to gameobject

--- Game/StopTheBunny/GameObject.cs
+++ Game/StopTheBunny/GameObject.cs
@@ -3,22 +3,7 @@

     public abstract class GameObject
     {
-        protected int posiotionX;
-        protected int positionY;
-
-        public int PositionX
-        {
-            get { return this.posiotionX; }
-            set
-            {
-                if (value<0 || value>)
-                {
-
-                }
-            }
-        }
-
-        public abstract int PositionY { get; set; }
+        public UpperLeftPoint UpperLeftPoint { get; set; }

         public abstract char Sign { get; set; }


优化Fsm的内存分配

优化Fsm的内存分配

--- GameFramework/Fsm/FsmManager.cs
+++ GameFramework/Fsm/FsmManager.cs
@@ -253,14 +253,14 @@
         /// <returns>要创建的有限状态机。</returns>
         public IFsm<T> CreateFsm<T>(string name, T owner, params FsmState<T>[] states) where T : class
         {
-            TypeNamePair typeNameKey = new TypeNamePair(typeof(T), name);
+            TypeNamePair typeNamePair = new TypeNamePair(typeof(T), name);
             if (HasFsm<T>(name))
             {
-                throw new GameFrameworkException(Utility.Text.Format("Already exist FSM '{0}'.", typeNameKey.ToString()));
+                throw new GameFrameworkException(Utility.Text.Format("Already exist FSM '{0}'.", typeNamePair.ToString()));
             }

             Fsm<T> fsm = Fsm<T>.Create(name, owner, states);
-            m_Fsms.Add(typeNameKey, fsm);
+            m_Fsms.Add(typeNamePair, fsm);
             return fsm;
         }

@@ -286,14 +286,14 @@
         /// <returns>要创建的有限状态机。</returns>
         public IFsm<T> CreateFsm<T>(string name, T owner, List<FsmState<T>> states) where T : class
         {
-            TypeNamePair typeNameKey = new TypeNamePair(typeof(T), name);
+            TypeNamePair typeNamePair = new TypeNamePair(typeof(T), name);
             if (HasFsm<T>(name))
             {
-                throw new GameFrameworkException(Utility.Text.Format("Already exist FSM '{0}'.", typeNameKey));
+                throw new GameFrameworkException(Utility.Text.Format("Already exist FSM '{0}'.", typeNamePair));
             }

             Fsm<T> fsm = Fsm<T>.Create(name, owner, states);
-            m_Fsms.Add(typeNameKey, fsm);
+            m_Fsms.Add(typeNamePair, fsm);
             return fsm;
         }

@@ -380,15 +380,15 @@
             return InternalDestroyFsm(new TypeNamePair(fsm.OwnerType, fsm.Name));
         }

-        private bool InternalHasFsm(TypeNamePair typeNameKey)
-        {
-            return m_Fsms.ContainsKey(typeNameKey);
-        }
-
-        private FsmBase InternalGetFsm(TypeNamePair typeNameKey)
+        private bool InternalHasFsm(TypeNamePair typeNamePair)
+        {
+            return m_Fsms.ContainsKey(typeNamePair);
+        }
+
+        private FsmBase InternalGetFsm(TypeNamePair typeNamePair)
         {
             FsmBase fsm = null;
-            if (m_Fsms.TryGetValue(typeNameKey, out fsm))
+            if (m_Fsms.TryGetValue(typeNamePair, out fsm))
             {
                 return fsm;
             }
@@ -396,13 +396,13 @@
             return null;
         }

-        private bool InternalDestroyFsm(TypeNamePair typeNameKey)
+        private bool InternalDestroyFsm(TypeNamePair typeNamePair)
         {
             FsmBase fsm = null;
-            if (m_Fsms.TryGetValue(typeNameKey, out fsm))
+            if (m_Fsms.TryGetValue(typeNamePair, out fsm))
             {
                 fsm.Shutdown();
-                return m_Fsms.Remove(typeNameKey);
+                return m_Fsms.Remove(typeNamePair);
             }

             return false;


Saving calibration data to file is configurable now

--- GazePlusMouse/GazeCalibrator.cs
+++ GazePlusMouse/GazeCalibrator.cs
@@ -22,6 +22,7 @@
         WarpPointer warp;
         MouseController controller;
         List<Event> events;
+        bool saveToFile = true;

         public GazeCalibrator(MouseController controller, WarpPointer warp)
         {
@@ -49,10 +50,13 @@
                 Event evt = new Event() { time = System.DateTime.Now, location = curr, delta = d };
                 events.Add(evt);

-                var csv = new StringBuilder();
-                var newLine = string.Format("{0},{1},{2},{3},{4}", System.DateTime.Now, curr.X, curr.Y, d.X, d.Y);
-                csv.AppendLine(newLine);
-                File.AppendAllText("CalibrationData.csv", csv.ToString());
+                if (saveToFile)
+                {
+                    var csv = new StringBuilder();
+                    var newLine = string.Format("{0},{1},{2},{3},{4}", System.DateTime.Now, curr.X, curr.Y, d.X, d.Y);
+                    csv.AppendLine(newLine);
+                    File.AppendAllText("CalibrationData.csv", csv.ToString());
+                }
             }
         }
     }


:bug: Find.InPath, when validating executable on !windows,   should actually attempt to validate executable, not   just return null

--- source/Utils/PeanutButter.Utils/Find.cs
+++ source/Utils/PeanutButter.Utils/Find.cs
@@ -36,7 +36,22 @@
                 return filePath;
             }

-            return null;
+            using (var io = new ProcessIO("ls", "-l", filePath))
+            {
+                if (!io.Started)
+                {
+                    return null;
+                }
+
+                var first = io.StandardOutput.FirstOrDefault();
+                if (first == null)
+                {
+                    return null;
+                }
+                var parts = first.Split(' ');
+                // look for the attribs section, and assume executable if any 'x'
+                return parts[0].Contains("x") ? filePath : null;
+            }
         }

         private static string[] GenerateWindowsExecutableExtensionsList()


Fix up initial scale of DrawableRepeatPoint

--- osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs
+++ osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs
@@ -47,16 +47,20 @@
                 AddJudgement(new OsuJudgement { Result = drawableSlider.Tracking ? HitResult.Great : HitResult.Miss });
         }

+        protected override void UpdateInitialState()
+        {
+            base.UpdateInitialState();
+
+            Scale = new Vector2(0.5f);
+        }
+
         protected override void UpdatePreemptState()
         {
             var animIn = Math.Min(150, repeatPoint.StartTime - FadeInTime);

-            this.Animate(
-                d => d.FadeIn(animIn),
-                d => d.ScaleTo(0.5f).ScaleTo(1.2f, animIn)
-            ).Then(
-                d => d.ScaleTo(1, 150, Easing.Out)
-            );
+            this.FadeIn(animIn).ScaleTo(1.2f, animIn)
+                .Then()
+                .ScaleTo(1, 150, Easing.Out);
         }

         protected override void UpdateCurrentState(ArmedState state)


Add test coverage

Add test coverage

--- osu.Game.Tests/Visual/Navigation/TestScenePerformFromScreen.cs
+++ osu.Game.Tests/Visual/Navigation/TestScenePerformFromScreen.cs
@@ -4,6 +4,7 @@
 #nullable disable

 using System.Linq;
+using System.Threading;
 using NUnit.Framework;
 using osu.Framework.Allocation;
 using osu.Framework.Extensions;
@@ -86,6 +87,19 @@
         }

         [Test]
+        public void TestPerformEnsuresScreenIsLoaded()
+        {
+            TestLoadBlockingScreen screen = null;
+
+            AddStep("push blocking screen", () => Game.ScreenStack.Push(screen = new TestLoadBlockingScreen()));
+            AddStep("perform", () => Game.PerformFromScreen(_ => actionPerformed = true, new[] { typeof(TestLoadBlockingScreen) }));
+            AddAssert("action not performed", () => !actionPerformed);
+
+            AddStep("allow load", () => screen.LoadEvent.Set());
+            AddUntilStep("action performed", () => actionPerformed);
+        }
+
+        [Test]
         public void TestOverlaysAlwaysClosed()
         {
             ChatOverlay chat = null;
@@ -270,5 +284,16 @@
                 return base.OnExiting(e);
             }
         }
+
+        public class TestLoadBlockingScreen : OsuScreen
+        {
+            public readonly ManualResetEventSlim LoadEvent = new ManualResetEventSlim();
+
+            [BackgroundDependencyLoader]
+            private void load()
+            {
+                LoadEvent.Wait(10000);
+            }
+        }
     }
 }


Fix parameter naming

Fix parameter naming

--- osu.Game.Tests/Visual/UserInterface/TestSceneOverlayHeaders.cs
+++ osu.Game.Tests/Visual/UserInterface/TestSceneOverlayHeaders.cs
@@ -76,10 +76,10 @@
                         Margin = new MarginPadding(20),
                         Text = name,
                     },
-                    header.With(header =>
+                    header.With(h =>
                     {
-                        header.Anchor = Anchor.TopCentre;
-                        header.Origin = Anchor.TopCentre;
+                        h.Anchor = Anchor.TopCentre;
+                        h.Origin = Anchor.TopCentre;
                     })
                 }
             });


removed second installer line

removed second installer line

--- src/CommitmentsV2/SFA.DAS.CommitmentsV2.MessageHandlers/NServiceBus/ServiceCollectionExtensions.cs
+++ src/CommitmentsV2/SFA.DAS.CommitmentsV2.MessageHandlers/NServiceBus/ServiceCollectionExtensions.cs
@@ -44,7 +44,6 @@
                         .UseNLogFactory()
                         //.UseOutbox()
                         .UseSqlServerPersistence(() => container.GetInstance<DbConnection>())
-                        .UseInstallers()
                         .UseStructureMapBuilder(container)
                         .UseUnitOfWork();


Formatting.

Formatting.

--- src/Features/Core/Portable/EmbeddedLanguages/RegularExpressions/RegexEmbeddedCompletionProvider.cs
+++ src/Features/Core/Portable/EmbeddedLanguages/RegularExpressions/RegexEmbeddedCompletionProvider.cs
@@ -191,7 +191,7 @@
             context.AddIfMissing("^", Regex_start_of_string_or_line_short, Regex_start_of_string_or_line_long, parentOpt: null);
             context.AddIfMissing("$", Regex_end_of_string_or_line_short, Regex_end_of_string_or_line_long, parentOpt: null);
             context.AddIfMissing(".", Regex_any_character_group_short, Regex_any_character_group_long, parentOpt: null);
-
+
             context.AddIfMissing("*", Regex_match_zero_or_more_times_short, Regex_match_zero_or_more_times_long, parentOpt: null);
             context.AddIfMissing("*?", Regex_match_zero_or_more_times_lazy_short, Regex_match_zero_or_more_times_lazy_long, parentOpt: null);

@@ -292,7 +292,7 @@
             {
                 return;
             }
-
+
             context.AddIfMissing($"(  {Regex_subexpression}  )", Regex_matched_subexpression_short, Regex_matched_subexpression_long, parentOpt, positionOffset: "(".Length, insertionText: "()");
             context.AddIfMissing($"(?<  {Regex_name}  >  {Regex_subexpression}  )", Regex_named_matched_subexpression_short, Regex_named_matched_subexpression_long, parentOpt, positionOffset: "(?<".Length, insertionText: "(?<>)");
             context.AddIfMissing($"(?<  {Regex_name1}  -  {Regex_name2}  >  {Regex_subexpression}  )", Regex_balancing_group_short, Regex_balancing_group_long, parentOpt, positionOffset: "(?<".Length, insertionText: "(?<->)");
@@ -393,9 +393,9 @@
         }

         private RegexItem CreateItem(
-            SyntaxToken stringToken, string displayText,
+            SyntaxToken stringToken, string displayText,
             string suffix, string description,
-            EmbeddedCompletionContext context, RegexNode parentOpt,
+            EmbeddedCompletionContext context, RegexNode parentOpt,
             int? positionOffset, string insertionText)
         {
             var replacementStart = parentOpt != null


move  async methods after corresponding sync methods #32

--- src/Infrastructure/Riganti.Utils.Infrastructure.Services/Facades/TemporalRelationshipCrudFacade.cs
+++ src/Infrastructure/Riganti.Utils.Infrastructure.Services/Facades/TemporalRelationshipCrudFacade.cs
@@ -229,6 +229,29 @@
         /// <summary>
         /// Removes a member from the relationship. All current members received by <see cref="SecondaryDTOKeySelector" /> will be invalidated.
         /// </summary>
+        public async Task DeleteAsync(TKey id, CancellationToken cancellationToken = default)
+        {
+            cancellationToken.ThrowIfCancellationRequested();
+
+            using (var uow = UnitOfWorkProvider.Create())
+            {
+                var entity = Repository.GetById(id);
+                if (entity == null)
+                {
+                    // entity was not found, nothing to delete
+                    return;
+                }
+
+                var relationshipDto = entityMapper.MapToDTO(entity);
+                await DeleteAsync(relationshipDto, cancellationToken);
+
+                await uow.CommitAsync(cancellationToken);
+            }
+        }
+
+        /// <summary>
+        /// Removes a member from the relationship. All current members received by <see cref="SecondaryDTOKeySelector" /> will be invalidated.
+        /// </summary>
         public void Delete(TRelationshipDTO relationship)
         {
             using (var uow = UnitOfWorkProvider.Create())
@@ -244,30 +267,7 @@
                 uow.Commit();
             }
         }
-
-        /// <summary>
-        /// Removes a member from the relationship. All current members received by <see cref="SecondaryDTOKeySelector" /> will be invalidated.
-        /// </summary>
-        public async Task DeleteAsync(TKey id, CancellationToken cancellationToken = default)
-        {
-            cancellationToken.ThrowIfCancellationRequested();
-
-            using (var uow = UnitOfWorkProvider.Create())
-            {
-                var entity = Repository.GetById(id);
-                if (entity == null)
-                {
-                    // entity was not found, nothing to delete
-                    return;
-                }
-
-                var relationshipDto = entityMapper.MapToDTO(entity);
-                await DeleteAsync(relationshipDto, cancellationToken);
-
-                await uow.CommitAsync(cancellationToken);
-            }
-        }
-
+
         /// <summary>
         /// Removes a member from the relationship. All current members received by <see cref="SecondaryDTOKeySelector" /> will be invalidated.
         /// </summary>
@@ -289,6 +289,17 @@
             }
         }

+        private ICollection<TRelationshipEntity> GetRelationshipCollection(TRelationshipDTO relationship)
+        {
+            var parentId = ParentDTOKeySelector(relationship);
+            var includes = AdditionalParentIncludes.Concat(new[] { ConvertToIncludesExpression(RelationshipCollectionSelector) }).ToArray();
+            var parentEntity = ParentRepository.GetById(parentId, includes);
+            ValidateModifyPermissions(parentEntity);
+
+            var relationshipCollection = RelationshipCollectionSelector.Compile()(parentEntity);
+            return relationshipCollection;
+        }
+
         private async Task<ICollection<TRelationshipEntity>> GetRelationshipCollectionAsync(TRelationshipDTO relationship, CancellationToken cancellationToken = default)
         {
             cancellationToken.ThrowIfCancellationRequested();
@@ -302,19 +313,6 @@
             return relationshipCollection;
         }

-
-        private ICollection<TRelationshipEntity> GetRelationshipCollection(TRelationshipDTO relationship)
-        {
-            var parentId = ParentDTOKeySelector(relationship);
-            var includes = AdditionalParentIncludes.Concat(new[] { ConvertToIncludesExpression(RelationshipCollectionSelector) }).ToArray();
-            var parentEntity = ParentRepository.GetById(parentId, includes);
-            ValidateModifyPermissions(parentEntity);
-
-            var relationshipCollection = RelationshipCollectionSelector.Compile()(parentEntity);
-            return relationshipCollection;
-        }
-
-
         private Expression<Func<TParentEntity, object>> ConvertToIncludesExpression(Expression<Func<TParentEntity, ICollection<TRelationshipEntity>>> relationshipCollectionSelector)
         {
             return Expression.Lambda<Func<TParentEntity, object>>(relationshipCollectionSelector.Body, relationshipCollectionSelector.Parameters);
@@ -352,8 +350,20 @@
             }
         }

+        protected virtual async Task ValidateReadPermissionsAsync(TParentEntity entity, CancellationToken cancellationToken = default)
+        {
+            cancellationToken.ThrowIfCancellationRequested();
+
+            if (!await HasReadPermissionsAsync(entity, cancellationToken))
+            {
+                throw new UnauthorizedAccessException();
+            }
+        }
+
         protected virtual bool HasReadPermissions(TParentEntity entity) => true;

+        protected virtual Task<bool> HasReadPermissionsAsync(TParentEntity entity, CancellationToken cancellationToken = default) => cancellationToken.IsCancellationRequested ? Task.FromCanceled<bool>(cancellationToken) : Task.FromResult(true);
+
         protected virtual void ValidateModifyPermissions(TParentEntity entity)
         {
             if (!HasModifyPermissions(entity))
@@ -362,30 +372,17 @@
             }
         }

+        protected virtual async Task ValidateModifyPermissionsAsync(TParentEntity entity, CancellationToken cancellationToken = default)
+        {
+            cancellationToken.ThrowIfCancellationRequested();
+
+            if (!await HasModifyPermissionsAsync(entity, cancellationToken))
+            {
+                throw new UnauthorizedAccessException();
+            }
+        }
+
         protected virtual bool HasModifyPermissions(TParentEntity entity) => true;
-
-
-        protected virtual async Task ValidateReadPermissionsAsync(TParentEntity entity, CancellationToken cancellationToken = default)
-        {
-            cancellationToken.ThrowIfCancellationRequested();
-
-            if (!await HasReadPermissionsAsync(entity, cancellationToken))
-            {
-                throw new UnauthorizedAccessException();
-            }
-        }
-
-        protected virtual Task<bool> HasReadPermissionsAsync(TParentEntity entity, CancellationToken cancellationToken = default) => cancellationToken.IsCancellationRequested ? Task.FromCanceled<bool>(cancellationToken) : Task.FromResult(true);
-
-        protected virtual async Task ValidateModifyPermissionsAsync(TParentEntity entity, CancellationToken cancellationToken = default)
-        {
-            cancellationToken.ThrowIfCancellationRequested();
-
-            if (!await HasModifyPermissionsAsync(entity, cancellationToken))
-            {
-                throw new UnauthorizedAccessException();
-            }
-        }

         protected virtual Task<bool> HasModifyPermissionsAsync(TParentEntity entity, CancellationToken cancellationToken = default) => cancellationToken.IsCancellationRequested ? Task.FromCanceled<bool>(cancellationToken) : Task.FromResult(true);
     }


git-svn-id: https://jumony.svn.codeplex.com/svn/trunk@70012 2327b42d-5241-43d6-9e2a-de5ac946f064

--- Ivony.Html.Web/JumonyHandler.cs
+++ Ivony.Html.Web/JumonyHandler.cs
@@ -157,6 +157,7 @@
     void IHtmlHandler.ProcessDocument( HttpContextBase context, IHtmlDocument document )
     {
       Context = context;//如果这里是入口，即被当作IHtmlHandler调用时，需要设置Context供派生类使用
+      Document = document;

       OnPreProcessDocument();