Text in entries can now be changed

Text in entries can now be changed

--- Program.cs
+++ Program.cs
@@ -477,7 +477,7 @@
 					if ((Gtk.ResponseType)fcd.Run() == Gtk.ResponseType.Accept) {
 						SaveStateToFile (fcd.Filename);
 					}
-					fcd.Destroy ();
+					fcd.Destroy ();
 				});
 			};

@@ -503,7 +503,7 @@

 			// ----------------------------------------------------------------------------------------------------
 			m_buttonDirectoryChoose.Clicked += delegate(object o, EventArgs e) {
-
+
 				Gtk.FileChooserDialog fcd = new Gtk.FileChooserDialog ("Select output folder", m_mainWindow, FileChooserAction.SelectFolder,
 					"_Cancel", ResponseType.Cancel,
 					"_Choose", ResponseType.Accept);
@@ -523,7 +523,7 @@
 				String[] filenames = OpenFileChooser ("Select subtitles file in native language");
 				if (filenames == null)
 					return;
-
+
 				m_entryNativeLanguage.Text = AddFilesToEntry(m_entryNativeLanguage.Text, filenames, "Error in native language file entry field: ");
 			};

@@ -574,7 +574,7 @@
 			};

 			m_buttonSubOptionsApply.Clicked += delegate(object sender, EventArgs e) {
-
+
 				Gtk.Entry currentEntry = m_subOptionsWindow_subIndex == 0 ? m_entryTargetLanguage : m_entryNativeLanguage;
 				UtilsInputFiles allFiles = new UtilsInputFiles(currentEntry.Text);
 				allFiles.SetPropertiesOfFirstFile("enc", InfoEncoding.getEncodings()[m_comboboxSubEncoding.Active].ShortName);
@@ -644,10 +644,10 @@
 					if(!wasLineSelected[index])
 						m_treeviewSelectionLines.SelectPath(new TreePath(new int[]{index}));
 				m_ignoreLineSelectionChanges = false;
-
+
 				SelectEntry();
 			};
-
+
 			m_treeviewSelectionLines.Changed += delegate(object sender, EventArgs e) {
 				SelectEntry();
 			};
@@ -715,6 +715,21 @@
 				})).Start();

 			};
+
+			// ----------------------------------------------------------------------
+			// change entries when text in preview textviews is changed
+			m_textviewTargetLanguage.Buffer.Changed += delegate(object sender, EventArgs e) {
+				m_allEntryInfomation[m_selectedPreviewIndex].targetLanguageString = m_textviewTargetLanguage.Buffer.Text;
+				UpdatePreviewListEntry(m_selectedPreviewIndex);
+			};
+
+			// ----------------------------------------------------------------------
+			// change entries when text in preview textviews is changed
+			m_textviewNativeLanguage.Buffer.Changed += delegate(object sender, EventArgs e) {
+				m_allEntryInfomation[m_selectedPreviewIndex].nativeLanguageString = m_textviewNativeLanguage.Buffer.Text;
+				UpdatePreviewListEntry(m_selectedPreviewIndex);
+			};
+
 		}

 		///
@@ -833,6 +848,40 @@
 		}

 		///
+		/// XXX: documentation missing
+		///
+		private TreeIter GetTreeIterByIndex(int index) {
+			TreeIter treeIter;
+			if(!m_liststoreLines.GetIterFirst(out treeIter)) throw new Exception("No entry in list");
+			do {
+				if(index == 0) return treeIter;
+				index--;
+			} while(m_liststoreLines.IterNext(ref treeIter));
+
+			// index is not in list
+			throw new ArgumentOutOfRangeException();
+		}
+
+		///
+		/// XXX: documentation missing
+		///
+		private void UpdatePreviewListEntry(int index, TreeIter? treeIter = null) {
+			if(index < 0 || index >= m_allEntryInfomation.Count) throw new ArgumentOutOfRangeException(); // nothing to update
+			if(treeIter == null)
+				treeIter = GetTreeIterByIndex(index);  // TODO: cache this value
+
+			UtilsSubtitle.EntryInformation entryInfo = m_allEntryInfomation[index];
+
+			// if this entry is deactivated the line is colored grey with Pango's markup language
+			String beginString = entryInfo.isActive ? "" : "";
+			String endString = entryInfo.isActive ? "" : "";
+
+			// set values in list TODO: can there be an index change?
+			m_liststoreLines.SetValue(treeIter.Value, 0, beginString + entryInfo.targetLanguageString + endString);
+			m_liststoreLines.SetValue(treeIter.Value, 1, beginString + entryInfo.nativeLanguageString + endString);
+		}
+
+		///
 		/// This function sets all lines in the Gtk.TreeView to the values in m_allEntryInfomation.
 		/// The TreeView has to contain exactly the same number of elements as the list.
 		///
@@ -840,16 +889,8 @@

 			TreeIter treeIter;
 			if(!m_liststoreLines.GetIterFirst(out treeIter)) return;
-			foreach (UtilsSubtitle.EntryInformation entryInfo in m_allEntryInfomation) {
-
-				// if this entry is deactivated the line is colored grey with Pango's markup language
-				String beginString = entryInfo.isActive ? "" : "";
-				String endString = entryInfo.isActive ? "" : "";
-
-				// set values in list TODO: can there be an index change?
-				m_liststoreLines.SetValue(treeIter, 0, beginString + entryInfo.targetLanguageString + endString);
-				m_liststoreLines.SetValue(treeIter, 1, beginString + entryInfo.nativeLanguageString + endString);
-
+			for(int i = 0; i < m_allEntryInfomation.Count; i++) {
+				UpdatePreviewListEntry(i, treeIter);
 				if(!m_liststoreLines.IterNext(ref treeIter))
 					break; // error: the two list didn't have the same number of elements
 			}
@@ -1011,7 +1052,7 @@
 		///
 		/// <param name="settings">Settings.</param>
 		private static List<UtilsSubtitle.EntryInformation> GenerateEntryInformation(Settings settings, List<EpisodeInfo> episodeInfos, InfoProgress progressInfo) {
-
+
 			// read subtitles
 			List<List<LineInfo>> lineInfosPerEpisode_TargetLanguage = ReadAllSubtitleFiles(settings, settings.PerSubtitleSettings[0], episodeInfos, 0, progressInfo);
 			List<List<LineInfo>> lineInfosPerEpisode_NativeLanguage = ReadAllSubtitleFiles(settings, settings.PerSubtitleSettings[1], episodeInfos, 1, progressInfo);
@@ -1046,7 +1087,7 @@
 			// do not start another operation when there is already one
 			if (m_pendingOperation != PendingOperation.NOTHING)
 				return false;
-
+

 			m_pendingOperation = thisOperation;

@@ -1077,7 +1118,7 @@
 			Gtk.Entry currentEntry = subIndex == 0 ? m_entryTargetLanguage : m_entryNativeLanguage;
 			m_subOptionsWindow_subIndex = subIndex;

-			// read properties of first file to get selected stream and
+			// read properties of first file to get selected stream and show them in combobox
 			UtilsInputFiles uif = new UtilsInputFiles(currentEntry.Text);
 			List<UtilsInputFiles.FileDesc> fileDescs = uif.GetFileDescriptions ();

@@ -1126,7 +1167,7 @@
 			}
 			if(selectedEntry_SubStreams >= 0)
 				m_comboboxSubStream.Active = selectedEntry_SubStreams;
-
+

 			// fill encodings in subtitle options
 			m_liststoreSubEncoding.Clear();
@@ -1147,8 +1188,8 @@
 				m_comboboxSubEncoding.Active = utf8index;
 			else
 				m_comboboxSubEncoding.Active = 0;
-
-
+
+
 			m_subtitleOptionsWindow.ShowAll ();
 		}

@@ -1175,7 +1216,7 @@
 		}

 		///
-		/// Update image and text view to match "selectedIndex". Can be in a different thread then Gtk-Thread. It will extract the image, so
+		/// Update image and text view to match "selectedIndex". Can be in a different thread then Gtk-Thread. It will extract the image, so
 		/// it can take 1-2 seconds.
 		///
 		/// <param name="selectedIndex">Selected index.</param>
@@ -1184,7 +1225,7 @@
 			// do not select currently selected entry again
 			if (selectedIndex == m_selectedPreviewIndex || selectedIndex < 0 || selectedIndex >= m_allEntryInfomation.Count)
 				return;
-
+
 			m_selectedPreviewIndex = selectedIndex;
 			UtilsSubtitle.EntryInformation entryInfo = m_allEntryInfomation [selectedIndex];

@@ -1216,7 +1257,7 @@
 			foreach (UtilsSubtitle.EntryInformation entryInfo in m_allEntryInfomation)
 				m_liststoreLines.AppendValues (entryInfo.targetLanguageString, entryInfo.nativeLanguageString);
 		}
-
+

 		private string ReadResourceString(String resourceName) {
 			var assembly = Assembly.GetExecutingAssembly ();
@@ -1347,9 +1388,9 @@
 			if(String.IsNullOrWhiteSpace(settings.OutputDirectoryPath))
 				throw new Exception ("No output directory selected.");

-			if(!Directory.Exists(settings.OutputDirectoryPath))
+			if(!Directory.Exists(settings.OutputDirectoryPath))
 				throw new Exception ("Selected output directory does not exist.");
-
+

 			if (!String.IsNullOrWhiteSpace (settings.NativeFilePath))
 				TryParseInputFilesString (settings.NativeFilePath, "Error in native language file entry: ");
@@ -1420,7 +1461,7 @@
 		}

 		private void ClearErrorMessages() {
-
+
 		}

@@ -1434,7 +1475,7 @@
 			}
 			Console.WriteLine (args.ExceptionObject.ToString ());
 		}
-
+
 		public static void Main (string[] args)
 		{
 			// ensure that the temporary path ("/tmp/subs2srs4linux") exists
@@ -1475,4 +1516,4 @@
 		}
 	}
 }
-
+


Removed redundant cast

Removed redundant cast

--- PiCross/Domain/PiCross/Game/Archiver.cs
+++ PiCross/Domain/PiCross/Game/Archiver.cs
@@ -48,8 +48,7 @@
             {
                 foreach ( var libraryEntry in library.Entries )
                 {
-                    // TODO Remove cast
-                    WriteLibraryEntry( (LibraryEntry) libraryEntry );
+                    WriteLibraryEntry( libraryEntry );
                 }
             }


load default setting if config.json is not found

--- Program.cs
+++ Program.cs
@@ -21,7 +21,10 @@

         private static void Execute(string[] args)
         {
-            Config config = JsonConvert.DeserializeObject<Config>(File.ReadAllText("config.json"));
+            string configPath = "config.json";
+            Config config = File.Exists(configPath) ?
+                JsonConvert.DeserializeObject<Config>(File.ReadAllText(configPath)) :
+                new Config { TrimWhitespacesFromResults = true, DisplayDebugInfoOnError = true, UseConsoleCodes = true };

             CommandLine.ApplyCommandLineArguments(args, config);


Reimplemented the Transform function very similarly to the Then fns.

--- Promise.cs
+++ Promise.cs
@@ -590,19 +590,29 @@
             var resultPromise = new Promise<ConvertedT>();
             resultPromise.WithName(Name);

-            this.Catch(e => resultPromise.Reject(e))
-                .Then(v =>
-                {
-                    try
-                    {
-                        var transformedValue = transform(v);
-                        resultPromise.Resolve(transformedValue);
-                    }
-                    catch (Exception ex)
-                    {
-                        resultPromise.Reject(ex);
-                    }
-                });
+            Action<PromisedT> resolveHandler = v =>
+            {
+                resultPromise.Resolve(transform(v));
+            };
+
+            Action<Exception> rejectHandler = ex =>
+            {
+                resultPromise.Reject(ex);
+            };
+
+            if (CurState == PromiseState.Resolved)
+            {
+                InvokeHandler(resolveHandler, resultPromise, resolveValue);
+            }
+            else if (CurState == PromiseState.Rejected)
+            {
+                InvokeHandler(rejectHandler, resultPromise, rejectionException);
+            }
+            else
+            {
+                AddResolveHandler(resolveHandler, resultPromise);
+                AddRejectHandler(rejectHandler, resultPromise);
+            }

             return resultPromise;
         }


Combine checks

Combine checks

