Added new methods to the EnumUtils class

The new methods can be used when the enum type is not known at compile time.

--- src/Skybrud.Essentials/Enums/EnumUtils.cs
+++ src/Skybrud.Essentials/Enums/EnumUtils.cs
@@ -2,6 +2,7 @@
 using System.Collections.Generic;
 using System.Linq;
 using System.Reflection;
+using Skybrud.Essentials.Collections.Extensions;
 using Skybrud.Essentials.Strings;

 namespace Skybrud.Essentials.Enums {
@@ -128,6 +129,44 @@
         }

         /// <summary>
+        /// Converts the string representation of the name or numeric value to an enum of the specified <paramref name="type"/>. The return value indicates whether the conversion succeeded.
+        /// </summary>
+        /// <param name="str">The string representation of the enumeration name or underlying value to convert.</param>
+        /// <param name="type">The type of the enum.</param>
+        /// <param name="value">When this method returns, contains a value of type <see cref="Enum"/>. This parameter is passed uninitialized.</param>
+        /// <returns><c>true</c> if the value parameter was converted successfully; otherwise, <c>false</c>.</returns>
+        public static bool TryParseEnum(string str, Type type, out Enum value) {
+
+            // Check whether the specified string is NULL (or white space)
+            if (string.IsNullOrWhiteSpace(str)) throw new ArgumentNullException(nameof(str));
+
+            // Check whether the type of T is an enum
+            if (IsEnum(type) == false) throw new ArgumentException("Specified type must be an enum.");
+
+            // Initialize "value"
+            value = default;
+
+            // Check whether the specified string is NULL (or white space)
+            if (string.IsNullOrWhiteSpace(str)) return false;
+
+            // Convert "str" to camel case and then lowercase
+            string modified = StringUtils.ToCamelCase(str + string.Empty).ToLowerInvariant();
+
+            // Parse the enum
+            foreach (Enum v in GetEnumValues(type)) {
+                string ordinal = Convert.ChangeType(v, typeof(int)) + string.Empty;
+                string name = v.ToString().ToLowerInvariant();
+                if (ordinal == modified || name == modified) {
+                    value = v;
+                    return true;
+                }
+            }
+
+            return false;
+
+        }
+
+        /// <summary>
         /// Converts the specified <paramref name="str"/> into an array of <typeparamref name="T"/>.
         /// </summary>
         /// <typeparam name="T">The type of the enum.</typeparam>
@@ -140,6 +179,48 @@
                 from piece in (str ?? string.Empty).Split(new[] { ',', ' ', '\r', '\n', '\t' }, StringSplitOptions.RemoveEmptyEntries)
                 select ParseEnum<T>(piece)
             ).ToArray();
+        }
+
+
+        /// <summary>
+        /// Converts the specified <paramref name="str"/> into an array of <paramref name="type"/>.
+        /// </summary>
+        /// <param name="str">A string value containing one or more enum values.</param>
+        /// <param name="type">The enum type.</param>
+        /// <returns>An instance of <see cref="Array"/> containing the parsed enum values.</returns>
+        public static Array ParseEnumArray(string str, Type type) {
+            return ParseEnumArray(str, type, new[] { ',', ' ', '\r', '\n', '\t' });
+        }
+
+        /// <summary>
+        /// Converts the specified <paramref name="str"/> into an array of <paramref name="type"/>.
+        /// </summary>
+        /// <param name="str">A string value containing one or more enum values.</param>
+        /// <param name="type">The enum type.</param>
+        /// <param name="separators">An array of supported separators.</param>
+        /// <returns>An instance of <see cref="Array"/> containing the parsed enum values.</returns>
+        public static Array ParseEnumArray(string str, Type type, char[] separators) {
+            return ParseEnumArray((str ?? string.Empty).Split(separators, StringSplitOptions.RemoveEmptyEntries), type);
+        }
+
+        /// <summary>
+        /// Converts the specified array of <paramref name="pieces"/> into an array of <paramref name="type"/>.
+        /// </summary>
+        /// <param name="pieces">Array of enum string representation.</param>
+        /// <param name="type">The enum type.</param>
+        /// <returns>An instanceo of <see cref="Array"/> containing the parsed enum values.</returns>
+        public static Array ParseEnumArray(string[] pieces, Type type) {
+
+            List<Enum> temp = new List<Enum>();
+
+            foreach (string piece in pieces) {
+                if (TryParseEnum(piece, type, out Enum value)) {
+                    temp.Add(value);
+                }
+            }
+
+            return temp.Cast(type).ToArray(type);
+
         }

         /// <summary>


Fixed: Given -1 MediaService returns all descendant media

It returned the entire media tree given the ID -1, changing this so it
returns children below root instead

