Minor style refactoring

Minor style refactoring

--- Source/Controller.cs
+++ Source/Controller.cs
@@ -57,8 +57,9 @@
   readonly Message<double> KerbalEvaFuelMsg = "EVA propellant: {0:F3}";
   readonly Message VesselIsControllableMsg = "IS controllable";
   readonly Message VesselIsNotControllableMsg = "Is NOT controllable";
-  readonly Message<CameraStabilization> CameraStabilizationModeChanged = "EVS stabilization: {0}";
-  readonly Message<float> DistantVesselTargeted = "Vessel is too distant: {0:N0}m";
+  readonly Message<CameraStabilization> CameraStabilizationModeChangedMsg =
+      "EVS stabilization: {0}";
+  readonly Message<float> DistantVesselTargetedMsg = "Vessel is too distant: {0:N0}m";
   readonly Message VesselIsAttachedToTheGroundMsg = "IS attached to the ground";
   readonly Message VesselIsNotAttachedToTheGroundMsg = "Is NOT attached to the ground";
   #endregion
@@ -160,7 +161,7 @@
         cameraStabilizationMode = CameraStabilization.None;
       }
       ScreenMessaging.ShowPriorityScreenMessage(
-          CameraStabilizationModeChanged.Format(cameraStabilizationMode));
+          CameraStabilizationModeChangedMsg.Format(cameraStabilizationMode));
     }

     // Handle vessel switch and highlight.
@@ -408,7 +409,7 @@
     float distanceBetweenVessels = Vector3.Distance(
         FlightGlobals.ActiveVessel.transform.position, hoveredVessel.transform.position);
     if (distanceBetweenVessels > maxVesselDistance) {
-      sb.Add(DistantVesselTargeted.Format(distanceBetweenVessels));
+      sb.Add(DistantVesselTargetedMsg.Format(distanceBetweenVessels));
     }

     if (kerbalEva != null) {


Widget.Initialize() should never be called directly.  It is only called via the constructor.

--- Source/Eto/Widget.cs
+++ Source/Eto/Widget.cs
@@ -199,7 +199,7 @@
 		/// If you pass false to the constructor's initialize property, you should call this manually in your constructor
 		/// after all of its logic has finished.
 		/// </remarks>
-		public void Initialize ()
+		protected void Initialize ()
 		{
 			((IWidget)Handler).Initialize ();
 		}


corrected small typo

corrected small typo

--- Source/MethodCall.cs
+++ Source/MethodCall.cs
@@ -81,7 +81,7 @@
 		}
 	}