--- PoE-TradeUI/PoE-TradeUI.Core/PoeGame.cs
+++ PoE-TradeUI/PoE-TradeUI.Core/PoeGame.cs
@@ -93,24 +93,20 @@
                     SetWindowState(false, true, true);
                     break;
                 case HookEvent.EVENT_SYSTEM_MINIMIZESTART:
-                    if (!_windowState.Open) break;
-                    if (e.HWnd != _poeHandle) break;
-                    if (_windowState.Minimized) break;
+                    if (!_windowState.Open || e.HWnd != _poeHandle || _windowState.Minimized) break;
                     SetWindowState(true, true, false);
                     break;
                 case HookEvent.EVENT_SYSTEM_MOVESIZEEND:
-                    if (!_windowState.Open) break;
-                    if (e.HWnd != _poeHandle) break;
+                    if (!_windowState.Open || e.HWnd != _poeHandle) break;
                     SetWindowSize();
                     break;
                 case HookEvent.EVENT_OBJECT_LOCATIONCHANGE:
-                    if (!_windowState.Open) break;
-                    if (e.HWnd != _poeHandle || _windowState.Minimized) break;
+                    if (!_windowState.Open || e.HWnd != _poeHandle || _windowState.Minimized) break;
                     SetWindowSize();
                     break;
                 case HookEvent.EVENT_OBJECT_DESTROY:
-                    if (!_windowState.Open) break;
-                    if(e.HWnd == _poeHandle) SetWindowState(false, false, false);
+                    if (!_windowState.Open || e.HWnd != _poeHandle) break;
+                    SetWindowState(false, false, false);
                     break;
                 case HookEvent.EVENT_OBJECT_CREATE:
                     if (_windowState.Open) break;


* catch additional exception in TarArchive#ctor * correct doc comment related to mentioned exception

--- Archives/TarArchive.cs
+++ Archives/TarArchive.cs
@@ -207,7 +207,7 @@
         /// </summary>
         /// <param name="stream">The stream containing the archive's bytes.</param>
         /// <exception cref="System.IO.IOException">
-        ///     Thrown when a temporary file could not be opened for writing.
+        ///     Thrown when a temporary file could not be opened.
         /// </exception>
         /// <exception cref="System.IO.InvalidDataException">
         ///     Thrown when the stream's length is shorter than the length of
@@ -250,8 +250,15 @@
             catch (IOException ioex)
             {
                 throw new IOException(
-                    "Could not open temporary file.",
+                    "Could not open a temporary file.",
                     ioex
+                    );
+            }
+            catch (UnauthorizedAccessException uaex)
+            {
+                throw new IOException(
+                    "Could not open a temporary file.",
+                    uaex
                     );
             }


changed door functions to void lol

changed door functions to void lol