--- src/Umbraco.Core/Services/MediaService.cs
+++ src/Umbraco.Core/Services/MediaService.cs
@@ -394,12 +394,8 @@
             using (var repository = RepositoryFactory.CreateMediaRepository(UowProvider.GetUnitOfWork()))
             {
                 var query = Query<IMedia>.Builder;
-                //if the id is -1, then just get all
-                if (id != -1)
-                {
-                    query.Where(x => x.ParentId == id);
-                }
-
+                query.Where(x => x.ParentId == id);
+
                 long total;
                 var medias = repository.GetPagedResultsByQuery(query, pageIndex, pageSize, out total, orderBy, orderDirection, filter);

@@ -427,11 +423,8 @@
             using (var repository = RepositoryFactory.CreateMediaRepository(UowProvider.GetUnitOfWork()))
             {
                 var query = Query<IMedia>.Builder;
-                //if the id is -1, then just get all
-                if (id != -1)
-                {
-                    query.Where(x => x.ParentId == id);
-                }
+                query.Where(x => x.ParentId == id);
+
                 var medias = repository.GetPagedResultsByQuery(query, pageIndex, pageSize, out totalChildren, orderBy, orderDirection, filter);

                 return medias;


DEV-15010 Updated SDK version.

DEV-15010 Updated SDK version.

--- Acrolinx.Sidebar/Properties/AssemblyInfo.cs
+++ Acrolinx.Sidebar/Properties/AssemblyInfo.cs
@@ -35,6 +35,6 @@
 // by using the '*' as shown below:
 // [assembly: AssemblyVersion("1.0.*")]

-[assembly: AssemblyVersion("1.1.0.27")]
-[assembly: AssemblyFileVersion("1.1.0.27")]
+[assembly: AssemblyVersion("1.1.0.28")]
+[assembly: AssemblyFileVersion("1.1.0.28")]


* Enhanced ParticleSystem Class documentation to be less ambiguous.

git-svn-id: c32cf1ecefca26b8770d7b0740bc0c5c174087e4@1612 c754d5e9-d413-0410-bcdf-9574c9dba6b7

--- libsecondlife/ParticleSystem.cs
+++ libsecondlife/ParticleSystem.cs
@@ -21,7 +21,7 @@
             {
                 /// None
                 None = 0,
-                /// Drop particles at source position with no force
+                /// Drop particles from source position with no force
                 Drop = 0x01,
                 /// "Explode" particles in all directions
                 Explode = 0x02,
@@ -45,7 +45,7 @@
                 InterpColor = 0x001,
                 /// Interpolate scale from start to end
                 InterpScale = 0x002,
-                /// Bounce particles off sourc Z height
+                /// Bounce particles off particle sources Z height
                 Bounce = 0x004,
                 /// velocity of particles is dampened toward the simulators wind
                 Wind = 0x008,
@@ -88,49 +88,57 @@
             public uint PartFlags;
             /// <seealso cref="T:SourcePattern"/> pattern of particles
             public SourcePattern Pattern;
-            /// Maximimum age (in seconds) particle will be displayed (max 30 seconds)
+            /// A <see langword="float"/> representing the maximimum age (in seconds) particle will be displayed
+            /// <remarks>Maximum value is 30 seconds</remarks>
             public float MaxAge;
-            /// Number of seconds, from when the particle source comes into view,
+            /// A <see langword="float"/> representing the number of seconds,
+            /// from when the particle source comes into view,
             /// or the particle system's creation, that the object will emits particles;
             /// after this time period no more particles are emitted
             public float StartAge;
-            /// Area in radians that specify where particles will not be created
+            /// A <see langword="float"/> in radians that specifies where particles will not be created
             public float InnerAngle;
-            /// Area in radians that will be filled with particles
+            /// A <see langword="float"/> in radians that specifies where particles will be created
             public float OuterAngle;
-            /// How often particle burts will occur in seconds
+            /// A <see langword="float"/> representing the number of seconds between burts.
             public float BurstRate;
-            /// Number of meters from center of sourcewhere particles are created
+            /// A <see langword="float"/> representing the number of meters
+            /// around the center of the source where particles will be created.
             public float BurstRadius;
-            /// Minimum speed of particle creation
+            /// A <see langword="float"/> representing in seconds, the minimum speed between bursts of new particles
+            /// being emitted
             public float BurstSpeedMin;
-            /// Maximum speed of particle creation
+            /// A <see langword="float"/> representing in seconds the maximum speed of new particles being emitted.
             public float BurstSpeedMax;
-            /// How many particles are generated per burst
+            /// A <see langword="byte"/> representing the maximum number of particles emitted per burst
             public byte BurstPartCount;
-            /// X/Y/Z Velocity in which particles are emitted
+            /// A <see cref="T:LLVector3"/> which represents the velocity (speed) from the source which particles are emitted
             public LLVector3 AngularVelocity;
-            /// X/Y/Z Acceleration in which particles are emitted
+            /// A <see cref="T:LLVector3"/> which represents the Acceleration from the source which particles are emitted
             public LLVector3 PartAcceleration;
-            /// Key of texture used in particle
+            /// The <see cref="T:LLUUID"/> Key of the texture displayed on the particle
             public LLUUID Texture;
-            /// Key of target
+            /// The <see cref="T:LLUUID"/> Key of the specified target object or avatar particles will follow
             public LLUUID Target;
             /// Flags of particle from <seealso cref="T:ParticleDataFlags"/>
             public ParticleDataFlags PartDataFlags;
             /// Max Age particle system will emit particles for
             public float PartMaxAge;
-            /// Starting color of particles
+            /// The <see cref="T:LLColor"/> the particle has at the beginning of its lifecycle
             public LLColor PartStartColor;
-            /// Ending color of particles
+            /// The <see cref="T:LLColor"/> the particle has at the ending of its lifecycle
             public LLColor PartEndColor;
-            /// Starting X size of particle (Min 0, Max 4)
+            /// A <see langword="float"/> that represents the starting X size of the particle
+            /// <remarks>Minimum value is 0, maximum value is 4</remarks>
             public float PartStartScaleX;
-            /// Starting Y size of particle (Min 0, Max 4)
+            /// A <see langword="float"/> that represents the starting Y size of the particle
+            /// <remarks>Minimum value is 0, maximum value is 4</remarks>
             public float PartStartScaleY;
-            /// Ending X size of particle (Min 0, Max 4)
+            /// A <see langword="float"/> that represents the ending X size of the particle
+            /// <remarks>Minimum value is 0, maximum value is 4</remarks>
             public float PartEndScaleX;
-            /// Ending Y size of particle (Min 0, Max 4)
+            /// A <see langword="float"/> that represents the ending Y size of the particle
+            /// <remarks>Minimum value is 0, maximum value is 4</remarks>
             public float PartEndScaleY;

             ///


added: GetObjectIDPosition() method

 added: GetObjectIDPosition() method

GetObjectIDPosition returns the position (0-based) within the `Hits`
result list of the record matching against the given objectID. If the
objectID is not found, -1 is returned.

[changelog]

--- src/Algolia.Search/Utils/AlgoliaHelper.cs
+++ src/Algolia.Search/Utils/AlgoliaHelper.cs
@@ -22,6 +22,7 @@
 */

 using Algolia.Search.Exceptions;
+using Algolia.Search.Models.Search;
 using Newtonsoft.Json;
 using Newtonsoft.Json.Linq;
 using System;
@@ -31,13 +32,28 @@

 namespace Algolia.Search.Utils
 {
-    internal static class AlgoliaHelper
+    /// <summary>
+    /// A collection of helpers related to Algolia
+    /// </summary>
+    public static class AlgoliaHelper
     {
+        /// <summary>
+        /// GetObjectIDPosition returns the position (0-based) within the `Hits`
+        /// result list of the record matching against the given `objectID`. If the
+        /// `objectID` is not found, `-1` is returned.
+        /// </summary>
+        /// <param name="objectID">ID of the record the check.</param>
+        /// <param name="searchResult">SearchResult to look in. </param>
+        public static int GetObjectIDPosition<T>(this SearchResponse<T> searchResult, string objectID) where T : class
+        {
+            return searchResult.Hits.FindIndex(x => GetObjectID(x).Equals(objectID));
+        }
+
         /// <summary>
         /// Ensure that the type T has a property ObjectID or a JsonPropertyAttribute(Name="objectID")
         /// </summary>
         /// <typeparam name="T">Type to check/type</typeparam>
-        public static void EnsureObjectID<T>()
+        internal static void EnsureObjectID<T>()
         {
             Type itemType = typeof(T);
             if (itemType == typeof(JToken) || itemType == typeof(JObject) || itemType == typeof(JArray) ||
@@ -69,7 +85,7 @@
         /// <typeparam name="T">Type of the data to send/retrieve</typeparam>
         /// <param name="data">Data to send</param>
         /// <returns></returns>
-        public static string GetObjectID<T>(T data)
+        internal static string GetObjectID<T>(T data)
         {
             var objectIdProperty = PropertyOrJsonAttributeExists<T>("ObjectID");

@@ -92,7 +108,7 @@
         /// Get all properties of a type (including base class)
         /// </summary>
         /// <param name="T"></param>
-        public static IEnumerable<PropertyInfo> GetAllProperties(Type T)
+        internal static IEnumerable<PropertyInfo> GetAllProperties(Type T)
         {
             IEnumerable<PropertyInfo> PropertyList = T.GetTypeInfo().DeclaredProperties;


Added omitted Threat

Added omitted Threat

--- src/Api.Database.Entity/Threats/Threat.cs
+++ src/Api.Database.Entity/Threats/Threat.cs
@@ -0,0 +1,67 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using System.ComponentModel.DataAnnotations.Schema;
+using System.Text;
+
+namespace Portal.Database.Entity.Threats
+{
+
+    public class Threat : BaseEntity
+    {
+
+        [Required]
+        [StringLength(100)]
+        public string Name
+        {
+            get;
+            set;
+        }
+
+        [StringLength(255)]
+        public string Description
+        {
+            get;
+            set;
+        }
+
+        [StringLength(255)]
+        [DataType(DataType.Text)]
+        public string Referer
+        {
+            get;
+            set;
+        }
+
+        public string Host
+        {
+            get;
+            set;
+        }
+
+        public string UserAgent
+        {
+            get;
+            set;
+        }
+
+        public string XForwardHost { get; set; }
+
+        public string XForwardProto { get; set; }
+
+        public string QueryString { get; set; }
+
+        public string Protocol { get; set; }
+
+        [ForeignKey("Status")]
+        public int StatusId { get; set; }
+
+        [ForeignKey("Type")]
+        public int TypeId { get; set; }
+
+        public virtual ThreatType Type { get; set; }
+        public virtual Status Status { get; set; }
+
+
+    }
+}


Support for "light" colors i n AnsiColorTerminalAppender.  LOG4NET-223.  Submitted by Bojan

git-svn-id: 7230453ef4d2e9c957b80d4737114f575fc9f7f8@1197625 13f79535-47bb-0310-9956-ffa450edef68

--- src/Appender/AnsiColorTerminalAppender.cs
+++ src/Appender/AnsiColorTerminalAppender.cs
@@ -153,7 +153,12 @@
 			/// <summary>
 			/// text is displayed with a strikethrough
 			/// </summary>
-			Strikethrough	= 64
+			Strikethrough		= 64,
+
+			/// <summary>
+			/// text color is light
+			/// </summary>
+			Light			= 128
 		}

 		/// <summary>
@@ -176,7 +181,7 @@
 			/// <summary>
 			/// color is red
 			/// </summary>
-			Red		= 1,
+			Red	= 1,

 			/// <summary>
 			/// color is green
@@ -510,12 +515,14 @@
 				// Reset any existing codes
 				buf.Append("\x1b[0;");

+				int lightAdjustment = ((m_attributes & AnsiAttributes.Light) > 0) ? 60 : 0;
+
 				// set the foreground color
-				buf.Append(30 + (int)m_foreColor);
+				buf.Append(30 + lightAdjustment + (int)m_foreColor);
 				buf.Append(';');

 				// set the background color
-				buf.Append(40 + (int)m_backColor);
+				buf.Append(40 + lightAdjustment + (int)m_backColor);

 				// set the attributes
 				if ((m_attributes & AnsiAttributes.Bright) > 0)


Fix failing unit test that somehow didn't fail on Linux

--- src/BloomTests/Book/XMatterHelperTests.cs
+++ src/BloomTests/Book/XMatterHelperTests.cs
@@ -189,17 +189,18 @@
 				"" +
 				"");
 			var helper1 = new XMatterHelper(dom1, "Factory", fileLocator);
-			if (!string.IsNullOrEmpty(xmatterBook))
+			if (xmatterBook.Contains("DoesNotExist") || string.IsNullOrEmpty(xmatterBook))
+			{
+				// An xmatter specification that cannot be found should be removed from the DOM.
+				// An empty xmatter specification is also removed.
+				Assert.That(dom1.GetMetaValue("xmatter", null), Is.Null);
+			}
+			else
 			{
 				// Verify that we may have what we want for the xmatter specification, valid or not.
 				Assert.That(dom1.GetMetaValue("xmatter", null), Is.Not.Null);
 			}
 			Assert.That(helper1.GetStyleSheetFileName(), Is.EqualTo(expected));
-			if (xmatterBook.Contains("DoesNotExist"))
-			{
-				// Invalid xmatter specification should be removed from the DOM.
-				Assert.That(dom1.GetMetaValue("xmatter", null), Is.Null);
-			}
 		}

 		//		TODO: at the moment, we'd have to creat a whole xmatter folder


Fixing build... somehow this got left out of the commit (BL-8545)

--- src/BloomTests/Book/XMatterHelperTests.cs
+++ src/BloomTests/Book/XMatterHelperTests.cs
@@ -174,7 +174,7 @@
 			elementsToCheck.ForEach(elementToCheck =>
 			{
 				string lang = languageLocationDiv.Attributes["lang"]?.Value;
-				while (lang.IsNullOrEmpty() || lang == "*")
+				while (string.IsNullOrEmpty(lang) || lang == "*")
 				{
 					elementToCheck = (XmlElement)elementToCheck.ParentNode;
 					lang = elementToCheck.Attributes["lang"]?.Value;


Clean up obsolete comment

Clean up obsolete comment

--- src/BloomTests/Publish/ExportEpubTests.cs
+++ src/BloomTests/Publish/ExportEpubTests.cs
@@ -1879,7 +1879,7 @@
 				book = SetupBookLong(
 					text: "
This is some text.
",
 					lang: "xyz",
-					extraContent: extraContentDe, // don't include the xyz extraContent, that would make two bloom-editables in the same language in the same group.
+					extraContent: extraContentDe,
 					extraEditDivClasses: "audio-sentence' id='e993d14a-0ec3-4316-840b-ac9143d59a2f",  // Injecting other attributes into the "class" field as well in order to create the ID attribute simultaneously
 					extraContentOutsideTranslationGroup: "

Another sentence

"
 				);


Initialize with the right capacity in CloneCustomMetadata (#5218)

To avoid resizing after creation.

--- src/Build/Instance/ProjectItemInstance.cs
+++ src/Build/Instance/ProjectItemInstance.cs
@@ -1386,9 +1386,10 @@
             /// <returns>The cloned metadata.</returns>
             public IDictionary CloneCustomMetadata()
             {
-                Dictionary<string, string> clonedMetadata = new Dictionary<string, string>(MSBuildNameIgnoreCaseComparer.Default);
-
-                foreach (ProjectMetadataInstance metadatum in MetadataCollection)
+                var metadata = MetadataCollection;
+                Dictionary<string, string> clonedMetadata = new Dictionary<string, string>(metadata.Count, MSBuildNameIgnoreCaseComparer.Default);
+
+                foreach (ProjectMetadataInstance metadatum in metadata)
                 {
                     clonedMetadata[metadatum.Name] = metadatum.EvaluatedValue;
                 }


Fixed GetLiteralDateDiff() to work even with composite arguments

--- src/DbLinq.PostgreSql/PgsqlSqlProvider.cs
+++ src/DbLinq.PostgreSql/PgsqlSqlProvider.cs
@@ -1,4 +1,4 @@
-#region MIT license
+#region MIT license
 //
 // MIT license
 //
@@ -72,7 +72,7 @@

         protected override SqlStatement GetLiteralDateDiff(SqlStatement dateA, SqlStatement dateB)
         {
-            return string.Format("(EXTRACT(EPOCH FROM ({0}-{1})::interval)*1000)", dateA, dateB);
+            return string.Format("(EXTRACT(EPOCH FROM ({0})::timestamp)-EXTRACT(EPOCH FROM ({1})::timestamp))*1000", dateA, dateB);
         }

         protected override SqlStatement GetLiteralEqual(SqlStatement a, SqlStatement b)
@@ -129,6 +129,7 @@

             {typeof(DateTime),"timestamp"},
             //{typeof(Guid),"uniqueidentifier"}
+            {typeof(byte[]),"bytea"},
         };

         public override SqlStatement GetLiteralConvert(SqlStatement a, Type type)


Resolved conflict in constants

Resolved conflict in constants

--- src/GameFifteen.Logic/Common/Constants.cs
+++ src/GameFifteen.Logic/Common/Constants.cs
@@ -40,4 +40,4 @@
         // Convertor
         public const int EnglishAlphabetLettersCount = 26;
     }
-}+}


VerifyGenericImplementationIsCompatible - Refactored (2)

--- src/GraphClimber/GenericArgumentBinder.cs
+++ src/GraphClimber/GenericArgumentBinder.cs
@@ -93,9 +93,7 @@
                 Type[] implementationArguments = implementation.GetGenericArguments();
                 Type[] staticArguments = genericType.GetGenericArguments();

-                for (int i = 0;
-                    i < implementationArguments.Length;
-                    i++)
+                for (int i = 0; i < implementationArguments.Length; i++)
                 {
                     if (!TryBind(staticArguments[i], implementationArguments[i]))
                     {


Remove obsolete method of binding ColorScheme cbo box

--- src/HearThis/UI/AdministrativeSettings.cs
+++ src/HearThis/UI/AdministrativeSettings.cs
@@ -89,10 +89,6 @@
 			_cboColorScheme.DisplayMember = "Value";
 			_cboColorScheme.ValueMember = "Key";
 			_cboColorScheme.DataSource = new BindingSource(AppPallette.AvailableColorSchemes, null);
-			//foreach (var schemeKeyValuePair in AppPallette.AvailableColorSchemes)
-			//{
-			//	_cboColorScheme.Items.Add(schemeKeyValuePair);
-			//}
 			_cboColorScheme.SelectedValue = Settings.Default.UserColorScheme;
 		}


Fix up unit tests for ProcessingState

Fix up unit tests for ProcessingState

One unit test was accidentally relying on LastStateChangeTicks not being
updated. Fixed up that unit test and created new one to specifically
check that LastStateChangeTicks *is* updated.

--- src/LfMerge.Tests/ProcessingStateTests.cs
+++ src/LfMerge.Tests/ProcessingStateTests.cs
@@ -112,18 +112,21 @@
 		public void State_SettingProperty_SerializesState()
 		{
 			// Setup
-			var ticks = DateTime.Now.Ticks;
 			var sut = new ProcessingState("proja", _env.Settings) {
 				SRState = ProcessingState.SendReceiveStates.SYNCING,
-				LastStateChangeTicks = ticks,
 				PercentComplete = 50,
 				ElapsedTimeSeconds = 10,
 				TimeRemainingSeconds = 20,
 				TotalSteps = 5,
 				CurrentStep = 1,
 				RetryCounter = 2,
-				UncommittedEditCounter = 0
+				UncommittedEditCounter = 0,
 			};
+
+			// Exercise
+			sut.SRState = ProcessingState.SendReceiveStates.SYNCING;
+
+			// Have to calculate the expected value AFTER setting the state
 			var expectedJson = string.Format(@"{{
   ""SRState"": ""{0}"",
   ""LastStateChangeTicks"": {1},
@@ -137,10 +140,7 @@
   ""ErrorMessage"": null,
   ""ErrorCode"": 0,
   ""ProjectCode"": ""proja""
-}}", ProcessingState.SendReceiveStates.SYNCING, ticks);
-
-			// Exercise
-			sut.SRState = ProcessingState.SendReceiveStates.SYNCING;
+}}", ProcessingState.SendReceiveStates.SYNCING, sut.LastStateChangeTicks);

 			// Verify
 			Directory.CreateDirectory(_env.Settings.StateDirectory);
@@ -148,6 +148,23 @@
 			Assert.That(File.ReadAllText(filename), Is.EqualTo(expectedJson));
 		}

+		[Test]
+		public void State_SettingProperty_ChangesLastStateChangeTicks()
+		{
+			// Setup
+			var sut = new ProcessingState("proja", _env.Settings) {
+				SRState = ProcessingState.SendReceiveStates.IDLE,
+			};
+			var oldTicks = sut.LastStateChangeTicks;
+
+			// Exercise
+			sut.SRState = ProcessingState.SendReceiveStates.SYNCING;
+			// Have to calculate the expected value AFTER setting the state
+			var newTicks = sut.LastStateChangeTicks;
+
+			// Verify
+			Assert.That(newTicks, Is.GreaterThan(oldTicks));
+		}
 	}
 }


Bumps version to 2.0

Bumps version to 2.0

--- src/Lithnet.GoogleApps.MA/AssemblyInfo.cs
+++ src/Lithnet.GoogleApps.MA/AssemblyInfo.cs
@@ -31,7 +31,7 @@
 // You can specify all the values or you can default the Revision and Build Numbers
 // by using the '*' as shown below:

-[assembly: AssemblyVersion("1.2.*")]
+[assembly: AssemblyVersion("2.0.*")]

 //
 // In order to sign your assembly you must specify a key to use. Refer to the


Build in CI

Build in CI

--- src/Media.Plugin/iOS/UIImageExtensions.cs
+++ src/Media.Plugin/iOS/UIImageExtensions.cs
@@ -30,7 +30,7 @@
 			imageSource?.Dispose();

 			CILanczosScaleTransform transform = null;
-			if(UIDevice.CurrentDevice.CheckSystemVersion(13, 0))
+			/*if(UIDevice.CurrentDevice.CheckSystemVersion(13, 0))
 			{
 				transform = new CILanczosScaleTransform
 				{
@@ -39,15 +39,15 @@
 					AspectRatio = 1.0f
 				};
 			}
-			else
+			else*/
+			//{
+			transform = new CILanczosScaleTransform
 			{
-				transform = new CILanczosScaleTransform
-				{
-					Scale = scale,
-					Image = sourceImage,
-					AspectRatio = 1.0f
-				};
-			}
+				Scale = scale,
+				Image = sourceImage,
+				AspectRatio = 1.0f
+			};
+			//}

 			var output = transform.OutputImage;
 			using var cgi = c.CreateCGImage(output, output.Extent);


Adjust test scene to cover failure

Adjust test scene to cover failure

--- osu.Game.Tests/Visual/Online/TestSceneBeatmapListingOverlay.cs
+++ osu.Game.Tests/Visual/Online/TestSceneBeatmapListingOverlay.cs
@@ -198,13 +198,13 @@
                 beatmapSet = CreateAPIBeatmapSet(Ruleset.Value);
                 beatmapSet.Title = "last beatmap of first page";

-                fetchFor(getManyBeatmaps(49).Append(beatmapSet).ToArray(), true);
+                fetchFor(getManyBeatmaps(49).Append(new APIBeatmapSet { Title = "last beatmap of first page", OnlineID = beatmapSet.OnlineID }).ToArray(), true);
             });
             AddUntilStep("wait for loaded", () => this.ChildrenOfType<BeatmapCard>().Count() == 50);