-    internal class TypeEqualityComaprer : IEqualityComparer<Type>
+    internal class TypeEqualityComparer : IEqualityComparer<Type>
     {
         public bool Equals(Type x, Type y)
         {
@@ -108,7 +108,7 @@
 		private int? expectedCallCount = null;
 		protected Func<bool> condition;
 		private List<KeyValuePair<int, object>> outValues = new List<KeyValuePair<int, object>>();
-	    private static readonly IEqualityComparer<Type> typesComparer = new TypeEqualityComaprer();
+	    private static readonly IEqualityComparer<Type> typesComparer = new TypeEqualityComparer();

 	    public MethodCall(Mock mock, Func<bool> condition, Expression originalExpression, MethodInfo method, params Expression[] arguments)
 		{


Enable correctioin box for UB

Enable correctioin box for UB

Fix #47

--- 3DSRNGTool/MainForm.cs
+++ 3DSRNGTool/MainForm.cs
@@ -920,7 +920,7 @@
                 if (FormPM is PKMW7 pmw7) // For UB
                 {
                     Special_th.Value = pmw7.Rate?[MetLocation.SelectedIndex] ?? (byte)(CB_Category.SelectedIndex == 2 ? 50 : 0);
-                    Correction.Enabled = Special_th.Enabled = pmw7.Conceptual;
+                    Special_th.Enabled = pmw7.Conceptual;
                 }
                 else if (FormPM is PKMW6 pmw6)
                 {


Removed old AssemblyInfo files

Removed old AssemblyInfo files

--- cfg/AssemblyInfo.cs
+++ cfg/AssemblyInfo.cs
@@ -1,20 +0,0 @@
-//------------------------------------------------------------------------------
-// <auto-generated>
-//     This code was generated by a tool.
-//     Runtime Version:4.0.30319.1
-//
-//     Changes to this file may cause incorrect behavior and will be lost if
-//     the code is regenerated.
-// </auto-generated>
-//------------------------------------------------------------------------------
-
-using System;
-using System.Reflection;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-[assembly: AssemblyVersion("1.0.3829.0")]
-[assembly: AssemblyInformationalVersion("1.0.3829.0 beta 1")]
-[assembly: AssemblyFileVersion("1.0.3829.0")]
-
-


修复形式匹配中原子还原索引错误

修复形式匹配中原子还原索引错误

--- SplitCore/Radical.cs
+++ SplitCore/Radical.cs
@@ -204,7 +204,7 @@
             {
                 for (int i = 0; i < this._redical.SpecialAtom.Length; i++) // 还原SpecialAtom
                 {
-                    base.Molecule.Sign[this._redical.SpecialAtom[i]] = 0;
+                    base.Molecule.Sign[this._matched[this._redical.SpecialAtom[i]]] = 0;
                 }
                 core_List.Add(this._matched[0]);
                 this._nSign++;


Fixed InstantiationException.Message causing NullReferenceException

SVN: 488784591515bd4cdaa016be4ec9b172dc4e7caf@1466

--- src/NHibernate/InstantiationException.cs
+++ src/NHibernate/InstantiationException.cs
@@ -72,7 +72,7 @@
 		/// </value>
 		public override string Message
 		{
-			get { return base.Message + type.FullName; }
+			get { return base.Message + ( type == null ? "" : type.FullName ); }
 		}


added Encoding property for ColoredConsoleTarget

--- src/NLog/Targets/ColoredConsoleTarget.cs
+++ src/NLog/Targets/ColoredConsoleTarget.cs
@@ -31,6 +31,8 @@
 // THE POSSIBILITY OF SUCH DAMAGE.
 //

+using System.Text;
+
 #if !SILVERLIGHT

 namespace NLog.Targets
@@ -126,6 +128,16 @@
         public bool UseDefaultRowHighlightingRules { get; set; }

         /// <summary>
+        /// The encoding for writing messages to the <see cref="Console"/>.
+        ///  </summary>
+        /// <remarks>Has side effect</remarks>
+        public Encoding Encoding
+        {
+            get { return Console.OutputEncoding; }
+            set { Console.OutputEncoding = value; }
+        }
+
+        /// <summary>
         /// Gets the row highlighting rules.
         /// </summary>
         /// <docgen category='Highlighting Rules' order='10' />


Adss null check

Adss null check

--- src/Umbraco.Web/Editors/TemplateController.cs
+++ src/Umbraco.Web/Editors/TemplateController.cs
@@ -135,21 +135,26 @@
                             var templateHasChildren = Services.FileService.GetTemplateDescendants(display.Id);

                             foreach (var childTemplate in templateHasChildren)
-                            {
+                            {
                                 //template ID to find
-                                var templateIDInPath = "," + display.Id + ",";
-
+                                var templateIdInPath = "," + display.Id + ",";
+
+                                if (string.IsNullOrEmpty(childTemplate.Path))
+                                {
+                                    continue;
+                                }
+
                                 //Find position in current comma seperate string path (so we get the correct children path)
-                                var positionInPath = childTemplate.Path.IndexOf(templateIDInPath) + templateIDInPath.Length;
-
+                                var positionInPath = childTemplate.Path.IndexOf(templateIdInPath) + templateIdInPath.Length;
+
                                 //Get the substring of the child & any children (descendants it may have too)
-                                var childTemplatePath = childTemplate.Path.Substring(positionInPath);
-
-                                //As we are updating the template to be a child of a master
+                                var childTemplatePath = childTemplate.Path.Substring(positionInPath);
+
+                                //As we are updating the template to be a child of a master
                                 //Set the path to the master's path + its current template id + the current child path substring
-                                childTemplate.Path = master.Path + "," + display.Id + "," + childTemplatePath;
-
-                                //Save the children with the updated path
+                                childTemplate.Path = master.Path + "," + display.Id + "," + childTemplatePath;
+
+                                //Save the children with the updated path
                                 Services.FileService.SaveTemplate(childTemplate);
                             }
                         }


Fixed bug in foreign-key handling in MigrationCredential

--- src/NuGetGallery/Services/UserService.cs
+++ src/NuGetGallery/Services/UserService.cs
@@ -360,7 +360,8 @@
             foreach (var cred in toRemove)
             {
                 creds.Remove(cred);
-                user.Credentials.Remove(cred);
+                user.Credentials.Remove(cred);
+                CredentialRepository.DeleteOnCommit(cred);
             }

             // Now add one if there are no credentials left
@@ -369,7 +370,7 @@
                 user.Credentials.Add(CredentialBuilder.CreatePbkdf2Password(password));
             }

-            // Save changes, if any
+            // Save changes, if any (even though we only commit one repo, both will get saved because they just wrap entities context)
             UserRepository.CommitChanges();
         }


Extends Humanize

Extends Humanize

--- src/Unosquare.Swan.Lite/Extensions.Strings.cs
+++ src/Unosquare.Swan.Lite/Extensions.Strings.cs
@@ -63,6 +63,7 @@
         /// The computed hash code.
         /// </returns>
         /// <exception cref="ArgumentNullException">stream.</exception>
+        [Obsolete("Use a better hasher.")]
         public static byte[] ComputeMD5(this Stream stream, bool createHasher = false)
         {
             if (stream == null)
@@ -108,6 +109,7 @@
         /// <param name="value">The input string.</param>
         /// <param name="createHasher">if set to <c>true</c> [create hasher].</param>
         /// <returns>The computed hash code.</returns>
+        [Obsolete("Use a better hasher.")]
         public static byte[] ComputeMD5(this string value, bool createHasher = false) =>
             Encoding.UTF8.GetBytes(value).ComputeMD5(createHasher);

@@ -117,6 +119,7 @@
         /// <param name="data">The data.</param>
         /// <param name="createHasher">if set to <c>true</c> [create hasher].</param>
         /// <returns>The computed hash code.</returns>
+        [Obsolete("Use a better hasher.")]
         public static byte[] ComputeMD5(this byte[] data, bool createHasher = false) =>
             (createHasher ? MD5.Create() : Md5Hasher.Value).ComputeHash(data);

@@ -129,6 +132,7 @@
         /// The computes a Hash-based Message Authentication Code (HMAC)
         /// using the SHA1 hash function.
         /// </returns>
+        [Obsolete("Use a better hasher.")]
         public static byte[] ComputeSha1(this string value, bool createHasher = false)
         {
             var inputBytes = Encoding.UTF8.GetBytes(value);
@@ -171,7 +175,7 @@
         /// overload exists.
         /// </summary>
         /// <param name="obj">The item.</param>
-        /// <returns>A <see cref="System.String" /> that represents the current object.</returns>
+        /// <returns>A <see cref="string" /> that represents the current object.</returns>
         public static string ToStringInvariant(this object obj)
         {
             if (obj == null)
@@ -194,7 +198,7 @@
         /// </summary>
         /// <typeparam name="T">The type to get the string.</typeparam>
         /// <param name="item">The item.</param>
-        /// <returns>A <see cref="System.String" /> that represents the current object.</returns>
+        /// <returns>A <see cref="string" /> that represents the current object.</returns>
         public static string ToStringInvariant<T>(this T item)
         {
             if (typeof(string) == typeof(T))
@@ -218,7 +222,7 @@
                 throw new ArgumentNullException(nameof(value));

             if (excludeChars == null)
-                excludeChars = new char[] { };
+                excludeChars = Array.Empty<char>();

             return new string(value
                 .Where(c => char.IsControl(c) == false || excludeChars.Contains(c))
@@ -229,7 +233,7 @@
         /// Removes all control characters from a string, including new line sequences.
         /// </summary>
         /// <param name="value">The input.</param>
-        /// <returns>A <see cref="System.String" /> that represents the current object.</returns>
+        /// <returns>A <see cref="string" /> that represents the current object.</returns>
         /// <exception cref="ArgumentNullException">input.</exception>
         public static string RemoveControlChars(this string value) => value.RemoveControlCharsExcept(null);

@@ -238,7 +242,7 @@
         /// </summary>
         /// <param name="obj">The object.</param>
         /// <param name="format">if set to <c>true</c> format the output.</param>
-        /// <returns>A <see cref="System.String" /> that represents the current object.</returns>
+        /// <returns>A <see cref="string" /> that represents the current object.</returns>
         public static string ToJson(this object obj, bool format = true) =>
             obj == null ? string.Empty : Json.Serialize(obj, format);

@@ -248,7 +252,7 @@
         /// examine objects.
         /// </summary>
         /// <param name="obj">The object.</param>
-        /// <returns>A <see cref="System.String" /> that represents the current object.</returns>
+        /// <returns>A <see cref="string" /> that represents the current object.</returns>
         public static string Stringify(this object obj)
         {
             if (obj == null)
@@ -315,7 +319,7 @@
         /// that are delimited by one or more characters in separator.
         /// </returns>
         public static string[] ToLines(this string value) =>
-            value == null ? new string[] { } : SplitLinesRegex.Value.Split(value);
+            value == null ? Array.Empty<string>() : SplitLinesRegex.Value.Split(value);

         /// <summary>
         /// Humanizes (make more human-readable) an identifier-style string
@@ -323,7 +327,7 @@
         /// Camel Case and Snake_Case will be converted to Snake Case.
         /// </summary>
         /// <param name="value">The identifier-style string.</param>
-        /// <returns>A <see cref="System.String" /> that represents the current object.</returns>
+        /// <returns>A <see cref="string" /> humanized.</returns>
         public static string Humanize(this string value)
         {
             if (value == null)
@@ -335,12 +339,37 @@
         }

         /// <summary>
+        /// Humanizes (make more human-readable) an boolean.
+        /// </summary>
+        /// <param name="value">if set to <c>true</c> [value].</param>
+        /// <returns>A <see cref="string" /> that represents the current boolean.</returns>
+        public static string Humanize(this bool value) => value ? "Yes" : "No";
+
+        /// <summary>
+        /// Humanizes (make more human-readable) the specified value.
+        /// </summary>
+        /// <param name="value">The value.</param>
+        /// <returns>A <see cref="string" /> that represents the current object.</returns>
+        public static string Humanize(this object value)
+        {
+            switch (value)
+            {
+                case string stringValue:
+                    return stringValue.Humanize();
+                case bool boolValue:
+                    return boolValue.Humanize();
+                default:
+                    return value.Stringify();
+            }
+        }
+
+        /// <summary>
         /// Indents the specified multi-line text with the given amount of leading spaces
         /// per line.
         /// </summary>
         /// <param name="value">The text.</param>
         /// <param name="spaces">The spaces.</param>
-        /// <returns>A <see cref="System.String" /> that represents the current object.</returns>
+        /// <returns>A <see cref="string" /> that represents the current object.</returns>
         public static string Indent(this string value, int spaces = 4)
         {
             if (value == null) value = string.Empty;


Delete IUserExports.cs

Delete IUserExports.cs

--- src/Vk.Api.Schema/Common/User/IUserExports.cs
+++ src/Vk.Api.Schema/Common/User/IUserExports.cs
@@ -1,14 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-
-namespace Vk.Api.Schema.Common.User
-{
-    /// <summary>
-    /// Интерфейс для представления внешних сервисов экспорта (Twitter, Facebook, и т.п.)
-    /// </summary>
-    public interface IUserExports
-    {
-
-    }
-}


Added a FormField.HeaderCollection class.

--- MultipartForm.cs
+++ MultipartForm.cs
@@ -5,6 +5,7 @@
 using System.IO;
 using System.Linq;
 using System.Net.Mime;
+using System.Runtime.Remoting.Messaging;
 using System.Text.RegularExpressions;
 using System.Web;

@@ -108,11 +109,26 @@

         public bool IsBinary { get; private set; }

-        public IDictionary<String, FormFieldHeader> Headers { get { return _headers; } }
-
-        protected FormField(IDictionary<String, FormFieldHeader> headers)
-        {
-            _headers = new Dictionary<string, FormFieldHeader>(headers, StringComparer.InvariantCultureIgnoreCase);
+        public class HeaderCollection
+        {
+            private readonly IDictionary<String, FormFieldHeader> _headers;
+
+            public FormFieldHeader this[String key]
+            {
+                get { return _headers.ContainsKey(key) ? _headers[key] : null; }
+            }
+
+            internal HeaderCollection(IDictionary<String, FormFieldHeader> headers)
+            {
+                _headers = new Dictionary<string, FormFieldHeader>(headers, StringComparer.InvariantCultureIgnoreCase);
+            }
+        }
+
+        public HeaderCollection Headers { get; private set; }
+
+        public FormField(IDictionary<String, FormFieldHeader> headers)
+        {
+            Headers = new HeaderCollection(headers);

             var cdisp = Headers["Content-Disposition"];
             if (cdisp != null) Name = cdisp["name"];


Fixed bug in block styles when rendering EditorConfig. Fixes #767

--- core/Piranha.Manager/Areas/Manager/Shared/Partial/_EditorConfig.cshtml
+++ core/Piranha.Manager/Areas/Manager/Shared/Partial/_EditorConfig.cshtml
@@ -11,7 +11,7 @@
             {
                 if (style.Type == EditorStyleType.Block)
                 {
-<text>            { title: "@style.Title", inline: "@style.Tag"@Html.Raw(style.HasClasses ? ", classes: \"" + style.Classes + "\"" : "") },
+<text>            { title: "@style.Title", block: "@style.Tag"@Html.Raw(style.HasClasses ? ", classes: \"" + style.Classes + "\"" : "") },
 </text>
                 }
                 else if (style.Type == EditorStyleType.Format)


More TO work

More TO work


Increase Version to 25

Increase Version to 25

--- Necrow/Necrow.cs
+++ Necrow/Necrow.cs
@@ -133,7 +133,7 @@
     {
         #region Fields

-        internal readonly static int Version = 24;
+        internal readonly static int Version = 25;

         private static Database j = null;


FieldOffset读取失败时返回-1

--- Il2CppDumper/Il2Cpp.cs
+++ Il2CppDumper/Il2Cpp.cs
@@ -201,7 +201,7 @@
                     }
                     return -1;
                 }
-                return 0;
+                return -1;
             }
             return fieldOffsets[fieldIndex];
         }


修改示例代码

修改示例代码

--- KS3Sample/KS3Sample.cs
+++ KS3Sample/KS3Sample.cs
@@ -100,7 +100,7 @@
              * 中国（上海）| ks3-cn-shanghai.ksyun.com
              * 中国（香港）| ks3-cn-hk-1.ksyun.com
              */
-            String endPoint = "kss.ksyun.com";    //此处以北京region为例
+            String endPoint = "ks3-cn-beijing.ksyun.com";    //此处以北京region为例

             ks3Client = new KS3Client(accessKey, secretKey);
             ks3Client.setEndpoint(endPoint);


Made a few changes to refactorings - Try using the minimal symbol display format as the - Implemented rename endpoint

--- src/OmniSharp/Api/OmnisharpController.cs
+++ src/OmniSharp/Api/OmnisharpController.cs
@@ -1,5 +1,7 @@
 using System.Collections.Generic;
+using System.IO;
 using System.Linq;
+using System.Text;
 using System.Threading.Tasks;
 using Microsoft.AspNet.Mvc;
 using Microsoft.CodeAnalysis;
@@ -21,40 +23,10 @@
             _workspace = workspace;
         }

-        [HttpPost("gotodefinition")]
-        public async Task<IActionResult> GotoDefinition([FromBody]Request request)
-        {
-            _workspace.EnsureBufferUpdated(request);
-
-            var quickFixes = new List<QuickFix>();
-
-            var documentIds = _workspace.CurrentSolution.GetDocumentIdsWithFilePath(request.FileName);
-            var documentId = documentIds.FirstOrDefault();
-            var response = new GotoDefinitionResponse();
-            if (documentId != null)
-            {
-                var document = _workspace.CurrentSolution.GetDocument(documentId);
-                var semanticModel = await document.GetSemanticModelAsync();
-                var syntaxTree = semanticModel.SyntaxTree;
-                var sourceText = await document.GetTextAsync();
-                var position = sourceText.Lines.GetPosition(new LinePosition(request.Line - 1, request.Column ));
-                var symbol = SymbolFinder.FindSymbolAtPosition(semanticModel, position, _workspace);
-                var lineSpan = symbol.Locations.First().GetMappedLineSpan();
-                response = new GotoDefinitionResponse
-                {
-                    FileName = lineSpan.Path,
-                    Line = lineSpan.StartLinePosition.Line + 1,
-                    Column = lineSpan.StartLinePosition.Character + 1
-                };
-            }
-
-            return new ObjectResult(response);
-        }
-
         [HttpPost("codecheck")]
         public async Task<IActionResult> CodeCheck([FromBody]Request request)
         {
-            _workspace.EnsureBufferUpdated(request);
+            EnsureBufferUpdated(request);

             var quickFixes = new List<QuickFix>();

@@ -78,7 +50,7 @@
         {
             var completions = Enumerable.Empty<AutoCompleteResponse>();

-            _workspace.EnsureBufferUpdated(request);
+            EnsureBufferUpdated(request);

             var documentIds = _workspace.CurrentSolution.GetDocumentIdsWithFilePath(request.FileName);

@@ -93,6 +65,10 @@

                 completions = symbols.Select(MakeAutoCompleteResponse);
             }
+            else
+            {
+                return new HttpNotFoundResult();
+            }

             return new ObjectResult(completions);
         }
@@ -100,7 +76,7 @@
         [HttpPost("rename")]
         public async Task<IActionResult> Rename([FromBody]RenameRequest request)
         {
-            _workspace.EnsureBufferUpdated(request);
+            EnsureBufferUpdated(request);

             var response = new RenameResponse();

@@ -157,6 +133,16 @@
             return response;
         }

+        private void EnsureBufferUpdated(Request request)
+        {
+            foreach (var documentId in _workspace.CurrentSolution.GetDocumentIdsWithFilePath(request.FileName))
+            {
+                var buffer = Encoding.UTF8.GetBytes(request.Buffer);
+                var sourceText = SourceText.From(new MemoryStream(buffer), encoding: Encoding.UTF8);
+                _workspace.OnDocumentChanged(documentId, sourceText);
+            }
+        }
+
         private static QuickFix MakeQuickFix(Diagnostic diagnostic)
         {
             var span = diagnostic.Location.GetMappedLineSpan();


Fixed the bugs when changing font styles.

--- TextPoint/FRMMain.cs
+++ TextPoint/FRMMain.cs
@@ -367,7 +367,6 @@
                 }
             }

-            //Cant set bold/italics/underline for mutiple fonts
             if (RTBText.SelectionFont != null && RTBText.SelectionFont.Bold) { BoldCheckboxBtn.Checked = true; }
             else { BoldCheckboxBtn.Checked = false; }

@@ -432,92 +431,164 @@
                 tmpRB.SelectedRtf = RTBText.SelectedRtf;
                 if (tmpRB.TextLength < 1)
                 {
-                    int size = (int)RTBText.SelectionFont.Size;
-                    string font = RTBText.SelectionFont.Name;
-                    var style = RTBText.SelectionFont.Style;
-                    if (what == "Size")
-                    {
-                        size = int.Parse(value);
-                    }
-                    else if (what == "Font")
-                    {
-                        font = value;
-                    }
-                    else if (what == "Bold")
-                    {
-                        if (value == "bold") { style = style | FontStyle.Bold; }
-                        else { style = style & ~FontStyle.Bold; }
-                    }
-                    else if (what == "Italic")
-                    {
-                        if (value == "italic") { style = style | FontStyle.Italic; }
-                        else { style = style & ~FontStyle.Italic; }
-                    }
-                    else if (what == "Underline")
-                    {
-                        if (value == "underline") { style = style | FontStyle.Underline; }
-                        else { style = style & ~FontStyle.Underline; }
-                    }
-
-                    RTBText.SelectionFont = new Font(font, size, style);
+                    ChangeFormatNoSelection(what, value);
                 }
                 else
                 {
-                    for (int i = 0; i < tmpRB.TextLength; ++i)
-                    {
-                        tmpRB.Select(i, 1);
-                        int size = (int)tmpRB.SelectionFont.Size;
-                        string font = tmpRB.SelectionFont.Name;
-                        var style = tmpRB.SelectionFont.Style;
-                        if (what == "Size")
-                        {
-                            size = int.Parse(value);
-                        }
-                        else if (what == "Font")
-                        {
-                            font = value;
-                        }
-                        else if (what == "Bold")
-                        {
-                            if (value == "bold") { style = style | FontStyle.Bold; }
-                            else { style = style & ~FontStyle.Bold; }
-                        }
-                        else if (what == "Italic")
-                        {
-                            if (value == "italic") { style = style | FontStyle.Italic; }
-                            else { style = style & ~FontStyle.Italic; }
-                        }
-                        else if (what == "Underline")
-                        {
-                            if (value == "underline") { style = style | FontStyle.Underline; }
-                            else { style = style & ~FontStyle.Underline; }
-                        }
-
-                        tmpRB.SelectionFont = new Font(font, size, style);
-                    }
-                    tmpRB.SelectAll();
-                    RTBText.SelectedRtf = tmpRB.SelectedRtf;
-                }
-            }
-        }
-
+                    ChangeFormatLongText(what, value, tmpRB);
+                }
+
+            }
+        }
+
+        private void ChangeFormatNoSelection(string what, string value)
+        {
+            int size = (int)RTBText.SelectionFont.Size;
+            string font = RTBText.SelectionFont.Name;
+            var style = RTBText.SelectionFont.Style;
+            if (what == "Size")
+            {
+                size = int.Parse(value);
+            }
+            else if (what == "Font")
+            {
+                font = value;
+            }
+            else if (what == "Bold")
+            {
+                if (value == "bold") { style = style | FontStyle.Bold; }
+                else { style = style & ~FontStyle.Bold; }
+            }
+            else if (what == "Italic")
+            {
+                if (value == "italic") { style = style | FontStyle.Italic; }
+                else { style = style & ~FontStyle.Italic; }
+            }
+            else if (what == "Underline")
+            {
+                if (value == "underline") { style = style | FontStyle.Underline; }
+                else { style = style & ~FontStyle.Underline; }
+            }
+
+            RTBText.SelectionFont = new Font(font, size, style);
+        }
+        private bool CheckAllBold(RichTextBox tmpRB)
+        {
+            for (int i = 0; i < tmpRB.TextLength; ++i)
+            {
+                tmpRB.Select(i, 1);
+                if (!tmpRB.SelectionFont.Bold) { return false; }
+            }
+            return true;
+        }
+        private bool CheckAllItalic(RichTextBox tmpRB)
+        {
+            for (int i = 0; i < tmpRB.TextLength; ++i)
+            {
+                tmpRB.Select(i, 1);
+                if (!tmpRB.SelectionFont.Italic) { return false; }
+            }
+            return true;
+        }
+        private bool CheckAllUnderline(RichTextBox tmpRB)
+        {
+            for (int i = 0; i < tmpRB.TextLength; ++i)
+            {
+                tmpRB.Select(i, 1);
+                if (!tmpRB.SelectionFont.Underline) { return false; }
+            }
+            return true;
+        }
+        private void ChangeFormatLongText(string what, string value, RichTextBox tmpRB)
+        {
+            {
+                bool AllBold = false;
+                bool AllItalic = true;
+                bool AllUnderline = true;
+                if (what == "Bold" && value == "unknown")
+                {
+                    AllBold = CheckAllBold(tmpRB);
+                }
+                if (what == "Italic" && value == "unknown")
+                {
+                    AllItalic = CheckAllItalic(tmpRB);
+                }
+                if (what == "Underline" && value == "unknown")
+                {
+                    AllUnderline = CheckAllUnderline(tmpRB);
+                }
+                tmpRB = ChangeAllText(tmpRB, what, value, AllBold, AllItalic, AllUnderline);
+                tmpRB.SelectAll();
+                RTBText.SelectedRtf = tmpRB.SelectedRtf;
+            }
+        }
+        private RichTextBox ChangeAllText(RichTextBox tmpRB, string what, string value, bool AllBold, bool AllItalic, bool AllUnderline)
+        {
+            for (int i = 0; i < tmpRB.TextLength; ++i)
+            {
+                tmpRB.Select(i, 1);
+                int size = (int)tmpRB.SelectionFont.Size;
+                string font = tmpRB.SelectionFont.Name;
+                var style = tmpRB.SelectionFont.Style;
+
+                if (what == "Size")
+                {
+                    size = int.Parse(value);
+                }
+
+                else if (what == "Font")
+                {
+                    font = value;
+                }
+
+                else if (what == "Bold" && AllBold && value == "unknown") { style = style & ~FontStyle.Bold; }
+                else if (what == "Bold" && !AllBold && value == "unknown") { style = style | FontStyle.Bold; }
+                else if (what == "Bold" && value != "unknown")
+                {
+                    if (value == "bold") { style = style | FontStyle.Bold; }
+                    else { style = style & ~FontStyle.Bold; }
+                }
+
+                else if (what == "Italic" && AllItalic && value == "unknown") { style = style & ~FontStyle.Italic; }
+                else if (what == "Italic" && !AllItalic && value == "unknown") { style = style | FontStyle.Italic; }
+                else if (what == "Italic" && value != "unknown")
+                {
+                    if (value == "italic") { style = style | FontStyle.Italic; }
+                    else { style = style & ~FontStyle.Italic; }
+                }
+
+                else if (what == "Underline" && AllUnderline && value == "unknown") { style = style & ~FontStyle.Underline; }
+                else if (what == "Underline" && !AllUnderline && value == "unknown") { style = style | FontStyle.Underline; }
+                else if (what == "Underline" && value != "unknown")
+                {
+                    if (value == "underline") { style = style | FontStyle.Underline; }
+                    else { style = style & ~FontStyle.Underline; }
+                }
+
+                tmpRB.SelectionFont = new Font(font, size, style);
+            }
+            return tmpRB;
+        }
         private void BoldCheckboxBtn_Click(object sender, EventArgs e)
         {
-            if (BoldCheckboxBtn.Checked) { ChangeFormat("Bold", "bold"); }
+            if(RTBText.SelectionFont == null) { ChangeFormat("Bold", "unknown"); }
+            else if (BoldCheckboxBtn.Checked) { ChangeFormat("Bold", "bold"); }
             else { ChangeFormat("Bold", "notbold"); }
             RTBText.Focus();
         }

         private void ItalicCheckboxBtn_Click(object sender, EventArgs e)
         {
-            if (ItalicCheckboxBtn.Checked){ ChangeFormat("Italic", "italic"); }
+            if (RTBText.SelectionFont == null) { ChangeFormat("Italic", "unknown"); }
+            else if (ItalicCheckboxBtn.Checked){ ChangeFormat("Italic", "italic"); }
             else { ChangeFormat("Italic", "notitalic"); }
             RTBText.Focus();
         }

         private void UnderlineCheckboxBtn_Click(object sender, EventArgs e)
         {
-            if (UnderlineCheckboxBtn.Checked) { ChangeFormat("Underline", "underline"); }
+            if (RTBText.SelectionFont == null) { ChangeFormat("Underline", "unknown"); }
+            else if (UnderlineCheckboxBtn.Checked) { ChangeFormat("Underline", "underline"); }
             else { ChangeFormat("Underline", "notunderline"); }
             RTBText.Focus();
         }


Added minimum size for TrimForm

Added minimum size for TrimForm

--- TrimForm.Designer.cs
+++ TrimForm.Designer.cs
@@ -31,15 +31,15 @@
             this.tableLayoutPanel = new System.Windows.Forms.TableLayoutPanel();
             this.flowTrimButtons = new System.Windows.Forms.FlowLayoutPanel();
             this.buttonTrimStart = new System.Windows.Forms.Button();
+            this.textBoxTrimStart = new System.Windows.Forms.TextBox();
             this.buttonTrimEnd = new System.Windows.Forms.Button();
+            this.textBoxTrimEnd = new System.Windows.Forms.TextBox();
             this.previewFrame = new WebMConverter.PreviewFrame();
             this.trackVideoTimeline = new System.Windows.Forms.TrackBar();
             this.flowDialogButtons = new System.Windows.Forms.FlowLayoutPanel();
             this.buttonConfirm = new System.Windows.Forms.Button();
             this.buttonCancel = new System.Windows.Forms.Button();
             this.textBoxSelectedFrame = new System.Windows.Forms.TextBox();
-            this.textBoxTrimStart = new System.Windows.Forms.TextBox();
-            this.textBoxTrimEnd = new System.Windows.Forms.TextBox();
             this.tableLayoutPanel.SuspendLayout();
             this.flowTrimButtons.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.trackVideoTimeline)).BeginInit();
@@ -90,6 +90,15 @@
             this.buttonTrimStart.UseVisualStyleBackColor = true;
             this.buttonTrimStart.Click += new System.EventHandler(this.buttonTrimStart_Click);
             //
+            // textBoxTrimStart
+            //
+            this.textBoxTrimStart.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
+            this.textBoxTrimStart.Enabled = false;
+            this.textBoxTrimStart.Location = new System.Drawing.Point(63, 4);
+            this.textBoxTrimStart.Name = "textBoxTrimStart";
+            this.textBoxTrimStart.Size = new System.Drawing.Size(59, 20);
+            this.textBoxTrimStart.TabIndex = 2;
+            //
             // buttonTrimEnd
             //
             this.buttonTrimEnd.Location = new System.Drawing.Point(128, 3);
@@ -99,6 +108,15 @@
             this.buttonTrimEnd.Text = "End";
             this.buttonTrimEnd.UseVisualStyleBackColor = true;
             this.buttonTrimEnd.Click += new System.EventHandler(this.buttonTrimEnd_Click);
+            //
+            // textBoxTrimEnd
+            //
+            this.textBoxTrimEnd.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
+            this.textBoxTrimEnd.Enabled = false;
+            this.textBoxTrimEnd.Location = new System.Drawing.Point(188, 4);
+            this.textBoxTrimEnd.Name = "textBoxTrimEnd";
+            this.textBoxTrimEnd.Size = new System.Drawing.Size(59, 20);
+            this.textBoxTrimEnd.TabIndex = 3;
             //
             // previewFrame
             //
@@ -167,24 +185,6 @@
             this.textBoxSelectedFrame.TabIndex = 6;
             this.textBoxSelectedFrame.KeyUp += new System.Windows.Forms.KeyEventHandler(this.textBoxSelectedFrame_KeyUp);
             //
-            // textBoxTrimStart
-            //
-            this.textBoxTrimStart.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
-            this.textBoxTrimStart.Enabled = false;
-            this.textBoxTrimStart.Location = new System.Drawing.Point(63, 4);
-            this.textBoxTrimStart.Name = "textBoxTrimStart";
-            this.textBoxTrimStart.Size = new System.Drawing.Size(59, 20);
-            this.textBoxTrimStart.TabIndex = 2;
-            //
-            // textBoxTrimEnd
-            //
-            this.textBoxTrimEnd.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
-            this.textBoxTrimEnd.Enabled = false;
-            this.textBoxTrimEnd.Location = new System.Drawing.Point(188, 4);
-            this.textBoxTrimEnd.Name = "textBoxTrimEnd";
-            this.textBoxTrimEnd.Size = new System.Drawing.Size(59, 20);
-            this.textBoxTrimEnd.TabIndex = 3;
-            //
             // TrimForm
             //
             this.AcceptButton = this.buttonConfirm;
@@ -195,6 +195,7 @@
             this.Controls.Add(this.tableLayoutPanel);
             this.MaximizeBox = false;
             this.MinimizeBox = false;
+            this.MinimumSize = new System.Drawing.Size(446, 299);
             this.Name = "TrimForm";
             this.ShowIcon = false;
             this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;


Changed command Messages

Changed command Messages

--- ATPTennisStat/ATPTennisStat.ConsoleClient/Core/Utilities/Messages.cs
+++ ATPTennisStat/ATPTennisStat.ConsoleClient/Core/Utilities/Messages.cs
@@ -29,11 +29,11 @@
         internal static string GenerateImportersMenu()
         {
             return @"
- [imatch] Import matches
- [iplayer] Import Players
- [ipoint] Tennis point distribution
- [itour] Import tournaments
- [isample] Import sample data
+ [importm] Import matches
+ [importp] Import Players
+ [importpd] Tennis point distribution
+ [importt] Import tournaments
+ [importsd] Import sample data

  [menu]";
         }


confirm simple repeated fields can be written

--- src/Parquet.Test/NestedStructuresTest.cs
+++ src/Parquet.Test/NestedStructuresTest.cs
@@ -35,6 +35,9 @@
          ds.Add(1, new[] { "one", "two" });

          DataSet ds1 = DataSetGenerator.WriteRead(ds);
+
+         Assert.Equal(1, ds1[0][0]);
+         Assert.Equal(new[] { "one", "two" }, ds1[0][1]);
       }
    }
 }


