Make ContentBuilder produce and accept protocol ver.3.

--- AIWolfLib/ContentBuilder.cs
+++ AIWolfLib/ContentBuilder.cs
@@ -7,6 +7,7 @@
 // http://opensource.org/licenses/mit-license.php
 //

+using System;
 using System.Collections.Generic;

 namespace AIWolf.Lib
@@ -24,6 +25,16 @@
     {
 #if JHELP
         /// <summary>
+        /// 不明
+        /// </summary>
+#else
+        /// <summary>
+        /// Uncertain.
+        /// </summary>
+#endif
+        UNC,
+#if JHELP
+        /// <summary>
         /// 会話
         /// </summary>
 #else
@@ -46,27 +57,19 @@

 #if JHELP
     /// <summary>
-    /// 発話内容クラスビルダー
-    /// </summary>
-#else
-    /// <summary>
-    /// Abstract class of the builder for Content class.
-    /// </summary>
-#endif
-    public abstract class ContentBuilder
+    /// 各種発話内容を生成するビルダークラスのためのクラス
+    /// </summary>
+#else
+    /// <summary>
+    /// A class for the builder classes to build Content of all kinds.
+    /// </summary>
+#endif
+    public class ContentBuilder
     {
         internal ContentBuilder() { }

-#if JHELP
-        /// <summary>
-        /// Contentのテキスト表現
-        /// </summary>
-#else
-        /// <summary>
-        /// The text representation of the Content.
-        /// </summary>
-#endif
-        internal string Text { get; set; }
+        private Agent _subject;
+        private Agent _target;

 #if JHELP
         /// <summary>
@@ -77,7 +80,7 @@
         /// The topic of the Content.
         /// </summary>
 #endif
-        internal abstract Topic Topic { get; }
+        internal Topic Topic { get; set; }

 #if JHELP
         /// <summary>
@@ -88,7 +91,7 @@
         /// The subject of the Content.
         /// </summary>
 #endif
-        internal Agent Subject { get; set; }
+        internal Agent Subject { get => _subject; set => _subject = value ?? Agent.NONE; }

 #if JHELP
         /// <summary>
@@ -99,7 +102,7 @@
         /// The target agent of the Content.
         /// </summary>
 #endif
-        internal Agent Target { get; set; }
+        internal Agent Target { get => _target; set => _target = value ?? Agent.ANY; }

 #if JHELP
         /// <summary>
@@ -155,6 +158,17 @@
         /// </summary>
 #endif
         internal IList<Content> ContentList { get; set; }
+
+#if JHELP
+        /// <summary>
+        /// 被演算子に付加される日付
+        /// </summary>
+#else
+        /// <summary>
+        /// The date added to the operand.
+        /// </summary>
+#endif
+        internal int Day { get; set; }
     }

 #if JHELP
@@ -168,7 +182,37 @@
 #endif
     public class AgreeContentBuilder : ContentBuilder
     {
-        internal override Topic Topic => Topic.AGREE;
+#if JHELP
+        /// <summary>
+        /// AgreeContentBuilderクラスの新しいインスタンスを初期化します
+        /// </summary>
+        /// <param name="subject">同意を表明するエージェント</param>
+        /// <param name="utteranceType">同意される発話の種類</param>
+        /// <param name="talkDay">同意される発話の発話日</param>
+        /// <param name="talkID">同意される発話のID</param>
+#else
+        /// <summary>
+        /// Initializes a new instance of AgreeContentBuilder.
+        /// </summary>
+        /// <param name="subject">The agent who agrees.</param>
+        /// <param name="utteranceType">The type of the agreed utterance.</param>
+        /// <param name="talkDay">The day of the utterance agreed with.</param>
+        /// <param name="talkID">The ID of the utterance agreed with.</param>
+#endif
+        public AgreeContentBuilder(Agent subject, UtteranceType utteranceType, int talkDay, int talkID)
+        {
+            Topic = Topic.AGREE;
+            Subject = subject;
+
+            if (utteranceType == UtteranceType.TALK)
+            {
+                Utterance = new Talk(talkID, talkDay, 0, Agent.NONE, "");
+            }
+            else if (utteranceType == UtteranceType.WHISPER)
+            {
+                Utterance = new Whisper(talkID, talkDay, 0, Agent.NONE, "");
+            }
+        }

 #if JHELP
         /// <summary>
@@ -185,19 +229,9 @@
         /// <param name="talkDay">The day of the utterance agreed with.</param>
         /// <param name="talkID">The ID of the utterance agreed with.</param>
 #endif
+        [Obsolete]
         public AgreeContentBuilder(UtteranceType utteranceType, int talkDay = 0, int talkID = 0)
-        {
-            if (utteranceType == UtteranceType.TALK)
-            {
-                Utterance = new Talk(talkID, talkDay);
-            }
-            else
-            {
-                Utterance = new Whisper(talkID, talkDay);
-            }
-            Text = string.Join(" ", new string[] { Subject == null ? "" : Subject.ToString(),
-                Topic.ToString(), utteranceType.ToString(), $"day{Utterance.Day}", $"ID:{Utterance.Idx}" }).Trim();
-        }
+            : this(Agent.NONE, utteranceType, talkDay, talkID) { }
     }

 #if JHELP
@@ -209,162 +243,264 @@
     /// Builder class for the utterance of a disagreement.
     /// </summary>
 #endif
-    public class DisagreeContentBuilder : ContentBuilder
-    {
-        internal override Topic Topic => Topic.DISAGREE;
-
+    public class DisagreeContentBuilder : AgreeContentBuilder
+    {
 #if JHELP
         /// <summary>
         /// DisagreeContentBuilderクラスの新しいインスタンスを初期化します
         /// </summary>
-        /// <param name="utteranceType">不同意される発話の種類.</param>
+        /// <param name="subject">不同意を表明するエージェント</param>
+        /// <param name="utteranceType">不同意される発話の種類</param>
         /// <param name="talkDay">不同意される発話の発話日</param>
         /// <param name="talkID">不同意される発話のID</param>
 #else
         /// <summary>
         /// Initializes a new instance of DisagreeContentBuilder.
         /// </summary>
-        /// <param name="utteranceType">The type of the utterance disagreed with.</param>
-        /// <param name="talkDay">The day of the utterance disagreed with.</param>
-        /// <param name="talkID">The ID of the utterance disagreed with.</param>
-#endif
+        /// <param name="subject">The agent who disagrees.</param>
+        /// <param name="utteranceType">The type of the disagreed utterance.</param>
+        /// <param name="talkDay">The date of the disagreed utterance.</param>
+        /// <param name="talkID">The ID of the disagreed utterance.</param>
+#endif
+        public DisagreeContentBuilder(Agent subject, UtteranceType utteranceType, int talkDay, int talkID)
+            : base(subject, utteranceType, talkDay, talkID)
+        {
+            Topic = Topic.DISAGREE;
+        }
+
+#if JHELP
+        /// <summary>
+        /// DisagreeContentBuilderクラスの新しいインスタンスを初期化します
+        /// </summary>
+        /// <param name="utteranceType">不同意される発話の種類</param>
+        /// <param name="talkDay">不同意される発話の発話日</param>
+        /// <param name="talkID">不同意される発話のID</param>
+#else
+        /// <summary>
+        /// Initializes a new instance of DisagreeContentBuilder.
+        /// </summary>
+        /// <param name="utteranceType">The type of the disagreed utterance.</param>
+        /// <param name="talkDay">The date of the disagreed utterance.</param>
+        /// <param name="talkID">The ID of the disagreed utterance.</param>
+#endif
+        [Obsolete]
         public DisagreeContentBuilder(UtteranceType utteranceType, int talkDay = 0, int talkID = 0)
-        {
-            if (utteranceType == UtteranceType.TALK)
-            {
-                Utterance = new Talk(talkID, talkDay);
-            }
-            else
-            {
-                Utterance = new Whisper(talkID, talkDay);
-            }
-            Text = string.Join(" ", new string[] { Subject == null ? "" : Subject.ToString(),
-                Topic.ToString(), utteranceType.ToString(), $"day{Utterance.Day}", $"ID:{Utterance.Idx}" }).Trim();
-        }
-    }
-
-#if JHELP
-    /// <summary>
-    /// 襲撃発話ビルダークラス
-    /// </summary>
-#else
-    /// <summary>
-    /// Builder class for the utterance of an attack.
+            : this(Agent.NONE, utteranceType, talkDay, talkID) { }
+    }
+
+#if JHELP
+    /// <summary>
+    /// 襲撃宣言発話ビルダークラス
+    /// </summary>
+#else
+    /// <summary>
+    /// Builder class for the declaration of an attack.
     /// </summary>
 #endif
     public class AttackContentBuilder : ContentBuilder
     {
-        internal override Topic Topic => Topic.ATTACK;
-
 #if JHELP
         /// <summary>
         /// AttackContentBuilderクラスの新しいインスタンスを初期化します
         /// </summary>
-        /// <param name="target">襲撃先エージェント</param>
+        /// <param name="subject">襲撃するエージェント</param>
+        /// <param name="target">襲撃されるエージェント</param>
 #else
         /// <summary>
         /// Initializes a new instance of AttackContentBuilder.
         /// </summary>
+        /// <param name="subject">The agent who will attack..</param>
         /// <param name="target">The agent to be attacked.</param>
 #endif
-        public AttackContentBuilder(Agent target)
-        {
-            if (target == null)
-            {
-                Error.RuntimeError("target is null.");
-                Target = Agent.GetAgent(0);
-                Error.Warning($"using {Target}.");
-            }
-            else
-            {
-                Target = target;
-            }
-            Text = string.Join(" ", new string[] { Subject == null ? "" : Subject.ToString(),
-                Topic.ToString(), Target.ToString() }).Trim();
-        }
-    }
-
-#if JHELP
-    /// <summary>
-    /// 占い発話ビルダークラス
-    /// </summary>
-#else
-    /// <summary>
-    /// Builder class for the utterance of a divination.
-    /// </summary>
-#endif
-    public class DivinationContentBuilder : ContentBuilder
-    {
-        internal override Topic Topic => Topic.DIVINATION;
-
-
+        public AttackContentBuilder(Agent subject, Agent target)
+        {
+            Topic = Topic.ATTACK;
+            Subject = subject;
+            Target = target;
+        }
+
+#if JHELP
+        /// <summary>
+        /// AttackContentBuilderクラスの新しいインスタンスを初期化します
+        /// </summary>
+        /// <param name="target">襲撃されるエージェント</param>
+#else
+        /// <summary>
+        /// Initializes a new instance of AttackContentBuilder.
+        /// </summary>
+        /// <param name="target">The agent to be attacked.</param>
+#endif
+        [Obsolete]
+        public AttackContentBuilder(Agent target) : this(Agent.NONE, target) { }
+    }
+
+#if JHELP
+    /// <summary>
+    /// 襲撃報告発話ビルダークラス
+    /// </summary>
+#else
+    /// <summary>
+    /// Builder class for the report of an attack.
+    /// </summary>
+#endif
+    public class AttackedContentBuilder : AttackContentBuilder
+    {
+#if JHELP
+        /// <summary>
+        /// AttackedContentBuilderクラスの新しいインスタンスを初期化します
+        /// </summary>
+        /// <param name="subject">襲撃したエージェント</param>
+        /// <param name="target">襲撃されたエージェント</param>
+#else
+        /// <summary>
+        /// Initializes a new instance of AttackedContentBuilder.
+        /// </summary>
+        /// <param name="subject">The agent who attacked.</param>
+        /// <param name="target">The agent who was attacked.</param>
+#endif
+        public AttackedContentBuilder(Agent subject, Agent target) : base(subject, target)
+        {
+            Topic = Topic.ATTACKED;
+        }
+    }
+
+#if JHELP
+    /// <summary>
+    /// 占い宣言発話ビルダークラス
+    /// </summary>
+#else
+    /// <summary>
+    /// Builder class for the declaration of a divination.
+    /// </summary>
+#endif
+    public class DivinationContentBuilder : AttackContentBuilder
+    {
 #if JHELP
         /// <summary>
         /// DivinationContentBuilderクラスの新しいインスタンスを初期化します
         /// </summary>
-        /// <param name="target">占い先エージェント</param>
+        /// <param name="subject">占いを行うエージェント</param>
+        /// <param name="target">占われるエージェント</param>
 #else
         /// <summary>
         /// Initializes a new instance of DivinationContentBuilder.
         /// </summary>
+        /// <param name="subject">The agent who will divine.</param>
         /// <param name="target">The agent to be divined.</param>
 #endif
-        public DivinationContentBuilder(Agent target)
-        {
-            if (target == null)
-            {
-                Error.RuntimeError("target is null.");
-                Target = Agent.GetAgent(0);
-                Error.Warning($"using {Target}.");
-            }
-            else
-            {
-                Target = target;
-            }
-            Text = string.Join(" ", new string[] { Subject == null ? "" : Subject.ToString(),
-                Topic.ToString(), Target.ToString() }).Trim();
-        }
-    }
-
-#if JHELP
-    /// <summary>
-    /// 護衛発話ビルダークラス
-    /// </summary>
-#else
-    /// <summary>
-    /// Builder class for the utterance of a guard.
-    /// </summary>
-#endif
-    public class GuardContentBuilder : ContentBuilder
-    {
-        internal override Topic Topic => Topic.GUARD;
-
+        public DivinationContentBuilder(Agent subject, Agent target) : base(subject, target)
+        {
+            Topic = Topic.DIVINATION;
+        }
+
+#if JHELP
+        /// <summary>
+        /// DivinationContentBuilderクラスの新しいインスタンスを初期化します
+        /// </summary>
+        /// <param name="target">占われるエージェント</param>
+#else
+        /// <summary>
+        /// Initializes a new instance of DivinationContentBuilder.
+        /// </summary>
+        /// <param name="target">The agent to be divined.</param>
+#endif
+        [Obsolete]
+        public DivinationContentBuilder(Agent target) : this(Agent.NONE, target) { }
+    }
+
+#if JHELP
+    /// <summary>
+    /// 占い報告発話ビルダークラス
+    /// </summary>
+#else
+    /// <summary>
+    /// Builder class for the report of a divination.
+    /// </summary>
+#endif
+    public class DivinedResultContentBuilder : ContentBuilder
+    {
+#if JHELP
+        /// <summary>
+        /// DivinedResultContentBuilderクラスの新しいインスタンスを初期化します
+        /// </summary>
+        /// <param name="subject">占いを行ったエージェント</param>
+        /// <param name="target">占われたエージェント</param>
+        /// <param name="result">占われたエージェントの種族</param>
+#else
+        /// <summary>
+        /// Initializes a new instance of DivinedResultContentBuilder.
+        /// </summary>
+        /// <param name="subject">The agent who divined.</param>
+        /// <param name="target">The agent who was divined.</param>
+        /// <param name="result">The species of the divined agent.</param>
+#endif
+        public DivinedResultContentBuilder(Agent subject, Agent target, Species result)
+        {
+            Topic = Topic.DIVINED;
+            Subject = subject;
+            Target = target;
+            Result = result;
+        }
+
+#if JHELP
+        /// <summary>
+        /// DivinedResultContentBuilderクラスの新しいインスタンスを初期化します
+        /// </summary>
+        /// <param name="target">占われたエージェント</param>
+        /// <param name="result">占われたエージェントの種族</param>
+#else
+        /// <summary>
+        /// Initializes a new instance of DivinedResultContentBuilder.
+        /// </summary>
+        /// <param name="target">The agent who was divined.</param>
+        /// <param name="result">The species of the divined agent.</param>
+#endif
+        [Obsolete]
+        public DivinedResultContentBuilder(Agent target, Species result) : this(Agent.NONE, target, result) { }
+    }
+
+#if JHELP
+    /// <summary>
+    /// 護衛宣言発話ビルダークラス
+    /// </summary>
+#else
+    /// <summary>
+    /// Builder class for the declaration of a guard.
+    /// </summary>
+#endif
+    public class GuardContentBuilder : AttackContentBuilder
+    {
 #if JHELP
         /// <summary>
         /// GuardContentBuilderクラスの新しいインスタンスを初期化します
         /// </summary>
-        /// <param name="target">護衛先エージェント</param>
+        /// <param name="subject">護衛を行うエージェント</param>
+        /// <param name="target">護衛されるエージェント</param>
 #else
         /// <summary>
         /// Initializes a new instance of GuardContentBuilder.
         /// </summary>
+        /// <param name="subject">The agent who will guard.</param>
         /// <param name="target">The agent to be guarded.</param>
 #endif
-        public GuardContentBuilder(Agent target)
-        {
-            if (target == null)
-            {
-                Error.RuntimeError("target is null.");
-                Target = Agent.GetAgent(0);
-                Error.Warning($"using {Target}.");
-            }
-            else
-            {
-                Target = target;
-            }
-            Text = string.Join(" ", new string[] { Subject == null ? "" : Subject.ToString(),
-                Topic.ToString(), Target.ToString() }).Trim();
-        }
+        public GuardContentBuilder(Agent subject, Agent target) : base(subject, target)
+        {
+            Topic = Topic.GUARD;
+        }
+
+#if JHELP
+        /// <summary>
+        /// GuardContentBuilderクラスの新しいインスタンスを初期化します
+        /// </summary>
+        /// <param name="target">護衛されるエージェント</param>
+#else
+        /// <summary>
+        /// Initializes a new instance of GuardContentBuilder.
+        /// </summary>
+        /// <param name="target">The agent to be guarded.</param>
+#endif
+        [Obsolete]
+        public GuardContentBuilder(Agent target) : this(Agent.NONE, target) { }
     }

 #if JHELP
@@ -376,76 +512,112 @@
     /// Builder class for the report of a guard.
     /// </summary>
 #endif
-    public class GuardedAgentContentBuilder : ContentBuilder
-    {
-        internal override Topic Topic => Topic.GUARDED;
-
+    public class GuardedAgentContentBuilder : AttackContentBuilder
+    {
 #if JHELP
         /// <summary>
         /// GuardedAgentContentBuilderクラスの新しいインスタンスを初期化します
         /// </summary>
-        /// <param name="target">占ったエージェント</param>
+        /// <param name="subject">護衛を行ったエージェント</param>
+        /// <param name="target">護衛されたエージェント</param>
 #else
         /// <summary>
         /// Initializes a new instance of GuardedAgentContentBuilder.
         /// </summary>
-        /// <param name="target">The guarded agent.</param>
-#endif
-        public GuardedAgentContentBuilder(Agent target)
-        {
-            if (target == null)
-            {
-                Error.RuntimeError("target is null.");
-                Target = Agent.GetAgent(0);
-                Error.Warning($"using {Target}.");
-            }
-            else
-            {
-                Target = target;
-            }
-            Text = string.Join(" ", new string[] { Subject == null ? "" : Subject.ToString(),
-                Topic.ToString(), Target.ToString() }).Trim();
-        }
-    }
-
-#if JHELP
-    /// <summary>
-    /// 投票発話ビルダークラス
-    /// </summary>
-#else
-    /// <summary>
-    /// Builder class for the utterance of a vote.
-    /// </summary>
-#endif
-    public class VoteContentBuilder : ContentBuilder
-    {
-        internal override Topic Topic => Topic.VOTE;
-
+        /// <param name="subject">The agent who guarded.</param>
+        /// <param name="target">The agent who was guarded.</param>
+#endif
+        public GuardedAgentContentBuilder(Agent subject, Agent target) : base(subject, target)
+        {
+            Topic = Topic.GUARDED;
+        }
+
+#if JHELP
+        /// <summary>
+        /// GuardedAgentContentBuilderクラスの新しいインスタンスを初期化します
+        /// </summary>
+        /// <param name="target">護衛されたエージェント</param>
+#else
+        /// <summary>
+        /// Initializes a new instance of GuardedAgentContentBuilder.
+        /// </summary>
+        /// <param name="target">The agent who was guarded.</param>
+#endif
+        [Obsolete]
+        public GuardedAgentContentBuilder(Agent target) : this(Agent.NONE, target) { }
+    }
+
+#if JHELP
+    /// <summary>
+    /// 投票宣言発話ビルダークラス
+    /// </summary>
+#else
+    /// <summary>
+    /// Builder class for the declaration of a vote.
+    /// </summary>
+#endif
+    public class VoteContentBuilder : AttackContentBuilder
+    {
 #if JHELP
         /// <summary>
         /// VoteContentBuilderクラスの新しいインスタンスを初期化します
         /// </summary>
-        /// <param name="target">投票先エージェント</param>
+        /// <param name="subject">投票を行うエージェント</param>
+        /// <param name="target">投票されるエージェント</param>
 #else
         /// <summary>
         /// Initializes a new instance of VoteContentBuilder.
         /// </summary>
-        /// <param name="target">The agent to be voted for.</param>
-#endif
-        public VoteContentBuilder(Agent target)
-        {
-            if (target == null)
-            {
-                Error.RuntimeError("target is null.");
-                Target = Agent.GetAgent(0);
-                Error.Warning($"using {Target}.");
-            }
-            else
-            {
-                Target = target;
-            }
-            Text = string.Join(" ", new string[] { Subject == null ? "" : Subject.ToString(),
-                Topic.ToString(), Target.ToString() }).Trim();
+        /// <param name="subject">The agent who will vote.</param>
+        /// <param name="target">The agent to be voted.</param>
+#endif
+        public VoteContentBuilder(Agent subject, Agent target) : base(subject, target)
+        {
+            Topic = Topic.VOTE;
+        }
+
+#if JHELP
+        /// <summary>
+        /// VoteContentBuilderクラスの新しいインスタンスを初期化します
+        /// </summary>
+        /// <param name="target">投票されるエージェント</param>
+#else
+        /// <summary>
+        /// Initializes a new instance of VoteContentBuilder.
+        /// </summary>
+        /// <param name="target">The agent to be voted.</param>
+#endif
+        [Obsolete]
+        public VoteContentBuilder(Agent target) : this(Agent.NONE, target) { }
+    }
+
+#if JHELP
+    /// <summary>
+    /// 投票報告発話ビルダークラス
+    /// </summary>
+#else
+    /// <summary>
+    /// Builder class for the report of a vote.
+    /// </summary>
+#endif
+    public class VotedContentBuilder : AttackContentBuilder
+    {
+#if JHELP
+        /// <summary>
+        /// VotedContentBuilderクラスの新しいインスタンスを初期化します
+        /// </summary>
+        /// <param name="subject">投票を行ったエージェント</param>
+        /// <param name="target">投票されたエージェント</param>
+#else
+        /// <summary>
+        /// Initializes a new instance of VotedContentBuilder.
+        /// </summary>
+        /// <param name="subject">The agent who voted.</param>
+        /// <param name="target">The agent who was voted.</param>
+#endif
+        public VotedContentBuilder(Agent subject, Agent target) : base(subject, target)
+        {
+            Topic = Topic.VOTED;
         }
     }

@@ -455,42 +627,49 @@
     /// </summary>
 #else
     /// <summary>
-    /// Builder class for the utterance of a coming-out.
+    /// Builder class for the utterance of a comingout.
     /// </summary>
 #endif
     public class ComingoutContentBuilder : ContentBuilder
     {
-        internal override Topic Topic => Topic.COMINGOUT;
-
 #if JHELP
         /// <summary>
         /// ComingoutContentBuilderクラスの新しいインスタンスを初期化します
         /// </summary>
-        /// <param name="target">役職を明らかにされるエージェント</param>
-        /// <param name="role">明らかにされる役職</param>
+        /// <param name="subject">役職公開を行うエージェント</param>
+        /// <param name="target">役職を公開されるエージェント</param>
+        /// <param name="role">公開される役職</param>
 #else
         /// <summary>
         /// Initializes a new instance of ComingoutContentBuilder.
         /// </summary>
-        /// <param name="target">The agent whose role is come out with.</param>
-        /// <param name="role">The role come out with.</param>
-#endif
-        public ComingoutContentBuilder(Agent target, Role role)
-        {
-            if (target == null)
-            {
-                Error.RuntimeError("target is null.");
-                Target = Agent.GetAgent(0);
-                Error.Warning($"using {Target}.");
-            }
-            else
-            {
-                Target = target;
-            }
+        /// <param name="subject">The agent who discloses.</param>
+        /// <param name="target">The disclosed agent.</param>
+        /// <param name="role">The disclosed role.</param>
+#endif
+        public ComingoutContentBuilder(Agent subject, Agent target, Role role)
+        {
+            Topic = Topic.COMINGOUT;
+            Subject = subject;
+            Target = target;
             Role = role;
-            Text = string.Join(" ", new string[] { Subject == null ? "" : Subject.ToString(),
-                Topic.ToString(), Target.ToString(), Role.ToString() }).Trim();
-        }
+        }
+
+#if JHELP
+        /// <summary>
+        /// ComingoutContentBuilderクラスの新しいインスタンスを初期化します
+        /// </summary>
+        /// <param name="target">役職を公開されるエージェント</param>
+        /// <param name="role">公開される役職</param>
+#else
+        /// <summary>
+        /// Initializes a new instance of ComingoutContentBuilder.
+        /// </summary>
+        /// <param name="target">The agent whose role is disclosed.</param>
+        /// <param name="role">The disclosed role.</param>
+#endif
+        [Obsolete]
+        public ComingoutContentBuilder(Agent target, Role role) : this(Agent.NONE, target, role) { }
     }

 #if JHELP
@@ -499,181 +678,393 @@
     /// </summary>
 #else
     /// <summary>
-    /// Builder class for the utterance of a estimation.
-    /// </summary>
-#endif
-    public class EstimateContentBuilder : ContentBuilder
-    {
-        internal override Topic Topic => Topic.ESTIMATE;
-
+    /// Builder class for the utterance of a estimate.
+    /// </summary>
+#endif
+    public class EstimateContentBuilder : ComingoutContentBuilder
+    {
 #if JHELP
         /// <summary>
         /// EstimateContentBuilderクラスの新しいインスタンスを初期化します
         /// </summary>
+        /// <param name="subject">推測を行うエージェント</param>
         /// <param name="target">推測されるエージェント</param>
         /// <param name="role">推測される役職</param>
 #else
         /// <summary>
         /// Initializes a new instance of EstimateContentBuilder.
         /// </summary>
+        /// <param name="subject">The agent who estimates.</param>
         /// <param name="target">The estimated agent.</param>
         /// <param name="role">The estimated role.</param>
 #endif
-        public EstimateContentBuilder(Agent target, Role role)
-        {
-            if (target == null)
+        public EstimateContentBuilder(Agent subject, Agent target, Role role)
+            : base(subject, target, role)
+        {
+            Topic = Topic.ESTIMATE;
+        }
+
+#if JHELP
+        /// <summary>
+        /// EstimateContentBuilderクラスの新しいインスタンスを初期化します
+        /// </summary>
+        /// <param name="target">推測されるエージェント</param>
+        /// <param name="role">推測される役職</param>
+#else
+        /// <summary>
+        /// Initializes a new instance of EstimateContentBuilder.
+        /// </summary>
+        /// <param name="target">The estimated agent.</param>
+        /// <param name="role">The estimated role.</param>
+#endif
+        [Obsolete]
+        public EstimateContentBuilder(Agent target, Role role) : this(Agent.NONE, target, role) { }
+    }
+
+#if JHELP
+    /// <summary>
+    /// 霊媒結果報告ビルダークラス
+    /// </summary>
+#else
+    /// <summary>
+    /// Builder class for the report of an identification.
+    /// </summary>
+#endif
+    public class IdentContentBuilder : DivinedResultContentBuilder
+    {
+#if JHELP
+        /// <summary>
+        /// IdentContentBuilderクラスの新しいインスタンスを初期化します
+        /// </summary>
+        /// <param name="subject">種族確認を行ったエージェント</param>
+        /// <param name="target">種族確認をされたエージェント</param>
+        /// <param name="result">確認されたエージェントの種族</param>
+#else
+        /// <summary>
+        /// Initializes a new instance of IdentContentBuilder.
+        /// </summary>
+        /// <param name="agents">The agent who identified.</param>
+        /// <param name="agents">The agent who was identified.</param>
+        /// <param name="result">The species of the identified agent.</param>
+#endif
+        public IdentContentBuilder(Agent subject, Agent target, Species result)
+            : base(subject, target, result)
+        {
+            Topic = Topic.IDENTIFIED;
+        }
+
+#if JHELP
+        /// <summary>
+        /// IdentContentBuilderクラスの新しいインスタンスを初期化します
+        /// </summary>
+        /// <param name="target">種族確認をされたエージェント</param>
+        /// <param name="result">確認されたエージェントの種族</param>
+#else
+        /// <summary>
+        /// Initializes a new instance of IdentContentBuilder.
+        /// </summary>
+        /// <param name="target">The identified agent.</param>
+        /// <param name="result">The species of the identified agent.</param>
+#endif
+        [Obsolete]
+        public IdentContentBuilder(Agent target, Species result) : this(Agent.NONE, target, result) { }
+    }
+
+#if JHELP
+    /// <summary>
+    /// 要求発話ビルダークラス
+    /// </summary>
+#else
+    /// <summary>
+    /// Builder class for a request.
+    /// </summary>
+#endif
+    public class RequestContentBuilder : ContentBuilder
+    {
+#if JHELP
+        /// <summary>
+        /// RequestContentBuilderクラスの新しいインスタンスを初期化します
+        /// </summary>
+        /// <param name="subject">要求を行うエージェント</param>
+        /// <param name="target">要求されるエージェント</param>
+        /// <param name="action">要求されるアクション</param>
+#else
+        /// <summary>
+        /// Initializes a new instance of RequestContentBuilder.
+        /// </summary>
+        /// <param name="subject">The agent who requests.</param>
+        /// <param name="target">The requested agent.</param>
+        /// <param name="content">The requested action.</param>
+#endif
+        public RequestContentBuilder(Agent subject, Agent target, Content action)
+        {
+            Topic = Topic.OPERATOR;
+            Operator = Operator.REQUEST;
+            Subject = subject;
+            Target = target;
+            ContentList = action == null ? null : new List<Content> { action }.AsReadOnly();
+        }
+
+#if JHELP
+        /// <summary>
+        /// RequestContentBuilderクラスの新しいインスタンスを初期化します
+        /// </summary>
+        /// <param name="target">要求をされるエージェント</param>
+        /// <param name="action">要求されるアクション</param>
+#else
+        /// <summary>
+        /// Initializes a new instance of RequestContentBuilder.
+        /// </summary>
+        /// <param name="target">The requested agent.</param>
+        /// <param name="action">The requested action.</param>
+#endif
+        [Obsolete]
+        public RequestContentBuilder(Agent target, Content action) : this(Agent.NONE, target, action) { }
+    }
+
+#if JHELP
+    /// <summary>
+    /// 照会発話ビルダークラス
+    /// </summary>
+#else
+    /// <summary>
+    /// Builder class for a inquiry.
+    /// </summary>
+#endif
+    public class InquiryContentBuilder : RequestContentBuilder
+    {
+#if JHELP
+        /// <summary>
+        /// InquiryContentBuilderクラスの新しいインスタンスを初期化します
+        /// </summary>
+        /// <param name="subject">照会を行うエージェント</param>
+        /// <param name="target">照会されるエージェント</param>
+        /// <param name="content">照会事項</param>
+#else
+        /// <summary>
+        /// Initializes a new instance of InquiryContentBuilder.
+        /// </summary>
+        /// <param name="subject">The agent who inquires.</param>
+        /// <param name="target">The inquired agent.</param>
+        /// <param name="content">The inquired matter.</param>
+#endif
+        public InquiryContentBuilder(Agent subject, Agent target, Content content)
+            : base(subject, target, content)
+        {
+            Operator = Operator.INQUIRE;
+        }
+    }
+
+#if JHELP
+    /// <summary>
+    /// 理由発話ビルダークラス
+    /// </summary>
+#else
+    /// <summary>
+    /// Builder class for the utterance of a reason.
+    /// </summary>
+#endif
+    public class BecauseContentBuilder : ContentBuilder
+    {
+#if JHELP
+        /// <summary>
+        /// BecauseContentBuilderクラスの新しいインスタンスを初期化します
+        /// </summary>
+        /// <param name="subject">行動とその理由を述べるエージェント</param>
+        /// <param name="reason">行動の理由</param>
+        /// <param name="action">理由に基づく行動</param>
+#else
+        /// <summary>
+        /// Initializes a new instance of BecauseContentBuilder.
+        /// </summary>
+        /// <param name="subject">The agent who express the action and its reason.</param>
+        /// <param name="reason">The reason.</param>
+        /// <param name="action">The action.</param>
+#endif
+        public BecauseContentBuilder(Agent subject, Content reason, Content action)
+        {
+            Topic = Topic.OPERATOR;
+            Operator = Operator.BECAUSE;
+            Subject = subject;
+
+            if (reason == null)
             {
-                Error.RuntimeError("target is null.");
-                Target = Agent.GetAgent(0);
-                Error.Warning($"using {Target}.");
+                Error.RuntimeError("Invalid argument: reason is null");
             }
-            else
+            if (action == null)
             {
-                Target = target;
+                Error.RuntimeError("Invalid argument: action is null");
             }
-            Role = role;
-            Text = string.Join(" ", new string[] { Subject == null ? "" : Subject.ToString(),
-                Topic.ToString(), Target.ToString(), Role.ToString() }).Trim();
-        }
-    }
-
-#if JHELP
-    /// <summary>
-    /// 占い結果報告ビルダークラス
-    /// </summary>
-#else
-    /// <summary>
-    /// Builder class for the report of a divination.
-    /// </summary>
-#endif
-    public class DivinedResultContentBuilder : ContentBuilder
-    {
-        internal override Topic Topic => Topic.DIVINED;
-
-#if JHELP
-        /// <summary>
-        /// DivinedResultContentBuilderクラスの新しいインスタンスを初期化します
-        /// </summary>
-        /// <param name="target">占われたエージェント</param>
-        /// <param name="result">占われたエージェントの種族</param>
-#else
-        /// <summary>
-        /// Initializes a new instance of DivinedResultContentBuilder.
-        /// </summary>
-        /// <param name="target">The divined agent.</param>
-        /// <param name="result">The species of target.</param>
-#endif
-        public DivinedResultContentBuilder(Agent target, Species result)
-        {
-            if (target == null)
+            ContentList = (reason == null || action == null) ? null : new List<Content> { reason, action }.AsReadOnly();
+        }
+    }
+
+#if JHELP
+    /// <summary>
+    /// AND演算子ビルダークラス
+    /// </summary>
+#else
+    /// <summary>
+    /// Builder class for AND operator.
+    /// </summary>
+#endif
+    public class AndContentBuilder : ContentBuilder
+    {
+#if JHELP
+        /// <summary>
+        /// AndContentBuilderクラスの新しいインスタンスを初期化します
+        /// </summary>
+        /// <param name="subject">この連言を主張するエージェント</param>
+        /// <param name="contents">連言肢の並び</param>
+#else
+        /// <summary>
+        /// Initializes a new instance of AndContentBuilder.
+        /// </summary>
+        /// <param name="subject">The agent who states this conjunction.</param>
+        /// <param name="contents">The series of the conjuncts.</param>
+#endif
+        public AndContentBuilder(Agent subject, params Content[] contents)
+        {
+            Topic = Topic.OPERATOR;
+            Operator = Operator.AND;
+            Subject = subject;
+            if (contents.Length == 0)
             {
-                Error.RuntimeError("target is null.");
-                Target = Agent.GetAgent(0);
-                Error.Warning($"using {Target}.");
+                Error.RuntimeError("Invalid argument: contents is empty");
             }
-            else
-            {
-                Target = target;
-            }
-            Result = result;
-            Text = string.Join(" ", new string[] { Subject == null ? "" : Subject.ToString(),
-                Topic.ToString(), Target.ToString(), Result.ToString() }).Trim();
-        }
-    }
-
-#if JHELP
-    /// <summary>
-    /// 霊媒結果報告ビルダークラス
-    /// </summary>
-#else
-    /// <summary>
-    /// Builder class for the report of an identification.
-    /// </summary>
-#endif
-    public class IdentContentBuilder : ContentBuilder
-    {
-        internal override Topic Topic => Topic.IDENTIFIED;
-
-#if JHELP
-        /// <summary>
-        /// IdentContentBuilderクラスの新しいインスタンスを初期化します
-        /// </summary>
-        /// <param name="target">霊媒されたエージェント</param>
-        /// <param name="result">霊媒されたエージェントの種族</param>
-#else
-        /// <summary>
-        /// Initializes a new instance of IdentContentBuilder.
-        /// </summary>
-        /// <param name="target">The identified agent.</param>
-        /// <param name="result">The species of target.</param>
-#endif
-        public IdentContentBuilder(Agent target, Species result)
-        {
-            if (target == null)
-            {
-                Error.RuntimeError("target is null.");
-                Target = Agent.GetAgent(0);
-                Error.Warning($"using {Target}.");
-            }
-            else
-            {
-                Target = target;
-            }
-            Result = result;
-            Text = string.Join(" ", new string[] { Subject == null ? "" : Subject.ToString(),
-                Topic.ToString(), Target.ToString(), Result.ToString() }).Trim();
-        }
-    }
-
-#if JHELP
-    /// <summary>
-    /// 要求発話ビルダークラス
-    /// </summary>
-#else
-    /// <summary>
-    /// Builder class for the report of a request.
-    /// </summary>
-#endif
-    public class RequestContentBuilder : ContentBuilder
-    {
-        internal override Topic Topic => Topic.OPERATOR;
-
-#if JHELP
-        /// <summary>
-        /// RequestContentBuilderクラスの新しいインスタンスを初期化します
-        /// </summary>
-        /// <param name="agent">要求先エージェント</param>
-        /// <param name="content">要求されるアクションを表すContent</param>
-#else
-        /// <summary>
-        /// Initializes a new instance of RequestContentBuilder.
-        /// </summary>
-        /// <param name="agent">The requested agent.</param>
-        /// <param name="content">Content representing the requested action.</param>
-#endif
-        public RequestContentBuilder(Agent agent, Content content)
-        {
-            Operator = Operator.REQUEST;
-            if (content == null)
-            {
-                Error.RuntimeError("content is null.");
-                Error.Warning("Using Content.SKIP.");
-                ContentList = new List<Content> { Content.SKIP }.AsReadOnly();
-            }
-            else
-            {
-                ContentList = new List<Content>
-                {
-                    new Content(content)
-                    {
-                        Subject = agent,
-                        Text = string.Join(" ", new string[] { agent == null ? "" : agent.ToString(),
-                            content.Text }).Trim()
-                    }
-                }.AsReadOnly();
-            }
-            Text = string.Join(" ", new string[] { Subject == null ? "" : Subject.ToString(),
-                $"{Operator}({ContentList[0].Text})" }).Trim();
+            ContentList = contents.Length == 0 ? null : new List<Content>(contents).AsReadOnly();
+        }
+    }
+
+#if JHELP
+    /// <summary>
+    /// OR演算子ビルダークラス
+    /// </summary>
+#else
+    /// <summary>
+    /// Builder class for OR operator.
+    /// </summary>
+#endif
+    public class OrContentBuilder : AndContentBuilder
+    {
+#if JHELP
+        /// <summary>
+        /// OrContentBuilderクラスの新しいインスタンスを初期化します
+        /// </summary>
+        /// <param name="subject">この選言を主張するエージェント</param>
+        /// <param name="contents">選言肢の並び</param>
+#else
+        /// <summary>
+        /// Initializes a new instance of OrContentBuilder.
+        /// </summary>
+        /// <param name="subject">The agent who states this disjunction.</param>
+        /// <param name="contents">The series of the disjuncts.</param>
+#endif
+        public OrContentBuilder(Agent subject, params Content[] contents) : base(subject, contents)
+        {
+            Operator = Operator.OR;
+        }
+    }
+
+#if JHELP
+    /// <summary>
+    /// XOR演算子ビルダークラス
+    /// </summary>
+#else
+    /// <summary>
+    /// Builder class for XOR operator.
+    /// </summary>
+#endif
+    public class XorContentBuilder : BecauseContentBuilder
+    {
+#if JHELP
+        /// <summary>
+        /// XorContentBuilderクラスの新しいインスタンスを初期化します
+        /// </summary>
+        /// <param name="subject">この排他的選言を主張するエージェント</param>
+        /// <param name="disjunct1">第1選言肢</param>
+        /// <param name="disjunct2">第2選言肢</param>
+#else
+        /// <summary>
+        /// Initializes a new instance of XorContentBuilder.
+        /// </summary>
+        /// <param name="subject">The agent who states this exclusive disjunction.</param>
+        /// <param name="disjunct1">The first disjunct.</param>
+        /// <param name="disjunct2">The second disjunct.</param>
+#endif
+        public XorContentBuilder(Agent subject, Content disjunct1, Content disjunct2)
+            : base(subject, disjunct1, disjunct2)
+        {
+            Operator = Operator.XOR;
+        }
+    }
+
+#if JHELP
+    /// <summary>
+    /// NOT演算子ビルダークラス
+    /// </summary>
+#else
+    /// <summary>
+    /// Builder class for NOT operator.
+    /// </summary>
+#endif
+    public class NotContentBuilder : ContentBuilder
+    {
+#if JHELP
+        /// <summary>
+        /// NotContentBuilderクラスの新しいインスタンスを初期化します
+        /// </summary>
+        /// <param name="subject">この否定を主張するエージェント</param>
+        /// <param name="content">否定される命題</param>
+#else
+        /// <summary>
+        /// Initializes a new instance of NotContentBuilder.
+        /// </summary>
+        /// <param name="subject">The agent who states this negation.</param>
+        /// <param name="content">The negated proposition.</param>
+#endif
+        public NotContentBuilder(Agent subject, Content content)
+        {
+            Topic = Topic.OPERATOR;
+            Operator = Operator.NOT;
+            Subject = subject;
+            ContentList = content == null ? null : new List<Content> { content }.AsReadOnly();
+        }
+    }
+
+#if JHELP
+    /// <summary>
+    /// DAY演算子ビルダークラス
+    /// </summary>
+#else
+    /// <summary>
+    /// Builder class for DAY operator.
+    /// </summary>
+#endif
+    public class DayContentBuilder : ContentBuilder
+    {
+#if JHELP
+        /// <summary>
+        /// DayContentBuilderクラスの新しいインスタンスを初期化します
+        /// </summary>
+        /// <param name="subject">日付を付加するエージェント</param>
+        /// <param name="day">日付</param>
+        /// <param name="content">日付を付加される発話</param>
+#else
+        /// <summary>
+        /// Initializes a new instance of DayContentBuilder.
+        /// </summary>
+        /// <param name="subject">The agent who adds the date to the Content.</param>
+        /// <param name="day">The date added to the Content.</param>
+        /// <param name="content">The Content whose date is added.</param>
+#endif
+        public DayContentBuilder(Agent subject, int day, Content content)
+        {
+            Topic = Topic.OPERATOR;
+            Operator = Operator.DAY;
+            Subject = subject;
+            Day = day;
+            ContentList = content == null ? null : new List<Content> { content }.AsReadOnly();
         }
     }

@@ -688,20 +1079,9 @@
 #endif
     public class SkipContentBuilder : ContentBuilder
     {
-        internal override Topic Topic => Topic.Skip;
-
-#if JHELP
-        /// <summary>
-        /// SkipContentBuilderクラスの新しいインスタンスを初期化します
-        /// </summary>
-#else
-        /// <summary>
-        /// Initializes a new instance of SkipContentBuilder.
-        /// </summary>
-#endif
         public SkipContentBuilder()
         {
-            Text = string.Join(" ", new string[] { Subject == null ? "" : Subject.ToString(), Talk.SKIP }).Trim();
+            Topic = Topic.Skip;
         }
     }

@@ -716,21 +1096,9 @@
 #endif
     public class OverContentBuilder : ContentBuilder
     {
-        internal override Topic Topic => Topic.Over;
-
-#if JHELP
-        /// <summary>
-        /// OverContentBuilderクラスの新しいインスタンスを初期化します
-        /// </summary>
-#else
-        /// <summary>
-        /// Initializes a new instance of OverContentBuilder.
-        /// </summary>
-#endif
         public OverContentBuilder()
         {
-            Text = string.Join(" ", new string[] { Subject == null ? "" : Subject.ToString(), Talk.OVER }).Trim();
+            Topic = Topic.Over;
         }
     }
 }
-


Added a settable TextWriter to the Profiler. Console.Out by default.

git-svn-id: 1800f71f313d917366f95485fa960eed04b40598@1177 33146b6e-df29-0410-a1ca-39be37fb9416

--- src/DbLinq/Util/Profiler.cs
+++ src/DbLinq/Util/Profiler.cs
@@ -3,6 +3,7 @@
 using System.Linq;
 using System.Text;
 using System.Diagnostics;
+using System.IO;

 namespace DbLinq.Util
 {
@@ -17,6 +18,22 @@
         private static long prevTicks;
         [ThreadStatic]
         private static bool profiling;
+        [ThreadStatic]
+        private static TextWriter log;
+
+        private static TextWriter Log
+        {
+            get
+            {
+                if (log == null)
+                    log = Console.Out;
+                return log;
+            }
+            set
+            {
+                log = value;
+            }
+        }

         [Conditional("DEBUG")]
         public static void Start()
@@ -33,9 +50,9 @@
             if (profiling)
             {
                 timer.Stop();
-                Console.Write("#AT(time={0:D12}, elapsed={1:D12}) ", timer.ElapsedTicks, timer.ElapsedTicks - prevTicks);
+                Log.Write("#AT(time={0:D12}, elapsed={1:D12}) ", timer.ElapsedTicks, timer.ElapsedTicks - prevTicks);
                 prevTicks = timer.ElapsedTicks;
-                Console.WriteLine(format, args);
+                Log.WriteLine(format, args);
                 timer.Start();
             }
         }


Simplify format logic

Simplify format logic

--- src/Discord.Net.Core/CDN.cs
+++ src/Discord.Net.Core/CDN.cs
@@ -8,11 +8,9 @@
         {
             if (avatarId == null)
                 return null;
-            var baseUrl = $"{DiscordConfig.CDNUrl}avatars/{userId}/{avatarId}";
             if (format == AvatarFormat.Auto)
-                return baseUrl + (avatarId.StartsWith("a_") ? "gif" : "png") + $"?size={size}";
-            else
-                return baseUrl + format.ToString().ToLower() + $"?size={size}";
+                format = avatarId.StartsWith("a_") ? AvatarFormat.Gif : AvatarFormat.Png;
+            return $"{DiscordConfig.CDNUrl}avatars/{userId}/{avatarId}.{format.ToString().ToLower()}?size={size}";
         }
         public static string GetGuildIconUrl(ulong guildId, string iconId)
             => iconId != null ? $"{DiscordConfig.CDNUrl}icons/{guildId}/{iconId}.jpg" : null;


Update ParameterList's this parameter's type sig

--- src/DotNet/ParameterList.cs
+++ src/DotNet/ParameterList.cs
@@ -44,8 +44,19 @@
 			this.parameters = new List<Parameter>();
 			this.methodSigIndexBase = -1;
 			this.hiddenThisParameter = new Parameter(this, 0, -1);
-			//TODO: Update hiddenThisParameter.TypeSig
+			UpdateThisParameterType();
 			UpdateParameterTypes();
+		}
+
+		void UpdateThisParameterType() {
+			var declaringType = method.DeclaringType;
+			if (declaringType == null)
+				return;
+
+			if (declaringType.IsValueType)
+				hiddenThisParameter.Type = new ByRefSig(new ValueTypeSig(declaringType));
+			else
+				hiddenThisParameter.Type = new ClassSig(declaringType);
 		}

 		/// <summary>


Fixed an issue where Metadata was not part of the payload

--- AfricasTalkingCS/B2BData.cs
+++ AfricasTalkingCS/B2BData.cs
@@ -1,15 +1,18 @@
-namespace AfricasTalkingCS
+using System.Collections.Generic;
+using  Newtonsoft.Json;
+namespace AfricasTalkingCS
 {
     public class B2BData
     {
         public string username { get; set; }
         public string productName { get; set; }
-        public string providerChannel { get; set; }
+        public string provider { get; set; }
         public string currencyCode { get; set; }
         public decimal amount { get; set; }
         public string transferType { get; set; }
         public string destinationChannel { get; set; }
         public string destinationAccount { get; set; }
+        public dynamic metadata { get;  set; }

     }
 }


Update doc

Update doc

--- src/Workspaces/Core/Portable/SemanticModelReuse/SemanticModelWorkspaceServiceFactory.SemanticModelWorkspaceService.cs
+++ src/Workspaces/Core/Portable/SemanticModelReuse/SemanticModelWorkspaceServiceFactory.SemanticModelWorkspaceService.cs
@@ -56,10 +56,14 @@
             /// A mapping from a document id to the last semantic model we produced for it, along with the top level
             /// semantic version that that semantic model corresponds to.  We can continue reusing the semantic model as
             /// long as no top level changes occur.
-            /// <para/>
+            /// <para>
             /// In general this dictionary will only contain a single key-value pair.  However, in the case of linked
             /// documents, there will be a key-value pair for each of the independent document links that a document
             /// has.
+            /// </para>
+            /// <para>
+            /// A <see langword="null"/> value simply means we haven't cached any information for that particular id.
+            /// </para>
             /// </summary>
             private ImmutableDictionary<DocumentId, SemanticModelReuseInfo?> _semanticModelMap = ImmutableDictionary<DocumentId, SemanticModelReuseInfo?>.Empty;


Fix inserimento LogBook

Fix inserimento LogBook

--- src/backend/SO115App.Models/Servizi/CQRS/Commands/GestioneSoccorso/GestioneIntervento/LogBook/LogBookAuthorization.cs
+++ src/backend/SO115App.Models/Servizi/CQRS/Commands/GestioneSoccorso/GestioneIntervento/LogBook/LogBookAuthorization.cs
@@ -60,16 +60,11 @@
                 else
                 {
                     Boolean abilitato = false;
-                    foreach (var ruolo in user.Ruoli)
-                    {
-                        foreach (var competenza in command.Richiesta.CodUOCompetenza)
-                        {
-                            if (_getAutorizzazioni.GetAutorizzazioniUtente(user.Ruoli, competenza, Costanti.GestoreChiamate))
-                                abilitato = true;
-                            if (_getAutorizzazioni.GetAutorizzazioniUtente(user.Ruoli, competenza, Costanti.GestoreRichieste))
-                                abilitato = true;
-                        }
-                    }
+
+                    if (_getAutorizzazioni.GetAutorizzazioniUtente(user.Ruoli, command.Richiesta.CodSOCompetente, Costanti.GestoreChiamate))
+                        abilitato = true;
+                    if (_getAutorizzazioni.GetAutorizzazioniUtente(user.Ruoli, command.Richiesta.CodSOCompetente, Costanti.GestoreRichieste))
+                        abilitato = true;

                     if (!abilitato)
                         yield return new AuthorizationResult(Costanti.UtenteNonAutorizzato);


fixed artifact extension

fixed artifact extension

--- Android/CoilBase/build.cake
+++ Android/CoilBase/build.cake
@@ -10,7 +10,7 @@
 {
 	EnsureDirectoryExists ("./externals");

-	DownloadFile(AAR_URL, $"./externals/coil-base-{AAR_VERSION}.jar");
+	DownloadFile(AAR_URL, $"./externals/coil-base-{AAR_VERSION}.aar");

 	// Update .csproj nuget versions
 	XmlPoke("./source/CoilBase/CoilBase.csproj", "/Project/PropertyGroup/PackageVersion", NUGET_VERSION);


(PAZ): added some signatures.

(PAZ): added some signatures.

--- ArcFormats/Musica/ArcPAZ.cs
+++ ArcFormats/Musica/ArcPAZ.cs
@@ -159,7 +159,7 @@

         public PazOpener ()
         {
-            Signatures = new uint[] { 0x858F8493, 0 };
+            Signatures = new uint[] { 0x858F8493, 0x8F889395, 0x6E656465, 0 };
         }

         static readonly ISet<string> AudioPazNames = new HashSet<string> {


Fixed Mesh in Xbox

Fixed Mesh in Xbox

--- AssetStudio/Classes/Mesh.cs
+++ AssetStudio/Classes/Mesh.cs
@@ -1,6 +1,7 @@
 using System;
 using System.Collections.Generic;
 using System.Collections;
+using System.Linq;
 using SharpDX;

 namespace AssetStudio
@@ -611,6 +612,17 @@
                                             }
                                         }

+                                        if (preloadData.sourceFile.platform == 11 && componentByteSize > 1) //swap bytes for Xbox
+                                        {
+                                            for (var i = 0; i < componentBytes.Length / componentByteSize; i++)
+                                            {
+                                                var buff = new byte[componentByteSize];
+                                                Buffer.BlockCopy(componentBytes, i * componentByteSize, buff, 0, componentByteSize);
+                                                buff = buff.Reverse().ToArray();
+                                                Buffer.BlockCopy(buff, 0, componentBytes, i * componentByteSize, componentByteSize);
+                                            }
+                                        }
+
                                         int[] componentsIntArray = null;
                                         float[] componentsFloatArray = null;
                                         if (m_Channel.format == 11)
@@ -690,10 +702,10 @@
                                     {
                                         if (m_Stream.channelMask.Get(b))
                                         {
-                                            // in version 4.x the colors channel has 1 dimension, as in 1 color with 4 components
+                                            //in version 4.x the colors is ColorRGBA32, size 4 with 4 byte components
                                             if (b == 2 && m_Channel.format == 2)
                                             {
-                                                m_Channel.dimension = 4;
+                                                m_Channel.dimension = 4; //set this so that don't need to convert int to 4 bytes
                                             }

                                             var componentByteSize = GetChannelFormatSize(m_Channel.format);
@@ -706,6 +718,17 @@
                                                 {
                                                     int componentOffset = vertexOffset + componentByteSize * d;
                                                     Buffer.BlockCopy(m_DataSize, componentOffset, componentBytes, componentByteSize * (v * m_Channel.dimension + d), componentByteSize);
+                                                }
+                                            }
+
+                                            if (preloadData.sourceFile.platform == 11 && componentByteSize > 1) //swap bytes for Xbox
+                                            {
+                                                for (var i = 0; i < componentBytes.Length / componentByteSize; i++)
+                                                {
+                                                    var buff = new byte[componentByteSize];
+                                                    Buffer.BlockCopy(componentBytes, i * componentByteSize, buff, 0, componentByteSize);
+                                                    buff = buff.Reverse().ToArray();
+                                                    Buffer.BlockCopy(buff, 0, componentBytes, i * componentByteSize, componentByteSize);
                                                 }
                                             }

@@ -1107,7 +1130,7 @@
                                 j++;
                             }
                         }
-                        //just fix it
+                        //TODO just fix it
                         m_SubMeshes[s].indexCount = j * 3;
                     }
                 }


Assert non-null in `ProfileHeader` to appease r#

--- osu.Game/Overlays/Profile/ProfileHeader.cs
+++ osu.Game/Overlays/Profile/ProfileHeader.cs
@@ -3,6 +3,7 @@

 #nullable disable

+using System.Diagnostics;
 using osu.Framework.Bindables;
 using osu.Framework.Extensions.Color4Extensions;
 using osu.Framework.Graphics;
@@ -36,6 +37,10 @@

             // todo: pending implementation.
             // TabControl.AddItem(LayoutStrings.HeaderUsersModding);
+
+            // Haphazardly guaranteed by OverlayHeader constructor (see CreateBackground / CreateContent).
+            Debug.Assert(centreHeaderContainer != null);
+            Debug.Assert(detailHeaderContainer != null);

             centreHeaderContainer.DetailsVisible.BindValueChanged(visible => detailHeaderContainer.Expanded = visible.NewValue, true);
         }


