appease resharper, C#6

appease resharper, C#6

--- MaterialDesignThemes.Wpf/TimePicker.cs
+++ MaterialDesignThemes.Wpf/TimePicker.cs
@@ -214,25 +214,22 @@

 		private void TextBoxOnLostFocus(object sender, RoutedEventArgs routedEventArgs)
 		{
-			if (_textBox == null) return;
-
-            if (!string.IsNullOrEmpty(_textBox.Text))
-            {
-                DateTime time;
-                if (IsTimeValid(_textBox.Text, out time))
-                    SetCurrentValue(SelectedTimeProperty, time);
-
-                else // Invalid time, jump back to previous good time
-                    SetInvalidTime();
-            }
-        }
+		    if (string.IsNullOrEmpty(_textBox?.Text)) return;
+
+		    DateTime time;
+		    if (IsTimeValid(_textBox.Text, out time))
+		        SetCurrentValue(SelectedTimeProperty, time);
+
+		    else // Invalid time, jump back to previous good time
+		        SetInvalidTime();
+		}

         private void SetInvalidTime()
         {
             if (_lastValidTime != null)
             {
-                SetCurrentValue(SelectedTimeProperty, (DateTime)_lastValidTime);
-                _textBox.Text = SelectedTime.Value.ToString(SelectedTime.Value.Hour % 12 > 9 ? "hh:mm tt" : "h:mm tt");
+                SetCurrentValue(SelectedTimeProperty, _lastValidTime.Value);
+                _textBox.Text = _lastValidTime.Value.ToString(_lastValidTime.Value.Hour % 12 > 9 ? "hh:mm tt" : "h:mm tt");
             }

             else
@@ -289,9 +286,7 @@

 		private void SetSelectedTime()
 		{
-			if (_textBox == null) return;
-
-			if (!string.IsNullOrEmpty(_textBox.Text))
+		    if (!string.IsNullOrEmpty(_textBox?.Text))
 			{
 				ParseTime(_textBox.Text, t => SetCurrentValue(SelectedTimeProperty, t));
 			}
@@ -306,7 +301,7 @@
 				successContinuation(time);
 		}

-        private bool IsTimeValid(string s, out DateTime time)
+        private static bool IsTimeValid(string s, out DateTime time)
         {
             return DateTime.TryParse(s,
                                      CultureInfo.CurrentCulture,
@@ -339,9 +334,7 @@
 			var popup = sender as Popup;
 			if (popup == null || popup.StaysOpen) return;

-			if (_dropDownButton == null) return;
-
-			if (_dropDownButton.InputHitTest(mouseButtonEventArgs.GetPosition(_dropDownButton)) != null)
+		    if (_dropDownButton?.InputHitTest(mouseButtonEventArgs.GetPosition(_dropDownButton)) != null)
 			{
 				// This popup is being closed by a mouse press on the drop down button
 				// The following mouse release will cause the closed popup to immediately reopen.


Prova

Prova

Former-commit-id: 81d869c1d2a15fe164a601ce6f7038de4f3ccb11

--- App/MicrosoftHouse/MicrosoftHouse/MainPage.xaml.cs
+++ App/MicrosoftHouse/MicrosoftHouse/MainPage.xaml.cs
@@ -13,7 +13,7 @@
         {
             InitializeComponent();

-			/// How to add images from code
+			/// How to add images from code.
 			/*Image image = new Image
 			{
 				Source = new FileImageSource


Bugfix of Scroller

Bugfix of Scroller

--- Assets/FancyScrollView/Sources/Runtime/Scroller.cs
+++ Assets/FancyScrollView/Sources/Runtime/Scroller.cs
@@ -112,23 +112,19 @@

         public void ScrollTo(int index, float duration, Func<float, float> easingFunction, Action onComplete = null)
         {
-            if (index < 0 || index > totalCount - 1)
-            {
-                throw new ArgumentOutOfRangeException(nameof(index));
-            }
-
             if (duration <= 0f)
             {
-                JumpTo(index);
-                return;
-            }
+                JumpTo(CircularIndex(index, totalCount));
+                return;
+            }
+

             autoScrollState.Reset();
             autoScrollState.Enable = true;
             autoScrollState.Duration = duration;
             autoScrollState.EasingFunction = easingFunction ?? DefaultEasingFunction;
             autoScrollState.StartTime = Time.unscaledTime;
-            autoScrollState.EndScrollPosition = CalculateDestinationIndex(index);
+            autoScrollState.EndScrollPosition = CalculateDestinationPosition(index);
             autoScrollState.OnComplete = onComplete;

             velocity = 0f;
@@ -382,11 +378,11 @@
             prevScrollPosition = currentScrollPosition;
         }

-        int CalculateDestinationIndex(int index) => movementType == MovementType.Unrestricted
-            ? CalculateClosestIndex(index)
+        int CalculateDestinationPosition(int index) => movementType == MovementType.Unrestricted
+            ? CalculateClosestPosition(index)
             : Mathf.Clamp(index, 0, totalCount - 1);

-        int CalculateClosestIndex(int index)
+        int CalculateClosestPosition(int index)
         {
             var diff = CircularPosition(index, totalCount)
                        - CircularPosition(currentScrollPosition, totalCount);
@@ -400,5 +396,7 @@
         }

         float CircularPosition(float p, int size) => size < 1 ? 0 : p < 0 ? size - 1 + (p + 1) % size : p % size;
+
+        int CircularIndex(int i, int size) => size < 1 ? 0 : i < 0 ? size - 1 + (i + 1) % size : i % size;
     }
 }


fixing comment bar

fixing comment bar

--- Assets/MRTK/Tests/PlayModeTests/ScrollViewTests.cs
+++ Assets/MRTK/Tests/PlayModeTests/ScrollViewTests.cs
@@ -19,10 +19,10 @@
     {
         private Material mrtkMaterial = new Material(StandardShaderUtility.MrtkStandardShader);

-        //Assets/MRTK/SDK/Features/UX/Interactable/Prefabs/PressableButtonHoloLens2_32x96_NoLabel.prefab
+        // Assets/MRTK/SDK/Features/UX/Interactable/Prefabs/PressableButtonHoloLens2_32x96_NoLabel.prefab
         private const string PressableHololens2_32x96_PrefabGuid = "eb36a4319b6be77409716f5a41e6da51";

-        //Assets/MRTK/SDK/Features/UX/Interactable/Prefabs/PressableButtonHoloLens2_NoLabel.prefab
+        // Assets/MRTK/SDK/Features/UX/Interactable/Prefabs/PressableButtonHoloLens2_NoLabel.prefab
         private const string PressableHololens2PrefabGuid = "b20573eb9bf8a914882fa4a571d2e8dc";


Fix Connection draw on out of view Block

Invert the short circuit so we still do the connection draw after all other block drawing logic

--- Assets/Fungus/Scripts/Editor/FlowchartWindow.cs
+++ Assets/Fungus/Scripts/Editor/FlowchartWindow.cs
@@ -2113,87 +2113,87 @@
             windowRelativeRect.position += flowchart.ScrollPos;

             //skip if outside of view
-            if (!scriptViewRect.Overlaps(windowRelativeRect))
-                return;
-
-            var tmpNormBg = nodeStyle.normal.background;
-
-            // Draw untinted highlight
-            if (block.IsSelected && !block.IsControlSelected)
-            {
+            if (scriptViewRect.Overlaps(windowRelativeRect))
+            {
+
+                var tmpNormBg = nodeStyle.normal.background;
+
+                // Draw untinted highlight
+                if (block.IsSelected && !block.IsControlSelected)
+                {
+                    GUI.backgroundColor = Color.white;
+                    nodeStyle.normal.background = graphics.onTexture;
+                    GUI.Box(windowRelativeRect, "", nodeStyle);
+                    nodeStyle.normal.background = tmpNormBg;
+                }
+
+                if (block.IsControlSelected && !block.IsSelected)
+                {
+                    GUI.backgroundColor = Color.white;
+                    nodeStyle.normal.background = graphics.onTexture;
+                    var c = GUI.backgroundColor;
+                    c.a = 0.5f;
+                    GUI.backgroundColor = c;
+                    GUI.Box(windowRelativeRect, "", nodeStyle);
+                    nodeStyle.normal.background = tmpNormBg;
+                }
+
+                // Draw tinted block; ensure text is readable
+                var brightness = graphics.tint.r * 0.3 + graphics.tint.g * 0.59 + graphics.tint.b * 0.11;
+                var tmpNormTxtCol = nodeStyle.normal.textColor;
+                nodeStyle.normal.textColor = brightness >= 0.5 ? Color.black : Color.white;
+
+                switch (block.FilterState)
+                {
+                case Block.FilteredState.Full:
+                    break;
+                case Block.FilteredState.Partial:
+                    graphics.tint.a *= 0.65f;
+                    break;
+                case Block.FilteredState.None:
+                    graphics.tint.a *= 0.2f;
+                    break;
+                default:
+                    break;
+                }
+
+                nodeStyle.normal.background = graphics.offTexture;
+                GUI.backgroundColor = graphics.tint;
+                GUI.Box(windowRelativeRect, block.BlockName, nodeStyle);
+
                 GUI.backgroundColor = Color.white;
-                nodeStyle.normal.background = graphics.onTexture;
-                GUI.Box(windowRelativeRect, "", nodeStyle);
+
+                if (block.Description.Length > 0)
+                {
+                    var content = new GUIContent(block.Description);
+                    windowRelativeRect.y += windowRelativeRect.height;
+                    windowRelativeRect.height = descriptionStyle.CalcHeight(content, windowRelativeRect.width);
+                    GUI.Label(windowRelativeRect, content, descriptionStyle);
+                }
+
+                GUI.backgroundColor = Color.white;
+
+                nodeStyle.normal.textColor = tmpNormTxtCol;
                 nodeStyle.normal.background = tmpNormBg;
-            }
-
-            if (block.IsControlSelected && !block.IsSelected)
-            {
-                GUI.backgroundColor = Color.white;
-                nodeStyle.normal.background = graphics.onTexture;
-                var c = GUI.backgroundColor;
-                c.a = 0.5f;
-                GUI.backgroundColor = c;
-                GUI.Box(windowRelativeRect, "", nodeStyle);
-                nodeStyle.normal.background = tmpNormBg;
-            }
-
-            // Draw tinted block; ensure text is readable
-            var brightness = graphics.tint.r * 0.3 + graphics.tint.g * 0.59 + graphics.tint.b * 0.11;
-            var tmpNormTxtCol = nodeStyle.normal.textColor;
-            nodeStyle.normal.textColor = brightness >= 0.5 ? Color.black : Color.white;
-
-            switch (block.FilterState)
-            {
-            case Block.FilteredState.Full:
-                break;
-            case Block.FilteredState.Partial:
-                graphics.tint.a *= 0.65f;
-                break;
-            case Block.FilteredState.None:
-                graphics.tint.a *= 0.2f;
-                break;
-            default:
-                break;
-            }
-
-            nodeStyle.normal.background = graphics.offTexture;
-            GUI.backgroundColor = graphics.tint;
-            GUI.Box(windowRelativeRect, block.BlockName, nodeStyle);
-
-            GUI.backgroundColor = Color.white;
-
-            if (block.Description.Length > 0)
-            {
-                var content = new GUIContent(block.Description);
-                windowRelativeRect.y += windowRelativeRect.height;
-                windowRelativeRect.height = descriptionStyle.CalcHeight(content, windowRelativeRect.width);
-                GUI.Label(windowRelativeRect, content, descriptionStyle);
-            }
-
-            GUI.backgroundColor = Color.white;
-
-            nodeStyle.normal.textColor = tmpNormTxtCol;
-            nodeStyle.normal.background = tmpNormBg;
-
-            // Draw Event Handler labels
-            if (block._EventHandler != null)
-            {
-                string handlerLabel = "";
-                EventHandlerInfoAttribute info = EventHandlerEditor.GetEventHandlerInfo(block._EventHandler.GetType());
-                if (info != null)
-                {
-                    handlerLabel = "<" + info.EventHandlerName + "> ";
-                }
-
-                Rect rect = new Rect(block._NodeRect);
-                rect.height = handlerStyle.CalcHeight(new GUIContent(handlerLabel), block._NodeRect.width);
-                rect.x += flowchart.ScrollPos.x;
-                rect.y += flowchart.ScrollPos.y - rect.height;
-
-                GUI.Label(rect, handlerLabel, handlerStyle);
-            }
-
+
+                // Draw Event Handler labels
+                if (block._EventHandler != null)
+                {
+                    string handlerLabel = "";
+                    EventHandlerInfoAttribute info = EventHandlerEditor.GetEventHandlerInfo(block._EventHandler.GetType());
+                    if (info != null)
+                    {
+                        handlerLabel = "<" + info.EventHandlerName + "> ";
+                    }
+
+                    Rect rect = new Rect(block._NodeRect);
+                    rect.height = handlerStyle.CalcHeight(new GUIContent(handlerLabel), block._NodeRect.width);
+                    rect.x += flowchart.ScrollPos.x;
+                    rect.y += flowchart.ScrollPos.y - rect.height;
+
+                    GUI.Label(rect, handlerLabel, handlerStyle);
+                }
+            }

             DrawConnections(block);
         }


Fix 'no multiple zeppelins of the same type' constraint server side.

--- Battlezeppelins/Models/PlayerTable/ZeppelinType.cs
+++ Battlezeppelins/Models/PlayerTable/ZeppelinType.cs
@@ -47,5 +47,19 @@
         {
             return name;
         }
+
+        public override bool Equals(object zeppelin) {
+            return this == (ZeppelinType)zeppelin;
+        }
+
+        public static bool operator==(ZeppelinType z1, ZeppelinType z2)
+        {
+            return z1.name == z2.name;
+        }
+
+        public static bool operator !=(ZeppelinType z1, ZeppelinType z2)
+        {
+            return z1.name != z2.name;
+        }
     }
 }


made it possible to go from any screen to any other screen using keyboard shortcuts


More constants.

More constants.

--- Aurora/AuroraDotNetEngine/APIs/LSL_Constants.cs
+++ Aurora/AuroraDotNetEngine/APIs/LSL_Constants.cs
@@ -617,5 +617,7 @@
         public static readonly LSLInteger RC_GET_NORMAL = 0;
         public static readonly LSLInteger RC_GET_ROOT_KEY = 1;
         public static readonly LSLInteger RC_GET_LINK_NUM = 2;
+
+        public static readonly LSLInteger RCERR_CAST_TIME_EXCEEDED = 1;
     }
 }


Add more missing constants for llCastRay.

--- Aurora/AuroraDotNetEngine/APIs/LSL_Constants.cs
+++ Aurora/AuroraDotNetEngine/APIs/LSL_Constants.cs
@@ -601,17 +601,21 @@
         public const string URL_REQUEST_DENIED = "URL_REQUEST_DENIED";

         public static readonly LSLInteger PASS_IF_NOT_HANDLED = 0;
-        public static readonly LSLInteger PASS_ALWAYS = 1;
-        public static readonly LSLInteger PASS_NEVER = 2;
-
-        public static readonly LSLInteger RC_REJECT_TYPES = 0;
-        public static readonly LSLInteger RC_DATA_FLAGS = 1;
-        public static readonly LSLInteger RC_MAX_HITS = 2;
-        public static readonly LSLInteger RC_DETECT_PHANTOM = 3;
-
-        public static readonly LSLInteger RC_REJECT_AGENTS = 0;
-        public static readonly LSLInteger RC_REJECT_PHYSICAL = 1;
-        public static readonly LSLInteger RC_REJECT_NONPHYSICAL = 2;
+        public static readonly LSLInteger PASS_ALWAYS = 1;
+        public static readonly LSLInteger PASS_NEVER = 2;
+
+        public static readonly LSLInteger RC_REJECT_TYPES = 0;
+        public static readonly LSLInteger RC_DATA_FLAGS = 1;
+        public static readonly LSLInteger RC_MAX_HITS = 2;
+        public static readonly LSLInteger RC_DETECT_PHANTOM = 3;
+
+        public static readonly LSLInteger RC_REJECT_AGENTS = 0;
+        public static readonly LSLInteger RC_REJECT_PHYSICAL = 1;
+        public static readonly LSLInteger RC_REJECT_NONPHYSICAL = 2;
         public static readonly LSLInteger RC_REJECT_LAND = 3;
+
+        public static readonly LSLInteger RC_GET_NORMAL = 0;
+        public static readonly LSLInteger RC_GET_ROOT_KEY = 1;
+        public static readonly LSLInteger RC_GET_LINK_NUM = 2;
     }
 }


Revert to previous debugging method as change wasn't working correctly.

--- CefSharp.BrowserSubprocess/Program.cs
+++ CefSharp.BrowserSubprocess/Program.cs
@@ -4,7 +4,6 @@

 using System;
 using System.Collections.Generic;
-using System.Diagnostics;
 using System.Linq;
 using System.Windows.Forms;
 using CefSharp.Internals;
@@ -19,14 +18,7 @@

             int result;

-            //MessageBox.Show("Please attach debugger now", null, MessageBoxButtons.OK, MessageBoxIcon.Information);
-
-            var commandLineArgs = new List<string>(args)
-            {
-                "--renderer-startup-dialog"
-            };
-
-            using (var subprocess = Create(commandLineArgs.ToArray()))
+            using (var subprocess = Create(args))
             {
                 //if (subprocess is CefRenderProcess)
                 //{


Un petit teste

Un petit teste

--- BBTA/BBTA/Classe/GestionAudio/GestionMusique.cs
+++ BBTA/BBTA/Classe/GestionAudio/GestionMusique.cs
@@ -13,7 +13,7 @@
 {
     public class GestionMusique : DrawableGameComponent
     {
-
+        //teste
         private AudioEngine moteur;
         private SoundBank banqueSon;
         private WaveBank banqueVague;


Add an invoices list to store list

Add an invoices list to store list

--- BTCPayServer/Views/UserStores/ListStores.cshtml
+++ BTCPayServer/Views/UserStores/ListStores.cshtml
@@ -42,6 +42,7 @@
                                 }

+                                Invoices -
                                 @if (store.IsOwner)
                                 {
                                     Settings -


clean

clean

--- CSharpGL/Canvas/RenderContexts/FBORenderContext.cs
+++ CSharpGL/Canvas/RenderContexts/FBORenderContext.cs
@@ -57,6 +57,10 @@
             //  Call the base class.
             base.Create(openGLVersion, width, height, bitDepth, parameter);

+            // Create frame buffer object.
+            Framebuffer framebuffer = CreateFramebuffer(width, height);
+            this.framebuffer = framebuffer;
+
             //  Create the DIB section.
             var dibSection = new DIBSection();
             dibSection.Create(this.DeviceContextHandle, width, height, bitDepth);
@@ -84,9 +88,13 @@
         /// </summary>
         protected override void DisposeUnmanagedResources()
         {
+            //  Delete the render buffers.
+            this.framebuffer.Dispose();
+
             //  Destroy the internal dc.
-            //Win32.DeleteDC(this.dibSection.MemoryDeviceContext);
-            this.dibSection.Dispose();
+            Win32.DeleteDC(this.dibSection.MemoryDeviceContext);
+
+            //this.dibSection.Dispose();

             //	Call the base, which will delete the render context handle and window.
             base.DisposeUnmanagedResources();
@@ -103,6 +111,21 @@

             //	Resize dib section.
             this.dibSection.Resize(width, height, this.BitDepth);
+
+            //  TODO: We should be able to just use the code below - however we
+            //  get invalid dimension issues at the moment, so recreate for now.
+
+            /*
+            //  Resize the render buffer storage.
+            GL.GetDelegateFor<GL.glBindRenderbufferEXT(GL.GL_RENDERBUFFER, colourRenderBufferId);
+            GL.GetDelegateFor<GL.glRenderbufferStorageEXT(GL.GL_RENDERBUFFER, GL.GL_RGBA, width, height);
+            GL.GetDelegateFor<GL.glBindRenderbufferEXT(GL.GL_RENDERBUFFER, depthRenderBufferId);
+            GL.GetDelegateFor<GL.glRenderbufferStorageEXT(GL.GL_RENDERBUFFER, GL.GL_DEPTH_ATTACHMENT, width, height);
+            var complete = GL.CheckFramebufferStatusEXT(GL.GL_FRAMEBUFFER_EXT);
+            */
+            this.framebuffer.Dispose();
+            Framebuffer framebuffer = CreateFramebuffer(width, height);
+            this.framebuffer = framebuffer;
         }
         /// <summary>
         ///
@@ -125,6 +148,8 @@
             }
         }

+        private Framebuffer framebuffer;
+
         ///// <summary>
         /////
         ///// </summary>


Fix possible Nullreference Exception in CardDavDataAccess.GetEntities().

--- CalDavSynchronizer/DataAccess/CardDavDataAccess.cs
+++ CalDavSynchronizer/DataAccess/CardDavDataAccess.cs
@@ -396,7 +396,7 @@
         var urlNode = responseElement.SelectSingleNode ("D:href", responseXml.XmlNamespaceManager);
         var dataNode = responseElement.SelectSingleNode ("D:propstat/D:prop/A:address-data", responseXml.XmlNamespaceManager);
         var contentTypeNode = responseElement.SelectSingleNode("D:propstat/D:prop/D:getcontenttype", responseXml.XmlNamespaceManager);
-        string contentType = contentTypeNode.InnerText ?? string.Empty;
+        string contentType = contentTypeNode?.InnerText ?? string.Empty;

         // TODO: add vlist support but for now filter out sogo vlists since we can't parse them atm
         if (urlNode != null && dataNode != null && !string.IsNullOrEmpty (dataNode.InnerText) && contentType != "text/x-vlist")


Default the image markup to 1.0 size (being invisible isn't very helpful for large images...)

--- CardMaker/Card/FormattedText/Markup/ImageMarkup.cs
+++ CardMaker/Card/FormattedText/Markup/ImageMarkup.cs
@@ -65,6 +65,7 @@
             switch (arrayComponents.Length)
             {
                 case 1: // <img=[filename]>
+                    fLineHeightPercent = 1.0f;
                     TargetRect = new RectangleF(zProcessData.CurrentX, zProcessData.CurrentY, m_zBmp.Width, m_zBmp.Height);
                     break;
                 case 2: // <img=[filename];[percent]>


Fix typo.

Fix typo.

--- src/Narvalo.Money/Currency.cs
+++ src/Narvalo.Money/Currency.cs
@@ -313,7 +313,7 @@
         {
             Require.NotNull(cultureInfo, nameof(cultureInfo));
             Require.True(
-                cultureInfo.IsNeutralCulture,
+                !cultureInfo.IsNeutralCulture,
                 nameof(cultureInfo),
                 Format.Current(Strings.Argument_NeutralCultureNotSupported_Format, cultureInfo));


Given that we can easily get the tick of day, let's use that fact... it's faster too.

--- src/NodaTime/LocalDateTime.cs
+++ src/NodaTime/LocalDateTime.cs
@@ -350,12 +350,7 @@
         {
             get
             {
-                long ticks = localInstant.Ticks % NodaConstants.TicksPerStandardDay;
-                if (ticks < 0)
-                {
-                    ticks += NodaConstants.TicksPerStandardDay;
-                }
-                return new LocalTime(new LocalInstant(ticks));
+                return new LocalTime(new LocalInstant(TickOfDay));
             }
         }


Fix typo in help output

Fix typo in help output

--- src/OmniSharp.Host/Program.cs
+++ src/OmniSharp.Host/Program.cs
@@ -66,7 +66,7 @@
             var logLevelOption = omnisharpApp.Option("-l | --loglevel", "Level of logging (defaults to 'Information').", CommandOptionType.SingleValue);
             var verboseOption = omnisharpApp.Option("-v | --verbose", "Explicitly set 'Debug' log level.", CommandOptionType.NoValue);
             var hostPidOption = omnisharpApp.Option("-hpid | --hostPID", "Host process ID.", CommandOptionType.SingleValue);
-            var stdioOption = omnisharpApp.Option("-stdio | --stdio", "Use STDIO over HTTP as OmniSharp commincation protocol.", CommandOptionType.NoValue);
+            var stdioOption = omnisharpApp.Option("-stdio | --stdio", "Use STDIO over HTTP as OmniSharp communication protocol.", CommandOptionType.NoValue);
             var zeroBasedIndicesOption = omnisharpApp.Option("-z | --zero-based-indices", "Use zero based indices in request/responses (defaults to 'false').", CommandOptionType.NoValue);
             var serverInterfaceOption = omnisharpApp.Option("-i | --interface", "Server interface address (defaults to 'localhost').", CommandOptionType.SingleValue);
             var encodingOption = omnisharpApp.Option("-e | --encoding", "Input / output encoding for STDIO protocol.", CommandOptionType.SingleValue);


Today I learned how to make a string variable and how to display its content to the console.

--- ConsoleApplication1/ConsoleApplication1/Program.cs
+++ ConsoleApplication1/ConsoleApplication1/Program.cs
@@ -10,7 +10,16 @@
     {
         static void Main(string[] args)
         {
-            Console.Out.WriteLine("Hello World!");
+            string sentence; // I created a variable called sentence which is the type "string"
+            sentence = "Hello Tony! \nhello henry "; // I assigned a value to my "sentence" variable
+            Console.Out.WriteLine(sentence);// This displays the "sentence" variable in the console
+            sentence = "2 plus 1 equals 3";
+            Console.Out.WriteLine(sentence);
+            sentence = "hahaha";
+            Console.Out.WriteLine(sentence);
+
+
+
         }
     }
 }


set string option for runner

set string option for runner

--- src/Parquet.Runner/Program.cs
+++ src/Parquet.Runner/Program.cs
@@ -15,7 +15,7 @@
          DataSet ds;
          using (var time = new TimeMeasure())
          {
-            ds = ParquetReader.ReadFile(args[0]);
+            ds = ParquetReader.ReadFile(args[0], new ParquetOptions { TreatByteArrayAsString = true });

             Console.WriteLine("read in {0}", time.Elapsed);
          }


iconv translit fix

iconv translit fix

- faster initialization of translit dictionary
- fix of //TRANSLIT for '#'

--- src/Peachpie.Library/iconv.cs
+++ src/Peachpie.Library/iconv.cs
@@ -246,20 +246,23 @@
                     string line;
                     while ((line = translit.ReadLine()) != null)
                     {
-                        // remove comments:
-                        int cut_from = line.IndexOf('#');
-                        if (cut_from >= 0) line = line.Remove(cut_from);
-
-                        // skip empty lines:
-                        if (line.Length == 0) continue;
-
-                        //
-                        string[] parts = line.Split('\t');  // HEX\tTRANSLIT\t
-                        Debug.Assert(parts != null && parts.Length == 3);
-
-                        int charNumber = int.Parse(parts[0], System.Globalization.NumberStyles.HexNumber);
-                        string str = parts[1];
-
+                        if (line.Length == 0 || line[0] == '#')
+                        {
+                            continue;
+                        }
+
+                        // HEX\tTRANSLIT\t#comment
+                        var t1 = line.IndexOf('\t');
+                        Debug.Assert(t1 > 0);
+                        var t2 = line.IndexOf('\t', t1 + 1);
+                        Debug.Assert(t2 > 0);
+
+                        string
+                            strChar = line.Substring(0, t1),
+                            str = line.Substring(t1 + 1, t2 - t1);
+
+                        int charNumber = int.Parse(strChar, System.Globalization.NumberStyles.HexNumber);
+
                         if (transliterationsMaxCharCount < str.Length)
                             transliterationsMaxCharCount = str.Length;


Remove user channel modes when they part the channel

--- ChatSharp/Handlers/ChannelHandlers.cs
+++ ChatSharp/Handlers/ChannelHandlers.cs
@@ -48,8 +48,10 @@

             if (user.Channels.Contains(channel))
                 user.Channels.Remove(channel);
-            client.OnUserPartedChannel(new ChannelUserEventArgs(client.Channels[message.Parameters[0]],
-                new IrcUser(message.Prefix)));
+            if (user.ChannelModes.ContainsKey(channel))
+                user.ChannelModes.Remove(channel);
+
+            client.OnUserPartedChannel(new ChannelUserEventArgs(channel, user));
         }

         public static void HandleUserListPart(IrcClient client, IrcMessage message)


Update SvgDebug.cs

Update SvgDebug.cs

--- src/SvgDemo/Debug/SvgDebug.cs
+++ src/SvgDemo/Debug/SvgDebug.cs
@@ -1279,11 +1279,10 @@
             }
         }

-        public Element PrintSvgElement(SvgElement svgElement, string indentLine, string indentAttribute, Element parent)
+        public void PrintSvgElement(SvgElement svgElement, string indentLine, string indentAttribute)
         {
             var name = GetElementName(svgElement);
             var type = svgElement.GetType();
-            var element = new Element(svgElement, parent, name);

             WriteLine($"{indentLine}-");

@@ -1473,15 +1472,9 @@

                 foreach (var child in svgElement.Children)
                 {
-                    var childElement = PrintSvgElement(child, indentLine + IndentTab, indentAttribute, element);
-                    if (childElement != null)
-                    {
-                        element.Children.Add(childElement);
-                    }
+                    PrintSvgElement(child, indentLine + IndentTab, indentAttribute);
                 }
             }
-
-            return element;
         }
     }
 }