-            AddStep("set next page", () => setSearchResponse(getManyBeatmaps(49).Prepend(beatmapSet).ToArray(), false));
+            AddStep("set next page", () => setSearchResponse(getManyBeatmaps(49).Prepend(new APIBeatmapSet { Title = "this shouldn't show up", OnlineID = beatmapSet.OnlineID }).ToArray(), false));
             AddStep("scroll to end", () => overlay.ChildrenOfType<OverlayScrollContainer>().Single().ScrollToEnd());
-            AddUntilStep("wait for loaded", () => this.ChildrenOfType<BeatmapCard>().Count() == 99);
+            AddUntilStep("wait for loaded", () => this.ChildrenOfType<BeatmapCard>().Count() >= 99);

             AddAssert("beatmap not duplicated", () => overlay.ChildrenOfType<BeatmapCard>().Count(c => c.BeatmapSet.Equals(beatmapSet)) == 1);
         }


Add some content to test scene for better visual representation

--- osu.Game.Tests/Visual/Online/TestSceneRankingsCountryFilter.cs
+++ osu.Game.Tests/Visual/Online/TestSceneRankingsCountryFilter.cs
@@ -4,8 +4,13 @@
 using System;
 using System.Collections.Generic;
 using osu.Framework.Bindables;
+using osu.Framework.Graphics.Containers;
 using osu.Game.Overlays.Rankings;
 using osu.Game.Users;