Fix formatting issues

Fix formatting issues

--- osu.Game/Users/Drawables/DrawableAvatar.cs
+++ osu.Game/Users/Drawables/DrawableAvatar.cs
@@ -14,7 +14,7 @@
     {
         private readonly User user;

-        [Resolved(CanBeNull=true)]
+        [Resolved(CanBeNull = true)]
         private IAPIProvider api { get; set; }

         /// <summary>
@@ -38,7 +38,7 @@
                 Texture = textures.Get(user.AvatarUrl.StartsWith('/') ? $"{api.WebsiteRootUrl}{user.AvatarUrl}" : user.AvatarUrl);
             else if (user != null && user.Id > 1)
                 Texture = textures.Get($@"https://a.ppy.sh/{user.Id}");
-
+
             Texture ??= textures.Get(@"Online/avatar-guest");
         }


[packages,GccCommon] Fixes #492. Also fixing the check for g++ minor version

--- packages/GccCommon/bam/Scripts/MetaData.cs
+++ packages/GccCommon/bam/Scripts/MetaData.cs
@@ -97,9 +97,12 @@
             {
                 throw new Bam.Core.Exception("{0} reports version {1}. Expected {2}.{3}", gxxLocation, System.String.Join(".", gxxVersion), this.Meta["ExpectedMajorVersion"], this.Meta["ExpectedMinorVersion"]);
             }