[Nodes] Remove autovalidate leftover on layer pin

--- Core/VVVV.DX11.Lib/BaseNodes/DX11LayerSpaceNode.cs
+++ Core/VVVV.DX11.Lib/BaseNodes/DX11LayerSpaceNode.cs
@@ -17,7 +17,7 @@
 {
     public abstract class AbstractDX11LayerSpaceNode : IPluginEvaluate, IDX11LayerProvider
     {
-        [Input("Layer In", AutoValidate = false)]
+        [Input("Layer In")]
         protected Pin<DX11Resource<DX11Layer>> FLayerIn;

         [Input("Enabled",DefaultValue=1, Order = 100000)]


added assembly info

added assembly info

--- ModAnalyzer/Properties/AssemblyInfo.cs
+++ ModAnalyzer/Properties/AssemblyInfo.cs
@@ -7,11 +7,11 @@
 // General Information about an assembly is controlled through the following
 // set of attributes. Change these attribute values to modify the information
 // associated with an assembly.
-[assembly: AssemblyTitle("ModAssetMapper")]
-[assembly: AssemblyDescription("")]
+[assembly: AssemblyTitle("Mod Analyzer")]
+[assembly: AssemblyDescription("Analyzes Bethesda Game mod archive files.")]
 [assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("ModAssetMapper")]
+[assembly: AssemblyCompany("Mod Picker")]
+[assembly: AssemblyProduct("Mod Analyzer")]
 [assembly: AssemblyCopyright("Copyright ©  2016")]
 [assembly: AssemblyTrademark("")]
 [assembly: AssemblyCulture("")]


[UPDATE] added more entities to the list of Non-Standard

--- CrmCodeGenerator.VSPackage/Helpers/EntityHelper.cs
+++ CrmCodeGenerator.VSPackage/Helpers/EntityHelper.cs
@@ -24,34 +24,51 @@
                         , "emailhash"  // Not Included with CrmSvcUtil 2013
                         , "emailsearch" // Not Included with CrmSvcUtil 2013
                         , "filtertemplate" // Not Included with CrmSvcUtil 2013
+                        , "imagedescriptor"  // Not included with CrmSvcUtil 2013
                         , "importdata" // Not included with CrmSvcUtil 6.0.0001.0061
                         , "integrationstatus" // Not included with CrmSvcUtil 6.0.0001.0061
                         , "interprocesslock" // Not included with CrmSvcUtil 6.0.0001.0061
                         , "multientitysearchentities" // Not included with CrmSvcUtil 6.0.0001.0061
                         , "multientitysearch" // Not included with CrmSvcUtil 6.0.0001.0061
                         , "notification" // Not included with CrmSvcUtil 6.0.0001.0061
-                        , "subscriptionclients" // Not included with CrmSvcUtil 6.0.0001.0061
+                        , "organizationstatistic" // Not included with CrmSvcUtil 6.0.0001.0061
+                        , "owner"   // Not included with CrmSvcUtil 2013
                         , "partnerapplication" // Not included with CrmSvcUtil 6.0.0001.0061
                         , "principalattributeaccessmap" // Not included with CrmSvcUtil 6.0.0001.0061
                         , "principalobjectaccessreadsnapshot" // Not included with CrmSvcUtil 6.0.0001.0061
                         , "principalobjectaccess" // Not included with CrmSvcUtil 6.0.0001.0061
+                        , "privilegeobjecttypecodes" // Not included with CrmSvcUtil 6.0.0001.0061
+                        , "postregarding"  // Not included with CrmSvcUtil 2013
+                        , "postrole"  // Not included with CrmSvcUtil 2013
+                        , "subscriptionclients" // Not included with CrmSvcUtil 6.0.0001.0061
                         , "salesprocessinstance" // Not included with CrmSvcUtil 6.0.0001.0061
-                        , "organizationstatistic" // Not included with CrmSvcUtil 6.0.0001.0061
                         , "recordcountsnapshot" // Not included with CrmSvcUtil 6.0.0001.0061
                         , "replicationbacklog" // Not included with CrmSvcUtil 6.0.0001.0061
+                        , "resourcegroupexpansion" // Not included with CrmSvcUtil 6.0.0001.0061
                         , "ribboncommand" // Not included with CrmSvcUtil 6.0.0001.0061
                         , "ribboncontextgroup" // Not included with CrmSvcUtil 6.0.0001.0061
                         , "ribbondiff" // Not included with CrmSvcUtil 6.0.0001.0061
                         , "ribbonrule" // Not included with CrmSvcUtil 6.0.0001.0061
                         , "ribbontabtocommandmap" // Not included with CrmSvcUtil 6.0.0001.0061
+                        , "roletemplate" // Not included with CrmSvcUtil 6.0.0001.0061
+                        , "statusmap" // Not included with CrmSvcUtil 6.0.0001.0061
+                        , "stringmap" // Not included with CrmSvcUtil 6.0.0001.0061
                         , "sqlencryptionaudit"
                         , "subscriptionsyncinfo"
                         , "subscription" // Not included with CrmSvcUtil 6.0.0001.0061
                         , "subscriptiontrackingdeletedobject"
-                        , "postregarding"  // Not included with CrmSvcUtil 2013
-                        , "postrole"  // Not included with CrmSvcUtil 2013
-                        , "imagedescriptor"  // Not included with CrmSvcUtil 2013
-                        , "owner"   // Not included with CrmSvcUtil 2013
-                            };
+                        , "systemapplicationmetadata" // Not included with CrmSvcUtil 6.0.0001.0061
+                        , "systemuserbusinessunitentitymap" // Not included with CrmSvcUtil 6.0.0001.0061
+                        , "systemuserprincipals" // Not included with CrmSvcUtil 6.0.0001.0061
+                        , "traceassociation" // Not included with CrmSvcUtil 6.0.0001.0061
+                        , "traceregarding" // Not included with CrmSvcUtil 6.0.0001.0061
+                        , "unresolvedaddress" // Not included with CrmSvcUtil 6.0.0001.0061
+                        , "userapplicationmetadata" // Not included with CrmSvcUtil 6.0.0001.0061
+                        , "userfiscalcalendar" // Not included with CrmSvcUtil 6.0.0001.0061
+                        , "webwizard" // Not included with CrmSvcUtil 6.0.0001.0061
+                        , "wizardaccessprivilege" // Not included with CrmSvcUtil 6.0.0001.0061
+                        , "wizardpage" // Not included with CrmSvcUtil 6.0.0001.0061
+                        , "workflowwaitsubscription" // Not included with CrmSvcUtil 6.0.0001.0061
+        };
     }
 }