Ask user if is removing a custom language that in-use

--- Assets/GameToolkit-Localization/Editor/LocalizationSettingsEditor.cs
+++ Assets/GameToolkit-Localization/Editor/LocalizationSettingsEditor.cs
@@ -35,7 +35,7 @@
                 {
                     EditorGUI.LabelField(rect, "Available Languages");
                 };
-                m_AvailableLanguagesList.drawElementCallback = (Rect rect, int index, bool isActive, bool isFocused) =>
+                m_AvailableLanguagesList.drawElementCallback = (rect, index, isActive, isFocused) =>
                 {
                     var languageProperty = m_AvailableLanguagesList.serializedProperty.GetArrayElementAtIndex(index);
                     var position = new Rect(rect.x, rect.y + 2, rect.width, EditorGUIUtility.singleLineHeight);
@@ -62,6 +62,27 @@
                     {
                         EditorHelper.LanguageField(position, languageProperty, GUIContent.none, true);
                     }
+                };
+                m_AvailableLanguagesList.onRemoveCallback = list =>
+                {
+                    var languageProperty = list.serializedProperty.GetArrayElementAtIndex(list.index);
+                    var language = EditorHelper.GetLanguageValueFromProperty(languageProperty);
+                    if (language.Custom)
+                    {
+                        var localizedAssets = Localization.FindAllLocalizedAssets();
+                        if (localizedAssets.Any(x =>
+                            x.LocaleItems.Any(y => y.Language == language)))
+                        {
+                            if (!EditorUtility.DisplayDialog("Remove \"" + language + "\" language?",
+                                "\"" + language + "\" language is in-use by some localized assets." +
+                                " Are you sure to remove?", "Remove", "Cancel"))
+                            {
+                                return; // Cancelled.
+                            }
+                        }
+                    }
+
+                    ReorderableList.defaultBehaviours.DoRemoveButton(list);
                 };
                 m_AvailableLanguagesList.onCanRemoveCallback = list => list.count > 1;
                 m_AvailableLanguagesList.onAddDropdownCallback = (buttonRect, list) =>