-            if (System.Convert.ToInt32(gxxVersion[1]) != (int)this.Meta["ExpectedMinorVersion"])
-            {
-                throw new Bam.Core.Exception("{0} reports version {1}. Expected {2}.{3}", gxxLocation, System.String.Join(".", gxxVersion), this.Meta["ExpectedMajorVersion"], this.Meta["ExpectedMinorVersion"]);
+            if (null != this.Meta["ExpectedMinorVersion"])
+            {
+                if (System.Convert.ToInt32(gxxVersion[1]) != (int)this.Meta["ExpectedMinorVersion"])
+                {
+                    throw new Bam.Core.Exception("{0} reports version {1}. Expected {2}.{3}", gxxLocation, System.String.Join(".", gxxVersion), this.Meta["ExpectedMajorVersion"], this.Meta["ExpectedMinorVersion"]);
+                }
             }
         }


Now returns null if given an empty string.

--- Assets/Scripts/Misc/Util.cs
+++ Assets/Scripts/Misc/Util.cs
@@ -99,6 +99,10 @@
     private static IDictionary<string, Sprite> sprites = new Dictionary<string, Sprite>();

     public static Sprite LoadIcon(string name) {
+        if (string.IsNullOrEmpty(name)) {
+            return null;
+        }
+
         if (!sprites.ContainsKey(name)) {
             sprites.Add(name, Resources.Load<Sprite>(string.Format("Images/Icons/{0}", name)));
         }


Moved Gaps to the last column of the species count log so the plots will use the same colors for each species.  Before the colors used on the species count plot were different from the others.

--- Assets/TreePlanterScript.cs
+++ Assets/TreePlanterScript.cs
@@ -757,26 +757,22 @@
         if (isForPlotting)
         {
             //Generate string for sending out for plotting
-            logDataBuilder.Append("\"year,Gaps,");
+            logDataBuilder.Append("\"year,");
             for (int i=1; i<6; i++)
             {
-                logDataBuilder.Append(m_prototypeNames[m_speciesList[i]]);
-                if (i != 5)
-                {
-                    logDataBuilder.Append(",");
-                }
-            }
-            logDataBuilder.Append("\\\n\" + ");
+                logDataBuilder.Append(m_prototypeNames[m_speciesList[i]] + ",");
+            }
+            logDataBuilder.Append("Gaps\\\n\" + ");
             for(int generation=0; generation<m_generations; generation++)
             {
                 logDataBuilder.Append("\"");
                 logDataBuilder.Append(generation.ToString() + ',');
-                logDataBuilder.Append(m_totalSpeciesCounts[generation, 0].ToString() + ",");
                 logDataBuilder.Append(m_totalSpeciesCounts[generation, 1].ToString() + ",");
                 logDataBuilder.Append(m_totalSpeciesCounts[generation, 2].ToString() + ",");
                 logDataBuilder.Append(m_totalSpeciesCounts[generation, 3].ToString() + ",");
                 logDataBuilder.Append(m_totalSpeciesCounts[generation, 4].ToString() + ",");
-                logDataBuilder.Append(m_totalSpeciesCounts[generation, 5].ToString() + "\\\n\"");
+                logDataBuilder.Append(m_totalSpeciesCounts[generation, 5].ToString() + ",");
+                logDataBuilder.Append(m_totalSpeciesCounts[generation, 0].ToString() + "\\\n\"");
                 if (generation != m_generations - 1)
                 {
                     logDataBuilder.Append(" + ");
@@ -786,25 +782,21 @@
         else
         {
             //Generate string for displaying to humans
-            logDataBuilder.Append("Year, Gaps, ");
+            logDataBuilder.Append("Year, ");
             for (int i=1; i<6; i++)
             {
-                logDataBuilder.Append(m_prototypeNames[m_speciesList[i]]);
-                if (i != 5)
-                {
-                    logDataBuilder.Append(", ");
-                }
-            }
-            logDataBuilder.Append("\n");
+                logDataBuilder.Append(m_prototypeNames[m_speciesList[i]] + ", ");
+            }
+            logDataBuilder.Append(" Gaps\n");
             for(int generation=0; generation<m_generations; generation++)
             {
                 logDataBuilder.Append(generation.ToString() + ", ");
-                logDataBuilder.Append(m_totalSpeciesCounts[generation, 0].ToString() + ", ");
                 logDataBuilder.Append(m_totalSpeciesCounts[generation, 1].ToString() + ", ");
                 logDataBuilder.Append(m_totalSpeciesCounts[generation, 2].ToString() + ", ");
                 logDataBuilder.Append(m_totalSpeciesCounts[generation, 3].ToString() + ", ");
                 logDataBuilder.Append(m_totalSpeciesCounts[generation, 4].ToString() + ", ");
-                logDataBuilder.Append(m_totalSpeciesCounts[generation, 5].ToString());
+                logDataBuilder.Append(m_totalSpeciesCounts[generation, 5].ToString() + ", ");
+                logDataBuilder.Append(m_totalSpeciesCounts[generation, 0].ToString());
                 if (generation != m_generations - 1)
                 {
                     logDataBuilder.Append("\n");


Bool constraints.

Bool constraints.

--- BTDB/ODBLayer/Constraint.cs
+++ BTDB/ODBLayer/Constraint.cs
@@ -35,6 +35,12 @@

     public static partial class Constraint
     {
+        public static partial class Bool
+        {
+            public static Constraint<bool> Exact(bool value) => new ConstraintBoolExact(value);
+            public static readonly Constraint<bool> Any = new ConstraintBoolAny();
+        }
+
         public static partial class DateTime
         {
             public static Constraint<System.DateTime> Exact(System.DateTime value) => new ConstraintDateTimeExact(value);
@@ -234,6 +240,15 @@
         public override bool Match(ref SpanReader reader, in StructList<byte> buffer)
         {
             reader.SkipStringOrdered();
+            return true;
+        }
+    }
+
+    public class ConstraintBoolAny : ConstraintAny<bool>
+    {
+        public override bool Match(ref SpanReader reader, in StructList<byte> buffer)
+        {
+            reader.SkipBool();
             return true;
         }
     }
@@ -283,10 +298,7 @@
     {
         readonly ulong _value;

-        public ConstraintUnsignedExact(ulong value)
-        {
-            _value = value;
-        }
+        public ConstraintUnsignedExact(ulong value) => _value = value;

         public override IConstraint.MatchType Prepare(ref StructList<byte> buffer)
         {
@@ -310,10 +322,7 @@
     {
         readonly long _value;

-        public ConstraintSignedExact(long value)
-        {
-            _value = value;
-        }
+        public ConstraintSignedExact(long value) => _value = value;

         public override IConstraint.MatchType Prepare(ref StructList<byte> buffer)
         {
@@ -337,10 +346,7 @@
     {
         readonly DateTime _value;

-        public ConstraintDateTimeExact(DateTime value)
-        {
-            _value = value;
-        }
+        public ConstraintDateTimeExact(DateTime value) => _value = value;

         public override IConstraint.MatchType Prepare(ref StructList<byte> buffer)
         {
@@ -359,4 +365,28 @@
             reader.SkipDateTime();
         }
     }
+
+    public class ConstraintBoolExact : ConstraintExact<bool>
+    {
+        readonly bool _value;
+
+        public ConstraintBoolExact(bool value) => _value = value;
+
+        public override IConstraint.MatchType Prepare(ref StructList<byte> buffer)
+        {
+            var structListWriter = new ContinuousMemoryBlockWriter(buffer);
+            Ofs = (int)buffer.Count;
+            var writer = new SpanWriter(structListWriter);
+            writer.WriteBool(_value);
+            writer.Sync();
+            buffer = structListWriter.GetStructList();
+            Len = (int)buffer.Count - Ofs;
+            return IConstraint.MatchType.Exact;
+        }
+
+        protected override void Skip(ref SpanReader reader)
+        {
+            reader.SkipBool();
+        }
+    }
 }


DateTime constraints

DateTime constraints

--- BTDB/ODBLayer/Constraint.cs
+++ BTDB/ODBLayer/Constraint.cs
@@ -35,6 +35,14 @@

     public static partial class Constraint
     {
+        public static partial class DateTime
+        {
+            public static Constraint<System.DateTime> Exact(System.DateTime value) => new ConstraintDateTimeExact(value);
+            public static Constraint<System.DateTime> Predicate(Predicate<System.DateTime> predicate) =>
+                new ConstraintDateTimePredicate(predicate);
+            public static readonly Constraint<System.DateTime> Any = new ConstraintDateTimeAny();
+        }
+
         public static partial class Unsigned
         {
             public static Constraint<ulong> Exact(ulong value) => new ConstraintUnsignedExact(value);
@@ -126,6 +134,15 @@
         public override bool Match(ref SpanReader reader, in StructList<byte> buffer) => _predicate(reader.ReadVInt64());
     }

+    public class ConstraintDateTimePredicate : ConstraintNoPrefix<DateTime>
+    {
+        readonly Predicate<DateTime> _predicate;
+
+        public ConstraintDateTimePredicate(Predicate<DateTime> predicate) => _predicate = predicate;
+
+        public override bool Match(ref SpanReader reader, in StructList<byte> buffer) => _predicate(reader.ReadDateTime());
+    }
+
     public abstract class ConstraintExact<T> : Constraint<T>
     {
         protected int Ofs;
@@ -199,6 +216,15 @@
         public override bool Match(ref SpanReader reader, in StructList<byte> buffer)
         {
             reader.SkipVInt64();
+            return true;
+        }
+    }
+
+    public class ConstraintDateTimeAny : ConstraintAny<DateTime>
+    {
+        public override bool Match(ref SpanReader reader, in StructList<byte> buffer)
+        {
+            reader.SkipDateTime();
             return true;
         }
     }
@@ -306,4 +332,31 @@
             reader.SkipVInt64();
         }
     }
+
+    public class ConstraintDateTimeExact : ConstraintExact<DateTime>
+    {
+        readonly DateTime _value;
+
+        public ConstraintDateTimeExact(DateTime value)
+        {
+            _value = value;
+        }
+
+        public override IConstraint.MatchType Prepare(ref StructList<byte> buffer)
+        {
+            var structListWriter = new ContinuousMemoryBlockWriter(buffer);
+            Ofs = (int)buffer.Count;
+            var writer = new SpanWriter(structListWriter);
+            writer.WriteDateTimeForbidUnspecifiedKind(_value);
+            writer.Sync();
+            buffer = structListWriter.GetStructList();
+            Len = (int)buffer.Count - Ofs;
+            return IConstraint.MatchType.Exact;
+        }
+
+        protected override void Skip(ref SpanReader reader)
+        {
+            reader.SkipDateTime();
+        }
+    }
 }


Fix TesterDiagnosticProvider not actually providing any document diagnostics

--- StyleCop.Analyzers/StyleCopTester/TesterDiagnosticProvider.cs
+++ StyleCop.Analyzers/StyleCopTester/TesterDiagnosticProvider.cs
@@ -24,7 +24,7 @@

         public override Task<IEnumerable<Diagnostic>> GetDocumentDiagnosticsAsync(Document document, CancellationToken cancellationToken)
         {
-            return Task.FromResult(this.diagnostics.Where(i => i.Location.GetLineSpan().Path == document.Name));
+            return Task.FromResult(this.diagnostics.Where(i => i.Location.GetLineSpan().Path == document.FilePath));
         }

         public override Task<IEnumerable<Diagnostic>> GetProjectDiagnosticsAsync(Project project, CancellationToken cancellationToken)


选项允许跨模块使用

选项允许跨模块使用

--- BaseForm/Models/MdiModel.cs
+++ BaseForm/Models/MdiModel.cs
@@ -340,7 +340,11 @@
             var datas = new List<ModuleParam>();
             foreach (var key in keys)
             {
-                var data = getParam(key["code"], key["deptId"], key["userId"]);
+                var code = key.ContainsKey("code") ? key["code"] : null;
+                var deptId = key.ContainsKey("deptId") ? key["deptId"] : null;
+                var userId = key.ContainsKey("userId") ? key["userId"] : null;
+                var byModule = key.ContainsKey("byModule");
+                var data = getParam(code, deptId, userId, byModule);
                 datas.Add(data);
             }

@@ -353,16 +357,18 @@
         /// <param name="key">选项代码</param>
         /// <param name="deptId">部门ID</param>
         /// <param name="userId">用户ID</param>
+        /// <param name="byModule">是否模块专用</param>
         /// <returns>ModuleParam 选项数据</returns>
-        public ModuleParam getParam(string key, string deptId = null, string userId = null)
-        {
-            var param = moduleParams.FirstOrDefault(i => i.code == key && i.deptId == deptId && i.userId == userId);
+        public ModuleParam getParam(string key, string deptId = null, string userId = null, bool byModule = false)
+        {
+            var param = moduleParams.FirstOrDefault(i => i.code == key && (!byModule || i.moduleId == moduleId)
+                                                                       && i.deptId == deptId && i.userId == userId);
             if (param == null)
             {
                 param = new ModuleParam
                 {
                     id = Util.newId(),
-                    moduleId = moduleId,
+                    moduleId = byModule ? moduleId : null,
                     code = key,
                     deptId = deptId,
                     userId = userId
@@ -379,7 +385,7 @@
         /// <returns>bool 是否成功</returns>
         public bool saveParam()
         {
-            var url = $"{baseServer}/commonapi/v1.0/navigations/{moduleId}/params";
+            var url = $"{baseServer}/commonapi/v1.0/params";
             var dict = new Dictionary<string, object> {{"list", moduleParams}};
             var client = new HttpClient<List<ModuleParam>>(tokenHelper);

@@ -549,7 +555,7 @@
         /// </summary>
         private void getParams()
         {
-            var url = $"{baseServer}/commonapi/v1.0/navigations/{moduleId}/params";
+            var url = $"{baseServer}/commonapi/v1.0/params";
             var client = new HttpClient<List<ModuleParam>>(tokenHelper);
             if (!client.get(url)) return;


Tiny solve block tuning.

Tiny solve block tuning.

--- BepuPhysics/Solver_Solve.cs
+++ BepuPhysics/Solver_Solve.cs
@@ -118,11 +118,13 @@
             }
         }

-        private unsafe void BuildWorkBlocks<TTypeBatchFilter>(BufferPool pool, int minimumBlockSizeInBundles, int targetBlocksPerBatch, ref TTypeBatchFilter typeBatchFilter) where TTypeBatchFilter : ITypeBatchSolveFilter
+        private unsafe void BuildWorkBlocks<TTypeBatchFilter>(BufferPool pool, int minimumBlockSizeInBundles, int maximumBlockSizeInBundles, int targetBlocksPerBatch, ref TTypeBatchFilter typeBatchFilter) where TTypeBatchFilter : ITypeBatchSolveFilter
         {
             ref var activeSet = ref ActiveSet;
             context.ConstraintBlocks.Blocks = new QuickList<WorkBlock>(targetBlocksPerBatch * activeSet.Batches.Count, pool);
             pool.Take(activeSet.Batches.Count, out context.BatchBoundaries);
+            var inverseMinimumBlockSizeInBundles = 1f / minimumBlockSizeInBundles;
+            var inverseMaximumBlockSizeInBundles = 1f / maximumBlockSizeInBundles;
             for (int batchIndex = 0; batchIndex < activeSet.Batches.Count; ++batchIndex)
             {
                 ref var typeBatches = ref activeSet.Batches[batchIndex].TypeBatches;
@@ -134,7 +136,6 @@
                         bundleCount += typeBatches[typeBatchIndex].BundleCount;
                     }
                 }
-
                 for (int typeBatchIndex = 0; typeBatchIndex < typeBatches.Count; ++typeBatchIndex)
                 {
                     ref var typeBatch = ref typeBatches[typeBatchIndex];
@@ -142,9 +143,10 @@
                     {
                         continue;
                     }
-                    var typeBatchSizeFraction = typeBatch.BundleCount / (float)bundleCount;
-                    var typeBatchMaximumBlockCount = typeBatch.BundleCount / (float)minimumBlockSizeInBundles;
-                    var typeBatchBlockCount = Math.Max(1, (int)Math.Min(typeBatchMaximumBlockCount, targetBlocksPerBatch * typeBatchSizeFraction));
+                    var typeBatchSizeFraction = typeBatch.BundleCount / (float)bundleCount; //note: pre-inverting this doesn't necessarily work well due to numerical issues.
+                    var typeBatchMaximumBlockCount = typeBatch.BundleCount * inverseMinimumBlockSizeInBundles;
+                    var typeBatchMinimumBlockCount = typeBatch.BundleCount * inverseMaximumBlockSizeInBundles;
+                    var typeBatchBlockCount = Math.Max(1, (int)Math.Min(typeBatchMaximumBlockCount, Math.Max(typeBatchMinimumBlockCount, targetBlocksPerBatch * typeBatchSizeFraction)));
                     int previousEnd = 0;
                     var baseBlockSizeInBundles = typeBatch.BundleCount / typeBatchBlockCount;
                     var remainder = typeBatch.BundleCount - baseBlockSizeInBundles * typeBatchBlockCount;
@@ -724,9 +726,10 @@
             //there are enough blocks that workstealing will still generally allow the extra threads to be useful.
             const int targetBlocksPerBatchPerWorker = 1;
             const int minimumBlockSizeInBundles = 1;
+            const int maximumBlockSizeInBundles = 1024;

             var targetBlocksPerBatch = workerCount * targetBlocksPerBatchPerWorker;
-            BuildWorkBlocks(pool, minimumBlockSizeInBundles, targetBlocksPerBatch, ref filter);
+            BuildWorkBlocks(pool, minimumBlockSizeInBundles, maximumBlockSizeInBundles, targetBlocksPerBatch, ref filter);
             ValidateWorkBlocks(ref filter);

             //Note the clear; the block claims must be initialized to 0 so that the first worker stage knows that the data is available to claim.


Make sure resume only gets fired if actually suspended

--- osu.Framework/Screens/ScreenStack.cs
+++ osu.Framework/Screens/ScreenStack.cs
@@ -123,7 +123,7 @@
             if (!child.ValidForPush)
             {
                 if (child == CurrentScreen)
-                    exitFrom(null, shouldFireEvent: false);
+                    exitFrom(null, shouldFireExitEvent: false, shouldFireResumeEvent: suspendImmediately);

                 return;
             }
@@ -221,8 +221,9 @@
         /// </summary>
         /// <param name="source">The <see cref="IScreen"/> which last exited.</param>
         /// <param name="onExiting">An action that is invoked when the current screen allows the exit to continue.</param>
-        /// <param name="shouldFireEvent">Whether <see cref="IScreen.OnExiting"/> should be fired on the exiting screen.</param>
-        private void exitFrom([CanBeNull] IScreen source, Action onExiting = null, bool shouldFireEvent = true)
+        /// <param name="shouldFireExitEvent">Whether <see cref="IScreen.OnExiting"/> should be fired on the exiting screen.</param>
+        /// <param name="shouldFireResumeEvent">Whether <see cref="IScreen.OnResuming"/> should be fired on the resuming screen.</param>
+        private void exitFrom([CanBeNull] IScreen source, Action onExiting = null, bool shouldFireExitEvent = true, bool shouldFireResumeEvent = true)
         {
             if (stack.Count == 0)
                 return;
@@ -231,7 +232,7 @@
             var toExit = stack.Pop();

             // The next current screen will be resumed
-            if (shouldFireEvent && toExit.AsDrawable().IsLoaded && toExit.OnExiting(CurrentScreen))
+            if (shouldFireExitEvent && toExit.AsDrawable().IsLoaded && toExit.OnExiting(CurrentScreen))
             {
                 stack.Push(toExit);
                 return;
@@ -254,7 +255,8 @@
             ScreenExited?.Invoke(toExit, CurrentScreen);

             // Resume the next current screen from the exited one
-            resumeFrom(toExit);
+            if (shouldFireResumeEvent)
+                resumeFrom(toExit);
         }

         /// <summary>


Mais algumas melhorias

Mais algumas melhorias

--- Boleto2.Net.Testes/Utils.cs
+++ Boleto2.Net.Testes/Utils.cs
@@ -1,12 +1,16 @@
 using System;
 using System.IO;
 using System.Text;
+using NReco.PdfGenerator;
 using NUnit.Framework;

 namespace Boleto2Net.Testes
 {
-    sealed class Utils
+    internal sealed class Utils
     {
+        private static int _contador = 1;
+
+        private static int _proximoNossoNumero = 1;

         internal static Cedente GerarCedente(string codigoCedente, string digitoCodigoCedente, ContaBancaria contaBancaria)
         {
@@ -30,11 +34,9 @@
             };
         }

-        static int _contador = 1;
         internal static Sacado GerarSacado()
         {
             if (_contador % 2 == 0)
-            {
                 return new Sacado
                 {
                     CPFCNPJ = "123.456.789-09",
@@ -50,40 +52,34 @@
                         CEP = "56789012"
                     }
                 };
-            }
-            else
-            {
-                return new Sacado
-                {
-                    CPFCNPJ = "98.765.432/1098-74",
-                    Nome = "Sacado Teste PJ",
-                    Observacoes = "Matricula 123/4",
-                    Endereco = new Endereco
-                    {
-                        LogradouroEndereco = "Avenida Testando",
-                        LogradouroNumero = "123",
-                        Bairro = "Bairro",
-                        Cidade = "Cidade",
-                        UF = "SP",
-                        CEP = "12345678"
-                    }
-                };
-            }
-        }
-
-        static int _proximoNossoNumero = 1;
+            return new Sacado
+            {
+                CPFCNPJ = "98.765.432/1098-74",
+                Nome = "Sacado Teste PJ",
+                Observacoes = "Matricula 123/4",
+                Endereco = new Endereco
+                {
+                    LogradouroEndereco = "Avenida Testando",
+                    LogradouroNumero = "123",
+                    Bairro = "Bairro",
+                    Cidade = "Cidade",
+                    UF = "SP",
+                    CEP = "12345678"
+                }
+            };
+        }
+
         internal static Boletos GerarBoletos(Banco banco, int quantidadeBoletos)
         {
             var boletos = new Boletos
             {
                 Banco = banco
             };
-            for (int i = 1; i <= quantidadeBoletos; i++)
-            {
+            for (var i = 1; i <= quantidadeBoletos; i++)
                 boletos.Add(GerarBoleto(banco, i));
-            }
             return boletos;
         }
+
         internal static Boleto GerarBoleto(Banco banco, int i)
         {
             var boleto = new Boleto
@@ -97,7 +93,7 @@
                 NossoNumero = (223344 + _proximoNossoNumero).ToString(),
                 NumeroDocumento = "BB" + _proximoNossoNumero.ToString("D6") + (char)(64 + i),
                 EspecieDocumento = TipoEspecieDocumento.DM,
-                Aceite = (_contador % 2) == 0 ? "N" : "A",
+                Aceite = _contador % 2 == 0 ? "N" : "A",
                 CodigoInstrucao1 = "11",
                 CodigoInstrucao2 = "22",
                 DataDesconto = DateTime.Now.AddMonths(i),
@@ -110,7 +106,7 @@
                 ValorJurosDia = (decimal)(100 * i * 0.002),
                 MensagemArquivoRemessa = "Mensagem para o arquivo remessa",
                 MensagemInstrucoesCaixa = "Mensagem para instruções do caixa",
-                NumeroControleParticipante = "CHAVEPRIMARIA=" + _proximoNossoNumero.ToString()
+                NumeroControleParticipante = "CHAVEPRIMARIA=" + _proximoNossoNumero
             };
             // Avalista
             if (_contador % 3 == 0)
@@ -120,17 +116,17 @@
             }
             // Grupo Demonstrativo do Boleto
             var grupoDemonstrativo = new GrupoDemonstrativo { Descricao = "GRUPO 1" };
-            grupoDemonstrativo.Itens.Add(new ItemDemonstrativo { Descricao = "Grupo 1, Item 1", Referencia = (boleto.DataEmissao.AddMonths(-1).Month).ToString() + "/" + (boleto.DataEmissao.AddMonths(-1).Year).ToString(), Valor = boleto.ValorTitulo * (decimal)0.15 });
-            grupoDemonstrativo.Itens.Add(new ItemDemonstrativo { Descricao = "Grupo 1, Item 2", Referencia = (boleto.DataEmissao.AddMonths(-1).Month).ToString() + "/" + (boleto.DataEmissao.AddMonths(-1).Year).ToString(), Valor = boleto.ValorTitulo * (decimal)0.05 });
+            grupoDemonstrativo.Itens.Add(new ItemDemonstrativo { Descricao = "Grupo 1, Item 1", Referencia = boleto.DataEmissao.AddMonths(-1).Month + "/" + boleto.DataEmissao.AddMonths(-1).Year, Valor = boleto.ValorTitulo * (decimal)0.15 });
+            grupoDemonstrativo.Itens.Add(new ItemDemonstrativo { Descricao = "Grupo 1, Item 2", Referencia = boleto.DataEmissao.AddMonths(-1).Month + "/" + boleto.DataEmissao.AddMonths(-1).Year, Valor = boleto.ValorTitulo * (decimal)0.05 });
             boleto.Demonstrativos.Add(grupoDemonstrativo);
             grupoDemonstrativo = new GrupoDemonstrativo { Descricao = "GRUPO 2" };
-            grupoDemonstrativo.Itens.Add(new ItemDemonstrativo { Descricao = "Grupo 2, Item 1", Referencia = (boleto.DataEmissao.Month).ToString() + "/" + (boleto.DataEmissao.Year).ToString(), Valor = boleto.ValorTitulo * (decimal)0.20 });
+            grupoDemonstrativo.Itens.Add(new ItemDemonstrativo { Descricao = "Grupo 2, Item 1", Referencia = boleto.DataEmissao.Month + "/" + boleto.DataEmissao.Year, Valor = boleto.ValorTitulo * (decimal)0.20 });
             boleto.Demonstrativos.Add(grupoDemonstrativo);
             grupoDemonstrativo = new GrupoDemonstrativo { Descricao = "GRUPO 3" };
-            grupoDemonstrativo.Itens.Add(new ItemDemonstrativo { Descricao = "Grupo 3, Item 1", Referencia = (boleto.DataEmissao.AddMonths(-1).Month).ToString() + "/" + (boleto.DataEmissao.AddMonths(-1).Year).ToString(), Valor = boleto.ValorTitulo * (decimal)0.37 });
-            grupoDemonstrativo.Itens.Add(new ItemDemonstrativo { Descricao = "Grupo 3, Item 2", Referencia = (boleto.DataEmissao.Month).ToString() + "/" + (boleto.DataEmissao.Year).ToString(), Valor = boleto.ValorTitulo * (decimal)0.03 });
-            grupoDemonstrativo.Itens.Add(new ItemDemonstrativo { Descricao = "Grupo 3, Item 3", Referencia = (boleto.DataEmissao.Month).ToString() + "/" + (boleto.DataEmissao.Year).ToString(), Valor = boleto.ValorTitulo * (decimal)0.12 });
-            grupoDemonstrativo.Itens.Add(new ItemDemonstrativo { Descricao = "Grupo 3, Item 4", Referencia = (boleto.DataEmissao.AddMonths(+1).Month).ToString() + "/" + (boleto.DataEmissao.AddMonths(+1).Year).ToString(), Valor = boleto.ValorTitulo * (decimal)0.08 });
+            grupoDemonstrativo.Itens.Add(new ItemDemonstrativo { Descricao = "Grupo 3, Item 1", Referencia = boleto.DataEmissao.AddMonths(-1).Month + "/" + boleto.DataEmissao.AddMonths(-1).Year, Valor = boleto.ValorTitulo * (decimal)0.37 });
+            grupoDemonstrativo.Itens.Add(new ItemDemonstrativo { Descricao = "Grupo 3, Item 2", Referencia = boleto.DataEmissao.Month + "/" + boleto.DataEmissao.Year, Valor = boleto.ValorTitulo * (decimal)0.03 });
+            grupoDemonstrativo.Itens.Add(new ItemDemonstrativo { Descricao = "Grupo 3, Item 3", Referencia = boleto.DataEmissao.Month + "/" + boleto.DataEmissao.Year, Valor = boleto.ValorTitulo * (decimal)0.12 });
+            grupoDemonstrativo.Itens.Add(new ItemDemonstrativo { Descricao = "Grupo 3, Item 4", Referencia = boleto.DataEmissao.AddMonths(+1).Month + "/" + boleto.DataEmissao.AddMonths(+1).Year, Valor = boleto.ValorTitulo * (decimal)0.08 });
             boleto.Demonstrativos.Add(grupoDemonstrativo);

             boleto.ValidarDados();
@@ -141,9 +137,9 @@

         internal static void TestarBoletoPDF(Banco banco, string nomeCarteira)
         {
-            int quantidadeBoletosParaTeste = 3;
+            var quantidadeBoletosParaTeste = 3;
             var boletos = GerarBoletos(banco, quantidadeBoletosParaTeste);
-            Assert.AreEqual(quantidadeBoletosParaTeste, boletos.Count, "Quantidade de boletos diferente de " + quantidadeBoletosParaTeste.ToString());
+            Assert.AreEqual(quantidadeBoletosParaTeste, boletos.Count, "Quantidade de boletos diferente de " + quantidadeBoletosParaTeste);

             // Define o nome do arquivo.
             var nomeArquivo = Path.GetTempPath() + "Boleto2Net\\" + nomeCarteira + "_Arquivo.PDF";
@@ -164,9 +160,9 @@
             try
             {
                 var html = new StringBuilder();
-                foreach (Boleto boletoTmp in boletos)
-                {
-                    using (BoletoBancario imprimeBoleto = new BoletoBancario
+                foreach (var boletoTmp in boletos)
+                {
+                    using (var boletoParaImpressao = new BoletoBancario
                     {
                         Boleto = boletoTmp,
                         OcultarInstrucoes = false,
@@ -176,15 +172,12 @@
                     })
                     {
                         html.Append("
");
-                        html.Append(imprimeBoleto.MontaHtml());
+                        html.Append(boletoParaImpressao.MontaHtml());
                         html.Append("
");
                     }
-                    var pdf = new NReco.PdfGenerator.HtmlToPdfConverter().GeneratePdf(html.ToString());
-                    using (FileStream fs = new FileStream(nomeArquivo, FileMode.Create))
-                    {
+                    var pdf = new HtmlToPdfConverter().GeneratePdf(html.ToString());
+                    using (var fs = new FileStream(nomeArquivo, FileMode.Create))
                         fs.Write(pdf, 0, pdf.Length);
-                        fs.Close();
-                    }
                 }
             }
             catch (Exception e)
@@ -200,33 +193,27 @@

         internal static void TestarArquivoRemessa(Banco banco, TipoArquivo tipoArquivo, string nomeCarteira)
         {
-            int quantidadeBoletosParaTeste = 36;
+            const int quantidadeBoletosParaTeste = 36;
             var boletos = GerarBoletos(banco, quantidadeBoletosParaTeste);
-            Assert.AreEqual(quantidadeBoletosParaTeste, boletos.Count, "Quantidade de boletos diferente de " + quantidadeBoletosParaTeste.ToString());
+            Assert.AreEqual(quantidadeBoletosParaTeste, boletos.Count, "Quantidade de boletos diferente de " + quantidadeBoletosParaTeste);

             // Define o nome do arquivo.
-            var nomeArquivo = Path.GetTempPath() + "Boleto2Net\\" + nomeCarteira + "_Arquivo" + tipoArquivo.ToString() + ".REM";
+            var nomeArquivo = Path.Combine(Path.GetTempPath(), "Boleto2Net", $"{nomeCarteira}_Arquivo{tipoArquivo}.REM");

             // Cria pasta para os arquivos
-            if (Directory.Exists(Path.GetDirectoryName(nomeArquivo)) == false)
+            if (!Directory.Exists(Path.GetDirectoryName(nomeArquivo)))
                 Directory.CreateDirectory(Path.GetDirectoryName(nomeArquivo));

-            // Se o arquivo já existir (testes anteriores), apaga o arquivo.
+            File.Delete(nomeArquivo);
             if (File.Exists(nomeArquivo))
-            {
-                File.Delete(nomeArquivo);
-                if (File.Exists(nomeArquivo))
-                    Assert.Fail("Arquivo Remessa não foi excluído: " + nomeArquivo);
-            }
+                Assert.Fail("Arquivo Remessa não foi excluído: " + nomeArquivo);

             // Gera o arquivo remessa.
             try
             {
                 var arquivoRemessa = new ArquivoRemessa(boletos.Banco, tipoArquivo, 1);
                 using (var fileStream = new FileStream(nomeArquivo, FileMode.Create))
-                {
                     arquivoRemessa.GerarArquivoRemessa(boletos, fileStream);
-                }
             }
             catch (Exception e)
             {
@@ -238,6 +225,5 @@
             // Se o arquivo existir, considera o teste OK
             Assert.IsTrue(File.Exists(nomeArquivo), "Arquivo Remessa não encontrado: " + nomeArquivo);
         }
-
     }
-};+}


Avoid crashes on attempting to import the same path twice in quick succession

--- osu.Game/Database/BeatmapDatabase.cs
+++ osu.Game/Database/BeatmapDatabase.cs
@@ -144,7 +144,11 @@
         public void Import(params string[] paths)
         {
             foreach (string p in paths)
-                Import(p);
+            {
+                //In case the file was imported twice and deleted after the first time
+                if (File.Exists(p))
+                    Import(p);
+            }
         }

         /// <summary>


Remove redundant interface

Remove redundant interface

--- osu.Game/Rulesets/Mods/ModPerfect.cs
+++ osu.Game/Rulesets/Mods/ModPerfect.cs
@@ -5,7 +5,7 @@

 namespace osu.Game.Rulesets.Mods
 {
-    public abstract class ModPerfect : ModSuddenDeath, IApplicableToScoreProcessor
+    public abstract class ModPerfect : ModSuddenDeath
     {
         public override string Name => "Perfect";
         public override string ShortenedName => "PF";


Fixed issue where the first frame would not check for input in Windows Native (Desktop and Editor)

--- XboxCtrlrInput/Assets/XboxCtrlrInputPackage/XboxCtrlrInput.cs
+++ XboxCtrlrInput/Assets/XboxCtrlrInputPackage/XboxCtrlrInput.cs
@@ -55,7 +55,7 @@

 		private static GamePadState[] xInputCtrlrs = new GamePadState[4];
 		private static GamePadState[] xInputCtrlrsPrev = new GamePadState[4];
-		private static int xiPrevFrameCount = 0;
+		private static int xiPrevFrameCount = -1;
 		private static bool xiUpdateAlreadyCalled = false;
 		private static bool xiNumOfCtrlrsQueried = false;

@@ -63,15 +63,19 @@

 		// >>> For Buttons <<< //

-		/// <summary> Returns <c>true</c> if the specified button is held down by any controller. </summary>
-		/// <param name='button'> Identifier for the Xbox button to be tested. </param>
+		/// <summary>
+		/// 	Returns <c>true</c> if the specified button is held down by any controller.
+		/// </summary>
+		/// <param name='button'>
+		/// 	Identifier for the Xbox button to be tested.
+		/// </param>
 		public static bool GetButton(XboxButton button)
 		{
 			if(OnWindowsNative())
 			{
 				if(!XInputStillInCurrFrame())
 				{
-					XInputUpdateAllStates(); //XInputUpdateSingleState();
+					XInputUpdateAllStates();
 				}
 				GamePadState ctrlrState = XInputGetSingleState();


Remove unnecessary Console.WriteLine in C# library

--- CSharpLibrary/Calculator.cs
+++ CSharpLibrary/Calculator.cs
@@ -39,7 +39,6 @@
             }
             catch (Exception e)
             {
-                Console.WriteLine(number);
                 Console.WriteLine(e.Message);
             }


Attempting to fix Linux axis input.

Attempting to fix Linux axis input.

Might not work.

--- XboxCtrlrInput/Assets/XboxCtrlrInputPackage/XboxCtrlrInput.cs
+++ XboxCtrlrInput/Assets/XboxCtrlrInputPackage/XboxCtrlrInput.cs
@@ -441,10 +441,10 @@
 				{
 					case XboxAxis.LeftStickX: 		sAxisCode = "X"; break;
 					case XboxAxis.LeftStickY:		sAxisCode = "Y"; break;
-					case XboxAxis.RightStickX:		sAxisCode = "3"; break;
-					case XboxAxis.RightStickY:		sAxisCode = "4"; break;
-					case XboxAxis.LeftTrigger:		sAxisCode = "2"; break;
-					case XboxAxis.RightTrigger:		sAxisCode = "5"; break;
+					case XboxAxis.RightStickX:		sAxisCode = "4"; break; //3
+					case XboxAxis.RightStickY:		sAxisCode = "5"; break; //4
+					case XboxAxis.LeftTrigger:		sAxisCode = "3"; break; //2
+					case XboxAxis.RightTrigger:		sAxisCode = "6"; break; //5

 					default: invalidCode = true; break;
 				}
@@ -527,8 +527,8 @@
 				{
 					case XboxDPad.Up: 		sPadCode = "7"; break;
 					case XboxDPad.Down:		sPadCode = "7"; break;
-					case XboxDPad.Left:		sPadCode = "6"; break;
-					case XboxDPad.Right:	sPadCode = "6"; break;
+					case XboxDPad.Left:		sPadCode = "8"; break; //6
+					case XboxDPad.Right:	sPadCode = "8"; break; //6

 					default: invalidCode = true; break;
 				}


CA-163777: [CAR-1711] Incorrect message for cleanup
-Added missing parameter to get_required_space plugin call.
-The required space is not shown in the notification when we are unable to tell how much space is required .

Signed-off-by: Gabor Apati-Nagy <fea1aad7ceb67d3aeb88acb6b51e51467c21418e@citrix.com>

--- XenModel/Actions/Pool_Patch/GetDiskSpaceRequirementsAction.cs
+++ XenModel/Actions/Pool_Patch/GetDiskSpaceRequirementsAction.cs
@@ -99,12 +99,16 @@
             long requiredDiskSpace = updateSize;
             try
             {
-                result = Host.call_plugin(Session, Host.opaque_ref, "disk-space", "get_required_space", new Dictionary<string, string>());
+                var args = new Dictionary<string, string>();
+                args.Add("size", updateSize.ToString());
+
+                result = Host.call_plugin(Session, Host.opaque_ref, "disk-space", "get_required_space", args);
                 requiredDiskSpace = Convert.ToInt64(result);
             }
             catch (Failure failure)
             {
                 log.WarnFormat("Plugin call disk-space.get_required_space on {0} failed with {1}", Host.Name, failure.Message);
+                requiredDiskSpace = 0;
             }

             // get available disk space
@@ -185,8 +189,11 @@

             sbMessage.AppendLine();
             sbMessage.AppendLine();
-            sbMessage.AppendFormat(Messages.NOT_ENOUGH_SPACE_MESSAGE_REQUIRED_SPACE, Util.DiskSizeString(RequiredDiskSpace));
-            sbMessage.AppendLine();
+            if (RequiredDiskSpace > 0)
+            {
+                sbMessage.AppendFormat(Messages.NOT_ENOUGH_SPACE_MESSAGE_REQUIRED_SPACE, Util.DiskSizeString(RequiredDiskSpace));
+                sbMessage.AppendLine();
+            }
             sbMessage.AppendFormat(Messages.NOT_ENOUGH_SPACE_MESSAGE_AVAILABLE_SPACE, Util.DiskSizeString(AvailableDiskSpace));
             sbMessage.AppendLine();
             sbMessage.AppendLine();


Update src/CommitmentsV2/SFA.DAS.CommitmentsV2.UnitTests/Application/Commands/UndoApprenticeshipUpdatesCommandHandlerTests.cs

Co-authored-by: Corey Faulconbridge <f1166372bbd52578c6fa637c95d9c61ae4c4871e@digital.education.gov.uk>

--- src/CommitmentsV2/SFA.DAS.CommitmentsV2.UnitTests/Application/Commands/UndoApprenticeshipUpdatesCommandHandlerTests.cs
+++ src/CommitmentsV2/SFA.DAS.CommitmentsV2.UnitTests/Application/Commands/UndoApprenticeshipUpdatesCommandHandlerTests.cs
@@ -44,7 +44,7 @@
         }

         [Test]
-        public async Task Handle_WhenCommandIsHandled_ApprenticeshipUpdateStatus_IsUndoed()
+        public async Task Handle_WhenCommandIsHandled_ApprenticeshipUpdateStatus_IsUndone()
         {
             fixture = new UndoApprenticeshipUpdatesCommandHandlerTestsFixture();
             fixture.ApprenticeshipUpdate.Cost = 195;
@@ -240,4 +240,4 @@
             Assert.IsInstanceOf<T>(Exception);
         }
     }
-}+}


Improve the applicability span.

Improve the applicability span.

--- src/Features/Core/Portable/MoveDeclarationNearReference/AbstractMoveDeclarationNearReferenceCodeRefactoringProvider.cs
+++ src/Features/Core/Portable/MoveDeclarationNearReference/AbstractMoveDeclarationNearReferenceCodeRefactoringProvider.cs
@@ -10,6 +10,7 @@
 using Microsoft.CodeAnalysis.LanguageServices;
 using Microsoft.CodeAnalysis.Shared.Extensions;
 using Microsoft.CodeAnalysis.Simplification;
+using Microsoft.CodeAnalysis.Text;

 namespace Microsoft.CodeAnalysis.MoveDeclarationNearReference
 {
@@ -48,9 +49,14 @@
                 return;
             }

-            // Only offer the refactoring when somewhere in the type+name of the local variable.
-            var identifier = this.GetIdentifierOfVariableDeclarator(state.VariableDeclarator);
-            if (position < statement.SpanStart || position > identifier.Span.End)
+            // Don't offer the refactoring inside the initializer for the variable.
+            var syntaxFacts = document.GetLanguageService<ISyntaxFactsService>();
+            var initializer = syntaxFacts.GetInitializerOfVariableDeclarator(state.VariableDeclarator);
+            var applicableSpan = initializer == null
+                ? statement.Span
+                : TextSpan.FromBounds(statement.SpanStart, initializer.SpanStart);
+
+            if (!applicableSpan.IntersectsWith(position))
             {
                 return;
             }