Added support for testing whether a type is a Set. Also refactored TypeManager collection tests to use 1 common function.

--- DaikonDotNetFrontEnd/DotNetFrontEnd/TypeManager.cs
+++ DaikonDotNetFrontEnd/DotNetFrontEnd/TypeManager.cs
@@ -9,11 +9,9 @@
   using System.Collections.Generic;
   using System.Linq;
   using System.Reflection;
+  using System.Text;
   using Microsoft.Cci;
   using Microsoft.Cci.MutableCodeModel;
-  using System.Runtime.CompilerServices;
-  using System.Text;
-  using System.Text.RegularExpressions;

   /// <summary>
   /// Keeps canoncial type references. Converts between CCIMetadata and .NET types.
@@ -46,6 +44,12 @@
     private static readonly Type uShortType = typeof(ushort);
     private static readonly Type uIntType = typeof(uint);

+    /// <summary>
+    ///  Name of the interface all sets must implement. Use is similar to a type store, but getting
+    ///  any specific set type wold require an element type.
+    /// </summary>
+    private static readonly string SetInterfaceName = "ISet";
+
     #endregion

     /// <summary>
@@ -73,16 +77,25 @@

     /// <summary>
     /// Map from a type to whether it is an FSharpList. Memoizes the lookup.
+    /// We use a bool-valued hashmap because there are essentially three states, IsLinkedList,
+    /// NotLinkedList and Unknown.
     /// </summary>
     private Dictionary<Type, bool> isFSharpListHashmap;

     /// <summary>
     /// Map from types to whether or not they are linked-list implementors
     /// Memoizes the lookup