remove comment

remove comment

--- BASE/src/ServerTelemetryChannel/Implementation/TransmissionSender.cs
+++ BASE/src/ServerTelemetryChannel/Implementation/TransmissionSender.cs
@@ -1,7 +1,6 @@
 namespace Microsoft.ApplicationInsights.WindowsServer.TelemetryChannel.Implementation
 {
     using System;
-    using System.Collections.Concurrent;
     using System.Collections.Generic;
     using System.Globalization;
     using System.Linq;
@@ -9,7 +8,6 @@
     using System.Net.Http;
     using System.Threading;
     using System.Threading.Tasks;
-    using System.Xml.Serialization;
     using Microsoft.ApplicationInsights.Channel;
     using Microsoft.ApplicationInsights.Common.Extensions;
     using Microsoft.ApplicationInsights.Extensibility;
@@ -17,12 +15,9 @@

     internal class TransmissionSender
     {
-        // private static string transmissionBatchId = Convert.ToBase64String(BitConverter.GetBytes(WeakConcurrentRandom.Instance.Next()));
         private readonly object lockObj = new object();
-        // Stores all inflight requests with a common id, before SendAsync.
-        // Removes entry from dictionary after getting response.
-        // Changes common id with IAsyncFlushable.FlushAsync, so it starts next batch to track for next IAsyncFlushable.FlushAsync.
-        // private ConcurrentDictionary<Task<HttpWebResponseWrapper>, string> inTransmitIds = new ConcurrentDictionary<Task<HttpWebResponseWrapper>, string>();
+        // Stores all inflight requests using this list, before SendAsync.
+        // Removes entry from lists after getting response.
         private List<InFlightTransmission> inFlightTransmissions = new List<InFlightTransmission>();
         private int transmissionCount = 0;
         private int capacity = 10;
@@ -142,15 +137,6 @@

                 if (transmission?.HasFlushTask == true)
                 {
-                    /* string lastTransmissionBatchId = transmissionBatchId;
-                    lock (this.lockObj)
-                    {
-                        // Generate new transmissionBatchId for next transmissions to be ready for next IAsyncFlushable.FlushAsync (if called).
-                        transmissionBatchId = Convert.ToBase64String(BitConverter.GetBytes(WeakConcurrentRandom.Instance.Next()));
-                    }*/
-
-                    // Wait for inflight transmissions to complete.
-                    // this.WaitForPreviousTransmissionsToComplete(transmission, lastTransmissionBatchId).ConfigureAwait(false).GetAwaiter().GetResult();
                     this.WaitForPreviousTransmissionsToComplete(transmission).ConfigureAwait(false).GetAwaiter().GetResult();
                     this.SendTransmissionToDisk(transmission);
                 }
@@ -189,7 +175,6 @@
             SdkInternalOperationsMonitor.Enter();
             Task<HttpWebResponseWrapper> transmissionTask = null;
             InFlightTransmission inFlightTransmission = default;
-            // string lastTransmissionBatchId = null;

             try
             {
@@ -204,23 +189,12 @@
                 {
                     TelemetryChannelEventSource.Log.TransmissionSendStarted(acceptedTransmission.Id);
                     transmissionTask = acceptedTransmission.SendAsync();
-                    // this.inTransmitIds.TryAdd(transmissionTask, transmissionBatchId);

                     inFlightTransmission = new InFlightTransmission(acceptedTransmission.FlushAsyncId, transmissionTask);
                     lock (this.lockObj)
                     {
                         this.inFlightTransmissions.Add(inFlightTransmission);
                     }
-
-                    /*if (acceptedTransmission.HasFlushTask)
-                    {
-                        lastTransmissionBatchId = transmissionBatchId;
-                        lock (this.lockObj)
-                        {
-                            // Generate new transmissionBatchId for next transmissions to be ready for next IAsyncFlushable.FlushAsync (if called).
-                            transmissionBatchId = Convert.ToBase64String(BitConverter.GetBytes(WeakConcurrentRandom.Instance.Next()));
-                        }
-                    }*/

                     responseContent = await transmissionTask.ConfigureAwait(false);
                 }
@@ -271,7 +245,6 @@
                         };
                     }

-                    // this.inTransmitIds.TryRemove(transmissionTask, out string ignoreValue);
                     lock (this.lockObj)
                     {
                         this.inFlightTransmissions.Remove(inFlightTransmission);
@@ -280,7 +253,6 @@
                     if (acceptedTransmission.HasFlushTask)
                     {
                         // Wait for inflight transmissions to complete.
-                        // await this.WaitForPreviousTransmissionsToComplete(acceptedTransmission, lastTransmissionBatchId).ConfigureAwait(false);
                         await this.WaitForPreviousTransmissionsToComplete(acceptedTransmission).ConfigureAwait(false);
                     }

@@ -292,25 +264,6 @@
                 SdkInternalOperationsMonitor.Exit();
             }
         }
-
-        /*
-        /// <summary>
-        /// Wait for inflight transmissions to complete. Honors the CancellationToken set by an application on IAsyncFlushable.FlushAsync.
-        /// </summary>
-        private async Task WaitForPreviousTransmissionsToComplete(Transmission transmission, string lastTransmissionBatchId)
-        {
-            var activeTransmissions = this.inTransmitIds.Where(p => p.Value == lastTransmissionBatchId).Select(p => p.Key);
-
-            if (activeTransmissions != null)
-            {
-                // Wait for all transmissions over the wire to complete.
-                var inTransitTasks = Task<HttpWebResponseWrapper>.WhenAll(activeTransmissions);
-                // Respect passed Cancellation token in FlushAsync call
-                await Task<HttpWebResponseWrapper>.WhenAny(inTransitTasks, new Task<HttpWebResponseWrapper>(() => { return default(HttpWebResponseWrapper); }, transmission.TransmissionCancellationToken)).ConfigureAwait(false);
-                // Remove processed transmission items from list to free the memory
-                activeTransmissions.ToList().ForEach(key => this.inTransmitIds.TryRemove(key, out string ignoreValue));
-            }
-        }*/

         /// <summary>
         /// Checks if the transmission throttling policy allows for sending another request.


Handle when we are content-free

Handle when we are content-free

--- src/PrivateCache/InMemoryContentStore.cs
+++ src/PrivateCache/InMemoryContentStore.cs
@@ -71,11 +71,16 @@
             var ms = new MemoryStream();

             foreach (var v in cacheContent.Response.Headers) newResponse.Headers.TryAddWithoutValidation(v.Key, v.Value);
-            await (await cacheContent.Response.Content.ReadAsStreamAsync().ConfigureAwait(false))
-                .CopyToAsync(ms).ConfigureAwait(false);

             newResponse.Content = new StreamContent(ms);