--- Assets/Scripts/Door.cs
+++ Assets/Scripts/Door.cs
@@ -6,14 +6,14 @@
 public class Door : MonoBehaviour {
 	bool open = false;

-	public bool Close(){
+	public void Close(){
 		if (open) {
 			open = false;
 		} else {
 			throw new Exception ("door is already closed");
 		}
 	}
-	public bool Open(){
+	public void Open(){
 		if (!open) {
 			open = true;
 		} else {


score slider changed to level complete time

--- Assets/Scripts/Game.cs
+++ Assets/Scripts/Game.cs
@@ -127,9 +127,9 @@
     private void updateIngameUI()
     {
         scoreText.text = string.Format("{0:0.##}", score);
-        scoreMaxSlider.value = IsGameRunning() ?
-           1 - ((enemy.transform.position - playingField.GetEndField().transform.position).magnitude /
-                maxDistance) : scoreMaxSlider.value;
+        float temp = score/FindObjectOfType<LevelGenerator>().selectedLevelTimeWin;
+        Mathf.Clamp(temp, 0, 1);
+        scoreMaxSlider.value = IsGameRunning() ? temp : scoreMaxSlider.value;
     }

     private void updateHighscore()


Fixed offset error

Fixed offset error

--- Assets/Scripts/Path.cs
+++ Assets/Scripts/Path.cs
@@ -41,11 +41,11 @@
         {
             if (a.x > b.x)
             {
-                AddSegmentWaypoints(waypoints, a, b, new Vector3(-mainOffset, 0, 0), new Vector3(sideOffset, 0, 0));
+                AddSegmentWaypoints(waypoints, a, b, new Vector3(-mainOffset, 0, 0), new Vector3(0, 0, sideOffset));
             }
             else
             {
-                AddSegmentWaypoints(waypoints, a, b, new Vector3(mainOffset, 0, 0), new Vector3(-sideOffset, 0, 0));
+                AddSegmentWaypoints(waypoints, a, b, new Vector3(mainOffset, 0, 0), new Vector3(0, 0, -sideOffset));
             }
         }


Fixed Sun behaviour

Fixed Sun behaviour

--- Assets/SunBehaviour.cs
+++ Assets/SunBehaviour.cs
@@ -2,7 +2,6 @@
 using System.Collections;

 public class SunBehaviour : MonoBehaviour {
-<<<<<<< HEAD

 	public AudioSource audioSource;


Adds default value support to RadioButtonList data editor setting type

--- components/editorControls/SettingControls/RadioButtonList.cs
+++ components/editorControls/SettingControls/RadioButtonList.cs
@@ -35,7 +35,10 @@
                 rbl.Items.Add(s);
             }

-            rbl.SelectedValue = _val;
+            if (string.IsNullOrEmpty(_val) && !string.IsNullOrEmpty(DefaultValue))
+                rbl.SelectedValue = DefaultValue;
+            else
+                rbl.SelectedValue = _val;

             return rbl;
         }


clarify comment

clarify comment

--- PowerAssert/Hints/BrokenEqualityHint.cs
+++ PowerAssert/Hints/BrokenEqualityHint.cs
@@ -38,7 +38,8 @@

                 if (binE.Method != null)
                     declaringType = binE.Method.DeclaringType;
-                else declaringType = typeof (object); // this should never happen ;)
+                else
+                    declaringType = typeof (object); // this should never happen - the hints are only called when the assert fails
             }

             if (left != null && left == right)


To test perf, measure big segment

To test perf, measure big segment

--- Turing.Perf/Program.cs
+++ Turing.Perf/Program.cs
@@ -11,7 +11,7 @@
 {
     class Program
     {
-        const int Size = 10000000;
+        const int Size = ((10000000 / TuringTransform.BlockSizeBytes) + 1) * TuringTransform.BlockSizeBytes;
         const int NumberOfRuns = 5;

         Tuple<TimeSpan,int> DoRun(ICryptoTransform transform, byte [] clear, byte [] cipher)
@@ -19,9 +19,7 @@
             var stopwatch = new Stopwatch();

             stopwatch.Start();
-            int count = 0;
-            while (count < Size)
-                count += transform.TransformBlock(clear, 0, transform.InputBlockSize / 8, cipher, 0);
+            int count = transform.TransformBlock(clear, 0, Size, cipher, 0);
             stopwatch.Stop();
             return Tuple.Create(stopwatch.Elapsed, count);
         }
@@ -39,7 +37,7 @@
             Console.WriteLine($"{name}: ");

             turing.Key = Encoding.ASCII.GetBytes("test key 128bits");
-            byte[] clear = new byte[340];
+            byte[] clear = new byte[Size];
             byte[] cipher = new byte[clear.Length];
             TimeSpan totalTime = new TimeSpan(0);
             int totalSize = 0;


Added copyright comment

Added copyright comment

--- RDFSharp/Model/Serializers/RDFTurtle.cs
+++ RDFSharp/Model/Serializers/RDFTurtle.cs
@@ -210,7 +210,8 @@
         }

         /// <summary>
-        /// Deserializes the given Turtle stream to a graph.
+        /// Deserializes the given Turtle stream to a graph.
+        /// (This algorythm is based on Sesame Turtle parser)
         /// </summary>
         internal static RDFGraph Deserialize(Stream inputStream) {
             try {


fix nvidia driver check for not-master build

--- CompatBot/Utils/ResultFormatters/LogParserResultFormatter.GeneralNotesSection.cs
+++ CompatBot/Utils/ResultFormatters/LogParserResultFormatter.GeneralNotesSection.cs
@@ -245,7 +245,8 @@
                                 notes.Add($"❗ Please update your nVidia GPU driver to at least version {NvidiaRecommendedOldWindowsVersion}");
                             if (items["os_type"] is string os
                                 && os != "Linux"
-                                && buildVersion < NvidiaFullscreenBugFixed)
+                                && buildVersion < NvidiaFullscreenBugFixed
+                                && items["build_branch"] == "HEAD")
                             {
                                 if (driverVersion >= NvidiaFullscreenBugMinVersion
                                     && driverVersion < NvidiaFullscreenBugMaxVersion


Move a code for beauty

Move a code for beauty

--- DotNetKit.Wpf.AutoCompleteComboBox/Windows/Controls/AutoCompleteComboBox.xaml.cs
+++ DotNetKit.Wpf.AutoCompleteComboBox/Windows/Controls/AutoCompleteComboBox.xaml.cs
@@ -118,13 +118,12 @@
             if (string.IsNullOrEmpty(text))
             {
                 IsDropDownOpen = false;
+                SelectedItem = null;

                 using (Items.DeferRefresh())
                 {
                     Items.Filter = null;
                 }
-
-                SelectedItem = null;
             }
             else if (SelectedItem != null && TextFromItem(SelectedItem) == text)
             {


Fix CancelChanges

Fix CancelChanges

--- ObservableEntitiesLightTracking/ObservableEntitiesLightTracking/OEEntityEntry.cs
+++ ObservableEntitiesLightTracking/ObservableEntitiesLightTracking/OEEntityEntry.cs
@@ -40,9 +40,9 @@

         private void InitializeOriginalValues()
         {
-            foreach (var property in this.GetType().GetProperties().Where(p => p.GetSetMethod() != null))
+            foreach (var property in _entity.GetType().GetProperties().Where(p => p.GetSetMethod() != null))
             {
-                _originalValues.Add(property.Name, property.GetValue(this));
+                _originalValues.Add(property.Name, property.GetValue(_entity));
             }
         }

@@ -50,7 +50,7 @@
         {
             foreach (var property in _entity.GetType().GetProperties().Where(p => p.GetSetMethod() != null))
             {
-                if (_originalValues.ContainsKey(property.Name) && property.GetValue(this) != _originalValues[property.Name])
+                if (_originalValues.ContainsKey(property.Name) && property.GetValue(_entity) != _originalValues[property.Name])
                 {
                     property.SetValue(_entity, _originalValues[property.Name]);
                 }


Functional adding and removing of subscriptions

--- PART/Source/CprBroker/Web/Views/SubscriptionDataProvider/DataProviderView.cshtml
+++ PART/Source/CprBroker/Web/Views/SubscriptionDataProvider/DataProviderView.cshtml
@@ -25,7 +25,7 @@
                         fieldSubscriptions = new string[0];

-

+

                             @field

                         @{int i = 0;}
@@ -33,11 +33,11 @@
                         {
                             foreach (var fieldLookup in fieldLookups)
                             {
-

+                                <div222 class="@{Output.Write((i++ % 2 == 0)? "Row222" : "AlternateRow222");}">
                                     @{var id = field.Trim() + "_" + @fieldLookup.Key;}
                                     <input type="checkbox" name="chkSubscription" checked="@fieldSubscriptions.Contains(fieldLookup.Key)" value="@fieldLookup.Key" id="@id" field="@field" />
                                     @fieldLookup.Value
-

+                                </div222>
                             }
                         }
                         else
@@ -50,14 +50,17 @@
                             {
                                 foreach (var fieldSubscription in fieldSubscriptions)
                                 {
-
@fieldSubscription

+

+                                        @fieldSubscription
+                                        <button class="CommandButton222" name="removeSubscription" field="@field" fieldValue="@fieldSubscription">X</button>
+

                                 }
                             }
                             var addTextBoxId = field.Replace(" ", "") + "_new";

                             <input type="text" id="@addTextBoxId" field="@field" />

-                                <button class="CommandButton" textboxid="@addTextBoxId" name="addSubscription">Add</button>
+                                <button class="CommandButton222" textboxid="@addTextBoxId" name="addSubscription">Add</button>

                         }

@@ -76,16 +79,49 @@
         var field = txt.attr('field');
         var value = txt.val();
         var dataProviderId = '@Model.Item2';
-        var url = '/mvc/pages/dataproviders/' + dataProviderId + '/addsubscription/' + field + '/' + value;
+        var url = '/mvc/pages/dataproviders/' + dataProviderId + '/putsubscription/' + field + '/' + value;

         $.get(url)
             .done(function (data, textStatus, jqXHR) {
                 // reload the page or section
-                alert(textStatus);
             })
             .fail(function (data, textStatus) {
                 alert('failed');
             });
-        alert(url);
+    });
+
+    $('[name="removeSubscription"]').click(function () {
+        var field = this.getAttribute('field');
+        var value = this.getAttribute('fieldValue');
+        var dataProviderId = '@Model.Item2';
+        var url = '/mvc/pages/dataproviders/' + dataProviderId + '/removesubscription/' + field + '/' + value;
+
+        $.get(url)
+            .done(function (data, textStatus, jqXHR) {
+                // reload the page or section
+            })
+            .fail(function (data, textStatus) {
+                alert('failed');
+            });
+    });
+
+    $('[name="chkSubscription"]').click(function () {
+        var chk = this;
+        var field = this.getAttribute('field');
+        var value = this.getAttribute('value');
+        var dataProviderId = '@Model.Item2';
+
+        var url = '/mvc/pages/dataproviders/' + dataProviderId
+            + ((this.checked) ? '/putsubscription/' : '/removesubscription/')
+            + field + '/' + value;
+
+        $.get(url)
+            .done(function (data, textStatus, jqXHR) {
+                // reload the page or section
+            })
+            .fail(function (data, textStatus) {
+                alert('failed');
+                chk.checked = !chk.checked;
+            });
     })
 </script>


added ConfigureAwait(false)

added ConfigureAwait(false)

one of async method call missed ConfigureAwait(false) (changeset 1220131)

--- Src/Workspaces/Core/Workspace/Host/SyntaxTreeStorage/SyntaxTreeStorageService.cs
+++ Src/Workspaces/Core/Workspace/Host/SyntaxTreeStorage/SyntaxTreeStorageService.cs
@@ -114,7 +114,7 @@
                 return null;
             }

-            using (var stream = await storage.ReadStreamAsync(cancellationToken))
+            using (var stream = await storage.ReadStreamAsync(cancellationToken).ConfigureAwait(false))
             {
                 return service.DeserializeNodeFrom(stream, cancellationToken);
             }


Skipping add_ and remove_ special methods as they are handled in a special loop. Thus preventing them from being generated more than once.

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

--- Tools/Castle.DynamicProxy2/Castle.DynamicProxy/Generators/ClassProxyGenerator.cs
+++ Tools/Castle.DynamicProxy2/Castle.DynamicProxy/Generators/ClassProxyGenerator.cs
@@ -35,8 +35,7 @@
 	{
 		private bool delegateToBaseGetObjectData = false;

-		public ClassProxyGenerator(ModuleScope scope, Type targetType)
-			: base(scope, targetType)
+		public ClassProxyGenerator(ModuleScope scope, Type targetType): base(scope, targetType)
 		{
 		}

@@ -44,7 +43,6 @@
 		{
 			Type type;

-
 			ReaderWriterLock rwlock = Scope.RWLock;

 			rwlock.AcquireReaderLock(-1);
@@ -85,11 +83,15 @@
 				}

 				AddDefaultInterfaces(interfaceList);
+
 				if (targetType.IsSerializable)
 				{
 					delegateToBaseGetObjectData = VerifyIfBaseImplementsGetObjectData(targetType);
+
 					if (!interfaceList.Contains(typeof(ISerializable)))
+					{
 						interfaceList.Add(typeof(ISerializable));
+					}
 				}

 				ClassEmitter emitter = BuildClassEmitter(newName, targetType, interfaceList);
@@ -170,7 +172,9 @@

 				foreach(MethodInfo method in methods)
 				{
-					if (method.IsSpecialName && (method.Name.StartsWith("get_") || method.Name.StartsWith("set_")) ||
+					if (method.IsSpecialName &&
+						(method.Name.StartsWith("get_") || method.Name.StartsWith("set_") ||
+						method.Name.StartsWith("add_") || method.Name.StartsWith("remove_")) ||
 					    methodsToSkip.Contains(method))
 					{
 						continue;


Added trapping disc i/o errors

Added trapping disc i/o errors

--- BEurtle/IssueDetail.cs
+++ BEurtle/IssueDetail.cs
@@ -322,7 +322,8 @@
         }
         private void SaveAsFile(Stream s)
         {
-            XPathNavigator comment = commentToUUID[Comments.SelectedNode].Item2;
+            XPathNavigator comment = commentToUUID.ContainsKey(Comments.SelectedNode) ? commentToUUID[Comments.SelectedNode].Item2 : null;
+            if (comment == null) throw new Exception("Comment not found");
             var commentbody = comment.SelectSingleNode("body").ToString();
             var commenttype = comment.SelectSingleNode("content-type").ToString();
             if (commenttype.StartsWith("text/"))
@@ -458,12 +459,19 @@

         private void LoadAttachment_Click(object sender, EventArgs e)
         {
-            if (DialogResult.OK == openFileDialog.ShowDialog())
-            {
-                using (var s = openFileDialog.OpenFile())
-                {
-                    LoadFromFile(s);
-                }
+            try
+            {
+                if (DialogResult.OK == openFileDialog.ShowDialog())
+                {
+                    using (var s = openFileDialog.OpenFile())
+                    {
+                        LoadFromFile(s);
+                    }
+                }
+            }
+            catch (Exception ex)
+            {
+                MessageBox.Show(this, "Error when loading file: " + ex.ToString(), "Error from BEurtle", MessageBoxButtons.OK, MessageBoxIcon.Error);
             }
         }

@@ -594,14 +602,21 @@
           };
         private void SaveAttachment_Click(object sender, EventArgs e)
         {
-            var ext = MIMETypesDictionary.ContainsKey(DraggableIcon.Items[0].Text) ? MIMETypesDictionary[DraggableIcon.Items[0].Text] : "bin";
-            saveFileDialog.DefaultExt=ext;
-            saveFileDialog.FileName = "comment." + ext;
-            saveFileDialog.Filter = DraggableIcon.Items[0].Text + " (*." + ext + ")|" + ext;
-            if (DialogResult.OK == saveFileDialog.ShowDialog())
-            {
-                using (var s = saveFileDialog.OpenFile())
-                    SaveAsFile(s);
+            try
+            {
+                var ext = MIMETypesDictionary.ContainsKey(DraggableIcon.Items[0].Text) ? MIMETypesDictionary[DraggableIcon.Items[0].Text] : "bin";
+                saveFileDialog.DefaultExt = ext;
+                saveFileDialog.FileName = "comment." + ext;
+                saveFileDialog.Filter = DraggableIcon.Items[0].Text + " (*." + ext + ")|" + ext;
+                if (DialogResult.OK == saveFileDialog.ShowDialog())
+                {
+                    using (var s = saveFileDialog.OpenFile())
+                        SaveAsFile(s);
+                }
+            }
+            catch (Exception ex)
+            {
+                MessageBox.Show(this, "Error when saving file: " + ex.ToString(), "Error from BEurtle", MessageBoxButtons.OK, MessageBoxIcon.Error);
             }
         }

@@ -612,10 +627,10 @@
             private bool disposed = false;
             public TemporarySaveFile(IssueDetail form)
             {
-                var comment = form.commentToUUID[form.Comments.SelectedNode];
+                var comment = form.commentToUUID.ContainsKey(form.Comments.SelectedNode) ? form.commentToUUID[form.Comments.SelectedNode] : null;
                 var ext = MIMETypesDictionary.ContainsKey(form.DraggableIcon.Items[0].Text) ? MIMETypesDictionary[form.DraggableIcon.Items[0].Text] : "bin";
                 string tempfilepath = Path.GetTempPath() + "BEurtle";
-                tempfilename = tempfilepath + @"\comment-" + comment.Item1 + "." + ext;
+                tempfilename = tempfilepath + @"\comment-" + (comment!=null ? comment.Item1 : "new") + "." + ext;
                 if (!Directory.Exists(tempfilepath)) Directory.CreateDirectory(tempfilepath);
                 data = new FileStream(tempfilename, FileMode.Create, FileAccess.ReadWrite, FileShare.Delete | FileShare.ReadWrite);
                 form.SaveAsFile(data);
@@ -654,42 +669,56 @@
         }
         private void DraggableIcon_DoubleClick(object sender, EventArgs e)
         {
-            using (var tsf = new TemporarySaveFile(this))
-            {
-                tsf.data.Close();
-                try
-                {
-                    this.UseWaitCursor = true;
-                    var result = System.Diagnostics.Process.Start(tsf.tempfilename);
-                    result.WaitForInputIdle();
-                }
-                finally
-                {
-                    this.UseWaitCursor = false;
-                }
+            try
+            {
+                using (var tsf = new TemporarySaveFile(this))
+                {
+                    tsf.data.Close();
+                    try
+                    {
+                        this.UseWaitCursor = true;
+                        var result = System.Diagnostics.Process.Start(tsf.tempfilename);
+                        result.WaitForInputIdle();
+                    }
+                    finally
+                    {
+                        this.UseWaitCursor = false;
+                    }
+                }
+            }
+            catch (Exception ex)
+            {
+                MessageBox.Show(this, "Error when launching file: " + ex.ToString(), "Error from BEurtle", MessageBoxButtons.OK, MessageBoxIcon.Error);
             }
         }

         private void DraggableIcon_ItemDrag(object sender, ItemDragEventArgs e)
         {
-            using (var tsf = new TemporarySaveFile(this))
-            {
-                DataObject obj = new DataObject();
-                if (DraggableIcon.Items[0].Text.StartsWith("text/"))
-                {
-                    string data_ = new StreamReader(tsf.data).ReadToEnd();
-                    obj.SetText(data_, DraggableIcon.Items[0].Text == "text/html" ? TextDataFormat.Html : TextDataFormat.UnicodeText);
-                }
-                else if (DraggableIcon.Items[0].Text.StartsWith("image/"))
-                {
-                    var data_ = new Bitmap(tsf.data);
-                    obj.SetImage(data_);
-                }
-                else
-                    obj.SetData(tsf.data);
-                tsf.data.Close();
-                obj.SetData(DataFormats.FileDrop, true, new String[] { tsf.tempfilename });
-                DraggableIcon.DoDragDrop(obj, DragDropEffects.All);
+            try
+            {
+                using (var tsf = new TemporarySaveFile(this))
+                {
+                    DataObject obj = new DataObject();
+                    if (DraggableIcon.Items[0].Text.StartsWith("text/"))
+                    {
+                        string data_ = new StreamReader(tsf.data).ReadToEnd();
+                        obj.SetText(data_, DraggableIcon.Items[0].Text == "text/html" ? TextDataFormat.Html : TextDataFormat.UnicodeText);
+                    }
+                    else if (DraggableIcon.Items[0].Text.StartsWith("image/"))
+                    {
+                        var data_ = new Bitmap(tsf.data);
+                        obj.SetImage(data_);
+                    }
+                    else
+                        obj.SetData(tsf.data);
+                    tsf.data.Close();
+                    obj.SetData(DataFormats.FileDrop, true, new String[] { tsf.tempfilename });
+                    DraggableIcon.DoDragDrop(obj, DragDropEffects.All);
+                }
+            }
+            catch (Exception ex)
+            {
+                MessageBox.Show(this, "Error when dragging file: " + ex.ToString(), "Error from BEurtle", MessageBoxButtons.OK, MessageBoxIcon.Error);
             }
         }

@@ -739,24 +768,31 @@
         {
             if (CommentEdit.Visible)
                 CommentAdd_Click(null, null);
-            // Load in preferred order
-            bool ishtml=false;
-            if ((ishtml = e.Data.GetDataPresent(DataFormats.Html)) || e.Data.GetDataPresent(DataFormats.UnicodeText))
-            {
-                string text = e.Data.GetData(ishtml ? DataFormats.Html : DataFormats.UnicodeText).ToString();
-                if (!ishtml) text = fixUp(text);
-                CommentBodyRaw.Text = CommentBody.Document.Body.InnerHtml = text;
-            }
-            else if (e.Data.GetDataPresent(DataFormats.FileDrop))
-            {
-                var files = (string[]) e.Data.GetData(DataFormats.FileDrop);
-                using(var s = new FileStream(files[0], FileMode.Open))
+            try
+            {
+                // Load in preferred order
+                bool ishtml = false;
+                if ((ishtml = e.Data.GetDataPresent(DataFormats.Html)) || e.Data.GetDataPresent(DataFormats.UnicodeText))
+                {
+                    string text = e.Data.GetData(ishtml ? DataFormats.Html : DataFormats.UnicodeText).ToString();
+                    if (!ishtml) text = fixUp(text);
+                    CommentBodyRaw.Text = CommentBody.Document.Body.InnerHtml = text;
+                }
+                else if (e.Data.GetDataPresent(DataFormats.FileDrop))
+                {
+                    var files = (string[])e.Data.GetData(DataFormats.FileDrop);
+                    using (var s = new FileStream(files[0], FileMode.Open))
+                        LoadFromFile(s);
+                }
+                else
+                {
+                    var s = (MemoryStream)e.Data.GetData(e.Data.GetFormats()[0]);
                     LoadFromFile(s);
-            }
-            else
-            {
-                var s = (MemoryStream) e.Data.GetData(e.Data.GetFormats()[0]);
-                LoadFromFile(s);
+                }
+            }
+            catch (Exception ex)
+            {
+                MessageBox.Show(this, "Error when loading file: " + ex.ToString(), "Error from BEurtle", MessageBoxButtons.OK, MessageBoxIcon.Error);
             }
         }


Color utility functions.

Color utility functions.

--- Behemoth.Util/Color.cs
+++ Behemoth.Util/Color.cs
@@ -57,6 +57,23 @@
     public override int GetHashCode()
     {
       return Num.HashPoint(R, G, B, A);
+    }
+
+
+    public float[] FloatArray
+    {
+      get
+      {
+        return new float[] {
+          (float)R / 255.0f, (float)G / 255.0f,
+          (float)B / 255.0f, (float)A / 255.0f};
+      }
+    }
+
+
+    public Color WithAlpha(byte alpha)
+    {
+      return new Color(R, G, B, alpha);
     }


Removed conn str

Removed conn str

--- UnitTests/UnitTest1.cs
+++ UnitTests/UnitTest1.cs
@@ -16,7 +16,7 @@
         [TestInitialize]
         public void Initialize()
         {
-            DataLibrary.Initialize("iagunity-dev.database.windows.net", "gts_Unitysystem", "unitysystem", "In$pired1");
+            DataLibrary.Initialize("<conn string>");
         }

         [TestMethod]


create ProjectSettings folder if not exists (for launcherarguments file)

--- UnityLauncher/Form1.cs
+++ UnityLauncher/Form1.cs
@@ -1233,6 +1233,13 @@

             string arguments = GetSelectedRowData("_launchArguments");

+            // check folder first
+            string outputFolder = Path.Combine(path, "ProjectSettings");
+            if (Directory.Exists(outputFolder) == false)
+            {
+                Directory.CreateDirectory(outputFolder);
+            }
+
             // save arguments to projectsettings folder
             string outputFile = Path.Combine(path, "ProjectSettings", launcherArgumentsFile);


Remove Facebook test for now

Remove Facebook test for now


Resolved #56: Remove custom auth schema.

--- aspnet-core/src/AbpCompanyName.AbpProjectName.Core/Identity/IdentityRegistrar.cs
+++ aspnet-core/src/AbpCompanyName.AbpProjectName.Core/Identity/IdentityRegistrar.cs
@@ -13,11 +13,7 @@
         {
             services.AddLogging();

-            services.AddAbpIdentity<Tenant, User, Role>(options =>
-                {
-                    options.Cookies.ApplicationCookie.AuthenticationScheme = "AbpZeroTemplateAuthSchema";
-                    options.Cookies.ApplicationCookie.CookieName = "AbpZeroTemplateAuth";
-                })
+            services.AddAbpIdentity<Tenant, User, Role>()
                 .AddAbpTenantManager<TenantManager>()
                 .AddAbpUserManager<UserManager>()
                 .AddAbpRoleManager<RoleManager>()


Changed dashboard alias to just "redirects"

The dashboard alias has been the full name of this package for a while, but as it's now possible to deeplink to dashboards, and the alias thereby is visible, the alias has now been updated to be "redirects" instead of the longer "Skybrud.Umbraco.Redirects".


Uri.AbosultePath パス情報には、URI のスキーム、ホスト名、およびクエリ部分は含まれていません。

--- Browser/FormBrowser.cs
+++ Browser/FormBrowser.cs
@@ -226,7 +226,7 @@
 				var document = Browser.Document;
 				if ( document == null ) return;

-				if ( document.Url.AbsolutePath.Contains( ".swf?" ) ) {
+				if ( document.Url.ToString().Contains( ".swf?" ) ) {

 					document.Body.SetAttribute( "width", "100%" );
 					document.Body.SetAttribute( "height", "100%" );
@@ -400,7 +400,7 @@
 				IViewObject viewobj = null;
 				//int width = 0, height = 0;

-				if ( wb.Document.Url.AbsolutePath.Contains( ".swf?" ) ) {
+				if ( wb.Document.Url.ToString().Contains( ".swf?" ) ) {

 					viewobj = wb.Document.GetElementsByTagName( "embed" )[0].DomElement as IViewObject;
 					if ( viewobj == null ) {


Throws sync after legacy result throws on begin

--- projects/AsyncEnumSample/test/AsyncEnumSample.Test.Unit/AsyncOperationTest.cs
+++ projects/AsyncEnumSample/test/AsyncEnumSample.Test.Unit/AsyncOperationTest.cs
@@ -322,6 +322,16 @@
             Assert.Equal(1234, task.Result);
         }

+        [Fact]
+        public void Throws_sync_after_legacy_result_throws_on_begin()
+        {
+            InvalidTimeZoneException expected = new InvalidTimeZoneException("Expected.");
+            ThrowOnBeginOperation op = new ThrowOnBeginOperation(expected);
+            InvalidTimeZoneException actual = Assert.Throws<InvalidTimeZoneException>(() => op.Start());
+
+            Assert.Same(expected, actual);
+        }
+
         private static class Legacy
         {
             public static AsyncResult BeginOp(AsyncCallback callback, object state)
@@ -876,5 +886,28 @@
                 this.Result = this.result;
             }
         }
+
+        private sealed class ThrowOnBeginOperation : TestAsyncOperation
+        {
+            private readonly Exception exception;
+
+            public ThrowOnBeginOperation(Exception exception)
+            {
+                this.exception = exception;
+            }
+
+            protected override IEnumerator<Step> Steps()
+            {
+                yield return Step.Await(
+                    this,
+                    (thisPtr, c, s) => thisPtr.Throw(),
+                    (thisPtr, r) => Legacy.EndOp(r));
+            }
+
+            private IAsyncResult Throw()
+            {
+                throw this.exception;
+            }
+        }
     }
 }


Fix the start debugging command caption by properly forwarding the QueryStatus to the next command filter.

--- Python/Product/PythonTools/PythonTools/Navigation/EditFilter.cs
+++ Python/Product/PythonTools/PythonTools/Navigation/EditFilter.cs
@@ -839,10 +839,10 @@
                     switch ((VSConstants.VSStd97CmdID)prgCmds[i].cmdID) {
                         case VSConstants.VSStd97CmdID.GotoDefn:
                             prgCmds[i].cmdf = (uint)(OLECMDF.OLECMDF_ENABLED | OLECMDF.OLECMDF_SUPPORTED);
-                            break;
+                            return VSConstants.S_OK;
                         case VSConstants.VSStd97CmdID.FindReferences:
                             prgCmds[i].cmdf = (uint)(OLECMDF.OLECMDF_ENABLED | OLECMDF.OLECMDF_SUPPORTED);
-                            break;
+                            return VSConstants.S_OK;
                     }
                 }
             } else if (pguidCmdGroup == VSConstants.VsStd12) {
@@ -858,7 +858,7 @@
                             );
                             prgCmds[i].cmdf = (uint)OLECMDF.OLECMDF_SUPPORTED;
                             prgCmds[0].cmdf |= (uint)(canPeek == true ? OLECMDF.OLECMDF_ENABLED : OLECMDF.OLECMDF_INVISIBLE);
-                            break;
+                            return VSConstants.S_OK;
                     }
                 }
             } else if (pguidCmdGroup == GuidList.guidPythonToolsCmdSet) {
@@ -869,13 +869,13 @@
                             // of the integrated shell.  In the integrated shell we provide our own
                             // command for it so these still show up.
                             prgCmds[i].cmdf = CommandDisabledAndHidden;
-                            break;
+                            return VSConstants.S_OK;
                         case PkgCmdIDList.cmdidExtractMethodIntegratedShell:
                             // C# provides the refactor context menu for the main VS command outside
                             // of the integrated shell.  In the integrated shell we provide our own
                             // command for it so these still show up.
                             prgCmds[i].cmdf = CommandDisabledAndHidden;
-                            break;
+                            return VSConstants.S_OK;
                         case CommonConstants.StartDebuggingCmdId:
                         case CommonConstants.StartWithoutDebuggingCmdId:
                             // Don't enable the command when the file is null or doesn't exist,
@@ -905,23 +905,24 @@
                     switch ((VSConstants.VSStd2KCmdID)prgCmds[i].cmdID) {
                         case VSConstants.VSStd2KCmdID.FORMATDOCUMENT:
                         case VSConstants.VSStd2KCmdID.FORMATSELECTION:
-
                         case VSConstants.VSStd2KCmdID.SHOWMEMBERLIST:
                         case VSConstants.VSStd2KCmdID.COMPLETEWORD:
                         case VSConstants.VSStd2KCmdID.QUICKINFO:
                         case VSConstants.VSStd2KCmdID.PARAMINFO:
                             prgCmds[i].cmdf = (uint)(OLECMDF.OLECMDF_ENABLED | OLECMDF.OLECMDF_SUPPORTED);
-                            break;
+                            return VSConstants.S_OK;

                         case VSConstants.VSStd2KCmdID.OUTLN_STOP_HIDING_ALL:
                             if (_textView.GetOutliningTagger()?.Enabled == true) {
                                 prgCmds[i].cmdf = (uint)(OLECMDF.OLECMDF_ENABLED | OLECMDF.OLECMDF_SUPPORTED);
+                                return VSConstants.S_OK;
                             }
                             break;

                         case VSConstants.VSStd2KCmdID.OUTLN_START_AUTOHIDING:
                             if (_textView.GetOutliningTagger()?.Enabled == false) {
                                 prgCmds[i].cmdf = (uint)(OLECMDF.OLECMDF_ENABLED | OLECMDF.OLECMDF_SUPPORTED);
+                                return VSConstants.S_OK;
                             }
                             break;

@@ -930,19 +931,15 @@
                         case VSConstants.VSStd2KCmdID.UNCOMMENT_BLOCK:
                         case VSConstants.VSStd2KCmdID.UNCOMMENTBLOCK:
                             prgCmds[i].cmdf = (uint)(OLECMDF.OLECMDF_ENABLED | OLECMDF.OLECMDF_SUPPORTED);
-                            break;
+                            return VSConstants.S_OK;
                         case VSConstants.VSStd2KCmdID.EXTRACTMETHOD:
                             QueryStatusExtractMethod(prgCmds, i);
-                            break;
+                            return VSConstants.S_OK;
                         case VSConstants.VSStd2KCmdID.RENAME:
                             QueryStatusRename(prgCmds, i);
-                            break;
+                            return VSConstants.S_OK;
                     }
                 }
-            }
-
-            if (prgCmds.All(f => f.cmdf != 0)) {
-                return VSConstants.S_OK;
             }

             return _next.QueryStatus(ref pguidCmdGroup, cCmds, prgCmds, pCmdText);


Logger property added to MicroserviceHost;


Removing pinning GCHandle when calling native calls.  This was already done in the github/master branch by an external PR - this merges it into this branch.

Change-Id: I43847d0ae442835cfc4be9750928aad8a0896073

--- source/PluginDev/Assets/GooglePlayGames/Platforms/Native/PInvoke/Callbacks.cs
+++ source/PluginDev/Assets/GooglePlayGames/Platforms/Native/PInvoke/Callbacks.cs
@@ -79,11 +79,9 @@
             // the garbage collector runs before the native code invokes the callback, chaos will
             // ensue.
             //
-            // To handle this, we manually pin the callback in memory (this means it cannot be
-            // collected or moved) - the GCHandle will be freed when the callback returns the and
+            // To handle this, we create a normal GCHandle. The GCHandle will be freed when the callback returns the and
             // handle is converted back to callback via IntPtrToCallback.
-            var handle = GCHandle.Alloc(callback, GCHandleType.Pinned);
-            //Logger.d("Returning a handle of type " + handle.Target.ToString());
+            var handle = GCHandle.Alloc(callback);
             return GCHandle.ToIntPtr(handle);
         }

@@ -214,7 +212,6 @@
         {
             return result =>
             {
-
                 if (toInvokeOnGameThread == null)
                 {
                     return;


Add tests.

Add tests.

--- src/EditorFeatures/CSharpTest/ConvertForToForEach/ConvertForToForEachTests.cs
+++ src/EditorFeatures/CSharpTest/ConvertForToForEach/ConvertForToForEachTests.cs
@@ -43,5 +43,65 @@
     }
 }");
         }
+
+        [Fact, Trait(Traits.Feature, Traits.Features.CodeActionsConvertForToForEach)]
+        public async Task TestPostIncrement()
+        {
+            await TestInRegularAndScript1Async(
+@"using System;
+
+class C
+{
+    void Test(string[] array)
+    {
+        [||]for (int i = 0; i < array.Length; ++i)
+        {
+            Console.WriteLine(array[i]);
+        }
+    }
+}",
+@"using System;
+
+class C
+{
+    void Test(string[] array)
+    {
+        foreach (string {|Rename:v|} in array)
+        {
+            Console.WriteLine(v);
+        }
+    }
+}");
+        }
+
+        [Fact, Trait(Traits.Feature, Traits.Features.CodeActionsConvertForToForEach)]
+        public async Task TestArrayPlusEqualsIncrementor()
+        {
+            await TestInRegularAndScript1Async(
+@"using System;
+
+class C
+{
+    void Test(string[] array)
+    {
+        [||]for (int i = 0; i < array.Length; i += 1)
+        {
+            Console.WriteLine(array[i]);
+        }
+    }
+}",
+@"using System;
+
+class C
+{
+    void Test(string[] array)
+    {
+        foreach (string {|Rename:v|} in array)
+        {
+            Console.WriteLine(v);
+        }
+    }
+}");
+        }
     }
 }


Using AddInsideMethod where possible

Using AddInsideMethod where possible

--- src/EditorFeatures/CSharpTest2/Recommendations/WhenKeywordRecommenderTests.cs
+++ src/EditorFeatures/CSharpTest2/Recommendations/WhenKeywordRecommenderTests.cs
@@ -333,41 +333,25 @@
         [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
         public async Task TestForSwitchCase_SemanticCheck_NotAfterPredefinedType()
         {
-            await VerifyAbsenceAsync(@"
-class C
-{
-    void M() { switch (new object()) { case int $$ } }
-}");
+            await VerifyAbsenceAsync(AddInsideMethod(@"switch (new object()) { case int $$ }"));
         }

         [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
         public async Task TestForSwitchCase_SemanticCheck_NotAfterPredefinedType_BeforeWhen()
         {
-            await VerifyAbsenceAsync(@"
-class C
-{
-    void M() { switch (new object()) { case int $$ when } }
-}");
+            await VerifyAbsenceAsync(AddInsideMethod(@"switch (new object()) { case int $$ when }"));
         }

         [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
         public async Task TestForSwitchCase_SemanticCheck_NotAfterGenericType()
         {
-            await VerifyAbsenceAsync(@"
-class C
-{
-    void M() { switch (new object()) { case Dictionary<string, int> $$ } }
-}");
+            await VerifyAbsenceAsync(AddInsideMethod(@"switch (new object()) { case Dictionary<string, int> $$ }"));
         }

         [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
         public async Task TestForSwitchCase_SemanticCheck_NotAfterGenericType_BeforeWhen()
         {
-            await VerifyAbsenceAsync(@"
-class C
-{
-    void M() { switch (new object()) { case Dictionary<string, int> $$ when } }
-}");
+            await VerifyAbsenceAsync(AddInsideMethod(@"switch (new object()) { case Dictionary<string, int> $$ when }"));
         }

         [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
@@ -419,41 +403,25 @@
         [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
         public async Task TestForSwitchCase_SemanticCheck_AfterLocalConstant()
         {
-            await VerifyKeywordAsync(@"
-class C
-{
-    void M() { const object local = null; switch (new object()) { case local $$ } }
-}");
+            await VerifyKeywordAsync(AddInsideMethod(@"const object c = null; switch (new object()) { case c $$ }"));
         }

         [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
         public async Task TestForSwitchCase_SemanticCheck_AfterLocalConstant_BeforeWhen()
         {
-            await VerifyKeywordAsync(@"
-class C
-{
-    void M() { const object local = null; switch (new object()) { case local $$ when } }
-}");
+            await VerifyKeywordAsync(AddInsideMethod(@"const object c = null; switch (new object()) { case c $$ when }"));
         }

         [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
         public async Task TestForSwitchCase_SemanticCheck_AfterUnknownName()
         {
-            await VerifyKeywordAsync(@"
-class C
-{
-    void M() { switch (new object()) { case unknown $$ } }
-}");
+            await VerifyKeywordAsync(AddInsideMethod(@"switch (new object()) { case unknown $$ }"));
         }

         [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
         public async Task TestForSwitchCase_SemanticCheck_AfterUnknownName_BeforeWhen()
         {
-            await VerifyKeywordAsync(@"
-class C
-{
-    void M() { switch (new object()) { case unknown $$ when } }
-}");
+            await VerifyKeywordAsync(AddInsideMethod(@"switch (new object()) { case unknown $$ when }"));
         }
     }
 }


move code.

move code.

--- src/Features/Core/Portable/PopulateSwitch/PopulateSwitchDiagnosticAnalyzer.cs
+++ src/Features/Core/Portable/PopulateSwitch/PopulateSwitchDiagnosticAnalyzer.cs
@@ -30,6 +30,7 @@

         protected abstract ICollection<ISymbol> GetMissingEnumMembers(TSwitchOperation operation);
         protected abstract bool HasDefaultCase(TSwitchOperation operation);
+        protected abstract Location GetDiagnosticLocation(SyntaxNode switchBlock);

         public sealed override DiagnosticAnalyzerCategory GetAnalyzerCategory() => DiagnosticAnalyzerCategory.SemanticSpanAnalysis;

@@ -52,7 +53,7 @@

                 var diagnostic = Diagnostic.Create(
                     Descriptor,
-                    switchBlock.GetFirstToken().GetLocation(),
+                    GetDiagnosticLocation(switchBlock),
                     properties: properties,
                     additionalLocations: new[] { switchBlock.GetLocation() });
                 context.ReportDiagnostic(diagnostic);
@@ -91,5 +92,8 @@

         protected override bool HasDefaultCase(ISwitchOperation operation)
             => PopulateSwitchHelpers.HasDefaultCase(operation);
+
+        protected override Location GetDiagnosticLocation(SyntaxNode switchBlock)
+            => switchBlock.GetFirstToken().GetLocation();
     }
 }


Updated string representation for the number.

--- src/Humanizer/Localisation/NumberToWords/SerbianCyrlNumberToWordsConverter.cs
+++ src/Humanizer/Localisation/NumberToWords/SerbianCyrlNumberToWordsConverter.cs
@@ -8,7 +8,7 @@
 {
     internal class SerbianCyrlNumberToWordsConverter : GenderlessNumberToWordsConverter
     {
-        private static readonly string[] UnitsMap = { "нула", "један", "два", "три", "четири", "пет", "шест", "седам", "осам", "девет", "десет", "једанест", "дванаест", "тринаест", "четрнаест", "петнаест", "шестнаест", "седамнаест", "осамнаест", "деветнаест" };
+        private static readonly string[] UnitsMap = { "нула", "један", "два", "три", "четири", "пет", "шест", "седам", "осам", "девет", "десет", "једанест", "дванаест", "тринаест", "четрнаест", "петнаест", "шеснаест", "седамнаест", "осамнаест", "деветнаест" };
         private static readonly string[] TensMap = { "нула", "десет", "двадесет", "тридесет", "четрдесет", "петдесет", "шестдесет", "седамдесет", "осамдесет", "деветдесет" };

         private readonly CultureInfo _culture;


Reacting to HeaderUtilities renames

Reacting to HeaderUtilities renames

--- src/Microsoft.AspNetCore.Server.HttpSys/RequestProcessing/HeaderCollection.cs
+++ src/Microsoft.AspNetCore.Server.HttpSys/RequestProcessing/HeaderCollection.cs
@@ -94,7 +94,7 @@

                 if (rawValue.Count == 1 &&
                     !string.IsNullOrWhiteSpace(rawValue[0]) &&
-                    HeaderUtilities.TryParseInt64(new StringSegment(rawValue[0]).Trim(), out value))
+                    HeaderUtilities.TryParseNonNegativeInt64(new StringSegment(rawValue[0]).Trim(), out value))
                 {
                     _contentLengthText = rawValue;
                     _contentLength = value;
@@ -113,7 +113,7 @@
                     {
                         throw new ArgumentOutOfRangeException("value", value.Value, "Cannot be negative.");
                     }
-                    _contentLengthText = HeaderUtilities.FormatInt64(value.Value);
+                    _contentLengthText = HeaderUtilities.FormatNonNegativeInt64(value.Value);
                     this[HttpKnownHeaderNames.ContentLength] = _contentLengthText;
                     _contentLength = value;
                 }


fix type resolver issue in yaml.

fix type resolver issue in yaml.

--- src/Microsoft.DocAsCode.YamlSerialization/TypeInspectors/EmitTypeInspector.cs
+++ src/Microsoft.DocAsCode.YamlSerialization/TypeInspectors/EmitTypeInspector.cs
@@ -18,8 +18,8 @@

     public class EmitTypeInspector : ExtensibleTypeInspectorSkeleton
     {
-        private static ConcurrentDictionary<Tuple<Type, Type>, CachingItem> Cache { get; } =
-            new ConcurrentDictionary<Tuple<Type, Type>, CachingItem>();
+        private static readonly ConcurrentDictionary<Type, CachingItem> _cache =
+            new ConcurrentDictionary<Type, CachingItem>();
         private readonly ITypeResolver _resolver;

         public EmitTypeInspector(ITypeResolver resolver)
@@ -29,38 +29,36 @@

         public override IEnumerable<IPropertyDescriptor> GetProperties(Type type, object container)
         {
-            CachingItem ci = Cache.GetOrAdd(Tuple.Create(type, _resolver.GetType()), pair => CachingItem.Create(pair.Item1, _resolver));
-            if (ci.Error != null)
-            {
-                throw ci.Error;
-            }
-            IEnumerable<IPropertyDescriptor> result = ci.Properies;
-            if (container != null && ci.ExtensibleProperies.Count > 0)
-            {
-                foreach (var ep in ci.ExtensibleProperies)
-                {
-                    result = result.Concat(
-                        from key in ep.GetAllKeys(container) ?? Enumerable.Empty<string>()
-                        select ep.SetName(ep.Prefix + key));
-                }
-            }
-            return result;
+            var item = _cache.GetOrAdd(type, CachingItem.Create);
+            if (item.Error != null)
+            {
+                throw item.Error;
+            }
+            var result = from p in item.Properies select (IPropertyDescriptor)new EmitPropertyDescriptor(p, _resolver);
+            if (container == null || item.ExtensibleProperies.Count == 0)
+            {
+                return result;
+            }
+            return result.Concat(
+                from ep in item.ExtensibleProperies
+                from key in ep.GetAllKeys(container) ?? Enumerable.Empty<string>()
+                select new ExtensiblePropertyDescriptor(ep, ep.Prefix + key, _resolver));
         }

         public override IPropertyDescriptor GetProperty(Type type, object container, string name)
         {
-            CachingItem ci = Cache.GetOrAdd(Tuple.Create(type, _resolver.GetType()), pair => CachingItem.Create(pair.Item1, _resolver));
-            if (ci.Error != null)
-            {
-                throw ci.Error;
-            }
-            if (ci.ExtensibleProperies.Count == 0)
+            var item = _cache.GetOrAdd(type, CachingItem.Create);
+            if (item.Error != null)
+            {
+                throw item.Error;
+            }
+            if (item.ExtensibleProperies.Count == 0)
             {
                 return null;
             }
-            return (from ep in ci.ExtensibleProperies
+            return (from ep in item.ExtensibleProperies
                     where name.StartsWith(ep.Prefix)
-                    select ep.SetName(name)).FirstOrDefault();
+                    select new ExtensiblePropertyDescriptor(ep, name, _resolver)).FirstOrDefault();
         }

         private sealed class CachingItem
@@ -69,11 +67,11 @@

             public Exception Error { get; private set; }

-            public List<EmitPropertyDescriptor> Properies { get; } = new List<EmitPropertyDescriptor>();
-
-            public List<ExtensiblePropertyDescriptor> ExtensibleProperies { get; } = new List<ExtensiblePropertyDescriptor>();
-
-            public static CachingItem Create(Type type, ITypeResolver typeResolver)
+            public List<EmitPropertyDescriptorSkeleton> Properies { get; } = new List<EmitPropertyDescriptorSkeleton>();
+
+            public List<ExtensiblePropertyDescriptorSkeleton> ExtensibleProperies { get; } = new List<ExtensiblePropertyDescriptorSkeleton>();
+
+            public static CachingItem Create(Type type)
             {
                 var result = new CachingItem();

@@ -110,13 +108,12 @@
 #else
                         var setMethod = prop.GetSetMethod();
 #endif
-                        result.Properies.Add(new EmitPropertyDescriptor
+                        result.Properies.Add(new EmitPropertyDescriptorSkeleton
                         {
                             CanWrite = setMethod != null,
                             Name = prop.Name,
                             Property = prop,
                             Type = propertyType,
-                            TypeResolver = typeResolver,
                             Reader = CreateReader(getMethod),
                             Writer = setMethod == null ? null : CreateWriter(setMethod),
                         });
@@ -132,14 +129,13 @@
                         }

                         result.ExtensibleProperies.Add(
-                            new ExtensiblePropertyDescriptor
+                            new ExtensiblePropertyDescriptorSkeleton
                             {
                                 KeyReader = CreateDictionaryKeyReader(getMethod, valueType),
                                 Prefix = extAttr.Prefix,
                                 Reader = CreateDictionaryReader(getMethod, valueType),
                                 Writer = CreateDictionaryWriter(getMethod, valueType),
                                 Type = valueType,
-                                TypeResolver = typeResolver,
                             });
                     }
                 }
@@ -453,110 +449,176 @@
             }
         }

+        private sealed class EmitPropertyDescriptorSkeleton
+        {
+            private volatile KeyValuePair<Type, Attribute>[] _attributeCache = null;
+
+            internal PropertyInfo Property { get; set; }
+
+            internal Func<object, object> Reader { get; set; }
+
+            internal Action<object, object> Writer { get; set; }
+
+            public bool CanWrite { get; set; }
+
+            public string Name { get; set; }
+
+            public Type Type { get; set; }
+
+            public T GetCustomAttribute<T>() where T : Attribute
+            {
+                var type = typeof(T);
+                var cache = _attributeCache;
+                var attr = FindAttributeInCache(type, cache);
+                if (attr != null)
+                {
+                    return (T)attr;
+                }
+                lock (this)
+                {
+                    var syncCache = _attributeCache;
+                    if (syncCache != cache)
+                    {
+                        attr = FindAttributeInCache(type, syncCache);
+                        if (attr != null)
+                        {
+                            return (T)attr;
+                        }
+                    }
+                    attr = Property.GetCustomAttribute<T>();
+                    if (syncCache == null)
+                    {
+                        _attributeCache = new KeyValuePair<Type, Attribute>[] { new KeyValuePair<Type, Attribute>(type, attr) };
+                    }
+                    else
+                    {
+                        var temp = new KeyValuePair<Type, Attribute>[syncCache.Length + 1];
+                        Array.Copy(syncCache, temp, syncCache.Length);
+                        temp[temp.Length - 1] = new KeyValuePair<Type, Attribute>(type, attr);
+                        _attributeCache = temp;
+                    }
+                    return (T)attr;
+                }
+            }
+
+            private static Attribute FindAttributeInCache(Type type, KeyValuePair<Type, Attribute>[] cache)
+            {
+                if (cache == null)
+                {
+                    return null;
+                }
+                for (int i = 0; i < cache.Length; i++)
+                {
+                    if (cache[i].Key == type)
+                    {
+                        return cache[i].Value;
+                    }
+                }
+                return null;
+            }
+        }
+
         private sealed class EmitPropertyDescriptor : IPropertyDescriptor
         {
-            private readonly ConcurrentDictionary<Type, Attribute> _attributeCache = new ConcurrentDictionary<Type, Attribute>();
-
-            internal PropertyInfo Property { get; set; }
-
-            internal ITypeResolver TypeResolver { get; set; }
-
-            internal Func<object, object> Reader { get; set; }
-
-            internal Action<object, object> Writer { get; set; }
-
-            public bool CanWrite { get; set; }
-
-            public string Name { get; set; }
+            private readonly EmitPropertyDescriptorSkeleton _skeleton;
+            private readonly ITypeResolver _typeResolver;
+
+            public EmitPropertyDescriptor(EmitPropertyDescriptorSkeleton skeleton, ITypeResolver typeResolver)
+            {
+                _skeleton = skeleton;
+                _typeResolver = typeResolver;
+            }
+
+            public bool CanWrite => _skeleton.CanWrite;
+
+            public string Name => _skeleton.Name;

             public int Order { get; set; }

             public ScalarStyle ScalarStyle { get; set; }

+            public Type Type => _skeleton.Type;
+
+            public Type TypeOverride { get; set; }
+
+            public T GetCustomAttribute<T>() where T : Attribute => _skeleton.GetCustomAttribute<T>();
+
+            public IObjectDescriptor Read(object target)
+            {
+                var value = _skeleton.Reader(target);
+                return new BetterObjectDescriptor(value, TypeOverride ?? _typeResolver.Resolve(Type, value), Type, ScalarStyle);
+            }
+
+            public void Write(object target, object value)
+            {
+                _skeleton.Writer(target, value);
+            }
+        }
+
+        private sealed class ExtensiblePropertyDescriptorSkeleton
+        {
+            internal string Prefix { get; set; }
+
+            internal Func<object, string, object> Reader { get; set; }
+
+            internal Action<object, string, object> Writer { get; set; }
+
+            internal Func<object, ICollection<string>> KeyReader { get; set; }
+
             public Type Type { get; set; }

+            public ICollection<string> GetAllKeys(object target) => KeyReader(target);
+        }
+
+        private sealed class ExtensiblePropertyDescriptor : IPropertyDescriptor
+        {
+            private readonly ExtensiblePropertyDescriptorSkeleton _skeleton;
+            private readonly string _name;
+            private readonly ITypeResolver _typeResolver;
+
+            public ExtensiblePropertyDescriptor(
+                ExtensiblePropertyDescriptorSkeleton skeleton,
+                string name,
+                ITypeResolver typeResolver)
+            {
+                _skeleton = skeleton;
+                _name = name;
+                _typeResolver = typeResolver;
+            }
+
+            internal string Prefix => _skeleton.Prefix;
+
+            public bool CanWrite => true;
+
+            public string Name => _name;
+
+            public int Order { get; set; }
+
+            public ScalarStyle ScalarStyle { get; set; }
+
+            public Type Type => _skeleton.Type;
+
             public Type TypeOverride { get; set; }

-            public T GetCustomAttribute<T>() where T : Attribute
-            {
-                return (T)_attributeCache.GetOrAdd(typeof(T), (s) => Property.GetCustomAttribute<T>());
-            }
+            public T GetCustomAttribute<T>() where T : Attribute => null;

             public IObjectDescriptor Read(object target)
             {
-                var value = Reader(target);
-                return new BetterObjectDescriptor(value, TypeOverride ?? TypeResolver.Resolve(Type, value), Type, ScalarStyle);
+                if (Name == null || Name.Length <= _skeleton.Prefix.Length)
+                {
+                    throw new YamlException($"Invalid read {Name}!");
+                }
+                var value = _skeleton.Reader(target, Name.Substring(_skeleton.Prefix.Length));
+                return new BetterObjectDescriptor(value, TypeOverride ?? _typeResolver.Resolve(Type, value), Type, ScalarStyle);
             }

             public void Write(object target, object value)
             {
-                Writer(target, value);
-            }
-        }
-
-        private sealed class ExtensiblePropertyDescriptor : IPropertyDescriptor
-        {
-            internal string Prefix { get; set; }
-
-            internal ITypeResolver TypeResolver { get; set; }
-
-            internal Func<object, string, object> Reader { get; set; }
-
-            internal Action<object, string, object> Writer { get; set; }
-
-            internal Func<object, ICollection<string>> KeyReader { get; set; }
-
-            public bool CanWrite => Name != null;
-
-            public string Name { get; private set; }
-
-            public int Order { get; set; }
-
-            public ScalarStyle ScalarStyle { get; set; }
-
-            public Type Type { get; set; }
-
-            public Type TypeOverride { get; set; }
-
-            public T GetCustomAttribute<T>() where T : Attribute
-            {
-                return null;
-            }
-
-            public IObjectDescriptor Read(object target)
-            {
-                if (Name == null || Name.Length <= Prefix.Length)
-                {
-                    throw new YamlException($"Invalid read {Name}!");
-                }
-                var value = Reader(target, Name.Substring(Prefix.Length));
-                return new BetterObjectDescriptor(value, TypeOverride ?? TypeResolver.Resolve(Type, value), Type, ScalarStyle);
-            }
-
-            public void Write(object target, object value)
-            {
-                if (Name == null || Name.Length <= Prefix.Length)
+                if (Name == null || Name.Length <= _skeleton.Prefix.Length)
                 {
                     throw new YamlException($"Invalid write {Name}!");
                 }
-                Writer(target, Name.Substring(Prefix.Length), value);
-            }
-
-            public ICollection<string> GetAllKeys(object target)
-            {
-                return KeyReader(target);
-            }
-
-            public ExtensiblePropertyDescriptor Clone()
-            {
-                return (ExtensiblePropertyDescriptor)MemberwiseClone();
-            }
-
-            public ExtensiblePropertyDescriptor SetName(string name)
-            {
-                var result = Clone();
-                result.Name = name;
-                return result;
+                _skeleton.Writer(target, Name.Substring(_skeleton.Prefix.Length), value);
             }
         }
     }


removed BrushRoundConverter

removed BrushRoundConverter

--- src/MvvmScarletToolkit.Wpf/MarkupExtensions/Converters/BrushRoundConverter.cs
+++ src/MvvmScarletToolkit.Wpf/MarkupExtensions/Converters/BrushRoundConverter.cs
@@ -1,26 +0,0 @@
-using System;
-using System.Globalization;
-using System.Windows.Data;
-using System.Windows.Media;
-
-namespace MvvmScarletToolkit
-{
-    [ValueConversion(typeof(SolidColorBrush), typeof(Brush))]
-    public class BrushRoundConverter : ConverterMarkupExtension<BrushRoundConverter>
-    {
-        public Brush HighValue { get; set; } = Brushes.White;
-        public Brush LowValue { get; set; } = Brushes.Black;
-
-        public override object Convert(object value, Type targetType, object parameter, CultureInfo culture)
-        {
-            if (!(value is SolidColorBrush solidColorBrush))
-                return Binding.DoNothing;
-
-            var color = solidColorBrush.Color;
-
-            var brightness = (0.3 * color.R) + (0.59 * color.G) + (0.11 * color.B);
-
-            return brightness < 123 ? LowValue : HighValue;
-        }
-    }
-}


Added IsParameterRequired

Added IsParameterRequired

--- src/NSwag.CodeGeneration/SwaggerGenerators/WebApi/WebApiToSwaggerGenerator.cs
+++ src/NSwag.CodeGeneration/SwaggerGenerators/WebApi/WebApiToSwaggerGenerator.cs
@@ -325,7 +325,7 @@
             operationParameter.Schema = CreateAndAddSchema<SwaggerParameter>(service, parameter.ParameterType, schemaResolver);
             operationParameter.Name = parameter.Name;
             operationParameter.Kind = SwaggerParameterKind.Body;
-            operationParameter.IsRequired = !parameter.HasDefaultValue;
+            operationParameter.IsRequired = IsParameterRequired(parameter);

             var description = parameter.GetXmlDocumentation();
             if (description != string.Empty)
@@ -341,9 +341,20 @@
                 parameter.ParameterType, parameter.GetCustomAttributes(), schemaResolver);

             if (setRequiredProperty)
-                operationParameter.IsRequired = !parameter.HasDefaultValue;
+                operationParameter.IsRequired = IsParameterRequired(parameter);

             return operationParameter;
+        }
+
+        private bool IsParameterRequired(ParameterInfo parameter)
+        {
+            if (parameter.HasDefaultValue)
+                return false;
+
+            if (parameter.ParameterType.GetGenericTypeDefinition() == typeof(Nullable<>))
+                return false;
+
+            return parameter.ParameterType.IsValueType;
         }

         private SwaggerParameter CreatePrimitiveParameter(SwaggerService service, string name, string description,


Abstract controller classes are excluded

--- src/NSwag.CodeGeneration/SwaggerGenerators/WebApi/WebApiToSwaggerGenerator.cs
+++ src/NSwag.CodeGeneration/SwaggerGenerators/WebApi/WebApiToSwaggerGenerator.cs
@@ -48,6 +48,7 @@
         {
             // TODO: Move to IControllerClassLoader interface
             return assembly.ExportedTypes
+                .Where(t => t.GetTypeInfo().IsAbstract == false)
                 .Where(t => t.Name.EndsWith("Controller") ||
                             t.InheritsFrom("ApiController", TypeNameStyle.Name) ||
                             t.InheritsFrom("Controller", TypeNameStyle.Name)) // in ASP.NET Core, a Web API controller inherits from Controller


Fix# 4168 : WidgetsListPart - Existing widgets are removed due to Null Zone (#4183)

--- src/OrchardCore.Modules/OrchardCore.Widgets/Views/WidgetsListPart.Edit.cshtml
+++ src/OrchardCore.Modules/OrchardCore.Widgets/Views/WidgetsListPart.Edit.cshtml
@@ -39,6 +39,7 @@
                                     widgetEditor.PrefixesName = Html.NameFor(x => x.Prefixes);
                                     widgetEditor.ContentTypesName = Html.NameFor(x => x.ContentTypes);
                                     widgetEditor.TargetId = widgetTemplatePlaceholderId;
+                                    widgetEditor.Zone = zone;

                                     widgetEditor.Metadata.Alternates.Add("Widget_Edit__List");
                                 }


Fixed implementations of IFaultExceptionTransformer

--- src/SoapCore.Tests/FaultExceptionTransformer/TestFaultExceptionTransformer.cs
+++ src/SoapCore.Tests/FaultExceptionTransformer/TestFaultExceptionTransformer.cs
@@ -9,7 +9,7 @@
 {
 	public class TestFaultExceptionTransformer : IFaultExceptionTransformer
 	{
-		public Message ProvideFault(Exception exception, MessageVersion messageVersion, XmlNamespaceManager xmlNamespaceManager)
+		public Message ProvideFault(Exception exception, MessageVersion messageVersion, Message requestMessage, XmlNamespaceManager xmlNamespaceManager)
 		{
 			var fault = new TestFault
 			{


DirectWrite : Refactored : Change Visibility

--- samples/SampleFramework/Rendering/DeviceContext2D.cs
+++ samples/SampleFramework/Rendering/DeviceContext2D.cs
@@ -37,7 +37,7 @@
         /// </summary>
         /// <param name="handle">The window handle to associate with the device.</param>
         /// <param name="settings">The settings used to configure the device.</param>
-        internal DeviceContext2D(IntPtr handle, DeviceSettings2D settings) {
+        public DeviceContext2D(IntPtr handle, DeviceSettings2D settings) {
             if (handle == IntPtr.Zero)
                 throw new ArgumentException("Value must be a valid window handle.", "handle");
             if (settings == null)


Remove extra white space.

Remove extra white space.

--- storage/api/StorageTest/StorageTest.cs
+++ storage/api/StorageTest/StorageTest.cs
@@ -647,8 +647,6 @@
                 File.ReadAllText("Hello-downloaded.txt"));
         }

-
-
         [Fact]
         public void TestEnableAndDisableRequesterPays()
         {


midway through timer spec

midway through timer spec

--- test/Akka.Tests/Actor/FSMTimingSpec.cs
+++ test/Akka.Tests/Actor/FSMTimingSpec.cs
@@ -1,4 +1,5 @@
-using Akka.Actor;
+using System;
+using Akka.Actor;
 using Microsoft.VisualStudio.TestTools.UnitTesting;

 namespace Akka.Tests.Actor
@@ -9,6 +10,126 @@
         public ActorRef Self { get { return testActor; } }

         #region Actors
+
+        private void Suspend(ActorRef actorRef)
+        {
+            actorRef.Match()
+                .With<ActorRefWithCell>(l => l.Suspend());
+        }
+
+        private void Resume(ActorRef actorRef)
+        {
+            actorRef.Match()
+                .With<ActorRefWithCell>(l => l.Resume());
+        }
+
+        public enum State
+        {
+            Initial,
+            TestStateTimeout,
+            TestStateTimeoutOverride,
+            TestSingleTimer,
+            TestSingleTimerResubmit,
+            TestRepeatedTimer,
+            TestUnandled,
+            TestCancelTimer,
+            TestCancelStateTimer,
+            TestCancelStateTimer2
+        }
+
+        public class Tick { }
+        public class Tock { }
+        public class Cancel { }
+        public class SetHandler { }
+
+        public class Unhandled
+        {
+            public Unhandled(object msg)
+            {
+                Msg = msg;
+            }
+
+            public object Msg { get; private set; }
+        }
+
+        public class StateMachine : FSM<State, int>
+        {
+            public StateMachine(ActorRef tester)
+            {
+                Tester = tester;
+                StartWith(State.Initial, 0);
+                When(State.Initial, @event =>
+                {
+                    State<State, int> nextState = null;
+                    @event.FsmEvent.Match()
+                        .With<State>(s =>
+                        {
+                            switch (s)
+                            {
+                                case State.TestSingleTimer:
+                                    SetTimer("tester", new Tick(), TimeSpan.FromMilliseconds(500), false);
+                                    nextState = GoTo(State.TestSingleTimer);
+                                    break;
+                                case State.TestRepeatedTimer:
+                                    SetTimer("tester", new Tick(), TimeSpan.FromMilliseconds(100), true);
+                                    nextState = GoTo(State.TestRepeatedTimer).Using(4);
+                                    break;
+                                case State.TestStateTimeoutOverride:
+                                    nextState = GoTo(State.TestStateTimeout).ForMax(TimeSpan.MaxValue);
+                                    break;
+                                default:
+                                    nextState = GoTo(s);
+                                    break;
+                            }
+                        });
+                    return nextState;
+                });
+
+                When(State.TestStateTimeout, @event =>
+                {
+                    State<State, int> nextState = null;
+                    @event.FsmEvent.Match()
+                        .With<State>(s =>
+                        {
+                            if (s == State.TestStateTimeout) nextState = GoTo(State.Initial);
+                        })
+                        .With<Cancel>(c =>
+                        {
+                            nextState = GoTo(State.Initial).Replying(new Cancel());
+                        });
+                    return nextState;
+
+                }, TimeSpan.FromMilliseconds(800));
+
+                When(State.TestSingleTimer, @event =>
+                {
+                    State<State, int> nextState = null;
+                    @event.FsmEvent.Match()
+                        .With<Tick>(t =>
+                        {
+                            tester.Tell(new Tick());
+                            nextState = GoTo(State.Initial);
+                        });
+                    return nextState;
+                });
+
+                OnTransition((state, state1) =>
+                {
+                    if(state == State.Initial && state1 == State.TestSingleTimerResubmit)
+                        SetTimer("blah", new Tick(), TimeSpan.FromMilliseconds(500));
+                });
+
+                When(State.TestSingleTimerResubmit, @event =>
+                {
+
+                });
+            }
+
+
+
+            public ActorRef Tester { get; private set; }
+        }
+
         #endregion
     }
 }


style: Add comment to UtilTest test case on timezone #202

--- test/Fan.UnitTests/Helpers/UtilTest.cs
+++ test/Fan.UnitTests/Helpers/UtilTest.cs
@@ -60,6 +60,9 @@
             // the user wants to see the actual post time in his own timezone
             // Util.ConvertTime returns him that
             var displayToUser = Util.ConvertTime(createdOn, coreSettings.TimeZoneId);
+            // https://en.wikipedia.org/wiki/Pacific_Time_Zone
+            // Pacific Time Zone observes standard time by subtracting eight hours from Coordinated Universal Time (UTC−8).
+            // During daylight saving time, a time offset of UTC−7 is used.
             Assert.Equal("-07:00:00", displayToUser.Offset.ToString());
         }


[Core.ViewModels.Pages] Removed unusable code from MainPageModel

--- source/WinHAB.Core/ViewModels/Pages/MainPageModel.cs
+++ source/WinHAB.Core/ViewModels/Pages/MainPageModel.cs
@@ -47,8 +47,6 @@

     private async Task LoadPageWidgets(Uri pageUri)
     {
-      const string fakeFrameLabel = "#WRAPPER#";
-
       TaskProgress.Show();

       Page page = null;
@@ -59,27 +57,20 @@
       }

       if (page == null || page.Widgets == null || page.Widgets.Count == 0) return;
-
-
+
       var widgetsInitializators = new List<Task>();
-
       var res = new List<FrameWidgetModel>();
+
       foreach (var frameData in page.Widgets.CreateFrameWrappedCollection())
       {
-        if (frameData.Label == fakeFrameLabel) frameData.Label = null;
-
         var frame = (FrameWidgetModel)_widgetsFactory.Create(frameData);
         res.Add(frame);
         widgetsInitializators.Add(frame.InitializeAsync(null));

-        foreach (var widgetData in frameData.Widgets)
+        foreach (var widget in frameData.Widgets.Select(widgetData => _widgetsFactory.Create(widgetData)).Where(widget => widget != null))
         {
-          var widget = _widgetsFactory.Create(widgetData);
-          if (widget != null)
-          {
-            frame.Widgets.Add(widget);
-            widgetsInitializators.Add(widget.InitializeAsync(null));
-          }
+          frame.Widgets.Add(widget);
+          widgetsInitializators.Add(widget.InitializeAsync(null));
         }
       }


[CSHARP-359] Tests for clustering order representation

--- src/Cassandra.IntegrationTests/Core/MetadataTests.cs
+++ src/Cassandra.IntegrationTests/Core/MetadataTests.cs
@@ -998,5 +998,40 @@
             Assert.AreEqual("description", descriptionIndex.Target);
             Assert.NotNull(descriptionIndex.Options);
         }
+        /// Tests that clustering order metadata is set properly
+        ///
+        /// ColumnClusteringOrderReversedTest tests that clustering order metadata for a clustering key is properly recalled in the driver
+        /// metadata under the "ClusteringKeys" metadata. It first creates a simple table with a primary key, one column ascending, and another
+        /// column descending. It checks the metadata for each clustering key to make sure that the proper value is recalled in the driver metadata.
+        ///
+        /// @since 3.0.0
+        /// @jira_ticket CSHARP-359
+        /// @expected_result Clustering order metadata is properly set
+        ///
+        /// @test_category metadata
+        [Test, TestCassandraVersion(3, 0)]
+        public void ColumnClusteringOrderReversedTest()
+        {
+            string keyspaceName = TestUtils.GetUniqueKeyspaceName();
+            string tableName = "products";
+            ITestCluster testCluster = TestClusterManager.GetNonShareableTestCluster(DefaultNodeCount);
+            var cluster = testCluster.Cluster;
+            var session = testCluster.Session;
+            session.CreateKeyspace(keyspaceName);
+            session.ChangeKeyspace(keyspaceName);
+
+            var cql = "CREATE TABLE " + tableName + " (" +
+                      @"id int,
+                      description text,
+                      price double,
+                      PRIMARY KEY(id, description, price)
+                      ) WITH COMPACT STORAGE
+                      AND CLUSTERING ORDER BY (description ASC, price DESC)";
+            session.Execute(cql);
+
+            var tableMeta = cluster.Metadata.GetKeyspace(keyspaceName).GetTableMetadata(tableName);
+            Assert.AreEqual(new[] { "description", "price" }, tableMeta.ClusteringKeys.Select(c => c.Item1.Name));
+            Assert.AreEqual(new[] { SortOrder.Ascending, SortOrder.Descending }, tableMeta.ClusteringKeys.Select(c => c.Item2));
+        }
     }
 }


added property GlobalThreshold to interface

--- src/DocToMarkdown.Common/Contracts/ILoggerManager.cs
+++ src/DocToMarkdown.Common/Contracts/ILoggerManager.cs
@@ -16,6 +16,17 @@
     /// </summary>
     public interface ILoggerManager : IDisposable
     {
+        #region properties
+
+        /// <summary>
+        /// Gets or sets the global threshold.
+        /// Loglevels below this threshold are not logged.
+        /// </summary>
+        /// <value>The global threshold.</value>
+        LogLevel GlobalThreshold { get; set; }
+
+        #endregion
+
         #region methods

         /// <summary>


Update AbstractSourceData.cs

Update AbstractSourceData.cs

--- src/FireworksNet.Tests/Explode/AbstractSourceData.cs
+++ src/FireworksNet.Tests/Explode/AbstractSourceData.cs
@@ -9,7 +9,7 @@
 {
     public abstract class AbstractSourceData
     {
-        public static IEnumerable<object[]> DataForTestMethodExploderOfParallelExploder
+        public static IEnumerable<object[]> DataForTestMethodExplodeOfParallelExploder
         {
             get
             {


var rename

var rename

--- src/FujiyBlog.Web/Areas/Admin/Views/Post/Edit.cshtml
+++ src/FujiyBlog.Web/Areas/Admin/Views/Post/Edit.cshtml
@@ -159,8 +159,8 @@

     function CheckPublishPermission () {

-        var hasPublishOwnPages = @(User.IsInRole(Permission.PublishOwnPosts)?"true":"false");;
-        var hasPublishOtherUsersPages = @(User.IsInRole(Permission.PublishOtherUsersPosts)?"true":"false");
+        var hasPublishOwn = @(User.IsInRole(Permission.PublishOwnPosts)?"true":"false");;
+        var hasPublishOtherUsers = @(User.IsInRole(Permission.PublishOtherUsersPosts)?"true":"false");
         var userName = '@(User.Identity.Name)';
         var currentPublishedValue = @(Model.Post.IsPublished?"true":"false");

@@ -168,7 +168,7 @@
         var newAuthor = $('#@(Html.FieldIdFor(x=> x.Post.AuthorId)) :selected').text();

         if (!currentPublishedValue) {
-            if (!(newAuthor != userName && hasPublishOtherUsersPages) && !(newAuthor == userName && hasPublishOwnPages)) {
+            if (!(newAuthor != userName && hasPublishOtherUsers) && !(newAuthor == userName && hasPublishOwn)) {
                 publishedField.attr('disabled', true);
                 publishedField.prop('checked', false);
             }


BUG: Lucene.Net.Codecs.BlockTerms.BlockTermsReader: fields field was a Dictionary, but it should be SortedDictionary

--- src/Lucene.Net.Codecs/BlockTerms/BlockTermsReader.cs
+++ src/Lucene.Net.Codecs/BlockTerms/BlockTermsReader.cs
@@ -51,7 +51,7 @@
         // Reads the terms index
         private TermsIndexReaderBase _indexReader;

-        private readonly Dictionary<string, FieldReader> _fields = new Dictionary<string, FieldReader>();
+        private readonly IDictionary<string, FieldReader> _fields = new SortedDictionary<string, FieldReader>(StringComparer.Ordinal);

         // keeps the dirStart offset
         private long _dirOffset;


Lucene.Net.Core.Search.TotalHitCountCollector refactor: renamed fields camelCase

--- src/Lucene.Net.Core/Search/TotalHitCountCollector.cs
+++ src/Lucene.Net.Core/Search/TotalHitCountCollector.cs
@@ -25,7 +25,7 @@

     public class TotalHitCountCollector : Collector
     {
-        private int TotalHits_Renamed; // LUCENENET TODO: Rename (private)
+        private int totalHits;

         /// <summary>
         /// Returns how many hits matched the search. </summary>
@@ -33,7 +33,7 @@
         {
             get
             {
-                return TotalHits_Renamed;
+                return totalHits;
             }
         }

@@ -43,7 +43,7 @@

         public override void Collect(int doc)
         {
-            TotalHits_Renamed++;
+            totalHits++;
         }

         public override void SetNextReader(AtomicReaderContext context)


Improved portability of NHibernate.Test.Component.Basic.ComponentTest.

SVN: 488784591515bd4cdaa016be4ec9b172dc4e7caf@5411

--- src/NHibernate.Test/Component/Basic/ComponentTest.cs
+++ src/NHibernate.Test/Component/Basic/ComponentTest.cs
@@ -1,5 +1,8 @@
 using System;
+using System.Collections;
 using System.Collections.Generic;
+using System.IO;
+using System.Reflection;
 using NHibernate;
 using NHibernate.Cfg;
 using NHibernate.Criterion;
@@ -18,12 +21,30 @@

 		protected override System.Collections.IList Mappings
 		{
-			get { return new string[] { "Component.Basic.User.hbm.xml" }; }
+			get { return new string[] { }; }
 		}

 		protected override void Configure(Configuration configuration)
 		{
-			configuration.SetProperty(NHibernate.Cfg.Environment.GenerateStatistics, "true");
+			if (Dialect.Functions.ContainsKey("year"))
+			{
+				using (Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("NHibernate.Test.Component.Basic.User.hbm.xml"))
+				{
+					using (StreamReader reader = new StreamReader(stream))
+					{
+						string mapping = reader.ReadToEnd();
+
+						IList args = new ArrayList();
+						args.Add("dob");
+						// We don't have a session factory yet... is there some way to get one sooner?
+						string replacement = Dialect.Functions["year"].Render(args, null).ToString();
+						mapping = mapping.Replace("year(dob)", replacement);
+
+						configuration.AddXml(mapping);
+						configuration.SetProperty(Cfg.Environment.GenerateStatistics, "true");
+					}
+				}
+			}
 		}

 		protected override void OnTearDown()


Minor

Minor

SVN: 488784591515bd4cdaa016be4ec9b172dc4e7caf@4493

--- src/NHibernate.Test/HQL/Ast/SqlTranslationFixture.cs
+++ src/NHibernate.Test/HQL/Ast/SqlTranslationFixture.cs
@@ -19,7 +19,6 @@
 			const string query = "from SimpleClass s where (case when s.IntValue > 0 then (cast(s.IntValue as long) * :pAValue) else 1 end) > 0";
 			Assert.DoesNotThrow(() => GetSql(query));

-			// This query fail because parenthesis on the math operation and does not fail in the old parser
 			const string queryWithoutParen = "from SimpleClass s where (case when s.IntValue > 0 then cast(s.IntValue as long) * :pAValue else 1 end) > 0";
 			Assert.DoesNotThrow(() => GetSqlWithClassicParser(queryWithoutParen));
 			Assert.DoesNotThrow(() => GetSql(queryWithoutParen));
@@ -28,11 +27,11 @@
 		[Test]
 		public void Union()
 		{
-			string query = "from SimpleClass s where s.id in ((select s1.id from SimpleClass s1) union (select s2.id from SimpleClass s2))";
+			const string query = "from SimpleClass s where s.id in ((select s1.id from SimpleClass s1) union (select s2.id from SimpleClass s2))";
 			Assert.DoesNotThrow(() => GetSqlWithClassicParser(query));

-         query = "from SimpleClass s where s.id in (select s1.id from SimpleClass s1 union select s2.id from SimpleClass s2)";
-         Assert.DoesNotThrow(() => GetSql(query));
+			const string queryForAntlr = "from SimpleClass s where s.id in (select s1.id from SimpleClass s1 union select s2.id from SimpleClass s2)";
+			Assert.DoesNotThrow(() => GetSql(queryForAntlr));
 		}
 	}
 }


Lazy-property was implemented the feature is now supported.

SVN: 488784591515bd4cdaa016be4ec9b172dc4e7caf@5219

--- src/NHibernate.Test/LazyOneToOne/LazyOneToOneTest.cs
+++ src/NHibernate.Test/LazyOneToOne/LazyOneToOneTest.cs
@@ -6,7 +6,7 @@

 namespace NHibernate.Test.LazyOneToOne
 {
-	[TestFixture, Ignore("Not supported.")]
+	[TestFixture]
 	public class LazyOneToOneTest : TestCase
 	{
 		protected override IList Mappings
@@ -19,15 +19,17 @@
 			get { return "NHibernate.Test"; }
 		}

-		protected override bool AppliesTo(Dialect.Dialect dialect)
-		{
-			// this test work only with Field interception (NH-1618)
-			return FieldInterceptionHelper.IsInstrumented( new Person() );
-		}
+		//protected override bool AppliesTo(Dialect.Dialect dialect)
+		//{
+		//  // this test work only with Field interception (NH-1618)
+		//  return FieldInterceptionHelper.IsInstrumented( new Person() );
+		//}
 		protected override void Configure(Cfg.Configuration configuration)
 		{
-			cfg.SetProperty(Environment.MaxFetchDepth, "2");
-			cfg.SetProperty(Environment.UseSecondLevelCache, "false");
+			configuration.SetProperty(Environment.ProxyFactoryFactoryClass,
+										typeof(NHibernate.ByteCode.Castle.ProxyFactoryFactory).AssemblyQualifiedName);
+			configuration.SetProperty(Environment.MaxFetchDepth, "2");
+			configuration.SetProperty(Environment.UseSecondLevelCache, "false");
 		}

 		protected override string CacheConcurrencyStrategy
@@ -53,7 +55,7 @@
 			s = OpenSession();
 			t = s.BeginTransaction();
 			p = s.CreateQuery("from Person where name='Gavin'").UniqueResult<Person>();
-			//Assert.That(!NHibernateUtil.IsPropertyInitialized(p, "Employee"));
+			Assert.That(!NHibernateUtil.IsPropertyInitialized(p, "Employee"));

 			Assert.That(p.Employee.Person, Is.SameAs(p));
 			Assert.That(NHibernateUtil.IsInitialized(p.Employee.Employments));
@@ -67,7 +69,7 @@
 			s = OpenSession();
 			t = s.BeginTransaction();
 			p = s.Get<Person>("Gavin");
-			//Assert.That(!NHibernateUtil.IsPropertyInitialized(p, "Employee"));
+			Assert.That(!NHibernateUtil.IsPropertyInitialized(p, "Employee"));

 			Assert.That(p.Employee.Person, Is.SameAs(p));
 			Assert.That(NHibernateUtil.IsInitialized(p.Employee.Employments));


SequenceStyleGenerator.cs: Reorder methods for easier comparison with Hibernate. No functional changes.

--- src/NHibernate/Id/Enhanced/SequenceStyleGenerator.cs
+++ src/NHibernate/Id/Enhanced/SequenceStyleGenerator.cs
@@ -82,34 +82,6 @@
 		public IType IdentifierType { get; private set; }

-		#region Implementation of IIdentifierGenerator
-
-		public virtual object Generate(ISessionImplementor session, object obj)
-		{
-			return Optimizer.Generate(DatabaseStructure.BuildCallback(session));
-		}
-
-		#endregion
-
-		#region Implementation of IPersistentIdentifierGenerator
-
-		public virtual string[] SqlCreateStrings(Dialect.Dialect dialect)
-		{
-			return DatabaseStructure.SqlCreateStrings(dialect);
-		}
-
-		public virtual string[] SqlDropString(Dialect.Dialect dialect)
-		{
-			return DatabaseStructure.SqlDropStrings(dialect);
-		}
-
-		public virtual string GeneratorKey()
-		{
-			return DatabaseStructure.Name;
-		}
-
-		#endregion
-
 		#region Implementation of IConfigurable

 		public virtual void Configure(IType type, IDictionary<string, string> parms, Dialect.Dialect dialect)
@@ -165,5 +137,35 @@
 		}

 		#endregion
+
+
+		#region Implementation of IIdentifierGenerator
+
+		public virtual object Generate(ISessionImplementor session, object obj)
+		{
+			return Optimizer.Generate(DatabaseStructure.BuildCallback(session));
+		}
+
+		#endregion
+
+
+		#region Implementation of IPersistentIdentifierGenerator
+
+		public virtual string GeneratorKey()
+		{
+			return DatabaseStructure.Name;
+		}
+
+		public virtual string[] SqlCreateStrings(Dialect.Dialect dialect)
+		{
+			return DatabaseStructure.SqlCreateStrings(dialect);
+		}
+
+		public virtual string[] SqlDropString(Dialect.Dialect dialect)
+		{
+			return DatabaseStructure.SqlDropStrings(dialect);
+		}
+
+		#endregion
 	}
 }