-    /// We use a bool-valued hashtable because there are essentially three states, IsLinkedList,
+    /// We use a bool-valued hashmap because there are essentially three states, IsLinkedList,
     /// NotLinkedList and Unknown.
     /// </summary>
     private Dictionary<Type, bool> isLinkedListHashmap;
+
+    /// <summary>
+    /// Map from type to whether that type is a C# hashset.
+    /// Memoizes the lookup
+    /// We use a bool-valued hashmap because there are three states, true, false and unknown.
+    /// </summary>
+    private Dictionary<Type, bool> isSetHashmap;

     /// <summary>
     /// A map from assembly qualified names to the Type they describe
@@ -116,6 +129,7 @@
       this.isListHashmap = new Dictionary<Type, bool>();
       this.isFSharpListHashmap = new Dictionary<Type, bool>();
       this.isLinkedListHashmap = new Dictionary<Type, bool>();
+      this.isSetHashmap = new Dictionary<Type, bool>();
       this.nameTypeMap = new Dictionary<string, Type>();
       this.pureMethodKeys = new Dictionary<Type, ISet<int>>();
       this.pureMethods = new Dictionary<int, MethodInfo>();
@@ -163,6 +177,44 @@
     }

     /// <summary>
+    /// Defines a test to see if a type is an element of a given collection set (e.g. is the type
+    /// a list, is the type a set, etc.)
+    /// </summary>
+    /// <param name="type">Type to test</param>
+    /// <returns>Whether the type is an element of the set</returns>
+    private delegate bool IsElementTest(Type type);
+
+    /// <summary>
+    /// Perform memoized lookup to see if the given type is a element of the given collection set.
+    /// If the type isn't in the collection set already then perform the test and update the set.
+    /// </summary>
+    /// <param name="type">Type to test</param>
+    /// <param name="entries">Set to test against</param>
+    /// <param name="test">Test to perform if type is not in test</param>
+    /// <returns>Whether type is an element of the set, or if it passed the test</returns>
+    private bool IsElementOfCollectionType(Type type, Dictionary<Type, bool> entries,
+        IsElementTest test)
+    {
+      if (type == null)
+      {
+        throw new ArgumentNullException("type");
+      }
+
+      // Check in result table
+      bool lookupResult;
+      if (entries.TryGetValue(type, out lookupResult))
+      {
+        return lookupResult;
+      }
+
+      // If we haven't seen this type before, check each interface it implements
+      // Store result for memoization
+      bool testResult = test(type);
+      entries.Add(type, testResult);
+      return testResult;
+    }
+
+    /// <summary>
     /// Set the given identity assembly as the assembly to use when resolving types.
     /// </summary>
     /// <param name="identity">The identity to use during type resolution</param>
@@ -186,6 +238,23 @@
     }

     /// <summary>
+    /// Explicit test for wheter the given type is an F# list.
+    /// </summary>
+    /// <param name="type">Type to test</param>
+    /// <returns>True if the type is an F# list, false otherwise.</returns>
+    private bool IsFSharpListTest(Type type)
+    {
+      if (this.frontEndArgs.ElementInspectArraysOnly)
+      {
+        return type.IsArray;
+      }
+      else
+      {
+        return type.Namespace == "Microsoft.FSharp.Collections" && type.Name.StartsWith("FSharpList");
+      }
+    }
+
+    /// <summary>
     /// Check if the given type extends FSharpList, memoized
     /// </summary>
     /// <param name="type">The type to check</param>
@@ -193,33 +262,32 @@
     /// false</returns>
     public bool IsFSharpListImplementer(Type type)
     {
-      if (type == null)
-      {
-        throw new ArgumentNullException("type");
-      }
-      // Check in result table
-      bool result;
-      if (this.isFSharpListHashmap.TryGetValue(type, out result))
-      {
-        return result;
-      }
-
+      return IsElementOfCollectionType(type, this.isFSharpListHashmap, IsFSharpListTest);
+    }
+
+    /// <summary>
+    /// Explicity test whether type is a C# list.
+    /// </summary>
+    /// <param name="type">Type to check</param>
+    /// <returns>Whether type is a C# list</returns>
+    private bool IsListTest(Type type)
+    {
       // If we haven't seen this type before, check each interface it implements
       // Store result for memoization
       if (this.frontEndArgs.ElementInspectArraysOnly)
       {
-        result = type.IsArray;
-        this.isFSharpListHashmap.Add(type, result);
-        return result;
+        return type.IsArray;
       }
       else
       {
-        if (type.Namespace == "Microsoft.FSharp.Collections" && type.Name.StartsWith("FSharpList"))
-        {
-          this.isFSharpListHashmap.Add(type, true);
-          return true;
-        }
-        this.isFSharpListHashmap.Add(type, false);
+        Type[] interfaces = type.GetInterfaces();
+        foreach (Type item in interfaces)
+        {
+          if (item == TypeManager.ListType)
+          {
+            return true;
+          }
+        }
         return false;
       }
     }
@@ -231,39 +299,7 @@
     /// <returns>True if the type implements System.Collections.List, otherwise false</returns>
     public bool IsListImplementer(Type type)
     {
-      if (type == null)
-      {
-        throw new ArgumentNullException("type");
-      }
-      // Check in result table
-      bool result;
-      if (this.isListHashmap.TryGetValue(type, out result))
-      {
-        return result;
-      }
-
-      // If we haven't seen this type before, check each interface it implements
-      // Store result for memoization
-      if (this.frontEndArgs.ElementInspectArraysOnly)
-      {
-        result = type.IsArray;
-        this.isListHashmap.Add(type, result);
-        return result;
-      }
-      else
-      {
-        Type[] interfaces = type.GetInterfaces();
-        foreach (Type item in interfaces)
-        {
-          if (item == TypeManager.ListType)
-          {
-            this.isListHashmap.Add(type, true);
-            return true;
-          }
-        }
-        this.isListHashmap.Add(type, false);
-        return false;
-      }
+      return IsElementOfCollectionType(type, this.isListHashmap, IsListTest);
     }

     /// <summary>
@@ -282,43 +318,69 @@
     }

     /// <summary>