-            foreach (var v in cacheContent.Response.Content.Headers) newResponse.Content.Headers.TryAddWithoutValidation(v.Key, v.Value);
+
+            if (cacheContent.Response.Content != null)
+            {
+                var stream = await cacheContent.Response.Content.ReadAsStreamAsync().ConfigureAwait(false);
+                await stream.CopyToAsync(ms).ConfigureAwait(false);
+
+                foreach (var v in cacheContent.Response.Content.Headers) newResponse.Content.Headers.TryAddWithoutValidation(v.Key, v.Value);
+            }

             var newContent = new CacheContent()
             {


cleanup using

cleanup using

--- src/RedCapped.Core.Tests/QueueOfTests.cs
+++ src/RedCapped.Core.Tests/QueueOfTests.cs
@@ -1,7 +1,6 @@
 using System;
+using MongoDB.Bson;
 using MongoDB.Driver;
-using MongoDB.Bson;
-using MongoDB.Driver.Core.Events;
 using NSubstitute;
 using NUnit.Framework;
 using RedCapped.Core.Tests.Extensions;


can handle multiline text

can handle multiline text

--- Assets/ButtonScript.cs
+++ Assets/ButtonScript.cs
@@ -6,6 +6,8 @@
 using System.Text.RegularExpressions; // for Regex

 /*
+ * v0.2 2015/09/27
+ *   - can handle multiline text
  * v0.1 2015/09/27
  *   - can replace nth tab to newline
  */
@@ -27,20 +29,32 @@
 		string intext = System.IO.File.ReadAllText ("indata.txt");

 		string outtext = "";
-		int count = 0;
-		foreach (var element in intext.Split('\t')) {
-			if (count >= nth) {
-				count = 0;
-				if (outtext.Length > 0) {
-					outtext = outtext + System.Environment.NewLine;
+		int count;
+		bool newline = false;
+		foreach (var linetext in intext.Split('\n')) {
+			count = 0;
+			if (outtext.Length > 0) {
+				outtext = outtext + '\n';
+				newline = true;
+			}
+			foreach (var element in linetext.Split('\t')) {
+				if (newline) {
+					newline = false;
+				} else {
+					if (count >= nth) {
+						count = 0;
+						if (outtext.Length > 0) {
+							outtext = outtext + System.Environment.NewLine;
+						}
+					} else {
+						if (outtext.Length > 0) {
+							outtext = outtext + '\t';
+						}
+					}
 				}
-			} else {
-				if (outtext.Length > 0) {
-					outtext = outtext + '\t';
-				}
+				outtext = outtext + element;
+				count++;
 			}
-			outtext = outtext + element;
-			count++;
 		}

 		T_status.text = "output to " + outfile;


fixed compile error

fixed compile error

--- Assets/Scripts/Hero.cs
+++ Assets/Scripts/Hero.cs
@@ -200,7 +200,7 @@
 			if (this.HeroController.Shooting && this.TimeUntilNextProjectile < 0.0f)
 			{
 				this.TimeUntilNextProjectile = this.ProjectileDelay;
-				Punch projectile = (GameObject)GameObject.Instantiate(this.Projectile, this.ProjectileEmitLocator.transform.position, Quaternion.identity);
+				GameObject projectile = (GameObject)GameObject.Instantiate(this.Projectile, this.ProjectileEmitLocator.transform.position, Quaternion.identity);
 				projectile.GetComponent<SpriteRenderer>().sprite = this.ProjectileSprite;
 				projectile.GetComponent<Projectile>().OwnerHero = this;
 				projectile.transform.localScale = this.transform.localScale;


Add z-order field to GameObject

Add z-order field to GameObject

--- Client/GameObject.cs
+++ Client/GameObject.cs
@@ -33,6 +33,7 @@
         public Vector2 velocity;
         public float facing;
         public byte sector;
+        public byte zorder;

         public string spritename;
         public SpriteSheet sprite;
@@ -69,6 +70,7 @@
             changed = true;
             color = Color.White;
             damping = 1.0f;
+            zorder = 127;
             layer = CollisionLayer.Default;
             layermask = CollisionLayer.All;
         }
@@ -310,6 +312,7 @@
             writer.Write(velocity.Y);
             writer.Write(facing);
             writer.Write((byte)sector);
+            writer.Write(zorder);
             writer.Write(bounding);
             writer.Write(damping);

@@ -327,6 +330,7 @@
             velocity = new Vector2(reader.ReadSingle(), reader.ReadSingle());
             facing = reader.ReadSingle();
             sector = reader.ReadByte();
+            zorder = reader.ReadByte();
             bounding = reader.ReadSingle();
             damping = reader.ReadSingle();


Updated GMail and outlook.com SSL certificate info


Fix SolutionAreaEffectSystem exception when the collection is modified.

--- Content.Server/GameObjects/EntitySystems/SolutionAreaEffectSystem.cs
+++ Content.Server/GameObjects/EntitySystems/SolutionAreaEffectSystem.cs
@@ -1,4 +1,5 @@
 #nullable enable
+using System.Linq;
 using Content.Server.GameObjects.Components.Chemistry;
 using JetBrains.Annotations;
 using Robust.Shared.GameObjects;
@@ -10,7 +11,7 @@
     {
         public override void Update(float frameTime)
         {
-            foreach (var inception in ComponentManager.EntityQuery<SolutionAreaEffectInceptionComponent>())
+            foreach (var inception in ComponentManager.EntityQuery<SolutionAreaEffectInceptionComponent>().ToArray())
             {
                 inception.InceptionUpdate(frameTime);
             }


Fix Build Error

Fix Build Error

--- DLaB.Xrm.Test.Tests.Base/Builders/OrganizationServiceBuilderTests.cs
+++ DLaB.Xrm.Test.Tests.Base/Builders/OrganizationServiceBuilderTests.cs
@@ -19,9 +19,6 @@
             TestInitializer.InitializeTestSettings();
         }

-        /// <summary>
-        /// Incident's can't be created without a customer, so attempt to force the incident to be created first
-        /// </summary>
         [TestMethod]
         public void OrganizationServiceBuilder_WithEntityNameDefaulted_Name_Should_BeDefaulted()
         {
@@ -32,28 +29,22 @@
             const string customEntityLogicalName = "custom_entity";
             var entities = new List<Entity>();

-            IOrganizationService service =
-                LocalCrmDatabaseOrganizationService.CreateOrganizationService(LocalCrmDatabaseInfo.Create<CrmContext>(Guid.NewGuid().ToString()));
-            service = new OrganizationServiceBuilder(service)
-                .WithFakeCreate((s, e) =>
+            IOrganizationService service = LocalCrmDatabaseOrganizationService.CreateOrganizationService(LocalCrmDatabaseInfo.Create<CrmContext>(Guid.NewGuid().ToString()));
+            service = new OrganizationServiceBuilder(service)
+                 .WithFakeCreate((s, e) =>
                  {
                      // Don't create fake entities
-                     if (e.LogicalName == notExistsEntityLogicalName)
+                     if (e.LogicalName == notExistsEntityLogicalName
+                         || e.LogicalName == customEntityLogicalName)
                      {

                          entities.Add(e);
                          return Guid.NewGuid();
                      }
-                     if (e.LogicalName == customEntityLogicalName)
-                     {
-                         entities.Add(e);
-                         return Guid.NewGuid();
-                     }

                      return s.Create(e);
                  })
-                 .WithEntityNameDefaulted((e, info) => GetName(e.LogicalName, info.AttributeName))
-                 .Build();
+                 .WithEntityNameDefaulted((e, info) => GetName(e.LogicalName, info.AttributeName), new NoCustomNames()).Build();

             //
@@ -72,6 +63,19 @@
             Assert.AreEqual(GetName(customEntityLogicalName,"custom_name"), entities.Single(e => e.LogicalName == customEntityLogicalName)["custom_name"]);
             Assert.AreEqual(GetName(Contact.EntityLogicalName, " " + Contact.Fields.FullName), service.GetFirst<Contact>().FullName);
             Assert.AreEqual(GetName(Account.EntityLogicalName, Account.Fields.Name), service.GetFirst<Account>().Name);
+        }
+
+        private class NoCustomNames : IEntityHelperConfig
+        {
+            public string GetIrregularIdAttributeName(string logicalName)
+            {
+                return null;
+            }
+
+            public PrimaryFieldInfo GetIrregularPrimaryFieldInfo(string logicalName, PrimaryFieldInfo defaultInfo = null)
+            {
+                return null;
+            }
         }

         /// <summary>


Added ControlCommandBinding and ControlPropertyBinding to DothtmlProperty.

--- DotvvmAcademy/DotvvmAcademy.BL/Validation/Dothtml/DothtmlProperty.cs
+++ DotvvmAcademy/DotvvmAcademy.BL/Validation/Dothtml/DothtmlProperty.cs
@@ -17,6 +17,10 @@
         public IAbstractPropertySetter Setter { get; }

         public void CommandBinding(params string[] expectedValues) => Binding<CommandBindingExpression>(expectedValues);
+
+        public void ControlCommandBinding(params string[] expectedValues) => Binding<ControlCommandBindingExpression>(expectedValues);
+
+        public void ControlPropertiesBinding(params string[] expectedValues) => Binding<ControlPropertyBindingExpression>(expectedValues);

         public void HardcodedValue(params object[] expectedValues)
         {


Refinements to CatalogSync to sync all terms that haven't yet ended.

--- CatalogSync/Program.cs
+++ CatalogSync/Program.cs
@@ -40,19 +40,66 @@
 		{
 			Console.WriteLine(DateTimeOffset.Now.ToString("G") + " Beginning synchronization...");
 			var terms = await Api.FetchTermList();
-			// Let's synchronize the first term that isn't STAR
-			var selectedTerm = terms.Where(t => !t.Name.ToUpper().StartsWith("STAR")).FirstOrDefault();
-			Console.WriteLine(DateTimeOffset.Now.ToString("G") + " Synchronizing term '" + selectedTerm.Name + "'...");
-			var subjects = await Api.FetchSubjectList(selectedTerm.Id);
-			Console.WriteLine("Found " + subjects.Count + " subjects");
-			foreach (var subject in subjects)
-			{
-				Console.Write(DateTimeOffset.Now.ToString("G") + " Synchronizing " + subject.SubjectCode + " / " + subject.SubjectName + ": ");
-				await SyncSubject(selectedTerm, subject);
-				Console.WriteLine("");
-			}
-			Console.WriteLine(DateTimeOffset.Now.ToString("G") + " Synchronization of term '" + selectedTerm.Name + "' complete.");
+            Console.WriteLine("Found terms:");
+            foreach (var term in terms)
+            {
+                Console.WriteLine("\t " + term.Id + ": " + term.Name);
+            }
+            // Take STAR out of the list. We don't sync STAR.
+            terms = terms.Where(t => !t.Name.ToUpper().StartsWith("STAR")).ToList();
+            List<MyPurdueTerm> termsToSync = new List<MyPurdueTerm>();
+            using (var db = new ApplicationDbContext())
+            {
+                var dbTerms = db.Terms.ToList();
+                foreach (var term in terms)
+                {
+                    var dbTerm = dbTerms.SingleOrDefault(t => t.TermCode == term.Id);
+                    if (dbTerm == null
+                        || dbTerm.EndDate > DateTimeOffset.Now
+                        || dbTerm.StartDate == DateTimeOffset.MinValue
+                        || dbTerm.EndDate == DateTimeOffset.MinValue)
+                    {
+                        termsToSync.Add(term);
+                    }
+                }
+            }
+            Console.WriteLine("Synchronizing these terms:");
+            foreach (var term in termsToSync)
+            {
+                Console.WriteLine("\t " + term.Id + ": " + term.Name);
+            }
+            foreach (var term in termsToSync)
+            {
+                await SyncTerm(term);
+            }
 		}
+
+        public async Task SyncTerm(MyPurdueTerm term)
+        {
+            Console.WriteLine(DateTimeOffset.Now.ToString("G") + " Synchronizing term '" + term.Name + "'...");
+            var subjects = await Api.FetchSubjectList(term.Id);
+            Console.WriteLine("Found " + subjects.Count + " subjects");
+            foreach (var subject in subjects)
+            {
+                Console.Write(DateTimeOffset.Now.ToString("G") + " Synchronizing " + subject.SubjectCode + " / " + subject.SubjectName + ": ");
+                //await SyncSubject(term, subject);
+                Console.WriteLine("");
+            }
+            using (var db = new ApplicationDbContext())
+            {
+                var dbTerm = db.Terms.SingleOrDefault(t => t.TermCode == term.Id);
+                var earliestSection = db.Sections.Where(s => s.Class.Term.TermId == dbTerm.TermId).OrderBy(s => s.StartDate).FirstOrDefault();
+                var latestSection = db.Sections.Where(s => s.Class.Term.TermId == dbTerm.TermId).OrderByDescending(s => s.EndDate).FirstOrDefault();
+                if (earliestSection != null && latestSection != null)
+                {
+                    dbTerm.StartDate = earliestSection.StartDate;
+                    dbTerm.EndDate = latestSection.EndDate;
+                    db.SaveChanges();
+                    Console.WriteLine("Updating term dates: " + dbTerm.StartDate.ToString("d") + " - " + dbTerm.EndDate.ToString("d"));
+                }
+            }
+            Console.WriteLine(DateTimeOffset.Now.ToString("G") + " Synchronization of term '" + term.Name + "' complete.");
+        }

 		public async Task SyncSubject(MyPurdueTerm term, MyPurdueSubject subject, int retries = 0)
 		{


Added traits. Key/Value is reversed because that's how VS like it. Currently dependant on my fork of Catch which adds the --list-tests-and-sources command.

--- CatchTestDiscoverer.cs
+++ CatchTestDiscoverer.cs
@@ -12,12 +12,6 @@
     [FileExtension(".exe")]
     class CatchTestDiscoverer : CatchTestOutputReader, ITestDiscoverer
     {
-        public CatchTestDiscoverer()
-        {
-#if DEBUG
-            Debugger.Launch();
-#endif
-        }
         public void DiscoverTests(IEnumerable<string> ASources, IDiscoveryContext ADiscoveryContext, IMessageLogger ALogger, ITestCaseDiscoverySink ADiscoverySink)
         {
             GetTests(ASources, ADiscoverySink);
@@ -67,7 +61,7 @@
                                 FLines = new List<string>();
                                 {
                                     Process P = new Process();
-                                    P.StartInfo.Arguments = "--list-test-names-and-sources";
+                                    P.StartInfo.Arguments = "--list-tests-and-sources";
                                     P.StartInfo.FileName = Source;
                                     P.StartInfo.RedirectStandardOutput = true;
                                     P.StartInfo.UseShellExecute = false;
@@ -80,13 +74,42 @@
                                 try {
                                     if (FLines.Count % 2 == 0)
                                     {
-                                        bool IsSourceLine = false;
+                                        int LineType = 0;
                                         TestCase TestCase = null;
-                                        foreach (var Line in FLines)
+                                        foreach (var LineF in FLines)
                                         {
-                                            if (!IsSourceLine)
+                                            var Line = LineF.Trim();
+                                            if (LineType == 0)
                                                 TestCase = new TestCase(Line, CatchTestExecuter.ExecutorUri, Source);
-                                            else
+                                            else if(LineType == 1)
+                                            {
+                                                int FirstParen = 0, SecondParen = 0;
+                                                for (;;)
+                                                {
+                                                    int I;
+                                                    for (I = FirstParen; I < Line.Length; ++I)
+                                                        if (Line[I] == '[')
+                                                        {
+                                                            FirstParen = I;
+                                                            break;
+                                                        }
+                                                    if (I >= Line.Length || Line[I] != '[')
+                                                        break;
+                                                    for (I = FirstParen + 1; I < Line.Length; ++I)
+                                                        if (Line[I] == ']')
+                                                        {
+                                                            SecondParen = I;
+                                                            break;
+                                                        }
+                                                    if (Line[I] != ']')
+                                                        break;
+
+                                                    var SubStr = Line.Substring(FirstParen + 1, SecondParen - FirstParen - 1);
+                                                    TestCase.Traits.Add(new Trait(SubStr, "Category"));
+                                                    FirstParen = SecondParen + 1;
+                                                }
+                                            }
+                                            else if (LineType == 2)
                                             {
                                                 int FirstParen = 0, SecondParen = 0;
                                                 for (int I = Line.Length - 1; I > 0; --I)
@@ -108,7 +131,9 @@
                                                 if (ADiscoverySink != null)
                                                     ADiscoverySink.SendTestCase(TestCase);
                                             }
-                                            IsSourceLine = !IsSourceLine;
+                                            ++LineType;
+                                            if (LineType > 2)
+                                                LineType = 0;
                                         }
                                     }
                                 }catch { }


Fix multiple download of spoilers.

Fix multiple download of spoilers.

--- Classes/SiteHelpers.cs
+++ Classes/SiteHelpers.cs
@@ -155,6 +155,7 @@
 	public class SiteHelper_4chan_org : SiteHelper {
 		public override List<ImageInfo> GetImages(List<ReplaceInfo> replaceList, List<ThumbnailInfo> thumbnailList) {
 			List<ImageInfo> imageList = new List<ImageInfo>();
+			bool seenSpoiler = false;

 			foreach (HTMLTagRange postTagRange in Enumerable.Where(Enumerable.Select(Enumerable.Where(_htmlParser.FindStartTags("div"),
 				t => HTMLParser.ClassAttributeValueHas(t, "post")), t => _htmlParser.CreateTagRange(t)), r => r != null))
@@ -248,7 +249,11 @@
 				}

 				imageList.Add(image);
-				thumbnailList.Add(thumb);
+
+				if (!isSpoiler || !seenSpoiler) {
+					thumbnailList.Add(thumb);
+					if (isSpoiler) seenSpoiler = true;
+				}
 			}

 			return imageList;


Changes

Changes

--- Client/OutputWindow.cs
+++ Client/OutputWindow.cs
@@ -61,26 +61,25 @@
         {
             while (true)
             {
-                lock (locker)
+                string messageProtocol = NetworkManager.ReadMessage(serverStream, 276);
+
+                char[] mesageProtocolArray = messageProtocol.ToCharArray();
+
+                if (messageProtocol[0] == 'C' && messageProtocol[1] == 'H' && messageProtocol[2] == 'A' && messageProtocol[3] == 'T' && messageProtocol[4] == 'P' && messageProtocol[5] == 'M')
                 {
-                    string messageProtocol = NetworkManager.ReadMessage(serverStream, 276);
+                    string messageString = string.Empty;

-                    char[] mesageProtocolArray = messageProtocol.ToCharArray();
+                    for (int i = 6; i < mesageProtocolArray.Length; i++)
+                    {
+                        messageString = messageString + mesageProtocolArray[i];
+                    }

-                    if (messageProtocol[0] == 'C' && messageProtocol[1] == 'H' && messageProtocol[2] == 'A' && messageProtocol[3] == 'T' && messageProtocol[4] == 'P' && messageProtocol[5] == 'M')
-                    {
-                        string messageString = string.Empty;
+                    string[] messageProtocolContent = messageString.Split('-');

-                        for (int i = 6; i < mesageProtocolArray.Length; i++)
-                        {
-                            messageString = messageString + mesageProtocolArray[i];
-                        }
+                    WriteMessage(messageProtocolContent[0], messageProtocolContent[1], messageProtocolContent[2], messageProtocolContent[3]);
+                }

-                        string[] messageProtocolContent = messageString.Split('-');
-
-                        WriteMessage(messageProtocolContent[0], messageProtocolContent[1], messageProtocolContent[2], messageProtocolContent[3]);
-                    }
-                }
+                Thread.Sleep(10);
             }
         }


Add valid cron expression to test

Add valid cron expression to test

--- IntegrationEngine.Tests/Api/Controllers/CronTriggerControllerTest.cs
+++ IntegrationEngine.Tests/Api/Controllers/CronTriggerControllerTest.cs
@@ -10,10 +10,10 @@
     public class CronTriggerControllerTest
     {
         [Test]
-        public void ShouldScheduleJobWhenCronTriggerIsCreated()
+        public void ShouldScheduleJobWhenCronTriggerIsCreatedWithValidCronExpression()
         {
             var subject = new CronTriggerController();
-            var cronExpression = "0 6 * * 1-5";
+            var cronExpression = "0 6 * * 1-5 ?";
             var jobType = "MyProject.MyIntegrationJob";
             var expected = new CronTrigger() {
                 JobType = jobType,


Fixed YAF-141.

Fixed YAF-141.

tha_watcha -- you broke the approve for registration when you fixed it for email. The issue was fixed by removing the User != null or User == null.. it's an unnecessary check.

--- yafsrc/YetAnotherForum.NET/pages/approve.ascx.cs
+++ yafsrc/YetAnotherForum.NET/pages/approve.ascx.cs
@@ -131,13 +131,6 @@
     /// </param>
     protected void Page_Load([NotNull] object sender, [NotNull] EventArgs e)
     {
-      // if already logged in..
-      if (this.User == null)
-      {
-        // redirect to front page...
-        YafBuildLink.Redirect(ForumPages.forum);
-      }
-
       if (this.IsPostBack)
       {
         return;


Add execution of post-install actions.

Add execution of post-install actions.

--- Libraries/ModInstallation/Implementations/DefaultPackageInstaller.cs
+++ Libraries/ModInstallation/Implementations/DefaultPackageInstaller.cs
@@ -11,6 +11,7 @@
 using ModInstallation.Implementations.Util;
 using ModInstallation.Interfaces;
 using ModInstallation.Interfaces.Mods;
+using Splat;

 #endregion

@@ -30,20 +31,106 @@
     }

     [Export(typeof(IPackageInstaller))]
-    public class DefaultPackageInstaller : IPackageInstaller
+    public class DefaultPackageInstaller : IPackageInstaller, IEnableLogger
     {
+        private string _installationDirectory;
+
         private readonly IArchiveExtractor _extractor;

         [NotNull]
         private readonly IFileDownloader _fileDownloader;
-
-        private string _installationDirectory;

         [ImportingConstructor]
         public DefaultPackageInstaller([NotNull] IFileDownloader downloader, [NotNull] IArchiveExtractor extractor)
         {
             _extractor = extractor;
             _fileDownloader = downloader;
+        }
+
+        [NotNull]
+        private async Task DownloadAndInstallFile([NotNull] IPackage package,
+            [NotNull] IFileInformation fileInformation,
+            [NotNull] IProgress<IInstallationProgress> progressReporter,
+            CancellationToken token)
+        {
+            // Downloading is only a part of the installation process
+            var delegatingProgress = new Progress<IInstallationProgress>(progress => progressReporter.Report(new DefaultInstallationProgress
+            {
+                Message = progress.Message,
+                OverallProgress = progress.OverallProgress * 0.5,
+                SubProgress = progress.SubProgress
+            }));
+
+            var downloadedFile = await _fileDownloader.DownloadFileAsync(fileInformation, new DownloadProgressTranslator(delegatingProgress), token);
+
+            delegatingProgress = new Progress<IInstallationProgress>(progress => progressReporter.Report(new DefaultInstallationProgress
+            {
+                Message = progress.Message,
+                OverallProgress = 0.5 + progress.OverallProgress * 0.5,
+                SubProgress = progress.SubProgress
+            }));
+            await InstallFile(package, downloadedFile, delegatingProgress, token);
+        }
+
+        [NotNull]
+        private async Task InstallFile([NotNull] IPackage package,
+            [NotNull] FileInfo downloadedFile,
+            [NotNull] IProgress<IInstallationProgress> delegatingProgress,
+            CancellationToken token)
+        {
+            var installationDirectory = GetInstallationDirectory(package);
+
+            token.ThrowIfCancellationRequested();
+
+            if (_extractor.IsArchive(downloadedFile.FullName))
+            {
+                await
+                    _extractor.ExtractArchiveAsync(downloadedFile.FullName,
+                        installationDirectory,
+                        new ExtractionProgressTranslator(delegatingProgress),
+                        token);
+            }
+            else
+            {
+                if (downloadedFile.DirectoryName != null && !Directory.Exists(downloadedFile.DirectoryName))
+                {
+                    Directory.CreateDirectory(downloadedFile.DirectoryName);
+                }
+
+                try
+                {
+                    var fileName = Path.Combine(installationDirectory, downloadedFile.Name);
+                    if (File.Exists(fileName))
+                    {
+                        File.Delete(fileName);
+                    }
+                    File.Move(downloadedFile.FullName, fileName);
+                }
+                catch (IOException e)
+                {
+                    // Make sure not to crash the application if this fails
+                    this.Log().WarnException("IO-Exception while moving downloaded file!", e);
+                }
+            }
+
+            // Now execute the post-install actions
+            if (package.ContainingModification.PostInstallActions != null)
+            {
+                // TODO: Add better progress reporting here
+                delegatingProgress.Report(new DefaultInstallationProgress
+                {
+                    Message = "Executing post-install steps...",
+                    OverallProgress = 1.0,
+                    SubProgress = -1.0
+                });
+                await package.ContainingModification.PostInstallActions.ExecuteActionsAsync(installationDirectory);
+            }
+        }
+
+        [NotNull]
+        private string GetInstallationDirectory([NotNull] IPackage package)
+        {
+            return Path.Combine(InstallationDirectory, "mods", package.ContainingModification.Id, package.ContainingModification.Version.ToString());
         }

         #region IPackageInstaller Members
@@ -74,7 +161,10 @@
                 return;
             }

-            var installationProgress = new InstallationProgress(progressReporter) {Total = fileList.Count};
+            var installationProgress = new InstallationProgress(progressReporter)
+            {
+                Total = fileList.Count
+            };

             foreach (var fileInformation in fileList)
             {
@@ -84,7 +174,9 @@
             }

             if (package.ContainingModification.PostInstallActions == null)
+            {
                 return;
+            }

             progressReporter.Report(new DefaultInstallationProgress
             {
@@ -95,79 +187,5 @@
         }

         #endregion
-
-        [NotNull]
-        private async Task DownloadAndInstallFile([NotNull] IPackage package, [NotNull] IFileInformation fileInformation,
-            [NotNull] IProgress<IInstallationProgress> progressReporter, CancellationToken token)
-        {
-            // Downloading is only a part of the installation process
-            var delegatingProgress =
-                new Progress<IInstallationProgress>(
-                    progress =>
-                        progressReporter.Report(new DefaultInstallationProgress
-                        {
-                            Message = progress.Message,
-                            OverallProgress = progress.OverallProgress * 0.5,
-                            SubProgress = progress.SubProgress
-                        }));
-
-            var downloadedFile = await _fileDownloader.DownloadFileAsync(fileInformation, new DownloadProgressTranslator(delegatingProgress), token);
-
-            delegatingProgress =
-                new Progress<IInstallationProgress>(
-                    progress =>
-                        progressReporter.Report(new DefaultInstallationProgress
-                        {
-                            Message = progress.Message,
-                            OverallProgress = 0.5 + progress.OverallProgress * 0.5,
-                            SubProgress = progress.SubProgress
-                        }));
-            await InstallFile(package, downloadedFile, delegatingProgress, token);
-        }
-
-        [NotNull]
-        private async Task InstallFile([NotNull] IPackage package, [NotNull] FileInfo downloadedFile,
-            [NotNull] IProgress<IInstallationProgress> delegatingProgress, CancellationToken token)
-        {
-            var installationDirectory = GetInstallationDirectory(package);
-
-            token.ThrowIfCancellationRequested();
-
-            if (_extractor.IsArchive(downloadedFile.FullName))
-            {
-                await
-                    _extractor.ExtractArchiveAsync(downloadedFile.FullName, installationDirectory,
-                        new ExtractionProgressTranslator(delegatingProgress), token);
-            }
-            else
-            {
-                if (downloadedFile.DirectoryName != null && !Directory.Exists(downloadedFile.DirectoryName))
-                {
-                    Directory.CreateDirectory(downloadedFile.DirectoryName);
-                }
-
-                try
-                {
-                    var fileName = Path.Combine(installationDirectory, downloadedFile.Name);
-                    if (File.Exists(fileName))
-                    {
-                        File.Delete(fileName);
-                    }
-                    File.Move(downloadedFile.FullName, fileName);
-                }
-                catch (IOException)
-                {
-                    // Make sure not to crash the application if this fails
-                    //TODO: Add some logging here
-                }
-            }
-        }
-
-        [NotNull]
-        private string GetInstallationDirectory([NotNull] IPackage package)
-        {
-            return Path.Combine(InstallationDirectory, "mods", package.ContainingModification.Id,
-                package.ContainingModification.Version.ToString());
-        }
     }
 }


Fixed nodestroy flag check

Fixed nodestroy flag check

--- RegionsPlugin.cs
+++ RegionsPlugin.cs
@@ -144,7 +144,7 @@
             var currentRegion = GetRegionAt(StRegion.structures[Index].point);
             if (currentRegion == null)
                 return;
-            if (currentRegion.Flags.Exists(fg => fg.Name == "NoDestroy") && !R.Permissions.HasPermission(new RocketPlayer(instigatorSteamID.m_SteamID.ToString()), Configuration.Instance.NoDestroyIgnorePermission) && !Configuration.Instance.NoDestroyIgnoredItems.Exists(k => k == StRegion.structures[Index].structure.id))
+            if (currentRegion.Flags.Exists(fg => fg.Name.Equals("NoDestroy", StringComparison.OrdinalIgnoreCase)) && !R.Permissions.HasPermission(new RocketPlayer(instigatorSteamID.m_SteamID.ToString()), Configuration.Instance.NoDestroyIgnorePermission) && !Configuration.Instance.NoDestroyIgnoredItems.Exists(k => k == StRegion.structures[Index].structure.id))
                 shouldAllow = false;
             else
                 return;
@@ -156,7 +156,7 @@
             var currentRegion = GetRegionAt(BarRegion.barricades[Index].point);
             if (currentRegion == null)
                 return;
-            if (currentRegion.Flags.Exists(fg => fg.Name == "NoDestroy") && !R.Permissions.HasPermission(new RocketPlayer(instigatorSteamID.m_SteamID.ToString()), Configuration.Instance.NoDestroyIgnorePermission) && !Configuration.Instance.NoDestroyIgnoredItems.Exists(k => k == BarRegion.barricades[Index].barricade.id))
+            if (currentRegion.Flags.Exists(fg => fg.Name.Equals("NoDestroy", StringComparison.OrdinalIgnoreCase)) && !R.Permissions.HasPermission(new RocketPlayer(instigatorSteamID.m_SteamID.ToString()), Configuration.Instance.NoDestroyIgnorePermission) && !Configuration.Instance.NoDestroyIgnoredItems.Exists(k => k == BarRegion.barricades[Index].barricade.id))
                 shouldAllow = false;
             else
                 return;


Fix commit 66d87c29af846ee0922fce7323d34d8810276148

--- Configuration/Paths.cs
+++ Configuration/Paths.cs
@@ -270,7 +270,7 @@
 		/// Check if an instance of the application already started.
 		/// </summary>
 		/// <returns>Check result.</returns>
-		public static bool StartIsRunning() => ThreadingHelper.TryGetUniqueMutex(Paths.AppDataPath.GetHashCode().To<string>(), out _mutex);
+		public static bool StartIsRunning() => ThreadingHelper.TryGetUniqueMutex(AppDataPath.GetHashCode().To<string>(), out _mutex);

 		/// <summary>
 		/// Release all resources allocated by <see cref="StartIsRunning"/>.


PowerShell script execution fails when running script from network resource

--- source/Playnite/Scripting/PowerShell/PowerShell.cs
+++ source/Playnite/Scripting/PowerShell/PowerShell.cs
@@ -34,7 +34,7 @@
         public PowerShellRuntime(string runspaceName = "PowerShell")
         {
             initialSessionState = InitialSessionState.CreateDefault();
-            initialSessionState.ExecutionPolicy = ExecutionPolicy.Unrestricted;
+            initialSessionState.ExecutionPolicy = ExecutionPolicy.Bypass;
             initialSessionState.ThreadOptions = PSThreadOptions.UseCurrentThread;
             powershell = System.Management.Automation.PowerShell.Create(initialSessionState);
             runspace = powershell.Runspace;


WIP continue tests on RDFConstructQuery

WIP continue tests on RDFConstructQuery

--- RDFSharp.Test/Query/Mirella/Algebra/Queries/RDFConstructQueryTest.cs
+++ RDFSharp.Test/Query/Mirella/Algebra/Queries/RDFConstructQueryTest.cs
@@ -96,7 +96,7 @@
             query.AddModifier(new RDFLimitModifier(100));
             query.AddModifier(new RDFOffsetModifier(20));

-            Assert.IsTrue(query.ToString().Equals($"PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>"+Environment.NewLine+"PREFIX owl: <http://www.w3.org/2002/07/owl#>"+Environment.NewLine+""+Environment.NewLine+"CONSTRUCT"+Environment.NewLine+"{"+Environment.NewLine+"  ?S ?P ?O ."+Environment.NewLine+"  ?S rdf:type <http://www.w3.org/2000/01/rdf-schema#Class> ."+Environment.NewLine+"}"+Environment.NewLine+"WHERE {"+Environment.NewLine+"  {"+Environment.NewLine+"    ?S rdf:type <http://www.w3.org/2000/01/rdf-schema#Class> ."+Environment.NewLine+"    FILTER ( ISURI(?S) ) "+Environment.NewLine+"  }"+Environment.NewLine+"  {"+Environment.NewLine+"    SELECT ?S ?P"+Environment.NewLine+"    WHERE {"+Environment.NewLine+"      {"+Environment.NewLine+"        ?S ?P owl:Class ."+Environment.NewLine+"        VALUES ?S { <http://www.w3.org/2000/01/rdf-schema#Class> } ."+Environment.NewLine+"      }"+Environment.NewLine+"    }"+Environment.NewLine+"  }"+Environment.NewLine+"}"+Environment.NewLine+"LIMIT 100"+Environment.NewLine+"OFFSET 20"));
+            Assert.IsTrue(query.ToString().Equals("PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>"+Environment.NewLine+"PREFIX owl: <http://www.w3.org/2002/07/owl#>"+Environment.NewLine+""+Environment.NewLine+"CONSTRUCT"+Environment.NewLine+"{"+Environment.NewLine+"  ?S ?P ?O ."+Environment.NewLine+"  ?S rdf:type <http://www.w3.org/2000/01/rdf-schema#Class> ."+Environment.NewLine+"}"+Environment.NewLine+"WHERE {"+Environment.NewLine+"  {"+Environment.NewLine+"    ?S rdf:type <http://www.w3.org/2000/01/rdf-schema#Class> ."+Environment.NewLine+"    FILTER ( ISURI(?S) ) "+Environment.NewLine+"  }"+Environment.NewLine+"  {"+Environment.NewLine+"    SELECT ?S ?P"+Environment.NewLine+"    WHERE {"+Environment.NewLine+"      {"+Environment.NewLine+"        ?S ?P owl:Class ."+Environment.NewLine+"        VALUES ?S { <http://www.w3.org/2000/01/rdf-schema#Class> } ."+Environment.NewLine+"      }"+Environment.NewLine+"    }"+Environment.NewLine+"  }"+Environment.NewLine+"}"+Environment.NewLine+"LIMIT 100"+Environment.NewLine+"OFFSET 20"));
             Assert.IsTrue(query.QueryMemberID.Equals(RDFModelUtilities.CreateHash(query.QueryMemberStringID)));
             Assert.IsTrue(query.Templates.Count == 2);
             Assert.IsTrue(query.Variables.Count == 4);
@@ -107,6 +107,92 @@
             Assert.IsTrue(query.GetModifiers().Count() == 3);
             Assert.IsTrue(query.GetPrefixes().Count() == 2);
         }
+
+        [TestMethod]
+        public void ShouldCreateConstructQueryWithOptionalQueryMembers()
+        {
+            RDFConstructQuery query = new RDFConstructQuery();
+            query.AddPrefix(RDFNamespaceRegister.GetByPrefix("rdf"));
+            query.AddTemplate(new RDFPattern(new RDFVariable("?C"), new RDFVariable("?S"), new RDFVariable("?P"), new RDFVariable("?O")));
+            query.AddTemplate(new RDFPattern(new RDFVariable("?C"), new RDFVariable("?S"), RDFVocabulary.RDF.TYPE, RDFVocabulary.RDFS.CLASS));
+            query.AddPatternGroup(
+                new RDFPatternGroup("PG1")
+                    .AddPattern(new RDFPattern(new RDFVariable("?S"), RDFVocabulary.RDF.TYPE, RDFVocabulary.RDFS.CLASS))
+                    .AddFilter(new RDFIsUriFilter(new RDFVariable("?S"))));
+            query.AddSubQuery(
+                new RDFSelectQuery()
+                    .AddPrefix(RDFNamespaceRegister.GetByPrefix("owl"))
+                    .AddPatternGroup(
+                        new RDFPatternGroup("PG1")
+                            .AddPattern(new RDFPattern(new RDFVariable("?S"), new RDFVariable("?P"), RDFVocabulary.OWL.CLASS))
+                            .AddValues(new RDFValues().AddColumn(new RDFVariable("?S"), new List<RDFPatternMember>() { RDFVocabulary.RDFS.CLASS })))
+                    .AddProjectionVariable(new RDFVariable("?S"))
+                    .AddProjectionVariable(new RDFVariable("?P"))
+                    .Optional());
+            query.AddModifier(new RDFDistinctModifier());
+            query.AddModifier(new RDFLimitModifier(100));
+            query.AddModifier(new RDFOffsetModifier(20));
+
+            Assert.IsTrue(query.ToString().Equals("PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>"+Environment.NewLine+"PREFIX owl: <http://www.w3.org/2002/07/owl#>"+Environment.NewLine+""+Environment.NewLine+"CONSTRUCT"+Environment.NewLine+"{"+Environment.NewLine+"  ?S ?P ?O ."+Environment.NewLine+"  ?S rdf:type <http://www.w3.org/2000/01/rdf-schema#Class> ."+Environment.NewLine+"}"+Environment.NewLine+"WHERE {"+Environment.NewLine+"  {"+Environment.NewLine+"    ?S rdf:type <http://www.w3.org/2000/01/rdf-schema#Class> ."+Environment.NewLine+"    FILTER ( ISURI(?S) ) "+Environment.NewLine+"  }"+Environment.NewLine+"  OPTIONAL {"+Environment.NewLine+"    SELECT ?S ?P"+Environment.NewLine+"    WHERE {"+Environment.NewLine+"      {"+Environment.NewLine+"        ?S ?P owl:Class ."+Environment.NewLine+"        VALUES ?S { <http://www.w3.org/2000/01/rdf-schema#Class> } ."+Environment.NewLine+"      }"+Environment.NewLine+"    }"+Environment.NewLine+"  }"+Environment.NewLine+"}"+Environment.NewLine+"LIMIT 100"+Environment.NewLine+"OFFSET 20"));
+            Assert.IsTrue(query.QueryMemberID.Equals(RDFModelUtilities.CreateHash(query.QueryMemberStringID)));
+            Assert.IsTrue(query.Templates.Count == 2);
+            Assert.IsTrue(query.Variables.Count == 4);
+            Assert.IsTrue(query.GetEvaluableQueryMembers().Count() == 2);
+            Assert.IsTrue(query.GetPatternGroups().Count() == 1);
+            Assert.IsTrue(query.GetSubQueries().Count() == 1);
+            Assert.IsTrue(query.GetSubQueries().Single().IsOptional);
+            Assert.IsTrue(query.GetValues().Count() == 1);
+            Assert.IsTrue(query.GetModifiers().Count() == 3);
+            Assert.IsTrue(query.GetPrefixes().Count() == 2);
+        }
+
+        [TestMethod]
+        public void ShouldCreateConstructQueryWithUnionQueryMembers()
+        {
+            RDFConstructQuery query = new RDFConstructQuery();
+            query.AddPrefix(RDFNamespaceRegister.GetByPrefix("rdf"));
+            query.AddTemplate(new RDFPattern(new RDFVariable("?C"), new RDFVariable("?S"), new RDFVariable("?P"), new RDFVariable("?O")));
+            query.AddTemplate(new RDFPattern(new RDFVariable("?C"), new RDFVariable("?S"), RDFVocabulary.RDF.TYPE, RDFVocabulary.RDFS.CLASS));
+            query.AddPatternGroup(
+                new RDFPatternGroup("PG1")
+                    .AddPattern(new RDFPattern(new RDFVariable("?S"), RDFVocabulary.RDF.TYPE, RDFVocabulary.RDFS.CLASS))
+                    .AddFilter(new RDFIsUriFilter(new RDFVariable("?S"))));
+            query.AddSubQuery(
+                new RDFSelectQuery()
+                    .AddPrefix(RDFNamespaceRegister.GetByPrefix("owl"))
+                    .AddPatternGroup(
+                        new RDFPatternGroup("PG1")
+                            .AddPattern(new RDFPattern(new RDFVariable("?S"), new RDFVariable("?P"), RDFVocabulary.OWL.CLASS))
+                            .AddValues(new RDFValues().AddColumn(new RDFVariable("?S"), new List<RDFPatternMember>() { RDFVocabulary.RDFS.CLASS })))
+                    .AddProjectionVariable(new RDFVariable("?S"))
+                    .AddProjectionVariable(new RDFVariable("?P"))
+                    .UnionWithNext());
+            query.AddSubQuery(
+                new RDFSelectQuery()
+                    .AddPrefix(RDFNamespaceRegister.GetByPrefix("owl"))
+                    .AddPatternGroup(
+                        new RDFPatternGroup("PG2")
+                            .AddPattern(new RDFPattern(new RDFVariable("?S"), new RDFVariable("?P"), RDFVocabulary.OWL.CLASS))
+                            .AddValues(new RDFValues().AddColumn(new RDFVariable("?S"), new List<RDFPatternMember>() { RDFVocabulary.RDFS.CLASS })))
+                    .AddProjectionVariable(new RDFVariable("?S"))
+                    .AddProjectionVariable(new RDFVariable("?P")));
+            query.AddModifier(new RDFDistinctModifier());
+            query.AddModifier(new RDFLimitModifier(100));
+            query.AddModifier(new RDFOffsetModifier(20));
+
+            Assert.IsTrue(query.ToString().Equals("PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>"+Environment.NewLine+"PREFIX owl: <http://www.w3.org/2002/07/owl#>"+Environment.NewLine+""+Environment.NewLine+"CONSTRUCT"+Environment.NewLine+"{"+Environment.NewLine+"  ?S ?P ?O ."+Environment.NewLine+"  ?S rdf:type <http://www.w3.org/2000/01/rdf-schema#Class> ."+Environment.NewLine+"}"+Environment.NewLine+"WHERE {"+Environment.NewLine+"  {"+Environment.NewLine+"    ?S rdf:type <http://www.w3.org/2000/01/rdf-schema#Class> ."+Environment.NewLine+"    FILTER ( ISURI(?S) ) "+Environment.NewLine+"  }"+Environment.NewLine+"  {"+Environment.NewLine+"    {"+Environment.NewLine+"      SELECT ?S ?P"+Environment.NewLine+"      WHERE {"+Environment.NewLine+"        {"+Environment.NewLine+"          ?S ?P owl:Class ."+Environment.NewLine+"          VALUES ?S { <http://www.w3.org/2000/01/rdf-schema#Class> } ."+Environment.NewLine+"        }"+Environment.NewLine+"      }"+Environment.NewLine+"    }"+Environment.NewLine+"    UNION"+Environment.NewLine+"    {"+Environment.NewLine+"      SELECT ?S ?P"+Environment.NewLine+"      WHERE {"+Environment.NewLine+"        {"+Environment.NewLine+"          ?S ?P owl:Class ."+Environment.NewLine+"          VALUES ?S { <http://www.w3.org/2000/01/rdf-schema#Class> } ."+Environment.NewLine+"        }"+Environment.NewLine+"      }"+Environment.NewLine+"    }"+Environment.NewLine+"  }"+Environment.NewLine+"}"+Environment.NewLine+"LIMIT 100"+Environment.NewLine+"OFFSET 20"));
+            Assert.IsTrue(query.QueryMemberID.Equals(RDFModelUtilities.CreateHash(query.QueryMemberStringID)));
+            Assert.IsTrue(query.Templates.Count == 2);
+            Assert.IsTrue(query.Variables.Count == 4);
+            Assert.IsTrue(query.GetEvaluableQueryMembers().Count() == 3);
+            Assert.IsTrue(query.GetPatternGroups().Count() == 1);
+            Assert.IsTrue(query.GetSubQueries().Count() == 2);
+            Assert.IsTrue(query.GetSubQueries().ElementAt(0).JoinAsUnion);
+            Assert.IsFalse(query.GetSubQueries().ElementAt(1).JoinAsUnion);
+            Assert.IsTrue(query.GetValues().Count() == 2);
+            Assert.IsTrue(query.GetModifiers().Count() == 3);
+            Assert.IsTrue(query.GetPrefixes().Count() == 2);
+        }
         #endregion
     }
 }


Corrected some issues with SVG not conforming to viewbox rules

--- source/SkiaSharp.Svg/SkiaSharp.Svg.Shared/SKSvg.cs
+++ source/SkiaSharp.Svg/SkiaSharp.Svg.Shared/SKSvg.cs
@@ -50,6 +50,7 @@

 		public float PixelsPerInch { get; set; }
 		public bool ThrowOnUnsupportedElement { get; set; }
+		public SKRect ViewBox { get; private set; }
 		public SKSize CanvasSize { get; private set; }
 		public SKPicture Picture { get; private set; }
 		public string Description { get; private set; }
@@ -83,29 +84,40 @@
 			Title = svg.Element(ns + "title")?.Value;
 			Description = svg.Element(ns + "desc")?.Value ?? svg.Element(ns + "description")?.Value;

+			// TODO: parse the "preserveAspectRatio" values properly
+			var preserveAspectRatio = svg.Attribute("preserveAspectRatio")?.Value;
+
+			// get the SVG dimensions
+			var viewBoxA = svg.Attribute("viewBox") ?? svg.Attribute("viewPort");
+			if (viewBoxA != null)
+			{
+				ViewBox = ReadRectangle(viewBoxA.Value);
+			}
+
 			if (CanvasSize.IsEmpty)
 			{
-				// get the dimensions
+				// get the user dimensions
 				var widthA = svg.Attribute("width");
 				var heightA = svg.Attribute("height");
 				var width = ReadNumber(widthA);
 				var height = ReadNumber(heightA);
 				var size = new SKSize(width, height);

-				var viewBox = SKRect.Create(size);
-				var viewBoxA = svg.Attribute("viewBox") ?? svg.Attribute("viewPort");
-				if (viewBoxA != null)
-				{
-					viewBox = ReadRectangle(viewBoxA.Value);
-				}
-
-				if (widthA != null && widthA.Value.Contains("%"))
-				{
-					size.Width *= viewBox.Width;
-				}
-				if (heightA != null && heightA.Value.Contains("%"))
-				{
-					size.Height *= viewBox.Height;
+				if (widthA == null)
+				{
+					size.Width = ViewBox.Width;
+				}
+				else if (widthA.Value.Contains("%"))
+				{
+					size.Width *= ViewBox.Width;
+				}
+				if (heightA == null)
+				{
+					size.Height = ViewBox.Height;
+				}
+				else if (heightA != null && heightA.Value.Contains("%"))
+				{
+					size.Height *= ViewBox.Height;
 				}

 				// set the property
@@ -116,6 +128,23 @@
 			using (var recorder = new SKPictureRecorder())
 			using (var canvas = recorder.BeginRecording(SKRect.Create(CanvasSize)))
 			{
+				// scale the SVG dimensions to fit inside the user dimensions
+				if (ViewBox.Width != CanvasSize.Width || ViewBox.Height != CanvasSize.Height)
+				{
+					if (preserveAspectRatio == "none")
+					{
+						canvas.Scale(CanvasSize.Width / ViewBox.Width, CanvasSize.Height / ViewBox.Height);
+					}
+					else
+					{
+						// TODO: just center scale for now
+						var scale = Math.Min(CanvasSize.Width / ViewBox.Width, CanvasSize.Height / ViewBox.Height);
+						var centered = SKRect.Create(CanvasSize).AspectFit(ViewBox.Size);
+						canvas.Translate(centered.Left, centered.Top);
+						canvas.Scale(scale, scale);
+					}
+				}
+
 				LoadElements(svg.Elements(), canvas);

 				Picture = recorder.EndRecording();


fix for when paths contains globs witch then can sometimes

--- ServiceFabricSdkContrib.MsBuild/CleanServiceFabricApplicationTask.cs
+++ ServiceFabricSdkContrib.MsBuild/CleanServiceFabricApplicationTask.cs
@@ -32,10 +32,13 @@

 		public bool IsUnderSymbolicLink(string path)
 		{
+			if (path.Contains("*"))
+				return false;
+
 			var fullPath = Path.Combine(BasePath, path);
 			if (symPaths.Any(s => path.StartsWith(fullPath)))
 				return true;
-
+
 			var symPath = Symlink.IsUnderSymbolicLink(path, BasePath);

 			if (symPath != null)


ILMergeHelper used incorrect TargetKind - closes #312

--- src/test/Test.FAKECore/ILMerge/ILMergeSpecs.cs
+++ src/test/Test.FAKECore/ILMerge/ILMergeSpecs.cs
@@ -24,8 +24,6 @@

         It should_have_the_right_arguments =
-            () =>
-            _arguments.ShouldEqual(
-                "/out:\".\\build\\myoutput.dll\" /target:\"fake.ilmergehelper+targetkind\" /closed myPrimaryAssembly.dll");
+            () => _arguments.ShouldEqual("/out:\".\\build\\myoutput.dll\" /target:\"library\" /closed myPrimaryAssembly.dll");
     }
 }