+using osu.Framework.Graphics;
+using osu.Framework.Graphics.Shapes;
+using osuTK.Graphics;
+using osu.Game.Graphics.Sprites;

 namespace osu.Game.Tests.Visual.Online
 {
@@ -20,9 +25,35 @@
         {
             var countryBindable = new Bindable<Country>();

-            Add(new CountryFilter
+            AddRange(new Drawable[]
             {
-                Country = { BindTarget = countryBindable }
+                new Box
+                {
+                    RelativeSizeAxes = Axes.Both,
+                    Colour = Color4.Gray,
+                },
+                new FillFlowContainer
+                {
+                    RelativeSizeAxes = Axes.X,
+                    AutoSizeAxes = Axes.Y,
+                    Direction = FillDirection.Vertical,
+                    Children = new Drawable[]
+                    {
+                        new CountryFilter
+                        {
+                            Anchor = Anchor.TopCentre,
+                            Origin = Anchor.TopCentre,
+                            Country = { BindTarget = countryBindable }
+                        },
+                        new OsuSpriteText
+                        {
+                            Anchor = Anchor.TopCentre,
+                            Origin = Anchor.TopCentre,
+                            Text = "Some content",
+                            Margin = new MarginPadding { Vertical = 20 }
+                        }
+                    }
+                }
             });

             var country = new Country


Fixed Map Serializer

Fixed Map Serializer

--- src/AntMe.Core/Map.cs
+++ src/AntMe.Core/Map.cs
@@ -691,14 +691,14 @@

             // Startpoints
             writer.Write((byte)StartPoints.Length);
-            for (int i = 0; i < StartPoints.GetLength(0); i++)
+            for (int i = 0; i < StartPoints.Length; i++)
             {
                 writer.Write((short)StartPoints[i].X);
                 writer.Write((short)StartPoints[i].Y);
             }

             // Map Properties
-            writer.Write((byte)Properties.Count() + UnknownProperties.Count);
+            writer.Write((byte)(Properties.Count() + UnknownProperties.Count));
             foreach (var property in Properties)
             {
                 writer.Write(property.GetType().FullName);
@@ -829,7 +829,7 @@
                         }

                         // Properties
-                        writer.Write((byte)tile.Properties.Count() + tile.UnknownProperties.Count);
+                        writer.Write((byte)(tile.Properties.Count() + tile.UnknownProperties.Count));
                         foreach (var property in tile.Properties)
                         {
                             int propertyIndex = propertyTypes.IndexOf(property.GetType().FullName);
@@ -980,7 +980,7 @@
                         continue;

                     // Identify Map Tile Type
-                    string tileTypeName = mapTileTypes[tileTypeIndex];
+                    string tileTypeName = mapTileTypes[tileTypeIndex - 1];
                     var tileTypeMap = context.Mapper.MapTiles.FirstOrDefault(t => t.Type.FullName.Equals(tileTypeName));
                     MapTile mapTile;
                     if (tileTypeMap != null)
@@ -996,12 +996,13 @@
                         byte[] payload = reader.ReadBytes(bufferSize);
                         mapTile = new UnknownMapTile(context, tileTypeName, payload);
                     }
+                    this[x, y] = mapTile;

                     // Handle Material
                     short materialIndex = reader.ReadByte();
                     if (materialIndex > 0)
                     {
-                        string materialTypeName = materialTypes[materialIndex];
+                        string materialTypeName = materialTypes[materialIndex - 1];
                         var materialMap = context.Mapper.MapMaterials.FirstOrDefault(m => m.Type.FullName.Equals(materialTypeName));
                         if (materialMap != null)
                         {


add svc client [#136060481]

add svc client [#136060481]

--- revashare-svc-webapi/revashare-svc-webapi.Logic/DriverLogic.cs
+++ revashare-svc-webapi/revashare-svc-webapi.Logic/DriverLogic.cs
@@ -9,6 +9,8 @@

 namespace revashare_svc_webapi.Logic {
   public class DriverLogic : IDriverRepository {
+    private RevaShareDataServiceClient svc = new RevaShareDataServiceClient();
+
     public bool UpdateVehicleInfo(VehicleDTO vehicle) {
       throw new NotImplementedException();
     }


Force sync

Force sync

--- sharpbox.Data/Strategy/EntityFrameworkStrategy.cs
+++ sharpbox.Data/Strategy/EntityFrameworkStrategy.cs
@@ -6,7 +6,7 @@

 namespace sharpbox.Data.Strategy
 {
-    class EntityFrameworkStrategy
+    public class EntityFrameworkStrategy
     {
     }
 }


test-1

--- silverneedle-asp/Views/Character/Character.cshtml
+++ silverneedle-asp/Views/Character/Character.cshtml
@@ -6,7 +6,6 @@
     var charFull = (CharacterSheet)ViewData["characterFull"];
     ViewData["Title"] = "NPC - " + character.Name;
     var domains = charFull.GetAll<SilverNeedle.Characters.Domains.Domain>();
-
 }
 <div class="charactersheet">
     <h1>


发送包时增加Socket有效性判断

发送包时增加Socket有效性判断

--- GameFramework/Network/NetworkManager.NetworkChannel.cs
+++ GameFramework/Network/NetworkManager.NetworkChannel.cs
@@ -550,7 +550,19 @@
                     string errorMessage = "You must connect first.";
                     if (NetworkChannelError != null)
                     {
-                        NetworkChannelError(this, NetworkErrorCode.SocketError, errorMessage);
+                        NetworkChannelError(this, NetworkErrorCode.SendError, errorMessage);
+                        return;
+                    }
+
+                    throw new GameFrameworkException(errorMessage);
+                }
+
+                if (!m_Active)
+                {
+                    string errorMessage = "Socket is not active.";
+                    if (NetworkChannelError != null)
+                    {
+                        NetworkChannelError(this, NetworkErrorCode.SendError, errorMessage);
                         return;
                     }


removes forgotten [HarmonyDebug] from tests (fails in CI)

--- HarmonyTests/Patching/Assets/ReturningStructMethods.cs
+++ HarmonyTests/Patching/Assets/ReturningStructMethods.cs
@@ -9,7 +9,6 @@
 	[HarmonyPatch]
 	public static class ReturningStructs_Patch
 	{
-		[HarmonyDebug]
 		static void Prefix(string s)
 		{
 			if (s != "test") throw new ArgumentException("First argument corrupt");


Fixed the SQL Script to update the users active status

--- Identity/src/Migrations/201601280309540_UpdatedUser.cs
+++ Identity/src/Migrations/201601280309540_UpdatedUser.cs
@@ -7,10 +7,10 @@
         public override void Up()
         {
             AlterColumn("dbo.Users", "Active", c => c.String());
+
+            base.Sql("UPDATE dbo.Users SET Active = CASE WHEN Active = 1 THEN 'active' ELSE 'inactive' END");
+        }

-            base.Sql("UPDATE dbo.Users SET CASE WHEN Active = 1 THEN 'active' ELSE 'inactive'");
-        }
-
         public override void Down()
         {
             AlterColumn("dbo.Users", "Active", c => c.Boolean(nullable: false));


Damn kernel !
- Fixed bug on event ComponentUnregister spotted by Craig.

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

--- InversionOfControl/Castle.MicroKernel/DefaultKernel.cs
+++ InversionOfControl/Castle.MicroKernel/DefaultKernel.cs
@@ -279,6 +279,8 @@
 					{
 						model.RemoveDepender(handler.ComponentModel);
 					}
+
+					RaiseComponentUnregistered(key, handler);

 					DisposeHandler(handler);


updating Min Skirt Length description

updating Min Skirt Length description

issue: MatterHackers/MatterControl#5098
Minimum extrusion length, shown in UI as X "mm", is generated as X decimeters long

--- MatterControl.Printing/Settings/SliceSettingsFields.cs
+++ MatterControl.Printing/Settings/SliceSettingsFields.cs
@@ -1497,7 +1497,7 @@
 				{
 					SlicerConfigName = SettingsKey.min_skirt_length,
 					PresentationName = "Minimum Extrusion Length".Localize(),
-					HelpText = "The minimum length of filament to use printing the skirt loops. Enough skirt loops will be drawn to use this amount of filament, overriding the value set in Loops if the value in Loops will produce a skirt shorter than this value.".Localize(),
+					HelpText = "The minimum length of filament to use printing the skirt loops. Enough skirt loops will be drawn to use this amount of filament, overriding the value set in Loops if the value in Loops will produce a skirt shorter than this value. NOTE: This is measure as input into the extruder not mm on the bed.".Localize(),
 					DataEditType = DataEditTypes.POSITIVE_DOUBLE,
 					RequiredDisplayDetail = DisplayDetailRequired.Advanced,
 					EnableIfSet = SettingsKey.create_skirt,


Adds another tab for tools

Adds another tab for tools

--- MonoDevelop.Inspector.Mac/Panels/MacInspectorWindow.cs
+++ MonoDevelop.Inspector.Mac/Panels/MacInspectorWindow.cs
@@ -19,7 +19,7 @@

         public const int ButtonWidth = 30;
         const int margin = 10;
-        const int ScrollViewSize = 150;
+        const int ScrollViewSize = 240;
         readonly MockEditorProvider editorProvider;
         readonly MockResourceProvider resourceProvider;
         readonly MockBindingProvider bindingProvider;
@@ -61,18 +61,15 @@
             var stackView = NativeViewHelper.CreateVerticalStackView(margin);
             contentView.AddSubview (stackView);

-            stackView.LeftAnchor.ConstraintEqualToAnchor(contentView.LeftAnchor, margin).Active = true;
-            stackView.RightAnchor.ConstraintEqualToAnchor(contentView.RightAnchor, -margin).Active = true;
-            stackView.TopAnchor.ConstraintEqualToAnchor(contentView.TopAnchor, margin).Active = true;
+            stackView.LeftAnchor.ConstraintEqualToAnchor(contentView.LeftAnchor, margin).Active = true;
+            stackView.RightAnchor.ConstraintEqualToAnchor(contentView.RightAnchor, -margin).Active = true;
+            stackView.TopAnchor.ConstraintEqualToAnchor(contentView.TopAnchor, margin).Active = true;

             constraint = stackView.HeightAnchor.ConstraintEqualToConstant(contentView.Frame.Height-margin * 2);
             constraint.Active = true;
-
             outlineView = new OutlineView ();
             var outlineViewScrollView = new ScrollContainerView (outlineView);
-            outlineViewScrollView.HeightAnchor.ConstraintEqualToConstant (ScrollViewSize).Active = true;
-            stackView.AddArrangedSubview(outlineViewScrollView);
-
+
             outlineView.SelectionNodeChanged += (s, e) => {
                 if (outlineView.SelectedNode is NodeView nodeView) {
                     RaiseFirstResponder?.Invoke (this, nodeView.View);
@@ -88,6 +85,27 @@
                     }
                 }
             };
+
+            var toolbarTab = new NSTabView() { TranslatesAutoresizingMaskIntoConstraints = false };
+            toolbarTab.WantsLayer = true;
+            toolbarTab.Layer.BackgroundColor = NSColor.Red.CGColor;
+
+            stackView.AddArrangedSubview(toolbarTab);
+
+            toolbarTab.LeftAnchor.ConstraintEqualToAnchor(contentView.LeftAnchor, margin).Active = true;
+            toolbarTab.RightAnchor.ConstraintEqualToAnchor(contentView.RightAnchor, -margin).Active = true;
+            toolbarTab.TopAnchor.ConstraintEqualToAnchor(contentView.TopAnchor, margin).Active = true;
+            toolbarTab.HeightAnchor.ConstraintEqualToConstant(ScrollViewSize).Active = true;
+
+            var outlineTabItem = new NSTabViewItem();
+            outlineTabItem.Label = "View Hierarchy";
+            outlineTabItem.View.AddSubview(outlineViewScrollView);
+            outlineViewScrollView.LeftAnchor.ConstraintEqualToAnchor(outlineTabItem.View.LeftAnchor, 0).Active = true;
+            outlineViewScrollView.RightAnchor.ConstraintEqualToAnchor(outlineTabItem.View.RightAnchor, 0).Active = true;
+            outlineViewScrollView.TopAnchor.ConstraintEqualToAnchor(outlineTabItem.View.TopAnchor, 0).Active = true;
+            outlineViewScrollView.BottomAnchor.ConstraintEqualToAnchor(outlineTabItem.View.BottomAnchor, 0).Active = true;
+
+            toolbarTab.Add(outlineTabItem);

             //===================


* minor: very small doc addition

* minor: very small doc addition

--- OpenSim/Region/ClientStack/LindenUDP/LLPacketServer.cs
+++ OpenSim/Region/ClientStack/LindenUDP/LLPacketServer.cs
@@ -67,7 +67,7 @@
         }

         /// <summary>
-        ///
+        /// Process an incoming packet.
         /// </summary>
         /// <param name="circuitCode"></param>
         /// <param name="packet"></param>


Allow the trash folder itself to be passed to PurgeFolder

--- OpenSim/Services/InventoryService/XInventoryService.cs
+++ OpenSim/Services/InventoryService/XInventoryService.cs
@@ -542,6 +542,9 @@
             if (folder.Length < 1)
                 return false;

+            if (folder[0].type == (int)AssetType.TrashFolder)
+                return true;
+
             UUID parentFolder = folder[0].parentFolderID;

             while (parentFolder != UUID.Zero)


[Fixes bug #704265] Ensure that the file filter cannot be blank.

--- Pinta/Actions/File/SaveDocumentImplementationAction.cs
+++ Pinta/Actions/File/SaveDocumentImplementationAction.cs
@@ -247,17 +247,24 @@
 			return response == (int)ResponseType.Ok;
 		}

-        private void OnFilterChanged(object o, GLib.NotifyArgs args)
-        {
-            FileChooserDialog fcd = (FileChooserDialog)o;
-
-            // find the FormatDescriptor
-            FormatDescriptor format_desc = PintaCore.System.ImageFormats.Formats.Single (f => f.Filter == fcd.Filter);
-
-            // adjust the filename
-            var p = fcd.Filename;
-            p = Path.ChangeExtension(Path.GetFileName(p), format_desc.Extensions[0]);
-            fcd.CurrentName = p;
-        }
+		private void OnFilterChanged (object o, GLib.NotifyArgs args)
+		{
+			FileChooserDialog fcd = (FileChooserDialog)o;
+
+			// Ensure that the file filter is never blank.
+			if (fcd.Filter == null)
+			{
+				fcd.Filter = PintaCore.System.ImageFormats.GetDefaultSaveFormat ().Filter;
+				return;
+			}
+
+			// find the FormatDescriptor
+			FormatDescriptor format_desc = PintaCore.System.ImageFormats.Formats.Single (f => f.Filter == fcd.Filter);
+
+			// adjust the filename
+			var p = fcd.Filename;
+			p = Path.ChangeExtension (Path.GetFileName (p), format_desc.Extensions[0]);
+			fcd.CurrentName = p;
+		}
 	}
 }


Easier way to dump the logfile in a handy location

--- src/NAppUpdate.Framework/Common/Logger.cs
+++ src/NAppUpdate.Framework/Common/Logger.cs
@@ -80,8 +80,19 @@
 			             	});
 		}

+		public void Dump()
+		{
+			Dump(null);
+		}
+
 		public void Dump(string filePath)
 		{
+			if (string.IsNullOrEmpty(filePath))
+			{
+				var workingDir = Path.GetDirectoryName(System.Reflection.Assembly.GetEntryAssembly().Location);
+				filePath = Path.Combine(workingDir ?? string.Empty, @"NauUpdate.log");
+			}
+
 			using (StreamWriter w = File.CreateText(filePath))
 			foreach (var logItem in LogItems)
 			{


Starting a search on parametereditor swiches view to command explorer

--- PowerShellTools.Explorer/UI/PSCommandExplorerWindow.cs
+++ PowerShellTools.Explorer/UI/PSCommandExplorerWindow.cs
@@ -103,6 +103,8 @@

         public override IVsSearchTask CreateSearch(uint dwCookie, IVsSearchQuery pSearchQuery, IVsSearchCallback pSearchCallback)
         {
+            ShowCommandExplorer();
+
             ISearchTaskTarget searchTarget = ((UserControl)ContentHost.Content).DataContext as ISearchTaskTarget;
             if (searchTarget == null || pSearchQuery == null || pSearchCallback == null)
             {


changes working directory of update process to application directory (fixes writing to c:\windows\system32 directory if the process is started on logon)

--- src/NAppUpdate.Framework/UpdateManager.cs
+++ src/NAppUpdate.Framework/UpdateManager.cs
@@ -293,6 +293,11 @@
 				LatestError = null;
             	bool revertToDefaultBackupPath = true;

+                // Set current directory the the application directory
+                // this prevents the updater from writing to e.g. c:\windows\system32
+                // if the process is started by autorun on windows logon.
+                Environment.CurrentDirectory = Path.GetDirectoryName(ApplicationPath);
+
                 // Make sure the current backup folder is accessible for writing from this process
                 string backupParentPath = Path.GetDirectoryName(BackupFolder) ?? string.Empty;
                 if (Directory.Exists(backupParentPath) && Utils.PermissionsCheck.HaveWritePermissionsForFolder(backupParentPath))


Processed timestamp updated on reports when sending to SD.

--- Presentation.Web/Controllers/sendDataToSdController.cs
+++ Presentation.Web/Controllers/sendDataToSdController.cs
@@ -65,7 +65,7 @@
             }
             catch (Exception e)
             {
-
+                _logger.Log($"{this.GetType().ToString()}, sendDataToSd(), error when initating SD client", "web", e, 1);
                 throw;
             }
             //var reports = _repo.AsQueryable().Where(x => x.Status == ReportStatus.Accepted).ToList();
@@ -101,7 +101,13 @@
                     try
                     {
                         // var response = client.KoerselOpret20120201Operation(opret.InddataStruktur);
+
                         t.Status = ReportStatus.Invoiced;
+
+                        var epoch = new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc);
+                        var deltaTime = DateTime.Now.ToUniversalTime() - epoch;
+                        t.ProcessedDateTimestamp = (long)deltaTime.TotalSeconds;
+
                         _repo.Save();

                     }
@@ -113,6 +119,7 @@
             }
             catch (Exception e)
             {
+                _logger.Log($"{this.GetType().ToString()}, sendDataToSd(), error when iterating over reports to send", "web", e, 1);
                 return StatusCode(HttpStatusCode.InternalServerError);
             }


Add GUID generation to Firebird dialect

Add GUID generation to Firebird dialect

Fixes tests such as NHibernate.Test.IdGen.NativeGuid.*

--- src/NHibernate/Dialect/FirebirdDialect.cs
+++ src/NHibernate/Dialect/FirebirdDialect.cs
@@ -1,12 +1,12 @@
+using System;
+using System.Collections;
 using System.Data;
+using System.Data.Common;
 using NHibernate.Dialect.Function;
 using NHibernate.Dialect.Schema;
+using NHibernate.Engine;
 using NHibernate.SqlCommand;
-using System.Collections;
-using NHibernate.Engine;
 using NHibernate.Type;
-using System.Data.Common;
-using System;
 using Environment = NHibernate.Cfg.Environment;

 namespace NHibernate.Dialect
@@ -143,7 +143,6 @@
 			DefaultProperties[Environment.ConnectionDriver] = "NHibernate.Driver.FirebirdClientDriver";
 		}

-		/// <summary></summary>
 		public override string AddColumnString
 		{
 			get { return "add"; }
@@ -213,17 +212,13 @@
 			{
 				return 6;
 			}
-
 			return -1;
 		}

 		[Serializable]
 		private class CastedFunction : NoArgSQLFunction
 		{
-			public CastedFunction(string name, IType returnType)
-				: base(name, returnType, false)
-			{
-			}
+			public CastedFunction(string name, IType returnType) : base(name, returnType, false) { }

 			public override SqlString Render(IList args, ISessionFactoryImplementor factory)
 			{
@@ -240,9 +235,7 @@
 		[Serializable]
 		private class CurrentTimeStamp : NoArgSQLFunction
 		{
-			public CurrentTimeStamp()
-				: base("current_timestamp", NHibernateUtil.DateTime, true)
-			{ }
+			public CurrentTimeStamp() : base("current_timestamp", NHibernateUtil.DateTime, true) { }

 			public override SqlString Render(IList args, ISessionFactoryImplementor factory)
 			{
@@ -276,5 +269,10 @@
 		{
 			get { return "select CURRENT_TIMESTAMP from RDB$DATABASE"; }
 		}
+
+		public override string SelectGUIDString
+		{
+			get { return "select GEN_UUID() from RDB$DATABASE"; }
+		}
 	}
 }


Disable DebugBeep by default

Disable DebugBeep by default

--- PropertyChanged.Fody.Analyzer/SourceGeneratorEngine.cs
+++ PropertyChanged.Fody.Analyzer/SourceGeneratorEngine.cs
@@ -8,6 +8,8 @@

     public static void GenerateSource(SourceProductionContext context, Configuration configuration, ImmutableArray<TypeContext> types)
     {
+        // DebugBeep();
+
         const string sourceFileHintName = "PropertyChanged.g.cs";

         if (configuration.IsCodeGeneratorDisabled)
@@ -57,8 +59,6 @@

     static void GenerateCodeForClass(TypeContext typeContext, CodeBuilder codeBuilder, string eventInvokerName)
     {
-        DebugBeep();
-
         codeBuilder.Add();

         using (codeBuilder.AddBlock("namespace {0}", typeContext.ContainingNamespace))


Switch `BeatmapInfo.OnlineID` delegation to use property getter for conformity

--- osu.Game/Beatmaps/BeatmapInfo.cs
+++ osu.Game/Beatmaps/BeatmapInfo.cs
@@ -177,7 +177,7 @@

         #region Implementation of IHasOnlineID

-        int IHasOnlineID<int>.OnlineID => onlineID ?? -1;
+        int IHasOnlineID<int>.OnlineID => OnlineID ?? -1;

         #endregion


Optimized generated code recognition.

Optimized generated code recognition.

--- RefactoringEssentials/Util/GeneratedCodeRecognition.cs
+++ RefactoringEssentials/Util/GeneratedCodeRecognition.cs
@@ -5,14 +5,34 @@
 using System.Threading;
 using System.Linq;
 using Microsoft.CodeAnalysis.CSharp;
+using System.Collections.Immutable;

 namespace RefactoringEssentials
 {
-    static class GeneratedCodeRecognition
+    public static class GeneratedCodeRecognition
     {
+
+        static WeakReference<ImmutableDictionary<SyntaxTree, bool>> cache = new WeakReference<ImmutableDictionary<SyntaxTree, bool>> (ImmutableDictionary<SyntaxTree, bool>.Empty);
+
         public static bool IsFromGeneratedCode(this SemanticModel semanticModel, CancellationToken cancellationToken)
         {
-            return IsFileNameForGeneratedCode(semanticModel.SyntaxTree.FilePath) || ContainsAutogeneratedComment(semanticModel.SyntaxTree, cancellationToken);
+            ImmutableDictionary<SyntaxTree, bool> table;
+            var tree = semanticModel.SyntaxTree;
+
+            if (cache.TryGetTarget(out table))
+            {
+                if (table.ContainsKey(tree))
+                    return table[tree];
+            }
+            else
+            {
+                table = ImmutableDictionary<SyntaxTree, bool>.Empty;
+            }
+
+            var result = IsFileNameForGeneratedCode(tree.FilePath) || ContainsAutogeneratedComment(tree, cancellationToken);
+            cache.SetTarget(table.Add(tree, result));
+
+            return result;
         }

         public static bool IsFromGeneratedCode(this SyntaxNodeAnalysisContext context)
@@ -25,29 +45,86 @@
             return IsFromGeneratedCode(context.SemanticModel, context.CancellationToken);
         }

-        public static bool IsFileNameForGeneratedCode(string fileName)
+        static readonly string[] generatedCodeSuffixes = {
+            "AssemblyInfo",
+            ".designer",
+            ".generated",
+            ".g",
+            ".g.i",
+            ".AssemblyAttributes"
+        };
+
+        static readonly string generatedCodePrefix = "TemporaryGeneratedFile_";
+        const int generatedCodePrefixLength = 23;
+
+        public unsafe static bool IsFileNameForGeneratedCode(string fileName)
         {
-            if (fileName.StartsWith("TemporaryGeneratedFile_", StringComparison.OrdinalIgnoreCase))
+            char* curPtr, endPtr;
+            fixed (char* beginPtr = fileName)
             {
-                return true;
-            }
+                // Check prefix
+                if (generatedCodePrefixLength < fileName.Length)
+                {
+                    curPtr = beginPtr;
+                    endPtr = beginPtr + generatedCodePrefixLength;

-            string extension = Path.GetExtension(fileName);
-            if (extension != string.Empty)
-            {
-                fileName = Path.GetFileNameWithoutExtension(fileName);
+                    fixed (char* patternPtr = generatedCodePrefix)
+                    {
+                        char* curPatternPtr = patternPtr;
+                        while (curPtr != endPtr)
+                        {
+                            if (char.ToUpperInvariant (*curPtr) != char.ToUpperInvariant (*curPatternPtr))
+                            {
+                                break;
+                            }
+                            curPtr++;
+                            curPatternPtr++;
+                        }
+                        if (curPtr == endPtr)
+                        {
+                            return true;
+                        }
+                    }
+                }

-                if (fileName.EndsWith("AssemblyInfo", StringComparison.OrdinalIgnoreCase) ||
-                    fileName.EndsWith(".designer", StringComparison.OrdinalIgnoreCase) ||
-                    fileName.EndsWith(".generated", StringComparison.OrdinalIgnoreCase) ||
-                    fileName.EndsWith(".g", StringComparison.OrdinalIgnoreCase) ||
-                    fileName.EndsWith(".g.i", StringComparison.OrdinalIgnoreCase) ||
-                    fileName.EndsWith(".AssemblyAttributes", StringComparison.OrdinalIgnoreCase))
+                // Search last index of '.'
+                curPtr = beginPtr + fileName.Length - 1;
+                while (curPtr >= beginPtr && *curPtr != '.')
                 {
-                    return true;
+                    curPtr--;
+                }
+                if (curPtr < beginPtr)
+                {
+                    return false;
+                }
+                endPtr = curPtr;
+
+                // Check suffix
+                for (int i = 0; i < generatedCodeSuffixes.Length; i++)
+                {
+                    string str = generatedCodeSuffixes[i];
+                    curPtr = endPtr - str.Length;
+                    if (curPtr < beginPtr)
+                        continue;
+                    fixed (char* patternPtr = str)
+                    {
+                        char* curPatternPtr = patternPtr;
+                        while (curPtr != endPtr)
+                        {
+                            if (char.ToUpperInvariant (*curPtr) != char.ToUpperInvariant (*curPatternPtr))
+                            {
+                                break;
+                            }
+                            curPtr++;
+                            curPatternPtr++;
+                        }
+                        if (curPtr == endPtr)
+                        {
+                            return true;
+                        }
+                    }
                 }
             }
-
             return false;
         }

@@ -58,16 +135,20 @@
                 return false;
             var firstToken = root.GetFirstToken();
             if (!firstToken.HasLeadingTrivia)
+            {
                 return false;
+            }
+
             foreach (var trivia in firstToken.LeadingTrivia.Where(t => t.IsKind(SyntaxKind.SingleLineCommentTrivia)).Take(2))
             {
                 var str = trivia.ToString();
-                if (str == "// This file has been generated by the GUI designer. Do not modify.")
+                if (str == "// This file has been generated by the GUI designer. Do not modify." ||
+                    str == "// <auto-generated>" || str == "// <autogenerated>")
+                {
                     return true;
-                if (str == "// <auto-generated>" || str == "// <autogenerated>")
-                    return true;
+                }
             }
             return false;
         }
     }
-}+}


Update Shortcode.cs

Update Shortcode.cs

--- src/Plivo/Resource/Powerpack/Shortcode.cs
+++ src/Plivo/Resource/Powerpack/Shortcode.cs
@@ -1,564 +1,81 @@
 using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Reflection;
 using System.Threading.Tasks;
-using Plivo.Client;
 using Plivo.Resource.PhoneNumber;
-
 namespace Plivo.Resource.Powerpack {
     /// <summary>
-    /// Powerpack interface.
+    /// Powerpack.
     /// </summary>
-    public class PowerpackInterface : ResourceInterface {
+    public class Shortcode : Resource {
+        private string numberpooluuid = "";
+        public Shortcode (string number_pool_id) {
+            numberpooluuid = number_pool_id;
+        }
+        public Shortcode () {
+
+        }
+        public new string Id => NumberPoolUUID;
+
         /// <summary>
-        /// Initializes a new instance of the <see cref="T:plivo.Resource.Powerpack.PowerpackInterface"/> class.
+        /// shortcode
         /// </summary>
-        /// <param name="client">Client.</param>
-        public PowerpackInterface (HttpClient client) : base (client) {
-            Uri = "Account/" + Client.GetAuthId () + "/";
+        /// <value>The shortcode .</value>
+        public string shortcode { get; set; }
+
+        /// <summary>
+        /// Gets or sets AddedOn.
+        /// </summary>
+        /// <value>AddedOn.</value>
+        public string AddedOn { get; set; }
+
+        /// <summary>
+        /// Gets or sets the created_on.
+        /// </summary>
+        /// <value>The created_on.</value>
+        public string CountryISO2 { get; set; }
+
+        /// <summary>
+        /// Gets or sets the NumberPoolUUID.
+        /// </summary>
+        /// <value>The NumberPoolUUID.</value>
+        public string NumberPoolUUID { get; set; }
+
+        // public Shortcode Get(string memberId)
+        // {
+        //     var member = new Shortcode();
+        //     return member;
+        // }
+        // public Shortcode(){
+
+        // }
+
+        public Lazy<PowerpackInterface> _powerpackInterface;
+
+        private PowerpackInterface PowerpackI => _powerpackInterface.Value;
+        public ListResponse<Shortcode> List (uint? limit = null, uint? offset = null) {
+            return PowerpackI
+                .ListShortcode (numberpooluuid, limit, offset);
         }
-        #region Create
-        /// <summary>
-        /// Create Message with the specified src, dst, text, type, url, method and log.
-        /// </summary>
-        /// <returns>The create.</returns>
-        /// <param name="name">Name.</param>
-        /// <param name="sticky_sender">StickySender.</param>
-        /// <param name="local_connect">LocalConnect.</param>
-        /// <param name="application_type">ApplicationType.</param>
-        /// <param name="application_id">ApplicationID.</param>
-        public Powerpack Create (
-            string name, string application_type = null, string application_id = null,
-            bool? sticky_sender = null, bool? local_connect = null) {
-            var mandatoryParams = new List<string> { "name" };
-            var data = CreateData (
-                mandatoryParams,
-                new {
-                    name,
-                    application_type,
-                    application_id,
-                    sticky_sender,
-                    local_connect
-                });
-            return ExecuteWithExceptionUnwrap (() => {
-                var result = Task.Run (async () => await Client.Update<Powerpack> (Uri + "Powerpack/", data).ConfigureAwait (false)).Result;
-                result.Object.StatusCode = result.StatusCode;
-                return result.Object;
-            });
+        public async Task<ListResponse<Shortcode>> ListAsync (uint? limit = null, uint? offset = null) {
+            return await PowerpackI
+                .List_ShortcodeAsync (numberpooluuid, limit, offset);
         }

-        /// <summary>
-        /// Create Message with the specified src, dst, text, type, url, method and log.
-        /// </summary>
-        /// <returns>The create.</returns>
-        /// <param name="name">Name.</param>
-        /// <param name="sticky_sender">StickySender.</param>
-        /// <param name="local_connect">LocalConnect.</param>
-        /// <param name="application_type">ApplicationType.</param>
-        /// <param name="application_id">ApplicationID.</param>
-        public async Task<Powerpack> CreateAsync (
-            string name, string application_type = null, string application_id = null,
-            bool? sticky_sender = null, bool? local_connect = null) {
-
-            var mandatoryParams = new List<string> { "name" };
-            var data = CreateData (
-                mandatoryParams,
-                new {
-                    name,
-                    application_type,
-                    application_id,
-                    sticky_sender,
-                    local_connect
-                });
-
-            var result = await Client.Update<Powerpack> (Uri + "Powerpack/", data);
-            result.Object.StatusCode = result.StatusCode;
-            return result.Object;
+        public Shortcode Find (string shortcode) {
+            return PowerpackI
+                .Find_Shortcode (shortcode, numberpooluuid);
         }
-        #endregion
-        #region GET
-        /// <summary>
-        /// Get Powerpack with the specified uuid.
-        /// </summary>
-        /// <returns>The get.</returns>
-        /// <param name="uuid">Powerpack  UUID.</param>
-        public Powerpack Get (string uuid) {
-            return ExecuteWithExceptionUnwrap (() => {
-                var powerpack = Task.Run (async () => await GetResource<Powerpack> ("Powerpack/" + uuid).ConfigureAwait (false)).Result;
-                powerpack.Interface = this;
-                powerpack.number_pool_id = powerpack.number_pool.Split ('/') [5];
-                powerpack._phonenumber = new Lazy<PhoneNumberInterface> (() => new PhoneNumberInterface (Client));
-                powerpack.numberpool = new NumberPool (powerpack.number_pool_id, Client);
-                return powerpack;
-            });
-        }
-        /// <summary>
-        /// Asynchronously get Powerpack with the specified uuid.
-        /// </summary>
-        /// <returns>The get.</returns>
-        /// <param name="uuid"> UUID.</param>
-        public async Task<Powerpack> GetAsync (string uuid) {
-            var powerpack = await GetResource<Powerpack> ("Powerpack/" + uuid);
-            powerpack.Interface = this;
-            powerpack.number_pool_id = powerpack.number_pool.Split ('/') [5];
-            return powerpack;
-        }
-        #endregion
-        #region Delete
-        /// <summary>
-        /// Delete Powerpack with the specified uuid.
-        /// </summary>
-        /// <returns>The delete.</returns>
-        /// <param name="uuid">powerpack identifier.</param>
-        public DeleteResponse<Powerpack> Delete (string uuid, bool? unrent_numbers = false) {
-            var mandatoryParams = new List<string> { "" };
-            var data = CreateData (
-                mandatoryParams,
-                new {
-                    unrent_numbers,
-                });
-
-            return ExecuteWithExceptionUnwrap (() => {
-                return Task.Run (async () => await DeleteResource<DeleteResponse<Powerpack>> ("Powerpack/" + uuid, data).ConfigureAwait (false)).Result;
-            });
+        public async Task<Shortcode> FindAsync (
+            string shortcode) {
+            return await PowerpackI
+                .Find_ShortcodeAsync (shortcode, numberpooluuid);
         }

-        /// <summary>
-        /// Asynchronously delete Powerpack with the specified uuid.
-        /// </summary>
-        /// <returns>The delete.</returns>
-        /// <param name="uuid">Powerpack identifier.</param>
-        public async Task<DeleteResponse<Powerpack>> DeleteAsync (string uuid, bool? unrent_numbers = false) {
-            var mandatoryParams = new List<string> { "" };
-            var data = CreateData (
-                mandatoryParams,
-                new {
-                    unrent_numbers,
-                });
-            return await DeleteResource<DeleteResponse<Powerpack>> ("Powerpack/" + uuid, data);
+        public override string ToString () {
+            return "\n" +
+                "NumberPoolUUID: " + NumberPoolUUID + "\n" +
+                "Shortcode: " + shortcode + "\n" +
+                "CountryISO2: " + CountryISO2 + "\n" +
+                "AddedOn: " + AddedOn + "\n";
         }
-        #endregion
-        #region List
-        /// <summary>
-        /// <summary>
-        /// List Powerpack list limit and offset.
-        /// </summary>
-        /// <returns>The list.</returns>
-        /// <param name="limit">Limit.</param>
-        /// <param name="offset">Offset.</param>
-        public ListResponse<Powerpack> List (
-            uint? limit = null, uint? offset = null) {
-            var mandatoryParams = new List<string> { "" };
-            var data = CreateData (
-                mandatoryParams,
-                new {
-                    limit,
-                    offset
-                });
-
-            return ExecuteWithExceptionUnwrap (() => {
-                var resources = Task.Run (async () => await ListResources<ListResponse<Powerpack>> ("Powerpack", data).ConfigureAwait (false)).Result;
-                resources.Objects.ForEach (
-                    (obj) => obj.Interface = this
-                );
-
-                return resources;
-            });
-        }
-        /// <summary>
-        /// List Powerpack list limit and offset.
-        /// </summary>
-        /// <returns>The list.</returns>
-        /// <param name="limit">Limit.</param>
-        /// <param name="offset">Offset.</param>
-        public async Task<ListResponse<Powerpack>> ListAsync (
-            uint? limit = null, uint? offset = null) {
-            var mandatoryParams = new List<string> { "" };
-            var data = CreateData (
-                mandatoryParams,
-                new {
-                    limit,
-                    offset
-                });
-            var resources = await ListResources<ListResponse<Powerpack>> ("Powerpack", data);
-            resources.Objects.ForEach (
-                (obj) => obj.Interface = this
-            );
-
-            return resources;
-        }
-        #endregion
-        #region Update
-        /// <summary>
-        /// Update the specified name, city, address and state.
-        /// </summary>
-        /// <returns>The update.</returns>
-        /// <param name="name">Name.</param>
-        /// <param name="sticky_sender">StickySender.</param>
-        /// <param name="local_connect">LocalConnect.</param>
-        /// <param name="application_type">ApplicationType.</param>
-        /// <param name="application_id">ApplicationID.</param>
-        ///<param name="uuid">UUID.</param>
-        public UpdateResponse<Powerpack> Update (string uuid, string name = null, string application_type = null, string application_id = null,
-            bool? sticky_sender = null, bool? local_connect = null) {
-            var mandatoryParams = new List<string> { "uuid" };
-            var data = CreateData (mandatoryParams, new {
-                name,
-                application_type,
-                application_id,
-                sticky_sender,
-                local_connect
-            });
-
-            return ExecuteWithExceptionUnwrap (() => {
-                var result = Task.Run (async () => await Client.Update<UpdateResponse<Powerpack>> (Uri, data).ConfigureAwait (false)).Result;
-                result.Object.StatusCode = result.StatusCode;
-                return result.Object;
-            });
-        }
-        /// <summary>
-        /// Update the specified name, sticky_sender, localconnect.
-        /// </summary>
-        /// <returns>The create.</returns>
-        /// <param name="name">Name.</param>
-        /// <param name="sticky_sender">StickySender.</param>
-        /// <param name="local_connect">LocalConnect.</param>
-        /// <param name="application_type">ApplicationType.</param>
-        /// <param name="application_id">ApplicationID.</param>
-        ///<param name="uuid">UUID.</param>
-
-        public async Task<UpdateResponse<Powerpack>> UpdateAsync (string uuid, string name = null, string application_type = null, string application_id = null,
-            bool? sticky_sender = null, bool? local_connect = null) {
-            var mandatoryParams = new List<string> { "uuid" };
-            var data = CreateData (
-                mandatoryParams, new {
-                    name,
-                    application_type,
-                    application_id,
-                    sticky_sender,
-                    local_connect
-                });
-            var result = await Client.Update<UpdateResponse<Powerpack>> (Uri + "Powerpack/" + uuid, data);
-            result.Object.StatusCode = result.StatusCode;
-            return result.Object;
-        }
-        #endregion
-        #region ListNumber
-        /// <summary>
-        /// List Powerpack Number limit and offset.
-        /// </summary>
-        /// <returns>The list.</returns>
-        /// <param name="starts_with">StartWith.</param>
-        /// <param name="country_iso2">Countryiso2.</param>
-        /// <param name="type">Type.</param>
-        /// <param name="limit">Limit.</param>
-        /// <param uuid="uuid">UUID</param>
-        /// <param name="offset">Offset.</param>
-        public ListResponse<Numbers> List_Numbers (string uuid, string starts_with = null, string country_iso2 = null,
-            string type = null, uint? limit = null, uint? offset = null) {
-            var mandatoryParams = new List<string> { "" };
-            var data = CreateData (
-                mandatoryParams,
-                new {
-                    starts_with,
-                    country_iso2,
-                    type,
-                    limit,
-                    offset
-                });
-
-            return ExecuteWithExceptionUnwrap (() => {
-                var resources = Task.Run (async () => await ListResources<ListResponse<Numbers>> ("NumberPool/" + uuid + "/Number", data).ConfigureAwait (false)).Result;
-                resources.Objects.ForEach (
-                    (obj) => obj.Interface = this
-                );
-
-                return resources;
-            });
-
-        }
-
-        /// <summary>
-        /// List Powerpack Number limit and offset.
-        /// </summary>
-        /// <returns>The list.</returns>
-        /// <param name="starts_with">StartWith.</param>
-        /// <param name="country_iso2">Countryiso2.</param>
-        /// <param name="type">Type.</param>
-        /// <param name="limit">Limit.</param>
-        /// <param uuid="uuid">UUID</param>
-        /// <param name="offset">Offset.</param>
-        public async Task<ListResponse<Numbers>> List_NumbersAsync (
-            string uuid, string starts_with = null, string country_iso2 = null,
-            string type = null, uint? limit = null, uint? offset = null) {
-            var mandatoryParams = new List<string> { "" };
-            var data = CreateData (
-                mandatoryParams,
-                new {
-                    starts_with,
-                    country_iso2,
-                    type,
-                    limit,
-                    offset
-                });
-            var resources = await ListResources<ListResponse<Numbers>> ("NumberPool/" + uuid + "/Number", data);
-            resources.Objects.ForEach (
-                (obj) => obj.Interface = this
-            );
-            return resources;
-        }
-
-        public string Hello () {
-            return "Hi";
-        }
-
-        #endregion
-        #region GETNUMBERCOUNT
-        /// <summary>
-        /// List Powerpack Number limit and offset.
-        /// </summary>
-        /// <returns>The list.</returns>
-        /// <param name="starts_with">StartWith.</param>
-        /// <param name="country_iso2">Countryiso2.</param>
-        /// <param name="type">Type.</param>
-        /// <param name="limit">Limit.</param>
-        /// <param uuid="uuid">UUID</param>
-        /// <param name="offset">Offset.</param>
-        public uint Count_Number (string uuid, string starts_with = null, string country_iso2 = null,
-            string type = null, uint? limit = null, uint? offset = null) {
-            var mandatoryParams = new List<string> { "" };
-            var data = CreateData (
-                mandatoryParams,
-                new {
-                    starts_with,
-                    country_iso2,
-                    type,
-                    limit,
-                    offset
-                });
-
-            // return ExecuteWithExceptionUnwrap(() =>
-            // {
-            var resources = Task.Run (async () => await ListResources<ListResponse<Numbers>> ("NumberPool/" + uuid + "/Number", data).ConfigureAwait (false)).Result;
-            resources.Objects.ForEach (
-                (obj) => obj.Interface = this
-            );
-
-            return resources.Meta.TotalCount; // Need to check
-            // });
-
-        }
-
-        /// <summary>
-        /// List Powerpack Number limit and offset.
-        /// </summary>
-        /// <returns>The list.</returns>
-        /// <param name="starts_with">StartWith.</param>
-        /// <param name="country_iso2">Countryiso2.</param>
-        /// <param name="type">Type.</param>
-        /// <param name="limit">Limit.</param>
-        /// <param uuid="uuid">UUID</param>
-        /// <param name="offset">Offset.</param>
-        public async Task<uint> Count_NumbersAsync (
-            string uuid, string starts_with = null, string country_iso2 = null,
-            string type = null, uint? limit = null, uint? offset = null) {
-            var mandatoryParams = new List<string> { "" };
-            var data = CreateData (
-                mandatoryParams,
-                new {
-                    starts_with,
-                    country_iso2,
-                    type,
-                    limit,
-                    offset
-                });
-            var resources = await ListResources<ListResponse<Numbers>> ("NumberPool/" + uuid + "/Number", data);
-            resources.Objects.ForEach (
-                (obj) => obj.Interface = this
-            );
-
-            return resources.Meta.TotalCount;
-
-        }
-        #endregion
-        #region ADDNUMBER
-        /// <summary>
-        /// Add a number
-        /// </summary>
-        /// <returns>The Number resource.</returns>
-        /// <param name="uuid">UUID.</param>
-        /// <param name="number">Number.</param>
-
-        public Numbers Add_Number (string uuid, string number, bool rent = false) {
-            var mandatoryParams = new List<string> { "" };
-            var data = CreateData (
-                mandatoryParams,
-                new {
-                    rent
-                });
-
-            return ExecuteWithExceptionUnwrap (() => {
-                var result = Task.Run (async () => await Client.Update<Numbers> (Uri + "NumberPool/" + uuid.ToString () + "/Number/" + number.ToString () + "/", data).ConfigureAwait (false)).Result;
-                result.Object.StatusCode = result.StatusCode;
-                return result.Object;
-            });
-        }
-
-        /// <summary>
-        /// Add a number
-        /// </summary>
-        /// <returns>The Number resource.</returns>
-        /// <param name="uuid">UUID.</param>
-        /// <param name="number">Number.</param>
-        public async Task<Numbers> Add_NumberAsync (
-            string uuid, string number, bool rent = false) {
-            var mandatoryParams = new List<string> { "" };
-            var data = CreateData (
-                mandatoryParams,
-                new {
-                    rent
-                });
-
-            var result = await Client.Update<Numbers> (Uri + "NumberPool/" + uuid + "/Number/" + number + "/", data);
-            result.Object.StatusCode = result.StatusCode;
-            return result.Object;
-        }
-        #endregion
-        #region REMOVENUMBER
-        /// <summary>
-        /// Remove a number
-        /// </summary>
-        /// <returns>The Number resource.</returns>
-        /// <param name="uuid">UUID.</param>
-        /// <param name="number">Number.</param>
-        public DeleteResponse<Numbers> Remove_Number (string uuid, string number, bool? unrent = null) {
-            var mandatoryParams = new List<string> { "" };
-            var data = CreateData (
-                mandatoryParams,
-                new {
-                    unrent,
-                });
-            return ExecuteWithExceptionUnwrap (() => {
-                return Task.Run (async () => await DeleteResource<DeleteResponse<Numbers>> ("NumberPool/" + uuid + "/Number/" + number, data).ConfigureAwait (false)).Result;
-            });
-        }
-
-        /// <summary>
-        /// Add a number
-        /// </summary>
-        /// <returns>The Number resource.</returns>
-        /// <param name="uuid">UUID.</param>
-        /// <param name="number">Number.</param>
-        public async Task<DeleteResponse<Numbers>> Remove_NumberAsync (
-            string uuid, string number, bool? unrent = null) {
-            var mandatoryParams = new List<string> { "" };
-            var data = CreateData (
-                mandatoryParams,
-                new {
-                    unrent,
-                });
-            return await DeleteResource<DeleteResponse<Numbers>> ("NumberPool/" + uuid + "/Number/" + number, data);
-        }
-        #endregion
-        #region FINDNUMBER
-
-        /// <summary>
-        /// Find a number
-        /// </summary>
-        /// <returns>The Number resource.</returns>
-        /// <param name="uuid">UUID.</param>
-        /// <param name="number">Number.</param>
-        public Numbers Find_Number (string uuid, string number) {
-            return ExecuteWithExceptionUnwrap (() => {
-                var numberpoolResponse = Task.Run (async () => await GetResource<Numbers> ("NumberPool/" + uuid + "/Number/" + number).ConfigureAwait (false)).Result;
-                numberpoolResponse.Interface = this;
-                return numberpoolResponse;
-            });
-        }
-        public async Task<Numbers> Find_NumberAsync (string uuid,
-            string number) {
-            var numberpoolresp = await GetResource<Numbers> ("NumberPool/" + uuid + "/Number/" + number);
-            numberpoolresp.Interface = this;
-            return numberpoolresp;
-
-        }
-        #endregion
-        #region LISTSHORTCODE
-        /// <summary>
-        /// Find a number
-        /// </summary>
-        /// <returns>The Number resource.</returns>
-        public ListResponse<Shortcode> ListShortcode (string uuid, uint? limit = null, uint? offset = null) {
-            var mandatoryParams = new List<string> { "" };
-            var data = CreateData (
-                mandatoryParams,
-                new {
-                    limit,
-                    offset
-                });
-
-            return ExecuteWithExceptionUnwrap (() => {
-                var resources = Task.Run (async () => await ListResources<ListResponse<Shortcode>> ("NumberPool/" + uuid + "/Shortcode", data).ConfigureAwait (false)).Result;
-                resources.Objects.ForEach (
-                    (obj) => obj.Interface = this
-                );
-
-                return resources;
-            });
-
-        }
-
-        /// <summary>
-        /// List Powerpack Shortcode limit and offset.
-        /// </summary>
-        /// <returns>The list.</returns>
-        /// <param name="limit">Limit.</param>
-        /// <param uuid="uuid">UUID</param>
-        /// <param name="offset">Offset.</param>
-        public async Task<ListResponse<Shortcode>> List_ShortcodeAsync (
-            string uuid, uint? limit = null, uint? offset = null) {
-            var mandatoryParams = new List<string> { "" };
-            var data = CreateData (
-                mandatoryParams,
-                new {
-                    limit,
-                    offset
-                });
-            var resources = await ListResources<ListResponse<Shortcode>> ("NumberPool/" + uuid + "/Shortcode", data);
-            resources.Objects.ForEach (
-                (obj) => obj.Interface = this
-            );
-
-            return resources;
-
-        }
-
-        #endregion
-        #region FINDSHORTCODE
-
-        /// <summary>
-        /// Find a shortcode
-        /// </summary>
-        /// <returns>The Shortcode resource.</returns>
-        /// <param name="uuid">UUID.</param>
-        /// <param name="shortcode">Shortcode.</param>
-        public Shortcode Find_Shortcode (string shortcode, string uuid) {
-            return ExecuteWithExceptionUnwrap (() => {
-                var powerpackresp = Task.Run (async () => await GetResource<Shortcode> ("NumberPool/" + uuid + "/Shortcode/" + shortcode).ConfigureAwait (false)).Result;
-                powerpackresp.Interface = this;
-                return powerpackresp;
-            });
-        }
-        public async Task<Shortcode> Find_ShortcodeAsync (
-            string shortcode, string uuid) {
-            var shortcodeResponse = await GetResource<Shortcode> ("NumberPool/" + uuid + "/Shortcode/" + shortcode);
-            shortcodeResponse.Interface = this;
-            return shortcodeResponse;
-
-        }
-
-        #endregion
     }
-
 }


Fix commit b23c4ca2520d0778e5fc0a997cf32286a9bbec45

--- Samples/Misc/SampleStrategies/SecuritiesWindow.xaml.cs
+++ Samples/Misc/SampleStrategies/SecuritiesWindow.xaml.cs
@@ -115,14 +115,21 @@
 			}
 		}

+		private Subscription FindSubscription(Security security, DataType dataType)
+		{
+			return Connector.FindSubscriptions(security, dataType).Where(s => s.SubscriptionMessage.To == null && s.State.IsActive()).FirstOrDefault();
+		}
+
 		private void QuotesClick(object sender, RoutedEventArgs e)
 		{
 			var connector = Connector;

 			foreach (var security in SecurityPicker.SelectedSecurities)
 			{
-				if (connector.RegisteredSecurities.Contains(security))
-					connector.UnSubscribeLevel1(security);
+				var subscription = FindSubscription(security, DataType.Level1);
+
+				if (subscription != null)
+					connector.UnSubscribe(subscription);
 				else
 					connector.SubscribeLevel1(security);
 			}


testing jenkins integration

testing jenkins integration

--- ServerCheck/ServerCheck/Controllers/CheckController.cs
+++ ServerCheck/ServerCheck/Controllers/CheckController.cs
@@ -17,7 +17,7 @@
         public HttpResponseMessage ApplicationStatus()
         {
             HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.OK);
-            response.Content = new StringContent("Web application working fine from VS", Encoding.UTF8, "application/json");
+            response.Content = new StringContent("Web application working fine from VS using Jenkins", Encoding.UTF8, "application/json");
             return response;
         }


change HttpStatusCode.Unauthorized to Forbidden to avoid Password dialog on Mixed mode

--- Signum.React/Filters/SignumExceptionFilterAttribute.cs
+++ Signum.React/Filters/SignumExceptionFilterAttribute.cs
@@ -107,7 +107,7 @@
                 return HttpStatusCode.Forbidden;

             if (type == typeof(AuthenticationException))
-                return HttpStatusCode.Unauthorized;
+                return HttpStatusCode.Forbidden; // Unauthorized produces Login Password dialog in Mixed mode

             if (type == typeof(EntityNotFoundException))
                 return HttpStatusCode.NotFound;


#115 - Implementation of the queue seems to be broken. ofc. its yucked code

--- SoraBot/SoraBot.Bot/Modules/AudioModule/AudioModule.cs
+++ SoraBot/SoraBot.Bot/Modules/AudioModule/AudioModule.cs
@@ -175,6 +175,61 @@
                 await ReplyFailureEmbed("Something broke :/");
             }
         }
+
+        [Command("skip"), Alias("next")]
+        [Summary("Skips the specified amount of songs")]
+        public async Task SkipSong(
+            [Summary("Number of songs to skip. 1 would just skip the currently playing song")]
+            uint number)
+        {
+            if (!_node.TryGetPlayer(Context.Guild, out var player))
+            {
+                await ReplyFailureEmbed("I have not joined any Voice Channel yet.");
+                return;
+            }
+
+            if (!await CheckIfSameVc(player.VoiceChannel))
+                return;
+
+            if (player.PlayerState != PlayerState.Playing)
+            {
+                await ReplyFailureEmbed("I'm currently not playing anything");
+                return;
+            }
+
+            if (number < 1 || number > (player.Queue.Count + 1))
+            {
+                await ReplyFailureEmbed(
+                    $"Cannot skip less than 1 song or more than the queue length + 1 ({(player.Queue.Count + 1).ToString()})");
+                return;
+            }
+
+            uint queueRemove = --number;
+            player.Queue.RemoveRange(0, (int)queueRemove);
+
+            try
+            {
+                if (player.Queue.Count == 0)
+                {
+                    await player.StopAsync();
+                    await ReplyMusicEmbed($"Queue is now finished.");
+                    return;
+                }
+                var currentTrack = await player.SkipAsync();
+                if (currentTrack == null)
+                {
+                    await ReplyMusicEmbed($"Queue is now finished.");
+                }
+                else
+                {
+                    await ReplyMusicExtended(currentTrack, false);
+                }
+            }
+            catch (Exception)
+            {
+                await ReplyFailureEmbed("Something broke :/");
+            }
+        }

         [Command("skip"), Alias("next")]
         [Summary("Skips the current song and plays the next")]
@@ -197,6 +252,12 @@

             try
             {
+                if (player.Queue.Count == 0)
+                {
+                    await player.StopAsync();
+                    await ReplyMusicEmbed($"Queue is now finished.");
+                    return;
+                }
                 var currentTrack = await player.SkipAsync();
                 if (currentTrack == null)
                 {


Refactors the ReceiveMessage partial view to use the new AJAX status widget.

--- Source/ExampleApp.Web/Views/Home/ReceiveMessage.cshtml
+++ Source/ExampleApp.Web/Views/Home/ReceiveMessage.cshtml
@@ -1,6 +1,7 @@

     <button id="ReceiveMessageButton" type="button">Receive</button>

+
?


Fixed VIDatagroup to make sure AssetID and corresponding Asset match when multiple sets of Voltages are used

--- Source/Libraries/FaultData/DataAnalysis/VIDataGroup.cs
+++ Source/Libraries/FaultData/DataAnalysis/VIDataGroup.cs
@@ -461,7 +461,7 @@
             {
                 // Calculate IA = IR - IB - IC
                 missingSeries = IR.Add(IB.Negate()).Add(IC.Negate());
-                missingSeries.SeriesInfo = GetSeriesInfo(meter, m_dataGroup, "Current", "AN");
+                missingSeries.SeriesInfo = GetSeriesInfo(meter, m_dataGroup, "Current", "AN", IR.SeriesInfo.Channel.AssetID);
                 missingSeries.Calculated = true;
                 m_iaIndex = m_dataGroup.DataSeries.Count;
                 m_dataGroup.Add(missingSeries);
@@ -470,7 +470,7 @@
             {
                 // Calculate IB = IR - IA - IC
                 missingSeries = IR.Add(IA.Negate()).Add(IC.Negate());
-                missingSeries.SeriesInfo = GetSeriesInfo(meter, m_dataGroup, "Current", "BN");
+                missingSeries.SeriesInfo = GetSeriesInfo(meter, m_dataGroup, "Current", "BN", IR.SeriesInfo.Channel.AssetID);
                 missingSeries.Calculated = true;
                 m_ibIndex = m_dataGroup.DataSeries.Count;
                 m_dataGroup.Add(missingSeries);
@@ -479,7 +479,7 @@
             {
                 // Calculate IC = IR - IA - IB
                 missingSeries = IR.Add(IA.Negate()).Add(IB.Negate());
-                missingSeries.SeriesInfo = GetSeriesInfo(meter, m_dataGroup, "Current", "CN");
+                missingSeries.SeriesInfo = GetSeriesInfo(meter, m_dataGroup, "Current", "CN", IR.SeriesInfo.Channel.AssetID);
                 missingSeries.Calculated = true;
                 m_icIndex = m_dataGroup.DataSeries.Count;
                 m_dataGroup.Add(missingSeries);
@@ -488,7 +488,7 @@
             {
                 // Calculate IR = IA + IB + IC
                 missingSeries = IA.Add(IB).Add(IC);
-                missingSeries.SeriesInfo = GetSeriesInfo(meter, m_dataGroup, "Current", "RES");
+                missingSeries.SeriesInfo = GetSeriesInfo(meter, m_dataGroup, "Current", "RES", IA.SeriesInfo.Channel.AssetID);
                 missingSeries.Calculated = true;
                 m_irIndex = m_dataGroup.DataSeries.Count;
                 m_dataGroup.Add(missingSeries);
@@ -519,7 +519,7 @@
                 {
                     // Calculate VAB = VA - VB
                     missingSeries = VA.Add(VB.Negate());
-                    missingSeries.SeriesInfo = GetSeriesInfo(meter, m_dataGroup, "Voltage", "AB");
+                    missingSeries.SeriesInfo = GetSeriesInfo(meter, m_dataGroup, "Voltage", "AB", VA.SeriesInfo.Channel.AssetID);
                     missingSeries.Calculated = true;
                     m_vIndices[i].Vab = m_dataGroup.DataSeries.Count;
                     m_dataGroup.Add(missingSeries);
@@ -529,7 +529,7 @@
                 {
                     // Calculate VBC = VB - VC
                     missingSeries = VB.Add(VC.Negate());
-                    missingSeries.SeriesInfo = GetSeriesInfo(meter, m_dataGroup, "Voltage", "BC");
+                    missingSeries.SeriesInfo = GetSeriesInfo(meter, m_dataGroup, "Voltage", "BC", VB.SeriesInfo.Channel.AssetID);
                     missingSeries.Calculated = true;
                     m_vIndices[i].Vbc = m_dataGroup.DataSeries.Count;
                     m_dataGroup.Add(missingSeries);
@@ -539,7 +539,7 @@
                 {
                     // Calculate VCA = VC - VA
                     missingSeries = VC.Add(VA.Negate());
-                    missingSeries.SeriesInfo = GetSeriesInfo(meter, m_dataGroup, "Voltage", "CA");
+                    missingSeries.SeriesInfo = GetSeriesInfo(meter, m_dataGroup, "Voltage", "CA", VC.SeriesInfo.Channel.AssetID);
                     missingSeries.Calculated = true;
                     m_vIndices[i].Vca = m_dataGroup.DataSeries.Count;
                     m_dataGroup.Add(missingSeries);
@@ -588,9 +588,8 @@
         #region [ Static ]

         // Static Methods
-        private static Series GetSeriesInfo(Meter meter, DataGroup dataGroup, string measurementTypeName, string phaseName)
-        {
-            int assetID = dataGroup.Asset.ID;
+        private static Series GetSeriesInfo(Meter meter, DataGroup dataGroup, string measurementTypeName, string phaseName, int assetID)
+        {
             string measurementCharacteristicName = "Instantaneous";
             string seriesTypeName = "Values";

@@ -609,6 +608,14 @@
             {
                 Channel dbChannel = meter.Channels
                     .FirstOrDefault(channel => channelKey.Equals(new ChannelKey(channel)));
+
+                //need to get Asset based on the asset of the datagroup or the connected assets
+                Asset asset = dataGroup.Asset;
+                if (asset.ID != assetID)
+                {
+                    List<Asset> connectedAssets = asset.ConnectedAssets.ToList();
+                    asset = connectedAssets.Find(item => item.ID == assetID);
+                }

                 if ((object)dbChannel == null)
                 {
@@ -629,7 +636,7 @@
                         Enabled = true,

                         Meter = meter,
-                        Asset = dataGroup.Asset,
+                        Asset = asset,
                         MeasurementType = measurementType,
                         MeasurementCharacteristic = measurementCharacteristic,
                         Phase = phase,


[Toolkit.Graphics] Fix compilation on DX11.2 for issue #290

--- Source/Toolkit/SharpDX.Toolkit.Graphics/DisplayMode.cs
+++ Source/Toolkit/SharpDX.Toolkit.Graphics/DisplayMode.cs
@@ -136,5 +136,13 @@
         {
             return new DisplayMode(description.Format, description.Width, description.Height, description.RefreshRate);
         }
+
+#if DIRECTX11_1
+        public static DisplayMode FromDescription(ModeDescription1 description)
+        {
+            return new DisplayMode(description.Format, description.Width, description.Height, description.RefreshRate);
+        }
+#endif
+
     }
 }


[Modify] Edit it

[Modify] Edit it

--- websocket-sharp/Logger.cs
+++ websocket-sharp/Logger.cs
@@ -157,17 +157,22 @@
     }

     /// <summary>
-    /// Gets or sets the current output action used to output a log.
+    /// Gets or sets the delegate used to output a log.
     /// </summary>
     /// <value>
     ///   <para>
-    ///   An <c>Action<LogData, string></c> delegate that references the method(s) used to
-    ///   output a log. A <see cref="string"/> parameter passed to this delegate is the value of
+    ///   An <c>Action<LogData, string></c> delegate.
+    ///   </para>
+    ///   <para>
+    ///   It references the method used to output a log.
+    ///   </para>
+    ///   <para>
+    ///   The string parameter passed to the delegate is the value of
     ///   the <see cref="Logger.File"/> property.
     ///   </para>
     ///   <para>
-    ///   If the value to set is <see langword="null"/>, the current output action is changed to
-    ///   the default output action.
+    ///   If the value to set is <see langword="null"/>, the default
+    ///   output method is set.
     ///   </para>
     /// </value>
     public Action<LogData, string> Output {


[Toolkit.Graphics] Removed garbage generation from SpriteBatch.End call

--- Source/Toolkit/SharpDX.Toolkit.Graphics/SpriteBatch.cs
+++ Source/Toolkit/SharpDX.Toolkit.Graphics/SpriteBatch.cs
@@ -861,14 +861,19 @@
                 {
                     // For x86 version, It seems that we can write directly to the buffer
                     // TODO: Need to check that this behavior is also running fine under WP8
-                    resourceContext.VertexBuffer.SetDynamicData(GraphicsDevice, ptr =>
-                                                                    {
-                                                                        var texturePtr = (VertexPositionColorTexture*) ptr;
-                                                                        for (int i = 0; i < batchSize; i++)
-                                                                        {
-                                                                            UpdateVertexFromSpriteInfo(ref sprites[offset + i], ref texturePtr, deltaX, deltaY);
-                                                                        }
-                                                                    }, offsetInBytes, noOverwrite);
+                    var deviceContext = (DeviceContext)GraphicsDevice;
+                    try
+                    {
+                        var box = deviceContext.MapSubresource(resourceContext.VertexBuffer, 0, SetDataOptionsHelper.ConvertToMapMode(noOverwrite), MapFlags.None);
+                        var pointer = (IntPtr)((byte*)box.DataPointer + offsetInBytes);
+                        var texturePtr = (VertexPositionColorTexture*)pointer;
+                        for(var i = 0; i < batchSize; i++)
+                            UpdateVertexFromSpriteInfo(ref sprites[offset + i], ref texturePtr, deltaX, deltaY);
+                    }
+                    finally
+                    {
+                        deviceContext.UnmapSubresource(resourceContext.VertexBuffer, 0);
+                    }
                 }

                 // Draw from the specified index