+    /// Explicity tests whether the given type is a C# linked list.
+    /// </summary>
+    /// <param name="type">Type to test</param>
+    /// <returns>Whether type is a linked list.</returns>
+    private static bool IsLinkedListTest(Type type)
+    {
+      // Number of fields whose type matches the type being checked
+      int numOwnType = 0;
+      FieldInfo[] fields = type.GetFields(System.Reflection.BindingFlags.Public
+                                            | System.Reflection.BindingFlags.NonPublic
+                                            | System.Reflection.BindingFlags.Instance);
+      foreach (FieldInfo field in fields)
+      {
+        if (field.FieldType == type)
+        {
+          numOwnType++;
+        }
+      }
+
+      // We have a linked list if there is exactly 1 field of the proper type.
+      return numOwnType == 1;
+    }
+
+    /// <summary>
     /// Returns whether the given type is a "linked-list" type: having 1 field of its own type.
     /// </summary>
     /// <param name="type">The type to check for linked-listness.</param>
     /// <returns>True if the type meets the linked-list qualification, otherwise false</returns>
     public bool IsLinkedListImplementer(Type type)
     {
-      if (type == null)
-      {
-        throw new ArgumentNullException("type");
-      }
-      // Check in result table
-      bool result;
-      if (this.isLinkedListHashmap.TryGetValue(type, out result))
-      {
-        return result;
+      return IsElementOfCollectionType(type, this.isLinkedListHashmap, IsLinkedListTest);
+    }
+
+    /// <summary>
+    /// Explicityly tests whether type is a C# set.
+    /// </summary>
+    /// <param name="type">Type to test</param>
+    /// <returns>True if type is a C# test, false otherwise.</returns>
+    private bool IsSetTest(Type type)
+    {
+      // If we haven't seen this type before, check each interface it implements
+      // Store result for memoization
+      if (this.frontEndArgs.ElementInspectArraysOnly)
+      {
+        return type.IsArray;
       }
       else
       {
-        // Number of fields whose type matches the type being checked
-        int numOwnType = 0;
-        FieldInfo[] fields = type.GetFields(System.Reflection.BindingFlags.Public
-                                              | System.Reflection.BindingFlags.NonPublic
-                                              | System.Reflection.BindingFlags.Instance);
-        foreach (FieldInfo field in fields)
-        {
-          if (field.FieldType == type)
+        Type[] interfaces = type.GetInterfaces();
+        foreach (Type item in interfaces)
+        {
+          if (item.Name.Contains(SetInterfaceName))
           {
-            numOwnType++;
+            return true;
           }
         }
-
-        // We have a linked list if there is exactly 1 field of the proper type.
-        bool success = numOwnType == 1;
-
-        this.isLinkedListHashmap.Add(type, success);
-        return success;
-      }
+        return false;
+      }
+    }
+
+    public bool IsSetImplementer(Type type)
+    {
+      return IsElementOfCollectionType(type, this.isSetHashmap, IsSetTest);
     }

     /// <summary>
@@ -406,63 +468,63 @@
     /// <param name="deeplyInspectGenericParameters">Whether to investigate constraints on
     /// generic parmeters</param>
     /// <returns>A reflection type</returns>
-    public string ConvertCCITypeToAssemblyQualifiedName(ITypeReference type,
+    public string ConvertCCITypeToAssemblyQualifiedName(ITypeReference type,
       bool deeplyInspectGenericParameters = true)
     {
       //try
       //{
-        string typeName = CheckSimpleCases(type);
-        if (typeName != null)
-        {
-          return typeName;
-        }
-
-        // TODO(#16): In a future version it'd be nice to get some more
-        // information out of these
-        if (type is GenericTypeParameterReference || type is GenericMethodParameter
-         || type is GenericTypeParameter)
-        {
-          if (type is GenericMethodParameter && deeplyInspectGenericParameters)
-          {
-            GenericMethodParameter gmp = (GenericMethodParameter)type;
-            return PrintListOfGenericParameterClassesAndInterfaces(gmp);
-          }
-          return "System.Object";
-        }
-
-
-        if (type is SpecializedNestedTypeReference)
-        {
-          type = ((SpecializedNestedTypeReference)type).UnspecializedVersion;
-        }
-
-        // Get the full name of the specified type
-        typeName = TypeHelper.GetTypeName(type,
-          NameFormattingOptions.UseReflectionStyleForNestedTypeNames);
-
-        typeName = UpdateTypeNameForNestedTypeDefinitions(type, typeName);
-
-        INamedTypeDefinition namedType = type as INamedTypeDefinition;
-        if (namedType != null && namedType.MangleName)
-        {
-          typeName = typeName + '`' + namedType.GenericParameterCount;
-        }
-        else if (type is GenericTypeInstanceReference)
-        {
-          var castedType = (GenericTypeInstanceReference)type;
-          typeName = TypeHelper.GetTypeName(castedType.GenericType,
-              NameFormattingOptions.UseReflectionStyleForNestedTypeNames) + '`' +
-              castedType.GenericArguments.Count;
-          if (deeplyInspectGenericParameters)
-          {
-            typeName = AddGenericTypeArguments(typeName, castedType);
-          }
-          type = castedType.GenericType;
-        }
-
-        AssemblyIdentity identity = DetermineAssemblyIdentity(type);
-
-        return CompleteAssemblyQualifiedTypeNameProcessing(typeName, identity);
+      string typeName = CheckSimpleCases(type);
+      if (typeName != null)
+      {
+        return typeName;
+      }
+
+      // TODO(#16): In a future version it'd be nice to get some more
+      // information out of these
+      if (type is GenericTypeParameterReference || type is GenericMethodParameter
+       || type is GenericTypeParameter)
+      {
+        if (type is GenericMethodParameter && deeplyInspectGenericParameters)
+        {
+          GenericMethodParameter gmp = (GenericMethodParameter)type;
+          return PrintListOfGenericParameterClassesAndInterfaces(gmp);
+        }
+        return "System.Object";
+      }
+
+
+      if (type is SpecializedNestedTypeReference)
+      {
+        type = ((SpecializedNestedTypeReference)type).UnspecializedVersion;
+      }
+
+      // Get the full name of the specified type
+      typeName = TypeHelper.GetTypeName(type,
+        NameFormattingOptions.UseReflectionStyleForNestedTypeNames);
+
+      typeName = UpdateTypeNameForNestedTypeDefinitions(type, typeName);
+
+      INamedTypeDefinition namedType = type as INamedTypeDefinition;
+      if (namedType != null && namedType.MangleName)
+      {
+        typeName = typeName + '`' + namedType.GenericParameterCount;
+      }
+      else if (type is GenericTypeInstanceReference)
+      {
+        var castedType = (GenericTypeInstanceReference)type;
+        typeName = TypeHelper.GetTypeName(castedType.GenericType,
+            NameFormattingOptions.UseReflectionStyleForNestedTypeNames) + '`' +
+            castedType.GenericArguments.Count;
+        if (deeplyInspectGenericParameters)
+        {
+          typeName = AddGenericTypeArguments(typeName, castedType);
+        }
+        type = castedType.GenericType;
+      }
+
+      AssemblyIdentity identity = DetermineAssemblyIdentity(type);
+
+      return CompleteAssemblyQualifiedTypeNameProcessing(typeName, identity);
       //}
       //catch (Exception ex)
       //{


Fixed the default values.

Fixed the default values.

--- DataClassFileBuilder/DataClassFileBuilderDialog.cs
+++ DataClassFileBuilder/DataClassFileBuilderDialog.cs
@@ -998,7 +998,15 @@
                             sw.Write("\t\t[System.Data.LightDatamodel.MemberModifierIgnoreWithSelect()]\n");

                         string defaultValue;
-                        defaultValue = FormatObjectToCSharp(provider.GetDefaultValue(mapping.TableName, mf.ColumnName, mapping.ViewSQL), provider.IsUnique(mapping.TableName, mf.ColumnName));
+                        if (mf.DefaultValue != null)
+                        {
+                            if (mf.DefaultValue as string == null)
+                                defaultValue = mf.DefaultValue.ToString();
+                            else
+                                defaultValue = "\"" + (mf.DefaultValue as string) + "\"";
+                        }
+                        else
+                            defaultValue = FormatObjectToCSharp(provider.GetDefaultValue(mapping.TableName, mf.ColumnName, mapping.ViewSQL), provider.IsUnique(mapping.TableName, mf.ColumnName));

 						sw.Write("\t\tprivate " + mf.DataType.FullName + " " + mf.FieldName + " = " + defaultValue + ";\n");
                     }


Update issue #508 Status: Fixed

Update issue #508
Status: Fixed

There is no longer url encoding of the username or API key for CloudFiles

git-svn-id: bf0bd98e94caaaf89d4dca54eab1bef459ce3438@986 59da171f-624f-0410-aa54-27559c288bec

--- Duplicati/Library/Backend/CloudFiles/CloudFiles.cs
+++ Duplicati/Library/Backend/CloudFiles/CloudFiles.cs
@@ -365,8 +365,8 @@
             if (string.IsNullOrEmpty(m_authToken) || string.IsNullOrEmpty(m_storageUrl))
             {
                 HttpWebRequest authReq = (HttpWebRequest)HttpWebRequest.Create(m_authUrl);
-                authReq.Headers.Add("X-Auth-User", UrlEncode(m_username));
-                authReq.Headers.Add("X-Auth-Key", UrlEncode(m_password));
+                authReq.Headers.Add("X-Auth-User", m_username);
+                authReq.Headers.Add("X-Auth-Key", m_password);
                 authReq.Method = "GET";

                 using (WebResponse resp = authReq.GetResponse())


Applied patch from issue #523 to support GoogleDocs accounts with shared folders.

git-svn-id: bf0bd98e94caaaf89d4dca54eab1bef459ce3438@1079 59da171f-624f-0410-aa54-27559c288bec

--- Duplicati/Library/Backend/GoogleDocs/GoogleDocs.cs
+++ Duplicati/Library/Backend/GoogleDocs/GoogleDocs.cs
@@ -152,7 +152,13 @@
             Dictionary<string, Google.Documents.Document> dict = new Dictionary<string, Google.Documents.Document>();

             foreach (Google.Documents.Document d in data)
-                parentlookup.Add(d.AtomEntry.EditUri.Content, d);
+            {
+                // note: some files have no Edit Uri (for ex. shared by different user)
+                if (d.AtomEntry.EditUri != null && d.AtomEntry.EditUri.Content != null)
+                {
+                    parentlookup.Add(d.AtomEntry.EditUri.Content, d);
+                }
+            }

             foreach (Google.Documents.Document d in parentlookup.Values)
             {


Spelling fix

Spelling fix

--- Duplicati/Library/Main/Operation/RestoreHandler.cs
+++ Duplicati/Library/Main/Operation/RestoreHandler.cs
@@ -150,7 +150,7 @@
                             PatchWithBlocklist(database, rd, m_options, m_result, m_blockbuffer);
                         };

-                    // TODO: When UpdateMisisngBlocksTable is implemented, the localpatcher can be activated
+                    // TODO: When UpdateMissingBlocksTable is implemented, the localpatcher can be activated
                     // and this will reduce the need for multiple downloads of the same volume
                     // TODO: This will need some work to preserve the missing block list for use with --fh-dryrun
                     m_result.RecreateDatabaseResults = new RecreateDatabaseResults(m_result);


Fix a bug with the console arguments class

--- Code/Luval.Common/ConsoleArguments.cs
+++ Code/Luval.Common/ConsoleArguments.cs
@@ -24,7 +24,7 @@
         {
             if (!ContainsSwitch(name)) return null;
             var switchIndex = _args.IndexOf(name);
-            if (_args.Count < switchIndex + 1) return null;
+            if ((_args.Count - 1) < switchIndex + 1) return null;
             return _args[switchIndex + 1];
         }
     }


Improved error message when reading invalid blocklists

--- Duplicati/Library/Main/Volumes/VolumeReaderBase.cs
+++ Duplicati/Library/Main/Volumes/VolumeReaderBase.cs
@@ -109,11 +109,13 @@
             using (var fs = compression.OpenRead(filename))
             {
                 int s;
+				var read = 0L;
                 while ((s = Library.Utility.Utility.ForceStreamRead(fs, buffer, buffer.Length)) != 0)
                 {
                     if (s != buffer.Length)
-                        throw new InvalidDataException("Premature End-of-stream encountered while reading blocklist hashes");
+						throw new InvalidDataException($"Premature End-of-stream encountered while reading blocklist hashes for {filename}. Got {s} bytes of {buffer.Length} at offset {read * buffer.Length}");

+					read++;
                     yield return Convert.ToBase64String(buffer);
                 }


Checking partition-level tests is wrong

Checking partition-level tests is wrong

--- ExFat.DiscUtils.Tests/Tests/PartitionWriteTests.cs
+++ ExFat.DiscUtils.Tests/Tests/PartitionWriteTests.cs
@@ -47,7 +47,7 @@
         [TestCategory("Write")]
         public void OverwriteSparseTest()
         {
-            using (var testEnvironment = new TestEnvironment(true))
+            using (var testEnvironment = new TestEnvironment())
             {
                 using (var partition = new ExFatPartition(testEnvironment.PartitionStream))
                 {
@@ -63,7 +63,7 @@
         [TestCategory("Write")]
         public void OverwriteContiguousTest()
         {
-            using (var testEnvironment = new TestEnvironment(true))
+            using (var testEnvironment = new TestEnvironment())
             {
                 using (var partition = new ExFatPartition(testEnvironment.PartitionStream))
                 {
@@ -106,7 +106,7 @@
         [TestCategory("Write")]
         public void AppendSparseTest()
         {
-            using (var testEnvironment = new TestEnvironment(true))
+            using (var testEnvironment = new TestEnvironment())
             {
                 using (var partition = new ExFatPartition(testEnvironment.PartitionStream))
                 {
@@ -122,7 +122,7 @@
         [TestCategory("Write")]
         public void AppendContiguousTest()
         {
-            using (var testEnvironment = new TestEnvironment(true))
+            using (var testEnvironment = new TestEnvironment())
             {
                 using (var partition = new ExFatPartition(testEnvironment.PartitionStream))
                 {
@@ -139,7 +139,7 @@
         [TestCategory("Write")]
         public void CreateStreamTest()
         {
-            using (var testEnvironment = new TestEnvironment(true))
+            using (var testEnvironment = new TestEnvironment())
             {
                 using (var partition = new ExFatPartition(testEnvironment.PartitionStream))
                 {


Fix compilation errors

Fix compilation errors

--- FDK/SoftFX.Extended.Net/Storage/DataFeedStorage.cs
+++ FDK/SoftFX.Extended.Net/Storage/DataFeedStorage.cs
@@ -1,4 +1,6 @@
-namespace SoftFX.Extended.Storage
+using TickTrader.Server.QuoteHistory.Engine.SymbolHistory;
+
+namespace SoftFX.Extended.Storage
 {
     using System;
     using System.Collections.Generic;
@@ -86,8 +88,8 @@
 		/// <param name="flushOnDispose">If true, then quotes cache in memory will be flushed to hard drive.</param>
 		/// <param name="saveTickLevel2History">Save incomning ticks as level2 history or not</param>
 		/// <exception cref="System.ArgumentNullException">If location is null.</exception>
-        public DataFeedStorage(string location, Type storageProviderType, int storageVersion, bool flushOnDispose, bool saveTickLevel2History)
-            : this(location, storageProviderType, storageVersion, null, flushOnDispose, saveTickLevel2History)
+        public DataFeedStorage(string location, Type storageProviderType, int protocolVersion, bool flushOnDispose, bool saveTickLevel2History)
+            : this(location, storageProviderType, protocolVersion, null, flushOnDispose, saveTickLevel2History)
         {
         }

@@ -599,11 +601,6 @@
 			{
 				if (!this.symbol2cache.TryGetValue(symbol, out result))
 				{
-                    var symbols = new HashSet<string>
-                    {
-                        symbol
-                    };
-
 					var storageVersion = this.storageVersion;

 					if (this.historyFeed != null)
@@ -612,7 +609,7 @@
 					var provider = HistoryManager.Create(
                         storageVersion,
                         this.store,
-                        symbols,
+                        null,
                         DataFeedStorage.GetSupportedPeriodicityToStoreLevel(this.storageVersion),
                         this.saveTickLevel2History,
                         Cache.ClientInstance(Guid.NewGuid().ToString()),


More cereal

More cereal

--- ForgeNetworkingUnityEditor/ForgeClassFieldValue.cs
+++ ForgeNetworkingUnityEditor/ForgeClassFieldValue.cs
@@ -17,6 +17,7 @@
 	/// <summary>
 	/// This is a class object that contains the field value
 	/// </summary>
+	[Serializable]
 	public class ForgeClassFieldValue
 	{
 		public string FieldName;


Another attempt at fixing the bug

Another attempt at fixing the bug

--- ConDep.Dsl/Operations/PreRemoteOps.cs
+++ ConDep.Dsl/Operations/PreRemoteOps.cs
@@ -39,15 +39,22 @@

         private void ConfigureCopyResource(Assembly assembly, IEnumerable<string> resources)
         {
-            foreach (var resource in resources)
+            if(resources != null)
             {
-                var path = Resources.ConDepResourceFiles.GetFilePath(assembly, resource, true);
-                var copyOp =
-                    new RemoteWebDeployOperation(
-                        new CopyFileProvider(path,
-                                             string.Format(@"%temp%\ConDep\{0}\PSScripts\ConDep\{1}", ConDepGlobals.ExecId,
-                                                           Path.GetFileName(path))), _webDeploy);
-                _sequence.Add(copyOp, true);
+                var resourceArray = resources.ToArray();
+                if (resourceArray.Any())
+                {
+                    foreach (var resource in resourceArray)
+                    {
+                        var path = Resources.ConDepResourceFiles.GetFilePath(assembly, resource, true);
+                        var copyOp =
+                            new RemoteWebDeployOperation(
+                                new CopyFileProvider(path,
+                                                     string.Format(@"%temp%\ConDep\{0}\PSScripts\ConDep\{1}", ConDepGlobals.ExecId,
+                                                                   Path.GetFileName(path))), _webDeploy);
+                        _sequence.Add(copyOp, true);
+                    }
+                }
             }
         }


Update AlphaStreamsBrokerageModel.cs

Update AlphaStreamsBrokerageModel.cs

Implement explicity method for getting security leverage. Adjusted leverage based on available research regarding hedge funds and PBs.

--- Common/Brokerages/AlphaStreamsBrokerageModel.cs
+++ Common/Brokerages/AlphaStreamsBrokerageModel.cs
@@ -53,6 +53,39 @@
         public override ISlippageModel GetSlippageModel(Security security) => new AlphaStreamsSlippageModel();

         /// <summary>
+        /// Gets the brokerage's leverage for the specified security
+        /// </summary>
+        /// <param name="security">The security's whose leverage we seek</param>
+        /// <returns>The leverage for the specified security</returns>
+        public override decimal GetLeverage(Security security)
+        {
+            if (AccountType == AccountType.Cash)
+            {
+                return 1m;
+            }
+
+            switch (security.Type)
+            {
+                case SecurityType.Equity:
+                    return 2m;
+
+                case SecurityType.Forex:
+                case SecurityType.Cfd:
+                    return 10m;
+
+                case SecurityType.Crypto:
+                    return 1m;
+
+                case SecurityType.Base:
+                case SecurityType.Commodity:
+                case SecurityType.Option:
+                case SecurityType.Future:
+                default:
+                    return 1m;
+            }
+        }
+
+        /// <summary>
         /// Gets a new settlement model for the security
         /// </summary>
         /// <param name="security">The security to get a settlement model for</param>


Updated response from data sensitivity level

--- Core.DomainModel/ItSystemUsage/ItSystemUsage.cs
+++ Core.DomainModel/ItSystemUsage/ItSystemUsage.cs
@@ -595,7 +595,7 @@

             if (!SensitiveDataLevelExists(sensitiveDataLevel))
             {
-                return new OperationError("Data sensitivity does not exists on system usage", OperationFailure.NotFound);
+                return new OperationError("Data sensitivity does not exists on system usage", OperationFailure.BadInput);
             }

             var dataLevelToRemove = SensitiveDataLevels.First(x => x.SensitivityDataLevel == sensitiveDataLevel);


Format object identity in result window #17

--- CsomInspector/CsomInspector.Core/Data/Result.cs
+++ CsomInspector/CsomInspector.Core/Data/Result.cs
@@ -1,4 +1,5 @@
-using Newtonsoft.Json.Linq;
+using CsomInspector.Core.ObjectPaths;
+using Newtonsoft.Json.Linq;
 using System;
 using System.Collections.Generic;
 using System.Linq;
@@ -35,9 +36,9 @@
 			}
 		}

-		public Int32 ActionId { get; private set; }
+		public Int32 ActionId { get; }

-		public IEnumerable<ResultProperty> Properties { get; private set; }
+		public IEnumerable<ResultProperty> Properties { get; }
 	}

 	public class ResultProperty : IObjectTreeNode
@@ -54,11 +55,11 @@
 			Children = children;
 		}

-		public IEnumerable<IObjectTreeNode> Children { get; private set; }
+		public IEnumerable<IObjectTreeNode> Children { get; }

-		public String Name { get; private set; }
+		public String Name { get; }

-		public String Value { get; private set; }
+		public String Value { get; }

 		public override String ToString()
 		{
@@ -74,11 +75,20 @@
 		{
 			foreach (var token in tokens)
 			{
-				var name = token.Path;
+				var property = token as JProperty;
 				var child = token.Children().FirstOrDefault();
 				var value = child?.ToString();

-				yield return new ResultProperty(name, value);
+				if (String.Equals(property.Name, "_ObjectIdentity_", StringComparison.InvariantCultureIgnoreCase))
+				{
+					var identity = IdentityParameter.FromIdentityString(value);
+
+					yield return new ResultProperty(property.Name, identity);
+				}
+				else
+				{
+					yield return new ResultProperty(property.Name, value);
+				}
 			}
 		}
 	}


return AdministrationController/RestartApp to have a possibility to reload AppCache.

--- DEM_MVC/Controllers/AdministrationController.cs
+++ DEM_MVC/Controllers/AdministrationController.cs
@@ -1,4 +1,5 @@
 using System;
+using System.Web;
 using System.Web.Mvc;
 using DEM_MVC_BL.Interfaces.IServices;
 using DEM_MVC_Infrastructure.Models;
@@ -24,7 +25,7 @@

             if (currentUserId == 0)
                 return new JsonResult { Data = new { success = false, responseText = "You can't delete post - You not authorized. Please, contact with administrator." } };
-
+
             if (!_permissionsService.UserHasPermissionByForumId(currentUserId, 8, CommonConstants.ShowAdminControls))//todo change check to Admin group, not to permisson
                 return new JsonResult { Data = new { success = false, responseText = "You can't delete post - you have not permisson. Please, contact with administrator." } };

@@ -71,6 +72,25 @@
             return new JsonResult { Data = new { success = false, responseText = "User wasn't unbanned. Please, contact with administrator." } };
         }

+
+        [HttpGet]
+        public ActionResult RestartApp()//todo create autorize for this method. Should be deleted in future
+        {
+            var currentUserId = User.Identity.GetUserId<int>();
+            if (currentUserId == 0)
+                return new JsonResult
+            {
+                Data = new { success = false, responseText = "You can't reload application - You not authorized. Please, contact with administrator." }
+            };
+
+            if (!_permissionsService.UserHasPermissionByForumId(currentUserId, 8, CommonConstants.ShowAdminControls))
+                return new JsonResult { Data = new { success = false, responseText = "You can't reload application - you have not permisson. Please, contact with administrator." } };
+
+            DemLogger.Current.Info($"App was restarted via AdministrationController/RestartApp at {DateTime.UtcNow}");
+            HttpRuntime.UnloadAppDomain();
+            return null;
+        }
+
         protected override void OnException(ExceptionContext filterContext)
         {
             Exception exception = filterContext.Exception;


Try to avoid unimplemented assembly getter in mono in DetourContext

--- MonoMod.RuntimeDetour/DetourContext.cs
+++ MonoMod.RuntimeDetour/DetourContext.cs
@@ -36,7 +36,7 @@
         private MethodBase Creator = null;

         public int Priority;
-        private string _FallbackID;
+        private readonly string _FallbackID;
         private string _ID;
         public string ID {
             get => _ID ?? _FallbackID;
@@ -100,7 +100,7 @@
                 break;
             }
 #endif
-            _FallbackID = Creator?.Module?.Assembly?.GetName().Name ?? Creator?.GetFindableID(simple: true);
+            _FallbackID = Creator?.DeclaringType?.GetTypeInfo().Assembly?.GetName().Name ?? Creator?.GetFindableID(simple: true);

             Last = this;
             Contexts.Add(this);


Support for running the app in a "portable" mode

--- MultiMiner.Utility/ApplicationPaths.cs
+++ MultiMiner.Utility/ApplicationPaths.cs
@@ -7,8 +7,31 @@
     {
         public static string AppDataPath()
         {
-            string rootPath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
-            return Path.Combine(rootPath, "MultiMiner");
+            //if running in "portable" mode
+            if (IsRunningInPortableMode())
+            {
+                //store files in the working directory rather than AppData
+                return GetWorkingDirectory();
+            }
+            else
+            {
+                string rootPath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
+                return Path.Combine(rootPath, "MultiMiner");
+            }
+        }
+
+        //simply check for a file named "portable" in the same folder
+        private static bool IsRunningInPortableMode()
+        {
+            string assemblyDirectory = GetWorkingDirectory();
+            string portableFile = Path.Combine(assemblyDirectory, "portable");
+            return File.Exists(portableFile);
+        }
+
+        private static string GetWorkingDirectory()
+        {
+            string assemblyFilePath = System.Reflection.Assembly.GetExecutingAssembly().Location;
+            return Path.GetDirectoryName(assemblyFilePath);
         }
     }
 }


Fix missing dispose in ObjectIdGenerator for MD5 hash of the host

--- NoRM/BSON/DbTypes/ObjectIdGenerator.cs
+++ NoRM/BSON/DbTypes/ObjectIdGenerator.cs
@@ -113,9 +113,11 @@
         /// </returns>
         private static byte[] GenerateHostHash()
         {
-            var md5 = MD5.Create();
-            var host = Dns.GetHostName();
-            return md5.ComputeHash(Encoding.Default.GetBytes(host));
+            using (var md5 = MD5.Create())
+            {
+                var host = Dns.GetHostName();
+                return md5.ComputeHash(Encoding.Default.GetBytes(host));
+            }
         }

         /// <summary>


DataLinq changes - DataContext.Fill() extension - GetTableName correctly scans the inheritance hierarchy

--- PART/Source/Core/Utilities/DataLinq.cs
+++ PART/Source/Core/Utilities/DataLinq.cs
@@ -51,6 +51,8 @@
 using System.Reflection;
 using System.Data.Linq;
 using System.Data.Linq.Mapping;
+using System.Data;
+using System.Data.SqlClient;

 namespace CprBroker.Utilities
 {
@@ -68,11 +70,20 @@
         /// <exception cref="ArgumentException"><typeparamref name="TTable"/> has no TableAttribute defined</exception>
         /// <returns>Table name</returns>
         public static string GetTableName(Type tableType)
-        {
-            var tableAttribute = tableType.GetCustomAttributes(typeof(TableAttribute), true).FirstOrDefault() as TableAttribute;
+        {
+            var attrType = typeof(TableAttribute);
+            TableAttribute tableAttribute = null;
+            var tempTableType = tableType;
+            do
+            {
+                tableAttribute = tempTableType.GetCustomAttributes(attrType, true).FirstOrDefault() as TableAttribute;
+                tempTableType = tempTableType.BaseType;
+            }
+            while (tableAttribute == null && tempTableType.BaseType != null);
+
             if (tableAttribute == null)
             {
-                throw new ArgumentException(string.Format("{0} is not defined on type {0}", tableType.FullName));
+                throw new ArgumentException(string.Format("{0} is not defined on type {1}", attrType.Name, tableType.FullName));
             }
             if (string.IsNullOrEmpty(tableAttribute.Name))
             {
@@ -84,5 +95,55 @@
             }
         }

+        /// <summary>
+        /// Fills a LINQ table object from a SQL query
+        /// Used mainly to handle the case of new columns that do not exist in all setups, so we can dynamically fill the objects without defining a LINQ discriminator column
+        /// </summary>
+        /// <typeparam name="T"></typeparam>
+        /// <param name="dataContext"></param>
+        /// <param name="cmd"></param>
+        /// <returns></returns>
+        public static IEnumerable<T> Fill<T>(this DataContext dataContext, string cmd)
+            where T : new()
+        {
+            using (SqlDataAdapter adpt = new SqlDataAdapter(cmd, dataContext.Connection as SqlConnection))
+            {
+                var props = typeof(T).GetProperties()
+                    .Select(p => new { Prop = p, Attr = Attribute.GetCustomAttribute(p, typeof(ColumnAttribute)) as ColumnAttribute })
+                    .Where(p => p.Attr != null)
+                    .ToDictionary(p => string.IsNullOrEmpty(p.Attr.Name) ? p.Prop.Name : p.Attr.Name);
+
+                DataTable t = new DataTable();
+                adpt.Fill(t);
+
+                var ret = new List<T>();
+                var rows = new DataRow[t.Rows.Count];
+                t.Rows.CopyTo(rows, 0);
+
+                ret.AddRange(rows.Select(r =>
+                {
+                    var o = new T();
+                    foreach (DataColumn c in t.Columns)
+                    {
+                        var p = props[c.ColumnName].Prop;
+                        var val = r[c];
+                        if (val != DBNull.Value)
+                        {
+                            if (p.PropertyType.Equals(typeof(char)) || p.PropertyType.Equals(typeof(char?)))
+                            {
+                                p.SetValue(o, val.ToString()[0], null);
+                            }
+                            else
+                            {
+                                p.SetValue(o, val, null);
+                            }
+                        }
+                    }
+                    return o;
+                }));
+                return ret;
+            }
+        }
+
     }
 }


Fix async issue when completing archive write

--- PPeX/Archives/ExtendedArchiveWriter.cs
+++ PPeX/Archives/ExtendedArchiveWriter.cs
@@ -564,7 +564,7 @@
                         completedFiles += chunk.Receipt.FileReceipts.Count;
                         ProgressPercentage.Report(completedFiles * 100 / totalFiles);
 	                }
-                }, TaskCreationOptions.LongRunning);
+                }, TaskCreationOptions.LongRunning).Unwrap();

                 ProgressStatus.Report("Allocating chunks...\r\n");
                 ProgressPercentage.Report(0);


Add HasFeature based on the id of the feature

Updating this for consistency with the Java SDK.

--- Cryptolens.Licensing/SKMv3/Helpers.cs
+++ Cryptolens.Licensing/SKMv3/Helpers.cs
@@ -644,6 +644,47 @@
         }

         ///
+        /// Checks so that a certain Feature is enabled (i.e. it's set to TRUE).
+        ///
+        /// <param name="featureNumber">The feature number, eg. feature1, feature 2, etc. FeatureNumber can be 1,2,...,8.</param>
+        /// <returns>A key information object if the condition is satisfied. Null otherwise.</returns>
+        public static bool HasFeature(LicenseKey licenseKey, int featureNumber)
+        {
+            if (licenseKey != null && featureNumber <= 8
+                                       && featureNumber >= 1
+                                       && GetFeatureByNumber(licenseKey, featureNumber))
+            {
+                return true;
+            }
+            return false;
+        }
+
+        internal static bool GetFeatureByNumber(this LicenseKey licenseKey, int i)
+        {
+            switch (i)
+            {
+                case 1:
+                    return licenseKey.F1;
+                case 2:
+                    return licenseKey.F2;
+                case 3:
+                    return licenseKey.F3;
+                case 4:
+                    return licenseKey.F4;
+                case 5:
+                    return licenseKey.F5;
+                case 6:
+                    return licenseKey.F6;
+                case 7:
+                    return licenseKey.F7;
+                case 8:
+                    return licenseKey.F8;
+                default:
+                    return false;
+            }
+        }
+
+        ///
         ///
Uses a special data object associated with the license key to determine if a certain feature exists (instead of the 8 feature flags).

         ///
Formatting:  The name of the data object should be 'cryptolens_features' and it should be structured as a JSON array.

         ///
For example,

["f1", "f2"]

means f1 and f2 are true. You can also have feature bundling, eg.

["f1", ["f2",["voice","image"]]]


fix codebase to comply with code analysis

--- h-dependency/tests/HDependency.Tests.cs
+++ h-dependency/tests/HDependency.Tests.cs
@@ -28,7 +28,7 @@
         Hdependency.Initialize(true);
         Assert.Fail("It should fail now because it has been not initialized in test mode before");
       }
-      catch (InvalidOperationException e)
+      catch (InvalidOperationException)
       {
         //here is fine, the exception is being correctly thrown
       }
@@ -91,4 +91,4 @@
       }
     }
   }
-}+}


Port color swatches to GTK3

Port color swatches to GTK3

--- Pinta.Core/Extensions/GdkExtensions.cs
+++ Pinta.Core/Extensions/GdkExtensions.cs
@@ -146,21 +146,13 @@

 		public static Pixbuf CreateColorSwatch(int size, Color color)
 		{
-			// TODO-GTK3
-#if false
-			using (var pmap = new Pixmap (Screen.Default.RootWindow, size, size))
-            using (var gc = new Gdk.GC (pmap)) {
-                gc.RgbFgColor = color;
-                pmap.DrawRectangle (gc, true, 0, 0, size, size);
-
-                gc.RgbFgColor = new Color (0, 0, 0);
-                pmap.DrawRectangle (gc, false, 0, 0, (size - 1), (size - 1));
-
-                return Pixbuf.FromDrawable (pmap, pmap.Colormap, 0, 0, 0, 0, size, size);
-            }
-#else
-			throw new NotImplementedException();
-#endif
+			using (var surf = new Cairo.ImageSurface(Cairo.Format.Argb32, size, size))
+			using (var g = new Cairo.Context(surf))
+			{
+				g.FillRectangle(new Cairo.Rectangle(0, 0, size, size), color.ToCairoColor());
+				g.DrawRectangle(new Cairo.Rectangle(0, 0, size - 1, size - 1), new Cairo.Color(0, 0, 0), 1);
+				return surf.ToPixbuf();
+			}
 		}

 		public static Pixbuf CreateTransparentColorSwatch(bool drawBorder)
@@ -170,23 +162,16 @@
             using (var surface = new Cairo.ImageSurface(Cairo.Format.Argb32, size, size))
             using (var g = new Cairo.Context(surface))
             {
-				// TODO-GTK3
-#if false
-				gc.RgbFgColor = new Color(255, 255, 255);
-				pmap.DrawRectangle(gc, true, 0, 0, size, size);
-
-				gc.RgbFgColor = new Color(200, 200, 200);
-				pmap.DrawRectangle(gc, true, 0, 0, (size / 2), (size / 2));
-				pmap.DrawRectangle(gc, true, size / 2, size / 2, (size / 2), (size / 2));
+				g.FillRectangle(new Cairo.Rectangle(0, 0, size, size), new Cairo.Color(1, 1, 1));
+                var color = new Cairo.Color(0.78, 0.78, 0.78);
+                var half_size = size / 2;
+				g.FillRectangle(new Cairo.Rectangle(0, 0, half_size, half_size), color);
+                g.FillRectangle(new Cairo.Rectangle(half_size, half_size, half_size, half_size), color);

 				if (drawBorder)
-				{
-					gc.RgbFgColor = new Color(0, 0, 0);
-					pmap.DrawRectangle(gc, false, 0, 0, (size - 1), (size - 1));
-				}
-#endif
+                    g.DrawRectangle(new Cairo.Rectangle(0, 0, size - 1, size - 1), new Cairo.Color(0, 0, 0), 1);

-				return surface.ToPixbuf();
+                return surface.ToPixbuf();
             }
 		}
 	}


Fixing messed up tests.

Fixing messed up tests.

--- DotSerializeTests/Serializer/SerializerTests.cs
+++ DotSerializeTests/Serializer/SerializerTests.cs
@@ -1,38 +0,0 @@
-using System;
-using System.IO;
-using System.Xml;
-using ApprovalTests;
-using Microsoft.VisualStudio.TestTools.UnitTesting;
-using Org.Edgerunner.DotSerialize.Tests.DataTypes;
-
-namespace Org.Edgerunner.DotSerialize.Tests
-{
-   /// <summary>
-   /// Summary description for SerializerTests
-   /// </summary>
-   [TestClass]
-   public class SerializerTests
-   {
-      protected const string _SerializeDogResultsInProperFile = "SerializerTests.SerializeDogResultsInProperFile.approved.xml";
-
-      [TestInitialize]
-      private void Setup()
-      {
-         Utilities.ExtractEmbeddedFile(_SerializeDogResultsInProperFile);
-      }
-      [TestCleanup]
-      private void CleanUp()
-      {
-         Utilities.DeleteFile(_SerializeDogResultsInProperFile);
-      }
-
-      [TestMethod]
-      public void SerializeDogResultsInProperFile()
-      {
-         var dog = new Dog("Fido", "Golden Retriever", true, null);
-         var serializer = new Serializer();
-         string xml = serializer.SerializeObject(dog);
-         Approvals.VerifyXml(xml);
-      }
-   }
-}


Refactoring ScrollingMessageDialog

Refactoring ScrollingMessageDialog

Preparation for using new design paradigm

--- EndlessClient/Dialogs/ScrollingMessageDialog.cs
+++ EndlessClient/Dialogs/ScrollingMessageDialog.cs
@@ -4,55 +4,58 @@

 using System;
 using System.Collections.Generic;
+using EndlessClient.GameExecution;
 using EndlessClient.UIControls;
 using EOLib;
 using EOLib.Graphics;
 using Microsoft.Xna.Framework;
+using Microsoft.Xna.Framework.Graphics;
 using XNAControls;

 namespace EndlessClient.Dialogs
 {
 	public class ScrollingMessageDialog : EODialogBase
 	{
-		private readonly ScrollBar scrollBar;
-		private readonly List<string> chatStrings = new List<string>();
-		private readonly TextSplitter textSplitter;
+		private readonly ScrollBar _scrollBar;
+		private readonly List<string> _chatStrings = new List<string>();
+		private readonly TextSplitter _textSplitter;
+		private readonly SpriteFont _font;

 		public new string MessageText
 		{
 			set
 			{
-				chatStrings.Clear();
-				textSplitter.Text = value;
+				_chatStrings.Clear();
+				_textSplitter.Text = value;

 				//special case: blank line, like in the news panel between news items
 				if (string.IsNullOrWhiteSpace(value))
 				{
-					chatStrings.Add(" ");
-					scrollBar.UpdateDimensions(chatStrings.Count);
+					_chatStrings.Add(" ");
+					_scrollBar.UpdateDimensions(_chatStrings.Count);
 					return;
 				}

 				//don't do multi-line processing if we don't need to
-				if (!textSplitter.NeedsProcessing)
+				if (!_textSplitter.NeedsProcessing)
 				{
-					chatStrings.Add(value);
-					scrollBar.UpdateDimensions(chatStrings.Count);
+					_chatStrings.Add(value);
+					_scrollBar.UpdateDimensions(_chatStrings.Count);
 					return;
 				}

-				chatStrings.AddRange(textSplitter.SplitIntoLines());
+				_chatStrings.AddRange(_textSplitter.SplitIntoLines());

-				scrollBar.UpdateDimensions(chatStrings.Count);
-				scrollBar.LinesToRender = (int)Math.Round(110.0f / 13); //draw area for the text is 117px, 13px per line
-				if (scrollBar.LinesToRender < chatStrings.Count)
-					scrollBar.SetDownArrowFlashSpeed(500);
+				_scrollBar.UpdateDimensions(_chatStrings.Count);
+				_scrollBar.LinesToRender = (int)Math.Round(110.0f / 13); //draw area for the text is 117px, 13px per line
+				if (_scrollBar.LinesToRender < _chatStrings.Count)
+					_scrollBar.SetDownArrowFlashSpeed(500);
 			}
 		}

 		public ScrollingMessageDialog(string msgText)
 		{
-			textSplitter = new TextSplitter("", EOGame.Instance.DBGFont) { LineLength = 275 };
+			_textSplitter = new TextSplitter("", EOGame.Instance.DBGFont) { LineLength = 275 };

 			bgTexture = ((EOGame)Game).GFXManager.TextureFromResource(GFXTypes.PreLoginUI, 40);
 			_setSize(bgTexture.Width, bgTexture.Height);
@@ -62,10 +65,31 @@
 			ok.SetParent(this);
 			dlgButtons.Add(ok);

-			scrollBar = new ScrollBar(this, new Vector2(320, 66), new Vector2(16, 119), ScrollBarColors.LightOnMed);
+			_scrollBar = new ScrollBar(this, new Vector2(320, 66), new Vector2(16, 119), ScrollBarColors.LightOnMed);
 			MessageText = msgText;

 			endConstructor();
+		}
+
+		public ScrollingMessageDialog(INativeGraphicsManager gfxManager,
+									  IGraphicsDeviceProvider graphicsDeviceProvider,
+									  IGameStateProvider gameStateProvider)
+		{
+			_font = Game.Content.Load<SpriteFont>(Constants.FontSize08);
+			_textSplitter = new TextSplitter("", _font);
+
+			bgTexture = gfxManager.TextureFromResource(GFXTypes.PreLoginUI, 40);
+			_setSize(bgTexture.Width, bgTexture.Height);
+
+			var ok = new XNAButton(smallButtonSheet, new Vector2(138, 197), _getSmallButtonOut(SmallButton.Ok), _getSmallButtonOver(SmallButton.Ok));
+			ok.OnClick += (sender, e) => Close(ok, XNADialogResult.OK);
+			ok.SetParent(this);
+			dlgButtons.Add(ok);
+
+			_scrollBar = new ScrollBar(this, new Vector2(320, 66), new Vector2(16, 119), ScrollBarColors.LightOnMed);
+			MessageText = "";
+
+			CenterAndFixDrawOrder(graphicsDeviceProvider, gameStateProvider);
 		}

 		public override void Draw(GameTime gt)
@@ -74,19 +98,19 @@
 				return;

 			base.Draw(gt);
-			if (scrollBar == null) return; //prevent nullreferenceexceptions
+			if (_scrollBar == null) return; //prevent nullreferenceexceptions

 			SpriteBatch.Begin();
-			Vector2 pos = new Vector2(27 + (int)DrawLocation.X, 69 + (int)DrawLocation.Y);
+			var pos = new Vector2(27 + (int)DrawLocation.X, 69 + (int)DrawLocation.Y);

-			for (int i = scrollBar.ScrollOffset; i < scrollBar.ScrollOffset + scrollBar.LinesToRender; ++i)
+			for (int i = _scrollBar.ScrollOffset; i < _scrollBar.ScrollOffset + _scrollBar.LinesToRender; ++i)
 			{
-				if (i >= chatStrings.Count)
+				if (i >= _chatStrings.Count)
 					break;

-				string strToDraw = chatStrings[i];
+				var strToDraw = _chatStrings[i];

-				SpriteBatch.DrawString(EOGame.Instance.DBGFont, strToDraw, new Vector2(pos.X, pos.Y + (i - scrollBar.ScrollOffset) * 13), Constants.LightGrayText);
+				SpriteBatch.DrawString(_font ?? EOGame.Instance.DBGFont, strToDraw, new Vector2(pos.X, pos.Y + (i - _scrollBar.ScrollOffset) * 13), Constants.LightGrayText);
 			}

 			SpriteBatch.End();


Fixed a bug that caused a NullReferenceException, if no save file existed yet

--- Espera/Espera.View/ViewModels/ShellViewModel.cs
+++ Espera/Espera.View/ViewModels/ShellViewModel.cs
@@ -625,7 +625,7 @@

         private string GetNewPlaylistName()
         {
-            string newName = this.playlists
+            string newName = (this.playlists ?? Enumerable.Empty<PlaylistViewModel>())
                 .Select(playlist => playlist.Name)
                 .CreateUnique(i =>
                     {


singletons

singletons

--- Fetcher/artm.MvxPlugins.Fetcher.Touch/Plugin.cs
+++ Fetcher/artm.MvxPlugins.Fetcher.Touch/Plugin.cs
@@ -13,15 +13,13 @@
         public void Load()
         {
             Mvx.ConstructAndRegisterSingleton<IFetcherLoggerService, FetcherLoggerService>();
-            Mvx.RegisterType<IFetcherWebService, FetcherWebService>();
+            Mvx.ConstructAndRegisterSingleton<IFetcherWebService, FetcherWebService>();
             Mvx.ConstructAndRegisterSingleton<IFetcherRepositoryStoragePathService, FetcherRepositoryStoragePathService>();
             Mvx.LazyConstructAndRegisterSingleton<IFetcherRepositoryService>(() => new FetcherRepositoryService(Mvx.Resolve<IFetcherLoggerService>(), () => CreateConnection(Mvx.Resolve<IFetcherRepositoryStoragePathService>())));
             Mvx.ConstructAndRegisterSingleton<IFetcherService, FetcherService>();
-
-            // Force construction of singletons
+
+            // Ensure database tables are created
             var repository = Mvx.Resolve<IFetcherRepositoryService>() as FetcherRepositoryService;
-
-            // Ensure database tables are created
             Task.Run(async () => await repository.Initialize());
         }


Fix for changes to ReduceOrder

Fix for changes to ReduceOrder

If ReduceOrder is changed while items are collapsed they stayed collapsed without this fix.
With this fix the initial state is restored by increasing the size according to the previous ReduceOrder.

--- Fluent.Ribbon/Controls/RibbonGroupsContainer.cs
+++ Fluent.Ribbon/Controls/RibbonGroupsContainer.cs
@@ -40,9 +40,16 @@
         private static void ReduceOrderPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
         {
             var ribbonPanel = (RibbonGroupsContainer)d;
+
+            for (var i = ribbonPanel.reduceOrderIndex; i < ribbonPanel.reduceOrder.Length - 1; i++)
+            {
+                ribbonPanel.IncreaseGroupBoxSize(ribbonPanel.reduceOrder[i]);
+            }
+
             ribbonPanel.reduceOrder = ((string)e.NewValue).Split(new[] { ',', ' ' }, StringSplitOptions.RemoveEmptyEntries);
-            ribbonPanel.reduceOrderIndex = ribbonPanel.reduceOrder.Length - 1;
-
+            var newReduceOrderIndex = ribbonPanel.reduceOrder.Length - 1;
+            ribbonPanel.reduceOrderIndex = newReduceOrderIndex;
+
             ribbonPanel.InvalidateMeasure();
             ribbonPanel.InvalidateArrange();
         }


[Event Hubs Client] Track Two: Third Preview (Event Data Mocking)

Correcting a design oversight for the current incarnation of `SystemProperties`
within `EventData` where accessibility for mocking and testing was inadvertently
limited due to setting as `internal`.   Allowing `protected` access to support
mocking.

--- sdk/eventhub/Azure.Messaging.EventHubs/src/EventData.cs
+++ sdk/eventhub/Azure.Messaging.EventHubs/src/EventData.cs
@@ -85,7 +85,7 @@
         ///   This property is only populated for events received from the Event Hubs service.
         /// </remarks>
         ///
-        public string PartitionKey => SystemProperties.PartitionKey;
+        public string PartitionKey => SystemProperties?.PartitionKey;

         /// <summary>
         ///   Initializes a new instance of the <see cref="EventData"/> class.
@@ -116,7 +116,7 @@
         ///   operations.
         /// </summary>
         ///
-        internal SystemEventProperties SystemProperties { get; set; }
+        protected internal SystemEventProperties SystemProperties { get; set; }

         /// <summary>
         ///   Determines whether the specified <see cref="System.Object" /> is equal to this instance.
@@ -151,13 +151,13 @@
         ///   The set of event properties which are owned and populated by the Event Hubs service.
         /// </summary>
         ///
-        internal sealed class SystemEventProperties
+        protected internal sealed class SystemEventProperties
         {
             /// <summary>
             ///   Initializes a new instance of the <see cref="SystemEventProperties"/> class.
             /// </summary>
             ///
-            internal SystemEventProperties()
+            public SystemEventProperties()
             {
             }

@@ -165,13 +165,13 @@
             ///   The logical sequence number of the <see cref="EventData" /> within the partition stream of the Event Hub.
             /// </summary>
             ///
-            public long SequenceNumber { get; internal set; }
+            public long SequenceNumber { get; set; }

             /// <summary>
             ///   The date and time, in UTC, that the <see cref="EventData" /> was received by the partition.
             /// </summary>
             ///
-            public DateTimeOffset EnqueuedTime { get; internal set; }
+            public DateTimeOffset EnqueuedTime { get; set; }

             /// <summary>
             ///   The offset of the <see cref="EventData" /> relative to the Event Hub partition stream.
@@ -182,13 +182,13 @@
             ///   identifier is unique within a partition of the Event Hubs stream.
             /// </remarks>
             ///
-            public long Offset { get; internal set; }
+            public long Offset { get; set; }

             /// <summary>
             ///   The partition hashing key applied to the batch that the associated <see cref="EventData"/>, was sent with.
             /// </summary>
             ///
-            public string PartitionKey { get; internal set; }
+            public string PartitionKey { get; set; }

             /// <summary>
             ///   Determines whether the specified <see cref="System.Object" /> is equal to this instance.


Support click-through in BrowserWindow

Support click-through in BrowserWindow

Now BrowserWindow.Clickable will change whether or not mouse clicks
go through it.

--- BrowserWindow.xaml.cs
+++ BrowserWindow.xaml.cs
@@ -1,18 +1,57 @@
 using CefSharp.Wpf;
+using System;
 using System.Windows;
 using System.Windows.Interop;
+using System.Runtime.InteropServices;

 namespace Cactbot
 {
     public partial class BrowserWindow : Window
     {
+        [DllImport("user32.dll")]
+        static extern int GetWindowLong(IntPtr hWnd, int nIndex);
+
+        [DllImport("user32.dll")]
+        static extern int SetWindowLong(IntPtr hWnd, int nIndex, int dwNewLong);
+
         public BrowserWindow()
         {
             InitializeComponent();
         }

+        private bool clickable = true;
+        public bool Clickable
+        {
+            get { return clickable; }
+            set
+            {
+                if (clickable == value)
+                    return;
+
+                IntPtr handle = new WindowInteropHelper(this).Handle;
+                if (handle == IntPtr.Zero)
+                    return;
+
+                clickable = value;
+
+                const int getWindowLongExStyle = -20;
+                const int transparent = 0x20;
+                const int layered = 0x80000;
+
+                int exStyle = GetWindowLong(handle, getWindowLongExStyle);
+                if (clickable)
+                    exStyle = exStyle & ~transparent & ~layered;
+                else
+                    exStyle = exStyle | transparent | layered;
+                SetWindowLong(handle, getWindowLongExStyle, exStyle);
+            }
+        }
+
         private void Window_Activated(object sender, System.EventArgs e)
         {
+            // Delay until window has a handle.
+            Clickable = false;
+
             // Terrible hack to fix missing content: http://stackoverflow.com/a/597055
             // This is the source of the delay before the window appears.
             this.Width++;


reducing output noise

reducing output noise

--- DataConverters3D/Object3D/Object3D.cs
+++ DataConverters3D/Object3D/Object3D.cs
@@ -294,14 +294,14 @@
 				if (item is Object3D object3D)
 				{
 					object3D.RebuildLockCount--;
-					item.DebugDepth($"Decrease Lock Count {object3D.RebuildLockCount}");
+					//item.DebugDepth($"Decrease Lock Count {object3D.RebuildLockCount}");
 				}
 			}
 		}

 		public RebuildLock RebuildLock()
 		{
-			this.DebugDepth($"Increase Lock Count {RebuildLockCount}");
+			//this.DebugDepth($"Increase Lock Count {RebuildLockCount}");
 			return new Object3DRebuildLock(this);
 		}


Fixed the error 'Index out of range' when selecting a multiple of fetch count rows out-of-process.

git-svn-id: 1b52f0a7ed2a8098cb721f3b9b4408691a7bfc16@1046 c93b7781-d36b-0e4d-be4f-9d94f2a838be

--- Dataphor/Client/Server/LocalCursor.cs
+++ Dataphor/Client/Server/LocalCursor.cs
@@ -521,7 +521,7 @@
         public bool EOF()
         {
 			if (BufferActive())
-				return SourceEOF() && (FBufferIndex >= FBuffer.Count);
+				return SourceEOF() && ((FBuffer.Count == 0) || (FBufferIndex >= FBuffer.Count));
 			else
 				return SourceEOF();
 		}


build: Incremented patch version,

build: Incremented patch version,

to indicate that this fixes a bug.

--- CommonAssemblyInfo.cs
+++ CommonAssemblyInfo.cs
@@ -10,8 +10,8 @@
 [assembly: ComVisible(false)]
 [assembly: NeutralResourcesLanguage("en-US")]
 [assembly: AssemblyProduct("")]
-[assembly: AssemblyVersion("0.0.2")]
-[assembly: AssemblyInformationalVersion("0.0.3-pre03")]
+[assembly: AssemblyVersion("0.0.3")]
+[assembly: AssemblyInformationalVersion("0.0.3")]

 /*
  * Version 0.0.3


fix version

fix version

--- CommonAssemblyInfo.cs
+++ CommonAssemblyInfo.cs
@@ -4,4 +4,4 @@
 [assembly: AssemblyProduct("PropertyChanged")]
 [assembly: AssemblyCompany("Simon Cropp and Contributors")]
 [assembly: AssemblyDescription("Fody add-in for injecting INotifyPropertyChanged code into properties.")]
-[assembly: AssemblyVersion("2.1.5")]+[assembly: AssemblyVersion("2.2.0")]


Small fix (remove hardcoded album Id).

Small fix (remove hardcoded album Id).

--- Homunculus/MarekMotykaBot/Services/ImgurService.cs
+++ Homunculus/MarekMotykaBot/Services/ImgurService.cs
@@ -21,10 +21,10 @@
             _client = new ImgurClient(_configuration["tokens:imgurClient"], _configuration["tokens:imgurSecret"]);
         }

-        public async Task<string> GetRandomImageFromAlbum(string albumUrl)
+        public async Task<string> GetRandomImageFromAlbum(string albumId)
         {
             var endpoint = new GalleryEndpoint(_client);
-            var album = await endpoint.GetGalleryAlbumAsync("0M9vR");
+            var album = await endpoint.GetGalleryAlbumAsync(albumId);

             int randomImageIndex = _rng.Next(1, album.Images.Count());