AV1704: Simplified tests

AV1704: Simplified tests

--- src/CSharpGuidelinesAnalyzer/CSharpGuidelinesAnalyzer.Test/Specs/Naming/DoNotUseNumberInIdentifierNameSpecs.cs
+++ src/CSharpGuidelinesAnalyzer/CSharpGuidelinesAnalyzer.Test/Specs/Naming/DoNotUseNumberInIdentifierNameSpecs.cs
@@ -174,12 +174,9 @@
         internal void When_field_name_contains_no_digits_it_must_be_skipped()
         {
             // Arrange
-            ParsedSourceCode source = new TypeSourceCodeBuilder()
-                .InGlobalScope(@"
-                    class C
-                    {
-                        private int f;
-                    }
+            ParsedSourceCode source = new MemberSourceCodeBuilder()
+                .InDefaultClass(@"
+                    private int f;
                 ")
                 .Build();

@@ -191,12 +188,9 @@
         internal void When_field_name_contains_a_digit_it_must_be_reported()
         {
             // Arrange
-            ParsedSourceCode source = new TypeSourceCodeBuilder()
-                .InGlobalScope(@"
-                    class C
-                    {
-                        private int [|f3|];
-                    }
+            ParsedSourceCode source = new MemberSourceCodeBuilder()
+                .InDefaultClass(@"
+                    private int [|f3|];
                 ")
                 .Build();

@@ -209,12 +203,9 @@
         internal void When_property_name_contains_no_digits_it_must_be_skipped()
         {
             // Arrange
-            ParsedSourceCode source = new TypeSourceCodeBuilder()
-                .InGlobalScope(@"
-                    class C
-                    {
-                        public int P { get; } = 123;
-                    }
+            ParsedSourceCode source = new MemberSourceCodeBuilder()
+                .InDefaultClass(@"
+                    public int P { get; } = 123;
                 ")
                 .Build();

@@ -226,12 +217,9 @@
         internal void When_property_name_contains_a_digit_it_must_be_reported()
         {
             // Arrange
-            ParsedSourceCode source = new TypeSourceCodeBuilder()
-                .InGlobalScope(@"
-                    class C
-                    {
-                        public int [|P6|] { get; } = 123;
-                    }
+            ParsedSourceCode source = new MemberSourceCodeBuilder()
+                .InDefaultClass(@"
+                    public int [|P6|] { get; } = 123;
                 ")
                 .Build();

@@ -290,12 +278,9 @@
         internal void When_event_name_contains_no_digits_it_must_be_skipped()
         {
             // Arrange
-            ParsedSourceCode source = new TypeSourceCodeBuilder()
-                .InGlobalScope(@"
-                    class C
-                    {
-                        public event EventHandler ValueChanged;
-                    }
+            ParsedSourceCode source = new MemberSourceCodeBuilder()
+                .InDefaultClass(@"
+                    public event EventHandler ValueChanged;
                 ")
                 .Build();

@@ -307,12 +292,9 @@
         internal void When_event_name_contains_a_digit_it_must_be_reported()
         {
             // Arrange
-            ParsedSourceCode source = new TypeSourceCodeBuilder()
-                .InGlobalScope(@"
-                    class C
-                    {
-                        public event EventHandler [|Value9Changed|];
-                    }
+            ParsedSourceCode source = new MemberSourceCodeBuilder()
+                .InDefaultClass(@"
+                    public event EventHandler [|Value9Changed|];
                 ")
                 .Build();

@@ -325,13 +307,10 @@
         internal void When_method_name_contains_no_digits_it_must_be_skipped()
         {
             // Arrange
-            ParsedSourceCode source = new TypeSourceCodeBuilder()
-                .InGlobalScope(@"
-                    class C
-                    {
-                        void M()
-                        {
-                        }
+            ParsedSourceCode source = new MemberSourceCodeBuilder()
+                .InDefaultClass(@"
+                    void M()
+                    {
                     }
                 ")
                 .Build();
@@ -344,13 +323,10 @@
         internal void When_method_name_contains_a_digit_it_must_be_reported()
         {
             // Arrange
-            ParsedSourceCode source = new TypeSourceCodeBuilder()
-                .InGlobalScope(@"
-                    class C
-                    {
-                        void [|M6|]()
-                        {
-                        }
+            ParsedSourceCode source = new MemberSourceCodeBuilder()
+                .InDefaultClass(@"
+                    void [|M6|]()
+                    {
                     }
                 ")
                 .Build();
@@ -414,15 +390,12 @@
         internal void When_local_function_name_contains_no_digits_it_must_be_skipped()
         {
             // Arrange
-            ParsedSourceCode source = new TypeSourceCodeBuilder()
-                .InGlobalScope(@"
-                    class C
-                    {
-                        void M()
-                        {
-                            void L()
-                            {
-                            }
+            ParsedSourceCode source = new MemberSourceCodeBuilder()
+                .InDefaultClass(@"
+                    void M()
+                    {
+                        void L()
+                        {
                         }
                     }
                 ")
@@ -436,15 +409,12 @@
         internal void When_local_function_name_contains_a_digit_it_must_be_reported()
         {
             // Arrange
-            ParsedSourceCode source = new TypeSourceCodeBuilder()
-                .InGlobalScope(@"
-                    class C
-                    {
-                        void M()
-                        {
-                            void [|L6|]()
-                            {
-                            }
+            ParsedSourceCode source = new MemberSourceCodeBuilder()
+                .InDefaultClass(@"
+                    void M()
+                    {
+                        void [|L6|]()
+                        {
                         }
                     }
                 ")
@@ -459,13 +429,10 @@
         internal void When_method_parameter_name_contains_no_digits_it_must_be_skipped()
         {
             // Arrange
-            ParsedSourceCode source = new TypeSourceCodeBuilder()
-                .InGlobalScope(@"
-                    class C
-                    {
-                        void M(int p)
-                        {
-                        }
+            ParsedSourceCode source = new MemberSourceCodeBuilder()
+                .InDefaultClass(@"
+                    void M(int p)
+                    {
                     }
                 ")
                 .Build();
@@ -478,13 +445,10 @@
         internal void When_method_parameter_name_contains_a_digit_it_must_be_reported()
         {
             // Arrange
-            ParsedSourceCode source = new TypeSourceCodeBuilder()
-                .InGlobalScope(@"
-                    class C
-                    {
-                        void M(int [|p1|])
-                        {
-                        }
+            ParsedSourceCode source = new MemberSourceCodeBuilder()
+                .InDefaultClass(@"
+                    void M(int [|p1|])
+                    {
                     }
                 ")
                 .Build();
@@ -498,15 +462,12 @@
         internal void When_local_function_parameter_name_contains_no_digits_it_must_be_skipped()
         {
             // Arrange
-            ParsedSourceCode source = new TypeSourceCodeBuilder()
-                .InGlobalScope(@"
-                    class C
-                    {
-                        void M()
-                        {
-                            void L(int p)
-                            {
-                            }
+            ParsedSourceCode source = new MemberSourceCodeBuilder()
+                .InDefaultClass(@"
+                    void M()
+                    {
+                        void L(int p)
+                        {
                         }
                     }
                 ")
@@ -520,15 +481,12 @@
         internal void When_local_function_parameter_name_contains_a_digit_it_must_be_reported()
         {
             // Arrange
-            ParsedSourceCode source = new TypeSourceCodeBuilder()
-                .InGlobalScope(@"
-                    class C
-                    {
-                        void M()
-                        {
-                            void L(int [|p1|])
-                            {
-                            }
+            ParsedSourceCode source = new MemberSourceCodeBuilder()
+                .InDefaultClass(@"
+                    void M()
+                    {
+                        void L(int [|p1|])
+                        {
                         }
                     }
                 ")
@@ -593,14 +551,11 @@
         internal void When_variable_name_contains_no_digits_it_must_be_skipped()
         {
             // Arrange
-            ParsedSourceCode source = new TypeSourceCodeBuilder()
-                .InGlobalScope(@"
-                    class C
-                    {
-                        void M()
-                        {
-                            string str = ""A"";
-                        }
+            ParsedSourceCode source = new MemberSourceCodeBuilder()
+                .InDefaultClass(@"
+                    void M()
+                    {
+                        string str = ""A"";
                     }
                 ")
                 .Build();
@@ -613,14 +568,11 @@
         internal void When_variable_name_contains_a_digit_it_must_be_reported()
         {
             // Arrange
-            ParsedSourceCode source = new TypeSourceCodeBuilder()
-                .InGlobalScope(@"
-                    class C
-                    {
-                        void M()
-                        {
-                            string [|str12|] = ""A"";
-                        }
+            ParsedSourceCode source = new MemberSourceCodeBuilder()
+                .InDefaultClass(@"
+                    void M()
+                    {
+                        string [|str12|] = ""A"";
                     }
                 ")
                 .Build();
@@ -762,13 +714,10 @@
         internal void When_method_name_contains_only_whitelisted_words_it_must_be_skipped()
         {
             // Arrange
-            ParsedSourceCode source = new TypeSourceCodeBuilder()
-                .InGlobalScope(@"
-                    class C
-                    {
-                        void Int16SaveInt32Or3DIntoInt64()
-                        {
-                        }
+            ParsedSourceCode source = new MemberSourceCodeBuilder()
+                .InDefaultClass(@"
+                    void Int16SaveInt32Or3DIntoInt64()
+                    {
                     }
                 ")
                 .Build();
@@ -781,13 +730,10 @@
         internal void When_method_name_contains_whitelisted_words_and_digits_it_must_be_reported()
         {
             // Arrange
-            ParsedSourceCode source = new TypeSourceCodeBuilder()
-                .InGlobalScope(@"
-                    class C
-                    {
-                        void [|ConvertDigit9IntoInt32|]()
-                        {
-                        }
+            ParsedSourceCode source = new MemberSourceCodeBuilder()
+                .InDefaultClass(@"
+                    void [|ConvertDigit9IntoInt32|]()
+                    {
                     }
                 ")
                 .Build();
@@ -801,13 +747,10 @@
         internal void When_method_name_contains_part_of_whitelisted_word_it_must_be_reported()
         {
             // Arrange
-            ParsedSourceCode source = new TypeSourceCodeBuilder()
-                .InGlobalScope(@"
-                    class C
-                    {
-                        void [|GetMatrix3Demo|]()
-                        {
-                        }
+            ParsedSourceCode source = new MemberSourceCodeBuilder()
+                .InDefaultClass(@"
+                    void [|GetMatrix3Demo|]()
+                    {
                     }
                 ")
                 .Build();


ssl doc for rmq

ssl doc for rmq

Former-commit-id: 85a378515bcafdf58be8251fc1e5370338f1944d

--- src/Transports/MassTransit.Transports.RabbitMq/Configuration/Configurators/SslConnectionFactoryConfigurator.cs
+++ src/Transports/MassTransit.Transports.RabbitMq/Configuration/Configurators/SslConnectionFactoryConfigurator.cs
@@ -12,6 +12,10 @@
 // specific language governing permissions and limitations under the License.
 namespace MassTransit.Transports.RabbitMq.Configuration.Configurators
 {
+	/// <summary>
+	/// Configures SSL/TLS for RabbitMQ. See http://www.rabbitmq.com/ssl.html
+	/// for details on how to set up RabbitMQ for SSL.
+	/// </summary>
 	public interface SslConnectionFactoryConfigurator
 	{
 		void SetServerName(string serverName);


Updated SetSiteLockState to not retrieve extended properties.

--- Core/OfficeDevPnP.Core/Extensions/TenantExtensions.cs
+++ Core/OfficeDevPnP.Core/Extensions/TenantExtensions.cs
@@ -518,7 +518,7 @@
         /// <param name="timeoutFunction">An optional function that will be called while waiting for the site to be created. If set will override the wait variable. Return true to cancel the wait loop.</param>
         public static void SetSiteLockState(this Tenant tenant, string siteFullUrl, SiteLockState lockState, bool wait = false, Func<TenantOperationMessage, bool> timeoutFunction = null)
         {
-            var siteProps = tenant.GetSitePropertiesByUrl(siteFullUrl, true);
+            var siteProps = tenant.GetSitePropertiesByUrl(siteFullUrl, false);
             tenant.Context.Load(siteProps);
             tenant.Context.ExecuteQueryRetry();


Fixed #25

Fixed #25

--- TDV/GUI.cs
+++ TDV/GUI.cs
@@ -78,8 +78,7 @@
 			Common.menuMusicVol = Common.currentMusicVol;
 			Common.onlineMusicVol = Common.currentMusicVol;
 			dxInput.DInputInit(this);
-			if (!DSound.initializeOgg())
-			{
+			if (!DSound.initializeOgg()) {
 				MessageBox.Show("You do not have XAudio installed." +
 	"You can download XAudio by running the SharpDX installer from the following address:\r\n" +
 	"http://www.bpcprograms.com/programs/utilities/," +
@@ -104,8 +103,7 @@
 		//Form overrides dispose to clean up the component list.
 		protected override void Dispose(bool disposing)
 		{
-			if (disposing)
-			{
+			if (disposing) {
 			}
 			base.Dispose(disposing);
 		}
@@ -256,8 +254,7 @@
 			if (!firstTimeLoad)
 				return;

-			try
-			{
+			try {
 				Common.menuNotifier = new AutoResetEvent(false);
 				Common.onlineMenuNotifier = new AutoResetEvent(false);
 				Options.readFromFile();
@@ -279,18 +276,15 @@
 				while (introSound.isPlaying() && !dxInput.isKeyHeldDown() && !dxInput.isJSButtonHeldDown() && dxInput.JSDirectionalPadIsCenter())
 					Thread.Sleep(100);
 				introSound.stopOgg();
-				if (isUpdating())
-				{
+				if (isUpdating()) {
 					while (!completedDownload)
 						Thread.Sleep(500);
 					completedDownload = false;

-					if (!error)
-					{
+					if (!error) {
 						Common.GenerateMenu("The update has been downloaded. Press ENTER to shut down TDV and install the update. TDV will restart once the update is complete.", new String[] { "OK" });
 						shutDownAndInstall = true;
-					}
-					else
+					} else
 						Common.GenerateMenu("Error downloading update. Press ENTER to continue.", new String[] { "Ok" });
 				} //if getting update
 				DateTime now = DateTime.Now;
@@ -299,8 +293,7 @@
 				Options.year = now.Year;
 				Options.writeToFile();
 			}
-			catch (Exception err)
-			{
+			catch (Exception err) {
 				if (err.Message.Contains("REGDB_E_CLASSNOTREG"))
 					MessageBox.Show("You do not have the latest DirectX components installed. " +
 						"You can download them from the following address:\r\n" +
@@ -318,25 +311,20 @@
 		{
 			if (Common.firstTimeLoad)
 				startGame(true);
-			if (shutDownAndInstall)
-			{
+			if (shutDownAndInstall) {
 				System.Diagnostics.Process.Start(Addendums.File.commonAppPath + "\\update.exe", "/silent");
 				SapiSpeech.enableJAWSHook();
 				Environment.Exit(0);
 			}

-			while (true)
-			{
-				try
-				{
-					if (!KeyMap.readFromFile() && Common.firstTimeLoad)
-					{
+			while (true) {
+				try {
+					if (!KeyMap.readFromFile() && Common.firstTimeLoad) {
 						OggBuffer kError = DSound.loadOgg(DSound.NSoundPath + "\\kme.ogg");
 						kError.play();
 						while (dxInput.isKeyHeldDown())
 							Thread.Sleep(10);
-						while (kError.isPlaying())
-						{
+						while (kError.isPlaying()) {
 							if (dxInput.isKeyHeldDown())
 								break;
 							Thread.Sleep(10);
@@ -347,12 +335,10 @@

 					Options.setDifficulty(Options.difficulties.easy);
 					Interaction.clearData();
-					if (Common.ACBMode)
-					{
+					if (Common.ACBMode) {
 						OggBuffer introSound = DSound.loadOgg(DSound.SoundPath + "\\tdvl.ogg");
 						introSound.play();
-						while (introSound.isPlaying())
-						{
+						while (introSound.isPlaying()) {
 							if (dxInput.isKeyHeldDown())
 								break;
 							Thread.Sleep(100);
@@ -360,8 +346,7 @@
 						introSound.stopOgg();
 					} //if ACB mode
 					mainMenu();
-					if (!Options.requestedShutdown)
-					{
+					if (!Options.requestedShutdown) {
 						Common.startGame();
 						if (Common.firstTimeLoad)
 							Common.firstTimeLoad = false;
@@ -370,16 +355,14 @@
 						if (Options.requestedShutdown)
 							return;
 					} //if not requested shutdown
-					//eg. player did not choose exit from main menu
-					else
-					{ //if requested shutdown
+					  //eg. player did not choose exit from main menu
+					else { //if requested shutdown
 						Options.requestedShutdown = false;
 						Common.shutdown();
 						return; //don't loop over
 					} //if shutdown
 				}
-				catch (Exception e)
-				{
+				catch (Exception e) {
 					Common.handleError(e);
 				}
 			} //while
@@ -407,38 +390,32 @@
 			//writeTrack();
 			DSound.masterMusicVolume = Common.menuMusicVol;
 			//If we tried to connect and the connection failed, then the main menu music will still be playing
-			if (!Common.failedConnect)
-			{
+			if (!Common.failedConnect) {
 				Common.music = DSound.loadOgg(DSound.SoundPath + "\\ms1.ogg", Common.menuMusicVol);
 				Common.music.play(true);
 			}
 			Common.failedConnect = false;

-			if (Common.ACBMode)
-			{
+			if (Common.ACBMode) {
 				//If we're setting up the environment for the first time,
 				//let us pick the game controller.
 				if (Options.enabled != Options.Device.gameController)
 					showDevices();
 				long time = Environment.TickCount;
 				bool a = false;
-				while ((Environment.TickCount - time) / 1000 < 60)
-				{
-					if (dxInput.isKeyHeldDown(Key.Escape))
-					{
+				while ((Environment.TickCount - time) / 1000 < 60) {
+					if (dxInput.isKeyHeldDown(Key.Escape)) {
 						Options.requestedShutdown = true;
 						a = true;
 						break;
 					}
-					if (dxInput.isKeyHeldDown(Key.T))
-					{
+					if (dxInput.isKeyHeldDown(Key.T)) {
 						a = true;
 						Options.autoPlay = false;
 						Options.mode = Options.Modes.testing;
 						break;
 					}
-					if (dxInput.isKeyHeldDown(Key.P))
-					{
+					if (dxInput.isKeyHeldDown(Key.P)) {
 						a = true;
 						Options.autoPlay = false;
 						Options.mode = Options.Modes.deathMatch;
@@ -448,31 +425,24 @@
 						showDevices();
 					Thread.Sleep(100);
 				} //while
-				if (!a)
-				{
+				if (!a) {
 					Options.autoPlay = true;
 					Options.mode = Options.Modes.deathMatch;
 				} //if we didn't get a specific action to perform
-			}
-			else
-			{ //if not ACB
+			} else { //if not ACB
 				string[] m1 = { "mainmenu_1.wav", "mainmenu_7.wav", "mainmenu_2.wav", "mainmenu_3.wav", "mainmenu_5.wav", "mainmenu_6.wav",
-                              "mainmenu_4.wav" };
+							  "mainmenu_4.wav" };
 				bool exitMenu = false;
 				int index = 0;
-				while (!exitMenu)
-				{
+				while (!exitMenu) {
 					index = Common.sVGenerateMenu(dxInput.JSDevice == null ? "mainmenu_i.wav" : "mainmenu_ijs.wav", m1, index, Common.getIncDecVol());
-					switch (index)
-					{
+					switch (index) {
 						case 0: //start game
-							if (Options.mode == Options.Modes.none)
-							{ //start flight with no mode selected
+							if (Options.mode == Options.Modes.none) { //start flight with no mode selected
 								if (!selectMode())
 									break; //escaped out of mode selection
 							}
-							if (Options.mode == Options.Modes.racing)
-							{
+							if (Options.mode == Options.Modes.racing) {
 								selectTrack();
 								exitMenu = true;
 							}
@@ -497,14 +467,12 @@
 							break;
 						case 4: //options
 							string[] oArray = { "mainmenu_5_1.wav", "mainmenu_5_2.wav",
-                                          "mainmenu_5_3.wav", "mainmenu_5_4.wav"};
+										  "mainmenu_5_3.wav", "mainmenu_5_4.wav"};

 							int oIndex = 0;
-							while (oIndex != -1)
-							{
+							while (oIndex != -1) {
 								oIndex = Common.sVGenerateMenu(null, oArray, oIndex, Common.getIncDecVol());
-								switch (oIndex)
-								{
+								switch (oIndex) {
 									case 0: //map keys
 										buildKeyMapMenu();
 										break;
@@ -543,8 +511,7 @@
 			int choice = Common.sVGenerateMenu("mainmenu_5_4_i.wav", new String[] { "mainmenu_5_4_1.wav", "mainmenu_5_4_2.wav" }, (int)(SapiSpeech.source - 1), Common.getIncDecVol());
 			if (choice == -1)
 				return;
-			switch (choice)
-			{
+			switch (choice) {
 				case 0:
 					SapiSpeech.setSource(SapiSpeech.SpeechSource.SAPI);
 					break;
@@ -558,13 +525,12 @@
 		private void changePerformance()
 		{
 			String[] options = { "mainmenu_5_3_1.wav",
-                                          "mainmenu_5_3_2.wav",
-                                          "mainmenu_5_3_3.wav" };
+										  "mainmenu_5_3_2.wav",
+										  "mainmenu_5_3_3.wav" };
 			int choice = Common.sVGenerateMenu("mainmenu_5_3_i.wav", options, Common.getIncDecVol());
 			if (choice == -1)
 				return;
-			switch (choice)
-			{
+			switch (choice) {
 				case 0:
 					Options.bufferSize = DSound.BufferSize.large;
 					break;
@@ -585,12 +551,11 @@
 		{
 			bool deletedMap = false;
 			int dO = 0; //keyboard by default
-			//Only display the menu below if we have a joystick connected,
-			//else skip it and assume keyboard mapping.
-			if (dxInput.JSDevice != null)
-			{
+						//Only display the menu below if we have a joystick connected,
+						//else skip it and assume keyboard mapping.
+			if (dxInput.JSDevice != null) {
 				string[] devices = {"mainmenu_5_1_1.wav",
-                      "mainmenu_5_1_2.wav"};
+					  "mainmenu_5_1_2.wav"};
 				dO = Common.sVGenerateMenu("mainmenu_5_1_i.wav",
 					devices, Common.getIncDecVol());
 				if (dO == -1)
@@ -608,8 +573,7 @@
 			int[] jsKey = null;
 			bool canceledCurrent = false;
 			int assigned = 0;
-			while (index != 0)
-			{
+			while (index != 0) {
 				r = null;
 				m = null;
 				jsKey = null;
@@ -635,25 +599,19 @@
 				index = Common.sVGenerateMenu("ki.wav", strKeys,
 																(index == -1) ? 0 : (index - 1),
 																Common.getIncDecVol()) + 1;
-				if (index > 0)
-				{
-					if (index < strKeys.Length)
-					{
-						if (mapKeyboard)
-						{
+				if (index > 0) {
+					if (index < strKeys.Length) {
+						if (mapKeyboard) {
 							m = null;
 							r = null;
 							OggBuffer prompt = DSound.loadOgg(DSound.NSoundPath + "\\kmp1.ogg");
 							prompt.play();
-							while (dxInput.isKeyHeldDown())
-							{
+							while (dxInput.isKeyHeldDown()) {
 								//wait till the user lets up on enter.
 								Application.DoEvents();
 							}
-							while (m == null)
-							{
-								if (dxInput.isKeyHeldDown(Key.Escape))
-								{
+							while (m == null) {
+								if (dxInput.isKeyHeldDown(Key.Escape)) {
 									canceledCurrent = true;
 									break;
 								}
@@ -663,18 +621,15 @@
 							prompt.stopOgg();
 							prompt = null;

-							if (!canceledCurrent)
-							{
+							if (!canceledCurrent) {
 								prompt = DSound.loadOgg(DSound.NSoundPath + "\\kmp2.ogg");
 								prompt.play();
-								while (dxInput.isKeyHeldDown())
-								{
+								while (dxInput.isKeyHeldDown()) {
 									//wait till the user lets up on enter.
 									Application.DoEvents();
 								}
 								//Next, get a key
-								while (r == null)
-								{
+								while (r == null) {
 									r = dxInput.getKeys();
 									Application.DoEvents();
 								}
@@ -685,13 +640,11 @@
 									assigned = KeyMap.alreadyAssignedTo(r[0]);
 								else
 									assigned = KeyMap.alreadyAssignedTo(m[0], r[0]);
-								if (KeyMap.isReserved(m[0], r[0]))
-								{
+								if (KeyMap.isReserved(m[0], r[0])) {
 									DSound.playAndWait(DSound.NSoundPath + "\\kd5.wav");
 									break;
 								}
-								if (assigned != 0)
-								{
+								if (assigned != 0) {
 									DSound.playAndWait(DSound.NSoundPath + "\\kp1.wav");
 									DSound.playAndWait(DSound.NSoundPath + "\\" + strKeys[assigned - 1]);
 									int overConf = Common.sVGenerateMenu("kp2.wav",
@@ -706,19 +659,14 @@
 								if (assigned != 0)
 									KeyMap.clearKeyboardAssignment((Aircraft.Action)assigned);
 							} //if !canceledCurrent
-						}
-
-						else
-						{
+						} else {
 							//joystick
 							OggBuffer prompt = DSound.loadOgg(DSound.NSoundPath + "\\kmp3.ogg");
 							prompt.play();
-							while (dxInput.isJSButtonHeldDown())
-							{
+							while (dxInput.isJSButtonHeldDown()) {
 								Application.DoEvents();
 							}
-							while (jsKey == null)
-							{
+							while (jsKey == null) {
 								jsKey = dxInput.getJSKeys();
 								Application.DoEvents();
 							}
@@ -728,12 +676,10 @@
 						}
 						//joystick
 					} //if index < .length
-					else
-					{ //if we want to delete keymap
+					else { //if we want to delete keymap
 						int yesNo = Common.sVGenerateMenu("kd2.wav",
 							new String[] { "kd3.wav", "kd4.wav" }, Common.getIncDecVol());
-						if (yesNo == 1)
-						{
+						if (yesNo == 1) {
 							KeyMap.deleteKeymap((mapKeyboard) ? KeyMap.Device.keyboard : KeyMap.Device.joystick);
 							index = 0; //exit keymap
 							deletedMap = true;
@@ -753,8 +699,7 @@
 			string[] tracks = Directory.GetFiles(Common.trackDirectory);
 			string[] trackNames = new string[tracks.Length];
 			int i = 0;
-			for (i = 0; i <= tracks.Length - 1; i++)
-			{
+			for (i = 0; i <= tracks.Length - 1; i++) {
 				trackNames[i] = Area.getName(Common.trackDirectory + '\\' + tracks[i].Split('\\')[tracks[i].Split('\\').Length - 1]);
 				////getFiles() returns tracks\filename,
 				////and we want only file name. So splitting the return value is necessary.
@@ -767,8 +712,7 @@
 			 trackIndex = Common.GenerateMenu("Select a track", trackNames);
 			}
 			 * */
-			if (trackIndex > -1)
-			{
+			if (trackIndex > -1) {
 				Options.currentTrack = tracks[trackIndex].Split('\\')[tracks[trackIndex].Split('\\').Length - 1];
 				////remove the leading relative directory name from the track filename
 			}
@@ -782,8 +726,8 @@
 						 DeviceEnumerationFlags.AttachedOnly); //enumerator for keyboards
 			dList2 = dxInput.input.GetDevices(DeviceClass.GameControl,
 						 DeviceEnumerationFlags.AttachedOnly); //enumerator for all game controllers
-			//Check to see if we have any controlers attached.
-			//dList2 itself will not be null, but the enumerator could be null which means no joysticks.
+															   //Check to see if we have any controlers attached.
+															   //dList2 itself will not be null, but the enumerator could be null which means no joysticks.
 			DeviceInstance o = null;
 			foreach (DeviceInstance t in dList2)
 				o = t;
@@ -795,15 +739,12 @@
 			DeviceInstance[] devList = null;
 			devList = (DeviceInstance[])(Array.CreateInstance(typeof(DeviceInstance),
 							(dList2 == null) ? 1 : 2));
-			foreach (DeviceInstance d in dList)
-			{
+			foreach (DeviceInstance d in dList) {
 				devList[0] = d;
 				break;
 			}
-			if (dList2 != null)
-			{
-				foreach (DeviceInstance d in dList2)
-				{
+			if (dList2 != null) {
+				foreach (DeviceInstance d in dList2) {
 					devList[1] = d;
 					break;
 				}
@@ -816,8 +757,7 @@
 						 : Common.sVGenerateMenu(null, devListSTR, Common.getIncDecVol());
 			if (mindex == -1)
 				return;
-			if (mindex > 0)
-			{
+			if (mindex > 0) {
 				//chose joystick
 				//so config it
 				bool success = configureJS(devList[mindex].InstanceGuid, silentMode);
@@ -825,9 +765,7 @@
 				Options.enabled = Options.Device.gameController;
 				if (success && !silentMode)
 					DSound.playAndWait(DSound.NSoundPath + "\\gce.wav");
-			}
-			else
-			{
+			} else {
 				dxInput.unacquireJoystick(true);
 				KeyMap.readFromFile();
 				Options.enabled = Options.Device.keyboard;
@@ -850,8 +788,7 @@
 				dxInput.DInputInit(Common.guiHandle, guid);

 			if (!File.Exists(Addendums.File.appPath
-						 + "\\dev_" + guid.ToString() + ".tdv"))
-			{
+						 + "\\dev_" + guid.ToString() + ".tdv")) {
 				if (silentMode)
 					return false;
 				dxInput.JSXCenter = dxInput.JSState.X;
@@ -867,9 +804,7 @@
 				s.Write(dxInput.JSZCenter);
 				s.Write(dxInput.JSRZCenter);
 				s.Close();
-			}
-			else
-			{
+			} else {
 				BinaryReader s = new BinaryReader(new FileStream(Addendums.File.appPath
 								+ "\\dev_" + guid.ToString() + ".tdv", FileMode.Open));
 				dxInput.JSXCenter = s.ReadInt32();
@@ -899,10 +834,8 @@
 			Thread thread = null;
 			if (Interaction.holderAt(0) == null)
 				return;
-			while (index < Interaction.holderArray.Count)
-			{
-				if (!Interaction.holderAt(index).isEmpty())
-				{
+			while (index < Interaction.holderArray.Count) {
+				if (!Interaction.holderAt(index).isEmpty()) {
 					thread = Interaction.holderAt(index).getAssociatedThread();
 					if (thread != null && thread.ThreadState == ThreadState.Running)
 						thread.Priority = ThreadPriority.Normal;
@@ -930,10 +863,8 @@
 			Thread thread = null;
 			if (Interaction.holderAt(0) == null)
 				return;
-			while (index < Interaction.holderArray.Count)
-			{
-				if (!Interaction.holderAt(index).isEmpty())
-				{
+			while (index < Interaction.holderArray.Count) {
+				if (!Interaction.holderAt(index).isEmpty()) {
 					thread = Interaction.holderAt(index).getAssociatedThread();
 					if (thread != null && thread.ThreadState == ThreadState.Running)
 						thread.Priority = ThreadPriority.Lowest;
@@ -945,18 +876,14 @@

 		private void register()
 		{
-			if (Common.isValidLicense())
-			{
+			if (Common.isValidLicense()) {
 				Options.isDemo = false;
 				return;
 			}
-			if (Common.isRegistered())
-			{
+			if (Common.isRegistered()) {
 				if (!Common.isValidLicense())
 					Common.playUntilKeyPress(DSound.NSoundPath + "\\reg2.ogg");
-			}
-			else
-			{ //if not license at all
+			} else { //if not license at all
 				if (!Common.ACBMode)
 					Common.playUntilKeyPress(DSound.NSoundPath + "\\reg1.ogg");
 			}
@@ -964,17 +891,16 @@

 		private bool selectMode(bool resetMode)
 		{
-			if (resetMode)
-			{
+			if (resetMode) {
 				Options.mode = Options.Modes.none;
 				Options.autoPlay = false;
 				Options.isPlayingOnline = false;
 			}

 			string[] modeOptions = { "mainmenu_2_1.wav",
-                                                   "mainmenu_2_2.wav",
+												   "mainmenu_2_2.wav",
 												   (Options.mode != Options.Modes.autoPlay) ? "mainmenu_2_3.wav" : "",
-                                                   (Options.mode != Options.Modes.autoPlay) ? "mainmenu_2_4.wav" : "",
+												   (Options.mode != Options.Modes.autoPlay) ? "mainmenu_2_4.wav" : "",
 (Options.mode != Options.Modes.autoPlay) ? "mainmenu_2_5.wav" : "",
 "mainmenu_2_6.wav"
 					   };
@@ -982,16 +908,12 @@
 			if (modeIndex == -1)
 				return false;
 			Options.mode = (Options.Modes)(modeIndex + 1);
-			if (Options.mode == Options.Modes.autoPlay)
-			{ //player selected autoplay,
-				//so next they need to select racing or dm to autoplay
-				if (!selectMode(false))
-				{
+			if (Options.mode == Options.Modes.autoPlay) { //player selected autoplay,
+														  //so next they need to select racing or dm to autoplay
+				if (!selectMode(false)) {
 					Options.mode = Options.Modes.none;
 					return false;
-				}
-				else
-				{ //selected an autoplay mode
+				} else { //selected an autoplay mode
 					Options.autoPlay = true;
 					return true;
 				} //if selected *an* autoplay mode
@@ -1053,8 +975,7 @@

 		private void textBox1_KeyDown(object sender, KeyEventArgs e)
 		{
-			if (e.KeyData == Keys.Enter || e.KeyData == Keys.Escape)
-			{
+			if (e.KeyData == Keys.Enter || e.KeyData == Keys.Escape) {
 				this.AcceptButton = BtnSend;
 				this.CancelButton = BtnLeave;
 				input = (e.KeyData == Keys.Enter) ? textBox1.Text : "";
@@ -1063,8 +984,7 @@
 				textBox1.Visible = false;
 				this.Focus();
 				pressedEnter = true;
-			}
-			else
+			} else
 				e.Handled = false;
 		}

@@ -1120,8 +1040,10 @@
 			dxInput.diDev.Unacquire();

 			textBox1.Invoke(new getInputHandler(this.getInput));
-			while (!pressedEnter)
+			while (!pressedEnter) {
 				Application.DoEvents();
+				Thread.Sleep(10);
+			}
 			SapiSpeech.disableJAWSHook();
 			dxInput.diDev.Acquire();
 			while (dxInput.isKeyHeldDown(Key.Escape))
@@ -1149,8 +1071,7 @@
 		private String
 				getPageContent(String url)
 		{
-			try
-			{
+			try {
 				if (webClient == null)
 					webClient = new WebClient();
 				byte[] output = webClient.DownloadData(url);
@@ -1160,8 +1081,7 @@
 						(char)b);
 				return str.ToString();
 			}
-			catch (System.Net.WebException)
-			{
+			catch (System.Net.WebException) {
 				return "failed";
 			}
 		}
@@ -1184,8 +1104,7 @@

 		private void progressUpdated(Object sender, DownloadProgressChangedEventArgs e)
 		{
-			if (e.ProgressPercentage != lastProgress && e.ProgressPercentage % 5 == 0)
-			{
+			if (e.ProgressPercentage != lastProgress && e.ProgressPercentage % 5 == 0) {
 				lastProgress = e.ProgressPercentage;
 				SapiSpeech.speak(e.ProgressPercentage + " percent complete", SapiSpeech.SpeakFlag.interruptableButStop);
 			}
@@ -1223,12 +1142,12 @@
 		private void soundDescriptionMenu()
 		{
 			String[] s = {"alarm5.wav","alarm7.wav",
-                                 "alarm2.wav", "alarm3.wav",
-                                 "alarm1.wav", "alarm4.wav",
-                                 "alarm6.wav", "ca1-1.wav",
-                                 "m2.wav", "bsg2.wav", "cr2.wav",
-                             "alarm8.wav", "rad2.wav", "alarm10.wav",
-                             "alarm9.wav"};
+								 "alarm2.wav", "alarm3.wav",
+								 "alarm1.wav", "alarm4.wav",
+								 "alarm6.wav", "ca1-1.wav",
+								 "m2.wav", "bsg2.wav", "cr2.wav",
+							 "alarm8.wav", "rad2.wav", "alarm10.wav",
+							 "alarm9.wav"};

 			String[] choices = new String[15];
 			int choice = 0;
@@ -1236,18 +1155,15 @@
 				choices[i] = "s" + (i + 1) + ".wav";
 			String intro = (dxInput.JSDevice == null) ? "mainmenu_6_i.wav" : "mainmenu_6_ij.wav";
 			SecondarySoundBuffer clip = null;
-			do
-			{
+			do {
 				choice = Common.sVGenerateMenu(intro, choices, choice, Common.getIncDecVol());
 				intro = null;
-				if (choice != -1)
-				{
+				if (choice != -1) {
 					clip = DSound.LoadSound(DSound.SoundPath + "\\" + s[choice]);
 					DSound.PlaySound(clip, true, false);
 					while (dxInput.isKeyHeldDown() || dxInput.isJSButtonHeldDown())
 						Thread.Sleep(50);
-					while (DSound.isPlaying(clip))
-					{
+					while (DSound.isPlaying(clip)) {
 						if (dxInput.isKeyHeldDown() || dxInput.isJSButtonHeldDown())
 							break;
 						Thread.Sleep(50);
@@ -1265,8 +1181,7 @@
 			Options.loadedFromMainMenu = true; //so loadGame knows we're loading from the main screen.
 			Options.Modes oldMode = Options.mode;
 			Options.mode = Options.Modes.mission; //Some loading code like weapons needs this to be set.
-			if (Common.loadGame(slot))
-			{
+			if (Common.loadGame(slot)) {
 				Mission.isMission = true;
 				return true;
 			}
@@ -1299,21 +1214,17 @@
 		private bool isUpdating()
 		{
 			DateTime now = DateTime.Now;
-			if (now.Hour != Options.hour || now.Day != Options.day || now.Year != Options.year)
-			{
+			if (now.Hour != Options.hour || now.Day != Options.day || now.Year != Options.year) {
 				String updatever = getPageContent("http://bpcprograms.com/updates/tdv2.txt");
 				System.Diagnostics.Trace.WriteLine(updatever);
 				if (updatever.Equals("failed"))
 					return false;
 				String[] updates = updatever.Split('&');
 				String[] updateCurrent = null;
-				foreach (String update in updates)
-				{
-					if (update.Contains(Common.applicationVersion))
-					{
+				foreach (String update in updates) {
+					if (update.Contains(Common.applicationVersion)) {
 						updateCurrent = update.Split(':');
-						if (updateCurrent[0].Equals(Common.applicationVersion))
-						{
+						if (updateCurrent[0].Equals(Common.applicationVersion)) {
 							System.Diagnostics.Trace.WriteLine("Updating to " + updateCurrent[1]);
 							updateTo(Common.applicationVersion, updateCurrent[1], null);
 							return true;


Add options for Dartium location and Dartium profile location (fixes #83)

--- DanTup.DartVS.Vsix/OptionsPages/OptionsPageGeneral.cs
+++ DanTup.DartVS.Vsix/OptionsPages/OptionsPageGeneral.cs
@@ -1,4 +1,5 @@
-using Microsoft.VisualStudio.Shell;
+using System.ComponentModel;
+using Microsoft.VisualStudio.Shell;

 namespace DanTup.DartVS.OptionsPages
 {
@@ -7,5 +8,23 @@
 		public OptionsPageGeneral()
 		{
 		}
+
+		[Category("Dartium")]
+		[Description("Dartium location")]
+		[DisplayName("Dartium location")]
+		public string DartiumLocation
+		{
+			get;
+			set;
+		}
+
+		[Category("Dartium")]
+		[Description("Dartium profile location")]
+		[DisplayName("Dartium profile location")]
+		public string DartiumProfileLocation
+		{
+			get;
+			set;
+		}
 	}
 }


avoid generating and handling useless SerializationException when MaybeMethodBase contains no method

--- src/runtime/StateSerialization/MaybeMethodBase.cs
+++ src/runtime/StateSerialization/MaybeMethodBase.cs
@@ -68,6 +68,9 @@
             name = serializationInfo.GetString(SerializationName);
             info = null;
             deserializationException = null;
+
+            if (name is null) return;
+
             try
             {
                 // Retrieve the reflected type of the method;


Added property bag value setter for web application xml configuration nodes.

--- Source/GSoft.Dynamite.PowerShell/GSoft.Dynamite.PowerShell/Cmdlets/Configuration/DSPCmdletAddPropertyBagValue.cs
+++ Source/GSoft.Dynamite.PowerShell/GSoft.Dynamite.PowerShell/Cmdlets/Configuration/DSPCmdletAddPropertyBagValue.cs
@@ -1,4 +1,5 @@
-using System.Diagnostics.CodeAnalysis;
+using System;
+using System.Diagnostics.CodeAnalysis;
 using System.Globalization;
 using System.Linq;
 using System.Management.Automation;
@@ -8,6 +9,7 @@
 using GSoft.Dynamite.PowerShell.Extensions;
 using GSoft.Dynamite.PowerShell.PipeBindsObjects;
 using Microsoft.SharePoint;
+using Microsoft.SharePoint.Administration;
 using Microsoft.SharePoint.PowerShell;

 namespace GSoft.Dynamite.PowerShell.Cmdlets.Configuration
@@ -48,61 +50,114 @@

         private void ProcessPropertyBagValues(XDocument configFile)
         {
+            // Get all web application nodes
+            var webApplicationNodes = configFile.Descendants("WebApplication").Select(x => x);
+            foreach (var webApplicationNode in webApplicationNodes)
+            {
+                // For each web application, create and configure the property bag values
+                this.SetWebApplicationPropertyBagValue(webApplicationNode);
+            }
+
             // Get all site nodes
             var webNodes = configFile.Descendants("Web").Select(x => x);
             foreach (var webNode in webNodes)
             {
                 // For each site, create and configure the property bag values
-                var webUrl = webNode.Attribute("Url").Value;
-                using (var site = new SPSite(webUrl))
+                this.SetWebPropertyBagValue(webNode);
+            }
+        }
+
+        private void SetWebApplicationPropertyBagValue(XElement webApplicationNode)
+        {
+            var webApplicationUrl = webApplicationNode.Attribute("Url").Value;
+            var webApplication = SPWebApplication.Lookup(new Uri(webApplicationUrl));
+            var propertyBagValues =
+                webApplicationNode.Descendants("PropertyBagValue")
+                    .Select(x => (PropertyBagValue)this._serializer.Deserialize(x.CreateReader()));
+
+            foreach (var propertyBagValue in propertyBagValues)
+            {
+                // Add value to root web property bag
+                if (webApplication.Properties.ContainsKey(propertyBagValue.Key) && propertyBagValue.Overwrite)
                 {
-                    using (var web = site.OpenWeb())
+                    this.WriteWarning(
+                        string.Format(
+                            CultureInfo.InvariantCulture,
+                            "Overwriting property bag '{0}' with value '{1}' to web application '{2}'",
+                            propertyBagValue.Key,
+                            propertyBagValue.Value,
+                            webApplicationUrl));
+
+                    webApplication.Properties[propertyBagValue.Key] = propertyBagValue.Value;
+                }
+                else if (!webApplication.Properties.ContainsKey(propertyBagValue.Key))
+                {
+                    this.WriteVerbose(
+                        string.Format(
+                            CultureInfo.InvariantCulture,
+                            "Adding property bag '{0}' with value '{1}' to web application '{2}'",
+                            propertyBagValue.Key,
+                            propertyBagValue.Value,
+                            webApplicationUrl));
+
+                    webApplication.Properties.Add(propertyBagValue.Key, propertyBagValue.Value);
+                }
+            }
+        }
+
+        private void SetWebPropertyBagValue(XElement webNode)
+        {
+            var webUrl = webNode.Attribute("Url").Value;
+            using (var site = new SPSite(webUrl))
+            {
+                using (var web = site.OpenWeb())
+                {
+                    var propertyBagValues =
+                        webNode.Descendants("PropertyBagValue")
+                            .Select(x => (PropertyBagValue)this._serializer.Deserialize(x.CreateReader()));
+                    foreach (var propertyBagValue in propertyBagValues)
                     {
-                        var propertyBagValues = webNode.Descendants("PropertyBagValue").Select(x => (PropertyBagValue)this._serializer.Deserialize(x.CreateReader()));
-                        foreach (var propertyBagValue in propertyBagValues)
+                        // Add value to root web property bag
+                        if (web.AllProperties.ContainsKey(propertyBagValue.Key) && propertyBagValue.Overwrite)
                         {
-                            // Add value to root web property bag
-                            if (web.AllProperties.ContainsKey(propertyBagValue.Key) && propertyBagValue.Overwrite)
-                            {
-                                this.WriteWarning(
-                                    string.Format(
+                            this.WriteWarning(
+                                string.Format(
                                     CultureInfo.InvariantCulture,
                                     "Overwriting property bag '{0}' with value '{1}' to web '{2}'",
                                     propertyBagValue.Key,
                                     propertyBagValue.Value,
                                     webUrl));

-                                web.AllProperties[propertyBagValue.Key] = propertyBagValue.Value;
-                            }
-                            else if (!web.AllProperties.ContainsKey(propertyBagValue.Key))
-                            {
-                                this.WriteVerbose(
-                                    string.Format(
+                            web.AllProperties[propertyBagValue.Key] = propertyBagValue.Value;
+                        }
+                        else if (!web.AllProperties.ContainsKey(propertyBagValue.Key))
+                        {
+                            this.WriteVerbose(
+                                string.Format(
                                     CultureInfo.InvariantCulture,
                                     "Adding property bag '{0}' with value '{1}' to web '{2}'",
                                     propertyBagValue.Key,
                                     propertyBagValue.Value,
                                     webUrl));

-                                web.AllProperties.Add(propertyBagValue.Key, propertyBagValue.Value);
-                            }
+                            web.AllProperties.Add(propertyBagValue.Key, propertyBagValue.Value);
+                        }

-                            // Add property bag key to indexed property keys
-                            if (!web.IndexedPropertyKeys.Contains(propertyBagValue.Key) && propertyBagValue.Indexed)
-                            {
-                                this.WriteVerbose(
-                                    string.Format(
+                        // Add property bag key to indexed property keys
+                        if (!web.IndexedPropertyKeys.Contains(propertyBagValue.Key) && propertyBagValue.Indexed)
+                        {
+                            this.WriteVerbose(
+                                string.Format(
                                     CultureInfo.InvariantCulture,
                                     "Setting property bag '{0}' to be indexable by search on web '{1}'",
                                     propertyBagValue.Key,
                                     webUrl));

-                                web.IndexedPropertyKeys.Add(propertyBagValue.Key);
-                            }
+                            web.IndexedPropertyKeys.Add(propertyBagValue.Key);
                         }
+                    }

-                        web.Update();
-                    }
+                    web.Update();
                 }
             }
         }


Add tests for GetUriPathParameters() in TraktCalendarUserDVDMoviesRequest

--- Source/Tests/TraktApiSharp.Tests/Experimental/Requests/Calendars/OAuth/TraktCalendarUserDVDMoviesRequestTests.cs
+++ Source/Tests/TraktApiSharp.Tests/Experimental/Requests/Calendars/OAuth/TraktCalendarUserDVDMoviesRequestTests.cs
@@ -2,7 +2,10 @@
 {
     using FluentAssertions;
     using Microsoft.VisualStudio.TestTools.UnitTesting;
+    using System;
+    using System.Collections.Generic;
     using TraktApiSharp.Experimental.Requests.Calendars.OAuth;
+    using TraktApiSharp.Extensions;
     using TraktApiSharp.Objects.Get.Calendars;
     using TraktApiSharp.Requests;

@@ -40,5 +43,75 @@
             var request = new TraktCalendarUserDVDMoviesRequest(null);
             request.UriTemplate.Should().Be("calendars/my/dvd{/start_date}{/days}{?extended,query,years,genres,languages,countries,runtimes,ratings}");
         }
+
+        [TestMethod, TestCategory("Requests"), TestCategory("Calendars"), TestCategory("With OAuth"), TestCategory("Movies")]
+        public void TestTraktCalendarUserDVDMoviesRequestUriParamsWithoutStartDateAndDays()
+        {
+            var request = new TraktCalendarUserDVDMoviesRequest(null);
+            var uriParams = request.GetUriPathParameters();
+
+            uriParams.Should().NotBeNull().And.BeEmpty();
+        }
+
+        [TestMethod, TestCategory("Requests"), TestCategory("Calendars"), TestCategory("With OAuth"), TestCategory("Movies")]
+        public void TestTraktCalendarUserDVDMoviesRequestUriParamsWithStartDate()
+        {
+            var startDate = DateTime.Now;
+
+            var request = new TraktCalendarUserDVDMoviesRequest(null)
+            {
+                StartDate = startDate
+            };
+
+            var uriParams = request.GetUriPathParameters();
+
+            uriParams.Should().NotBeNull().And.NotBeEmpty().And.HaveCount(1);
+            uriParams.Should().Contain("start_date", startDate.ToTraktDateString());
+        }
+
+        [TestMethod, TestCategory("Requests"), TestCategory("Calendars"), TestCategory("With OAuth"), TestCategory("Movies")]
+        public void TestTraktCalendarUserDVDMoviesRequestUriParamsWithStartDateAndDays()
+        {
+            var startDate = DateTime.Now;
+            var days = 14;
+
+            var request = new TraktCalendarUserDVDMoviesRequest(null)
+            {
+                StartDate = startDate,
+                Days = days
+            };
+
+            var uriParams = request.GetUriPathParameters();
+
+            uriParams.Should().NotBeNull().And.NotBeEmpty().And.HaveCount(2);
+
+            uriParams.Should().Contain(new Dictionary<string, object>
+            {
+                ["start_date"] = startDate.ToTraktDateString(),
+                ["days"] = days
+            });
+        }
+
+        [TestMethod, TestCategory("Requests"), TestCategory("Calendars"), TestCategory("With OAuth"), TestCategory("Movies")]
+        public void TestTraktCalendarUserDVDMoviesRequestUriParamsWithDays()
+        {
+            var startDate = DateTime.Now;
+            var days = 14;
+
+            var request = new TraktCalendarUserDVDMoviesRequest(null)
+            {
+                Days = days
+            };
+
+            var uriParams = request.GetUriPathParameters();
+
+            uriParams.Should().NotBeNull().And.NotBeEmpty().And.HaveCount(2);
+
+            uriParams.Should().Contain(new Dictionary<string, object>
+            {
+                ["start_date"] = startDate.ToTraktDateString(),
+                ["days"] = days
+            });
+        }
     }
 }


DotNetCliGenerator.TargetFrameworkMoniker must be public

--- src/BenchmarkDotNet/Toolchains/DotNetCli/DotNetCliGenerator.cs
+++ src/BenchmarkDotNet/Toolchains/DotNetCli/DotNetCliGenerator.cs
@@ -12,7 +12,8 @@
     [PublicAPI]
     public abstract class DotNetCliGenerator : GeneratorBase
     {
-        internal string TargetFrameworkMoniker { get; }
+        [PublicAPI]
+        public string TargetFrameworkMoniker { get; }

         protected Func<Platform, string> PlatformProvider { get; }


Use `Uri.TryCreate` to parse URI.

Use `Uri.TryCreate` to parse URI.

--- src/GitHub.VisualStudio/UI/Views/PullRequestDetailView.xaml.cs
+++ src/GitHub.VisualStudio/UI/Views/PullRequestDetailView.xaml.cs
@@ -309,11 +309,11 @@

         void OpenHyperlink(object sender, ExecutedRoutedEventArgs e)
         {
-            var url = e.Parameter.ToString();
-
-            if (!string.IsNullOrEmpty(url))
-            {
-                VisualStudioBrowser.OpenUrl(new Uri(url));
+            Uri uri;
+
+            if (Uri.TryCreate(e.Parameter?.ToString(), UriKind.Absolute, out uri))
+            {
+                VisualStudioBrowser.OpenUrl(uri);
             }
         }
     }


Improved descrition of iterative solver.

--- src/Itinero.Optimization/Algorithms/Solvers/IterativeSolver.cs
+++ src/Itinero.Optimization/Algorithms/Solvers/IterativeSolver.cs
@@ -17,6 +17,7 @@
  */

 using Itinero.Optimization.Algorithms.Solvers.Objective;
+using System.Text;

 namespace Itinero.Optimization.Algorithms.Solvers
 {
@@ -65,7 +66,22 @@
         /// </summary>
         public override string Name
         {
-            get { return string.Format("ITER_[{0}x{1}]", _n, _solver.Name); }
+            get
+            {
+                if (_operators != null &&
+                    _operators.Length > 0)
+                {
+                    var op = new StringBuilder();
+                    op.Append(_operators[0].Name);
+                    for (var i = 1; i < _operators.Length; i++)
+                    {
+                        op.Append('+');
+                        op.Append(_operators[i].Name);
+                    }
+                    return string.Format("ITER_[{0}x({1}+{2}]", _n, _solver.Name, op.ToString());
+                }
+                return string.Format("ITER_[{0}x{1}]", _n, _solver.Name);
+            }
         }

         /// <summary>


Lucene.Net.Core.Analysis refactor: Changed ITermAttribute members - TermLength() & SetTermLength() > TermLength (property)

--- src/Lucene.Net.Core/Analysis/TokenAttributes/ITermAttribute.cs
+++ src/Lucene.Net.Core/Analysis/TokenAttributes/ITermAttribute.cs
@@ -48,7 +48,7 @@
         /// <summary>Copies the contents of buffer into the termBuffer array.</summary>
         /// <param name="buffer">the buffer to copy
         /// </param>
-        void SetTermBuffer(System.String buffer);
+        void SetTermBuffer(string buffer);

         /// <summary>Copies the contents of buffer, starting at offset and continuing
         /// for length characters, into the termBuffer array.
@@ -59,7 +59,7 @@
         /// </param>
         /// <param name="length">the number of characters to copy
         /// </param>
-        void SetTermBuffer(System.String buffer, int offset, int length);
+        void SetTermBuffer(string buffer, int offset, int length);

         /// <summary>Returns the internal termBuffer character array which
         /// you can then directly alter.  If the array is too
@@ -85,19 +85,15 @@
         /// </returns>
         char[] ResizeTermBuffer(int newSize);

-        /// <summary>Return number of valid characters (length of the term)
+        /// <summary>
+        /// Gets or sets the number of valid characters (length of the term)
         /// in the termBuffer array.
-        /// </summary>
-        int TermLength();
-
-        /// <summary>Set number of valid characters (length of the term) in
-        /// the termBuffer array. Use this to truncate the termBuffer
+        /// <para/>
+        /// Use this to truncate the termBuffer
         /// or to synchronize with external manipulation of the termBuffer.
         /// Note: to grow the size of the array,
         /// use <see cref="ResizeTermBuffer(int)" /> first.
         /// </summary>
-        /// <param name="length">the truncated length
-        /// </param>
-        void SetTermLength(int length);
+        int TermLength { get; set; }
     }
 }


Used other fix for threading, not as nice, but works on older GTK# releases aswell

svn path=/trunk/bitsharp/; revision=74870

--- src/MonoTorrent.Interface/src/MonoTorrent.Interface/Program.cs
+++ src/MonoTorrent.Interface/src/MonoTorrent.Interface/Program.cs
@@ -51,9 +51,10 @@
             CreateDirs();
             Application.Init();

-           // GLib threads need to be initialised before launching the main application
-           if (!GLib.Thread.Supported) {
-               GLib.Thread.Init();
+            // GLib threads need to be initialised before launching the main application
+            // when we don't run on Mono, we need to initialize glib ourself
+            if (Type.GetType("Mono.Runtime") == null)
+                GLib.Thread.Init();
         }

         private static void CreateDirs()


Find usages finds symbols that aren't declared in the source fixes #2

--- src/OmniSharp/Api/Navigation/OmnisharpController.FindUsages.cs
+++ src/OmniSharp/Api/Navigation/OmnisharpController.FindUsages.cs
@@ -10,6 +10,7 @@
 {
     public partial class OmnisharpController
     {
+        private List<QuickFix> _quickFixes = new List<QuickFix>();
         [HttpPost("findusages")]
         public async Task<IActionResult> FindUsages([FromBody]Request request)
         {
@@ -25,44 +26,47 @@
                 var position = sourceText.Lines.GetPosition(new LinePosition(request.Line - 1, request.Column - 1));
                 var symbol = SymbolFinder.FindSymbolAtPosition(semanticModel, position, _workspace);
                 var definition = await SymbolFinder.FindSourceDefinitionAsync(symbol, _workspace.CurrentSolution);
-                var usages = await SymbolFinder.FindReferencesAsync(definition, _workspace.CurrentSolution);
-                var quickFixes = new List<QuickFix>();
+                var usages = await SymbolFinder.FindReferencesAsync(definition ?? symbol, _workspace.CurrentSolution);
+

                 foreach (var usage in usages)
                 {
                     foreach (var location in usage.Locations)
                     {
-                        quickFixes.Add(await GetQuickFix(location.Location));
+                        AddQuickFix(location.Location);
                     }

                     foreach (var location in usage.Definition.Locations)
                     {
-                        quickFixes.Add(await GetQuickFix(location));
+                        AddQuickFix(location);
                     }
                 }

-                response = new QuickFixResponse(quickFixes);
+                response = new QuickFixResponse(_quickFixes);
             }

             return new ObjectResult(response);
         }

-        private async Task<QuickFix> GetQuickFix(Location location)
+        private async void AddQuickFix(Location location)
         {
-            var lineSpan = location.GetLineSpan();
-            var path = lineSpan.Path;
-            var document = _workspace.GetDocument(path);
-            var line = lineSpan.StartLinePosition.Line;
-            var syntaxTree = await document.GetSyntaxTreeAsync();
-            var text = syntaxTree.GetText().Lines[line].ToString();
-
-            return new QuickFix
+            if (location.IsInSource)
             {
-                Text = text.Trim(),
-                FileName = path,
-                Line = line + 1,
-                Column = lineSpan.StartLinePosition.Character + 1
-            };
+                var lineSpan = location.GetLineSpan();
+                var path = lineSpan.Path;
+                var document = _workspace.GetDocument(path);
+                var line = lineSpan.StartLinePosition.Line;
+                var syntaxTree = await document.GetSyntaxTreeAsync();
+                var text = syntaxTree.GetText().Lines[line].ToString();
+
+                _quickFixes.Add(new QuickFix
+                {
+                    Text = text.Trim(),
+                    FileName = path,
+                    Line = line + 1,
+                    Column = lineSpan.StartLinePosition.Character + 1
+                });
+            }
         }
     }
 }


#19893: Removing the limitation of unknown mime types for importing media

Work Item: 19893

--HG--
branch : 1.x
extra : rebase_source : 45662b8bb6150c7b7fb25cfd46cdacebd581930b

--- src/Orchard.Web/Modules/Upgrade/Controllers/MediaController.cs
+++ src/Orchard.Web/Modules/Upgrade/Controllers/MediaController.cs
@@ -70,8 +70,7 @@

                 foreach (var extension in extensions) {
                     if (_mimeTypeProvider.GetMimeType("." + extension) == "application/unknown") {
-                        _orchardServices.Notifier.Warning(T("Unknown MIME type: {0}", extension));
-                        ViewBag.CanMigrate = false;
+                        _orchardServices.Notifier.Warning(T("Unknown MIME type for extension: {0}. These files will be imported as Document media.", extension));
                     }
                 }
             }


#16423: Log error w/ module name when unable to load manifest.

--HG--
branch : dev

--- src/Orchard/Environment/Extensions/Folders/ExtensionFolders.cs
+++ src/Orchard/Environment/Extensions/Folders/ExtensionFolders.cs
@@ -62,7 +62,7 @@
                         }
                         catch ( Exception ex ) {
                             // Ignore invalid module manifests
-                            Logger.Error(ex, "A module could not be loaded. It was ignored.");
+                            Logger.Error(ex, "The module '{0}' could not be loaded. It was ignored.", extensionName);
                         }
                     }
                     return localList;


Send EvaluateRequest after execution completes

This change modifies the way the EvaluateRequest message is handled in the
LanguageServer.  Previously the evaluation response would be sent back
immediately since we aren't giving back an actual result.  This behavior
is now changed to wait until execution completes before sending the
response so that the caller knows when execution has completed.

--- src/PowerShellEditorServices.Protocol/Server/LanguageServer.cs
+++ src/PowerShellEditorServices.Protocol/Server/LanguageServer.cs
@@ -737,7 +737,7 @@
             return symbolName.IndexOf(query, StringComparison.OrdinalIgnoreCase) >= 0;
         }

-        protected async Task HandleEvaluateRequest(
+        protected Task HandleEvaluateRequest(
             DebugAdapterMessages.EvaluateRequestArguments evaluateParams,
             RequestContext<DebugAdapterMessages.EvaluateResponseBody> requestContext)
         {
@@ -749,16 +749,25 @@
                 this.editorSession.PowerShellContext.ExecuteScriptString(
                     evaluateParams.Expression,
                     true,
-                    true).ConfigureAwait(false);
-
-            // Return an empty result since the result value is irrelevant
-            // for this request in the LanguageServer
-            await requestContext.SendResult(
-                new DebugAdapterMessages.EvaluateResponseBody
-                {
-                    Result = "",
-                    VariablesReference = 0
+                    true);
+
+            // Return the execution result after the task completes so that the
+            // caller knows when command execution completed.
+            executeTask.ContinueWith(
+                (task) =>
+                {
+                    // Return an empty result since the result value is irrelevant
+                    // for this request in the LanguageServer
+                    return
+                        requestContext.SendResult(
+                            new DebugAdapterMessages.EvaluateResponseBody
+                            {
+                                Result = "",
+                                VariablesReference = 0
+                            });
                 });
+
+            return Task.FromResult(true);
         }

         #endregion


Remove allocations by changing AsTask to GetAsTask (#22557)

--- src/Servers/Kestrel/Core/src/Internal/Http2/Http2Connection.cs
+++ src/Servers/Kestrel/Core/src/Internal/Http2/Http2Connection.cs
@@ -22,6 +22,7 @@
 using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2.FlowControl;
 using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure;
 using Microsoft.Extensions.Logging;
+using Microsoft.AspNetCore.Internal;

 namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2
 {
@@ -752,7 +753,7 @@
                 // the new size.
                 _frameWriter.UpdateMaxHeaderTableSize(Math.Min(_clientSettings.HeaderTableSize, (uint)Limits.Http2.HeaderTableSize));

-                return ackTask.AsTask();
+                return ackTask.GetAsTask();
             }
             catch (Http2SettingsParameterOutOfRangeException ex)
             {
@@ -785,7 +786,7 @@
                 return Task.CompletedTask;
             }

-            return _frameWriter.WritePingAsync(Http2PingFrameFlags.ACK, payload).AsTask();
+            return _frameWriter.WritePingAsync(Http2PingFrameFlags.ACK, payload).GetAsTask();
         }

         private Task ProcessGoAwayFrameAsync()


Fixed 'Bug 38191 - ConvertIfStatementToNullCoalescingExpressionAction error'.

--- RefactoringEssentials/CSharp/CodeRefactorings/Uncategorized/ConvertIfStatementToNullCoalescingExpressionAction.cs
+++ RefactoringEssentials/CSharp/CodeRefactorings/Uncategorized/ConvertIfStatementToNullCoalescingExpressionAction.cs
@@ -117,7 +117,7 @@
             if (contentStatement == null)
                 return null;

-            var assignExpr = ((ExpressionStatementSyntax)contentStatement).Expression as AssignmentExpressionSyntax;
+            var assignExpr = (contentStatement as ExpressionStatementSyntax)?.Expression as AssignmentExpressionSyntax;
             if (assignExpr == null || !assignExpr.Left.IsEquivalentTo(nullIsRight ? condition.Left : condition.Right, true))
                 return null;
             rightSide = assignExpr.Right;


red: added non-display name steps of ExampleFeature.Examples to v2

--- src/test/Xbehave.Features.Net40/ExampleFeature.cs
+++ src/test/Xbehave.Features.Net40/ExampleFeature.cs
@@ -2,7 +2,6 @@
 //  Copyright (c) xBehave.net contributors. All rights reserved.
 // </copyright>

-#if !V2
 namespace Xbehave.Test.Acceptance
 {
     using System;
@@ -20,8 +19,11 @@
     public static class ExampleFeature
     {
         [Scenario]
-        public static void Examples(Type feature, Result[] results)
-        {
+        public static void Examples()
+        {
+            var feature = default(Type);
+            var results = default(Result[]);
+
             "Given a feature with a scenario with examples"
                 .f(() => feature = typeof(SingleStepAndThreeExamples));

@@ -33,7 +35,7 @@

             "And each result should be a pass"
                 .f(() => results.Should().ContainItemsAssignableTo<Pass>());
-
+#if !V2
             "And the display name of one result should contain '(x: 1, y: 2, sum: 3)'"
                 .f(() => results.Should().ContainSingle(result =>
                     result.DisplayName.Contains("(x: 1, y: 2, sum: 3)")));
@@ -45,8 +47,10 @@
             "And the display name of one result should contain '(x: 100, y: 200, sum: 300)'"
                 .f(() => results.Should().ContainSingle(result =>
                     result.DisplayName.Contains("(x: 100, y: 200, sum: 300)")));
-        }
-
+#endif
+        }
+
+#if !V2
         [Scenario]
         public static void ExamplesWithTwoMissingArguments(Type feature, Result[] results)
         {
@@ -189,6 +193,7 @@
             "And the display name of no result should contain '(x: 5, y: 6, z: 7)'"
                 .And(() => results.Should().NotContain(result => result.DisplayName.Contains("(x: 5, y: 6, z: 7)")));
         }
+#endif

         private static class SingleStepAndThreeExamples
         {
@@ -210,6 +215,7 @@
             }
         }

+#if !V2
         private static class SingleStepAndThreeExamplesWithTwoMissingArguments
         {
             private static int previousExample;
@@ -335,6 +341,6 @@
                     .Given(() => { });
             }
         }
+#endif
     }
 }
-#endif


Fixed comments and white space issues

Fixed comments and white space issues

--- src/System.Management.Automation/engine/SecurityManagerBase.cs
+++ src/System.Management.Automation/engine/SecurityManagerBase.cs
@@ -87,12 +87,12 @@
                                         CommandOrigin origin,
                                         PSHost host)
         {
-#if LINUX
+#if LINUX
             // TODO:PSL this is a workaround since the exception below
             // hides the internal issue of what's going on in terms of
             // execution policy.
-            // On non-Windows platform Set/Get-ExecutionPolicy return
-            // Operation is not supported on this platform.
+            // On non-Windows platform Set/Get-ExecutionPolicy throw
+            // PlatformNotSupportedException
             return;
 #else

@@ -160,7 +160,7 @@
                     throw new PSSecurityException(AuthorizationManagerBase.AuthorizationManagerDefaultFailureReason);
                 }
             }
-#endif
+#endif
         }

         /// <summary>


Minor code cleanup and formatting changes

--- src/TaglibSharp/Mpeg4/Boxes/AppleElementaryStreamDescriptor.cs
+++ src/TaglibSharp/Mpeg4/Boxes/AppleElementaryStreamDescriptor.cs
@@ -27,413 +27,361 @@

 namespace TagLib.Mpeg4
 {
-    /// <summary>
-    ///    This class extends <see cref="FullBox" /> to provide an
-    ///    implementation of an Apple ElementaryStreamDescriptor.
-    /// </summary>
-    /// <remarks>
-    ///    This box may appear as a child of a <see
-    ///    cref="IsoAudioSampleEntry" /> and provided further information
-    ///    about an audio stream.
-    /// </remarks>
-    public class AppleElementaryStreamDescriptor : FullBox
-    {
-        #region Private Fields
-
-        /// <summary>
-        /// Descriptor Tags
-        /// </summary>
-        private enum DescriptorTag
-        {
-            Forbidden_00 = 0,
-            ObjectDescrTag = 1,
-            InitialObjectDescrTag = 2,
-            ES_DescrTag = 3,
-            DecoderConfigDescrTag = 4,
-            DecSpecificInfoTag = 5,
-            SLConfigDescrTag = 6,
-            ContentIdentDescrTag = 7,
-            SupplContentIdentDescrTag = 8,
-            IPI_DescrPointerTag = 9,
-            IPMP_DescrPointerTag = 10,
-            IPMP_DescrTag = 11,
-            QoS_DescrTag = 12,
-            RegistrationDescrTag = 13,
-            ES_ID_IncTag = 14,
-            ES_ID_RefTag = 15,
-            MP4_IOD_Tag = 16,
-            MP4_OD_Tag = 17,
-            IPL_DescrPointerRefTag = 18,
-            ExtensionProfileLevelDescrTag = 19,
-            profileLevelIndicationIndexDescrTag = 20,
-            ReservedForFutureISOUse_15_TO_3F = 21,
-            ContentClassificationDescrTag = 64,
-            KeyWordDescrTag = 65,
-            RatingDescrTag = 66,
-            LanguageDescrTag = 67,
-            ShortTextualDescrTag = 68,
-            ExpandedTextualDescrTag = 69,
-            ContentCreatorNameDescrTag = 70,
-            ContentCreationDateDescrTag = 71,
-            OCICreatorNameDescrTag = 72,
-            OCICreationDateDescrTag = 73,
-            SmpteCameraPositionDescrTag = 74,
-            SegmentDescrTag = 75,
-            MediaTimeDescrTag = 76,
-            ReservedForFutureISOUseOCI = 77,
-            IPMP_ToolsListDescrTag = 96,
-            IPMP_ToolTag = 97,
-            M4MuxTimingDescrTag = 98,
-            M4MuxCodeTableDescrTag = 99,
-            ExtSLConfigDescrTag = 100,
-            M4MuxBufferSizeDescrTag = 101,
-            M4MuxIdentDescrTag = 102,
-            DependencyPointerTag = 103,
-            DependencyMarkerTag = 104,
-            M4MuxChannelDescrTag = 105,
-            ReservedForFutureISO_6A_TO_BF = 106,
-            UserPrivate = 192,
-            Forbidden_FF = 255,
-        }
-
-        /// <summary>
-        /// Contains the stream ID.
-        /// </summary>
-        private ushort es_id;
-
-        /// <summary>
-        /// the ES_ID of another elementary stream on which this elementary stream depends
-        /// </summary>
-        private ushort dependsOn_ES_ID;
-
-        /// <summary>
-        /// Indicates that a dependsOn_ES_ID will follow
-        /// </summary>
-        private bool stream_dependence_flag;
-
-        /// <summary>
-        /// OCR Stream Flag
-        /// </summary>
-        private bool ocr_stream_flag;
-
-        /// <summary>
-        /// OCR ES_ID
-        /// </summary>
-        private ushort OCR_ES_Id;
-
-        /// <summary>
-        /// Indicates that a URLstring will follow
-        /// </summary>
-        private bool URL_flag;
-
-        /// <summary>
-        /// Length of URL String
-        /// </summary>
-        private byte URLlength;
-
-        /// <summary>
-        /// URL String of URLlength, contains a URL that shall point to the location of an SL-packetized stream by name
-        /// </summary>
-        private string URLstring;
-
-        /// <summary>
-        ///    Contains the stream priority.
-        /// </summary>
-        private byte stream_priority;
-
-        /// <summary>
-        ///    Contains the object type ID.
-        /// </summary>
-        private byte object_type_id;
-
-        /// <summary>
-        ///    Contains the stream type.
-        /// </summary>
-        private byte stream_type;
-
-        /// <summary>
-        /// Indicates that this stream is used for upstream information
-        /// </summary>
-        private bool upStream;
-
-        /// <summary>
-        ///    Contains the bugger size.
-        /// </summary>
-        private uint buffer_size_db;
-
-        /// <summary>
-        ///    Contains the maximum bitrate.
-        /// </summary>
-        private uint max_bitrate;
-
-        /// <summary>
-        ///    Contains the average bitrate.
-        /// </summary>
-        private uint average_bitrate;
-
-        /// <summary>
-        ///    Contains the decoder config.
-        /// </summary>
-        private ByteVector decoder_config;
-
-        #endregion
-
-
-
-        #region Constructors
-
-        /// <summary>
-        ///    Constructs and initializes a new instance of <see
-        ///    cref="AppleElementaryStreamDescriptor" /> with a provided
-        ///    header and handler by reading the contents from a
-        ///    specified file.
-        /// </summary>
-        /// <param name="header">
-        ///    A <see cref="BoxHeader" /> object containing the header
-        ///    to use for the new instance.
-        /// </param>
-        /// <param name="file">
-        ///    A <see cref="TagLib.File" /> object to read the contents
-        ///    of the box from.
-        /// </param>
-        /// <param name="handler">
-        ///    A <see cref="IsoHandlerBox" /> object containing the
-        ///    handler that applies to the new instance.
-        /// </param>
-        /// <exception cref="ArgumentNullException">
-        ///    <paramref name="file" /> is <see langword="null" />.
-        /// </exception>
-        /// <exception cref="CorruptFileException">
-        ///    Valid data could not be read.
-        /// </exception>
-        public AppleElementaryStreamDescriptor(BoxHeader header,
-                                                TagLib.File file,
-                                                IsoHandlerBox handler)
-            : base(header, file, handler)
-        {
-            /* ES_Descriptor Specifications
+	/// <summary>
+	///    This class extends <see cref="FullBox" /> to provide an
+	///    implementation of an Apple ElementaryStreamDescriptor.
+	/// </summary>
+	/// <remarks>
+	///    This box may appear as a child of a <see
+	///    cref="IsoAudioSampleEntry" /> and provided further information
+	///    about an audio stream.
+	/// </remarks>
+	public class AppleElementaryStreamDescriptor : FullBox
+	{
+		#region Private Fields
+
+		/// <summary>
+		/// Descriptor Tags
+		/// </summary>
+		enum DescriptorTag
+		{
+			Forbidden_00 = 0,
+			ObjectDescrTag = 1,
+			InitialObjectDescrTag = 2,
+			ES_DescrTag = 3,
+			DecoderConfigDescrTag = 4,
+			DecSpecificInfoTag = 5,
+			SLConfigDescrTag = 6,
+			ContentIdentDescrTag = 7,
+			SupplContentIdentDescrTag = 8,
+			IPI_DescrPointerTag = 9,
+			IPMP_DescrPointerTag = 10,
+			IPMP_DescrTag = 11,
+			QoS_DescrTag = 12,
+			RegistrationDescrTag = 13,
+			ES_ID_IncTag = 14,
+			ES_ID_RefTag = 15,
+			MP4_IOD_Tag = 16,
+			MP4_OD_Tag = 17,
+			IPL_DescrPointerRefTag = 18,
+			ExtensionProfileLevelDescrTag = 19,
+			profileLevelIndicationIndexDescrTag = 20,
+			ReservedForFutureISOUse_15_TO_3F = 21,
+			ContentClassificationDescrTag = 64,
+			KeyWordDescrTag = 65,
+			RatingDescrTag = 66,
+			LanguageDescrTag = 67,
+			ShortTextualDescrTag = 68,
+			ExpandedTextualDescrTag = 69,
+			ContentCreatorNameDescrTag = 70,
+			ContentCreationDateDescrTag = 71,
+			OCICreatorNameDescrTag = 72,
+			OCICreationDateDescrTag = 73,
+			SmpteCameraPositionDescrTag = 74,
+			SegmentDescrTag = 75,
+			MediaTimeDescrTag = 76,
+			ReservedForFutureISOUseOCI = 77,
+			IPMP_ToolsListDescrTag = 96,
+			IPMP_ToolTag = 97,
+			M4MuxTimingDescrTag = 98,
+			M4MuxCodeTableDescrTag = 99,
+			ExtSLConfigDescrTag = 100,
+			M4MuxBufferSizeDescrTag = 101,
+			M4MuxIdentDescrTag = 102,
+			DependencyPointerTag = 103,
+			DependencyMarkerTag = 104,
+			M4MuxChannelDescrTag = 105,
+			ReservedForFutureISO_6A_TO_BF = 106,
+			UserPrivate = 192,
+			Forbidden_FF = 255,
+		}
+
+		/// <summary>
+		/// the ES_ID of another elementary stream on which this elementary stream depends
+		/// </summary>
+		ushort dependsOn_ES_ID;
+
+		/// <summary>
+		/// Indicates that a dependsOn_ES_ID will follow
+		/// </summary>
+		readonly bool stream_dependence_flag;
+
+		/// <summary>
+		/// OCR Stream Flag
+		/// </summary>
+		readonly bool ocr_stream_flag;
+
+		/// <summary>
+		/// OCR ES_ID
+		/// </summary>
+		ushort OCR_ES_Id;
+
+		/// <summary>
+		/// Indicates that a URLstring will follow
+		/// </summary>
+		readonly bool URL_flag;
+
+		/// <summary>
+		/// Length of URL String
+		/// </summary>
+		readonly byte URLlength;
+
+		/// <summary>
+		/// URL String of URLlength, contains a URL that shall point to the location of an SL-packetized stream by name
+		/// </summary>
+		string URLstring;
+
+		/// <summary>
+		/// Indicates that this stream is used for upstream information
+		/// </summary>
+		bool upStream;
+
+		/// <summary>
+		///    Contains the maximum bitrate.
+		/// </summary>
+		readonly uint max_bitrate;
+
+		/// <summary>
+		///    Contains the average bitrate.
+		/// </summary>
+		readonly uint average_bitrate;
+
+		#endregion
+
+
+
+		#region Constructors
+
+		/// <summary>
+		///    Constructs and initializes a new instance of <see
+		///    cref="AppleElementaryStreamDescriptor" /> with a provided
+		///    header and handler by reading the contents from a
+		///    specified file.
+		/// </summary>
+		/// <param name="header">
+		///    A <see cref="BoxHeader" /> object containing the header
+		///    to use for the new instance.
+		/// </param>
+		/// <param name="file">
+		///    A <see cref="TagLib.File" /> object to read the contents
+		///    of the box from.
+		/// </param>
+		/// <param name="handler">
+		///    A <see cref="IsoHandlerBox" /> object containing the
+		///    handler that applies to the new instance.
+		/// </param>
+		/// <exception cref="ArgumentNullException">
+		///    <paramref name="file" /> is <see langword="null" />.
+		/// </exception>
+		/// <exception cref="CorruptFileException">
+		///    Valid data could not be read.
+		/// </exception>
+		public AppleElementaryStreamDescriptor (BoxHeader header, TagLib.File file, IsoHandlerBox handler)
+			: base (header, file, handler)
+		{
+			/* ES_Descriptor Specifications
              *  Section 7.2.6.5 http://ecee.colorado.edu/~ecen5653/ecen5653/papers/ISO%2014496-1%202004.PDF
              */

-            ByteVector box_data = file.ReadBlock(DataSize);
-            decoder_config = new ByteVector();
-            int offset = 0;
-
-            // Elementary Stream Descriptor Tag
-            if ((DescriptorTag)box_data[offset++] != DescriptorTag.ES_DescrTag)
-                throw new CorruptFileException("Invalid Elementary Stream Descriptor, missing tag.");
-
-            // We have a descriptor tag. Check that the remainder of the tag is at least [Base (3 bytes) + DecoderConfigDescriptor (15 bytes) + SLConfigDescriptor (3 bytes) + OtherDescriptors] bytes long
-            uint es_length = ReadLength(box_data, ref offset);
-            uint min_es_length = 3 + 15 + 3; // Base minimum length
-            if (es_length < min_es_length)
-                throw new CorruptFileException("Insufficient data present.");
-
-            es_id = box_data.Mid(offset, 2).ToUShort();
-            offset += 2; // Done with ES_ID
-
-            stream_dependence_flag = ((byte)((box_data[offset] >> 7) & 0x1) == 0x1 ? true : false); // 1st bit
-            URL_flag = ((byte)((box_data[offset] >> 6) & 0x1) == 0x1 ? true : false); // 2nd bit
-            ocr_stream_flag = ((byte)((box_data[offset] >> 5) & 0x1) == 0x1 ? true : false); // 3rd bit
-            stream_priority = (byte)(box_data[offset++] & 0x1F); // Last 5 bits and we're done with this byte
-
-            if (stream_dependence_flag)
-            {
-                min_es_length += 2; // We need 2 more bytes
-                if (es_length < min_es_length)
-                    throw new CorruptFileException("Insufficient data present.");
-
-                dependsOn_ES_ID = box_data.Mid(offset, 2).ToUShort();
-                offset += 2; // Done with stream dependence
-            }
-
-            if (URL_flag)
-            {
-                min_es_length += 2; // We need 1 more byte
-                if (es_length < min_es_length)
-                    throw new CorruptFileException("Insufficient data present.");
-
-                URLlength = box_data[offset++]; // URL Length
-                min_es_length += URLlength; // We need URLength more bytes
-                if (es_length < min_es_length)
-                    throw new CorruptFileException("Insufficient data present.");
-
-                URLstring = box_data.Mid(offset, URLlength).ToString(); // URL name
-                offset += URLlength; // Done with URL name
-            }
-
-            if (ocr_stream_flag)
-            {
-                min_es_length += 2; // We need 2 more bytes
-                if (es_length < min_es_length)
-                    throw new CorruptFileException("Insufficient data present.");
-
-                OCR_ES_Id = box_data.Mid(offset, 2).ToUShort();
-                offset += 2; // Done with OCR
-            }
-
-            while (offset < DataSize) // Loop through all trailing Descriptors Tags
-            {
-                DescriptorTag tag = (DescriptorTag)box_data[offset++];
-                switch (tag)
-                {
-                    case DescriptorTag.DecoderConfigDescrTag: // DecoderConfigDescriptor
-                        {
-                            // Check that the remainder of the tag is at least 13 bytes long (13 + DecoderSpecificInfo[] + profileLevelIndicationIndexDescriptor[])
-                            if (ReadLength(box_data, ref offset) < 13)
-                                throw new CorruptFileException("Could not read data. Too small.");
-
-                            // Read a lot of good info.
-                            object_type_id = box_data[offset++];
-
-                            stream_type = (byte)(box_data[offset] >> 2); // First 6 bits
-                            upStream = ((byte)((box_data[offset++] >> 1) & 0x1) == 0x1 ? true : false); // 7th bit and we're done with the stream bits
-
-                            buffer_size_db = box_data.Mid(offset, 3).ToUInt();
-                            offset += 3; // Done with bufferSizeDB
-
-                            max_bitrate = box_data.Mid(offset, 4).ToUInt();
-                            offset += 4; // Done with maxBitrate
-
-                            average_bitrate = box_data.Mid(offset, 4).ToUInt();
-                            offset += 4; // Done with avgBitrate
-
-                            // If there's a DecoderSpecificInfo[] array at the end it'll pick it up in the while loop
-                        }
-                        break;
-
-                    case DescriptorTag.DecSpecificInfoTag: // DecoderSpecificInfo
-                        {
-                            // The rest of the info is decoder specific.
-                            uint length = ReadLength(box_data, ref offset);
-
-                            decoder_config = box_data.Mid(offset, (int)length);
-                            offset += (int)length; // We're done with the config
-                        }
-                        break;
-
-
-                    case DescriptorTag.SLConfigDescrTag: // SLConfigDescriptor
-                        {
-                            // The rest of the info is SL specific.
-                            uint length = ReadLength(box_data, ref offset);
-
-                            offset += (int)length; // Skip the rest of the descriptor as reported in the length so we can move onto the next one
-                        }
-                        break;
-
-                    case DescriptorTag.Forbidden_00:
-                    case DescriptorTag.Forbidden_FF:
-                        throw new CorruptFileException("Invalid Descriptor tag.");
-
-                    default:
-                        {
-                            /* TODO: Should we handle other optional descriptor tags?
-                             *  ExtensionDescriptor extDescr[0 .. 255];
-                                LanguageDescriptor langDescr[0 .. 1];
-                                IPI_DescPointer ipiPtr[0 .. 1];
-                                IP_IdentificationDataSet ipIDS[0 .. 1];
-                                QoS_Descriptor qosDescr[0 .. 1];
-                             */
-                            uint length = ReadLength(box_data, ref offset); // Every descriptor starts with a length
-
-                            offset += (int)length; // Skip the rest of the descriptor as reported in the length so we can move onto the next one
-                            break;
-                        }
-                }
-            }
-        }
-
-        #endregion
-
-
-
-        #region Public Properties
-
-        /// <summary>
-        ///    Gets the ID of the stream described by the current
-        ///    instance.
-        /// </summary>
-        /// <value>
-        ///    A <see cref="ushort" /> value containing the ID of the
-        ///    stream described by the current instance.
-        /// </value>
-        public ushort StreamId
-        {
-            get { return es_id; }
-        }
-
-        /// <summary>
-        ///    Gets the priority of the stream described by the current
-        ///    instance.
-        /// </summary>
-        /// <value>
-        ///    A <see cref="byte" /> value containing the priority of
-        ///    the stream described by the current instance.
-        /// </value>
-        public byte StreamPriority
-        {
-            get { return stream_priority; }
-        }
-
-        /// <summary>
-        ///    Gets the object type ID of the stream described by the
-        ///    current instance.
-        /// </summary>
-        /// <value>
-        ///    A <see cref="byte" /> value containing the object type ID
-        ///    of the stream described by the current instance.
-        /// </value>
-        public byte ObjectTypeId
-        {
-            get { return object_type_id; }
-        }
-
-        /// <summary>
-        ///    Gets the type the stream described by the current
-        ///    instance.
-        /// </summary>
-        /// <value>
-        ///    A <see cref="byte" /> value containing the type the
-        ///    stream described by the current instance.
-        /// </value>
-        public byte StreamType
-        {
-            get { return stream_type; }
-        }
-
-        /// <summary>
-        ///    Gets the buffer size DB value the stream described by the
-        ///    current instance.
-        /// </summary>
-        /// <value>
-        ///    A <see cref="uint" /> value containing the buffer size DB
-        ///    value the stream described by the current instance.
-        /// </value>
-        public uint BufferSizeDB
-        {
-            get { return buffer_size_db; }
-        }
-
-        /// <summary>
-        ///    Gets the maximum bitrate the stream described by the
-        ///    current instance.
-        /// </summary>
-        /// <value>
-        ///    A <see cref="uint" /> value containing the maximum
-        ///    bitrate the stream described by the current instance.
-        /// </value>
-        public uint MaximumBitrate { get { return max_bitrate / 1000; } }
-
-        /// <summary>
-        ///    Gets the maximum average the stream described by the
-        ///    current instance.
-        /// </summary>
-        /// <value>
-        ///    A <see cref="uint" /> value containing the average
-        ///    bitrate the stream described by the current instance.
-        /// </value>
-        public uint AverageBitrate { get { return average_bitrate / 1000; } }
+			ByteVector box_data = file.ReadBlock (DataSize);
+			DecoderConfig = new ByteVector ();
+			int offset = 0;
+
+			// Elementary Stream Descriptor Tag
+			if ((DescriptorTag)box_data[offset++] != DescriptorTag.ES_DescrTag)
+				throw new CorruptFileException ("Invalid Elementary Stream Descriptor, missing tag.");
+
+			// We have a descriptor tag. Check that the remainder of the tag is at least [Base (3 bytes) + DecoderConfigDescriptor (15 bytes) + SLConfigDescriptor (3 bytes) + OtherDescriptors] bytes long
+			uint es_length = ReadLength (box_data, ref offset);
+			uint min_es_length = 3 + 15 + 3; // Base minimum length
+			if (es_length < min_es_length)
+				throw new CorruptFileException ("Insufficient data present.");
+
+			StreamId = box_data.Mid (offset, 2).ToUShort ();
+			offset += 2; // Done with ES_ID
+
+			stream_dependence_flag = ((byte)((box_data[offset] >> 7) & 0x1) == 0x1 ? true : false); // 1st bit
+			URL_flag = ((byte)((box_data[offset] >> 6) & 0x1) == 0x1 ? true : false); // 2nd bit
+			ocr_stream_flag = ((byte)((box_data[offset] >> 5) & 0x1) == 0x1 ? true : false); // 3rd bit
+			StreamPriority = (byte)(box_data[offset++] & 0x1F); // Last 5 bits and we're done with this byte
+
+			if (stream_dependence_flag) {
+				min_es_length += 2; // We need 2 more bytes
+				if (es_length < min_es_length)
+					throw new CorruptFileException ("Insufficient data present.");
+
+				dependsOn_ES_ID = box_data.Mid (offset, 2).ToUShort ();
+				offset += 2; // Done with stream dependence
+			}
+
+			if (URL_flag) {
+				min_es_length += 2; // We need 1 more byte
+				if (es_length < min_es_length)
+					throw new CorruptFileException ("Insufficient data present.");
+
+				URLlength = box_data[offset++]; // URL Length
+				min_es_length += URLlength; // We need URLength more bytes
+				if (es_length < min_es_length)
+					throw new CorruptFileException ("Insufficient data present.");
+
+				URLstring = box_data.Mid (offset, URLlength).ToString (); // URL name
+				offset += URLlength; // Done with URL name
+			}
+
+			if (ocr_stream_flag) {
+				min_es_length += 2; // We need 2 more bytes
+				if (es_length < min_es_length)
+					throw new CorruptFileException ("Insufficient data present.");
+
+				OCR_ES_Id = box_data.Mid (offset, 2).ToUShort ();
+				offset += 2; // Done with OCR
+			}
+
+			while (offset < DataSize) // Loop through all trailing Descriptors Tags
+			{
+				DescriptorTag tag = (DescriptorTag)box_data[offset++];
+				switch (tag) {
+				case DescriptorTag.DecoderConfigDescrTag: // DecoderConfigDescriptor
+					{
+						// Check that the remainder of the tag is at least 13 bytes long (13 + DecoderSpecificInfo[] + profileLevelIndicationIndexDescriptor[])
+						if (ReadLength (box_data, ref offset) < 13)
+							throw new CorruptFileException ("Could not read data. Too small.");
+
+						// Read a lot of good info.
+						ObjectTypeId = box_data[offset++];
+
+						StreamType = (byte)(box_data[offset] >> 2); // First 6 bits
+						upStream = ((byte)((box_data[offset++] >> 1) & 0x1) == 0x1 ? true : false); // 7th bit and we're done with the stream bits
+
+						BufferSizeDB = box_data.Mid (offset, 3).ToUInt ();
+						offset += 3; // Done with bufferSizeDB
+
+						max_bitrate = box_data.Mid (offset, 4).ToUInt ();
+						offset += 4; // Done with maxBitrate
+
+						average_bitrate = box_data.Mid (offset, 4).ToUInt ();
+						offset += 4; // Done with avgBitrate
+
+						// If there's a DecoderSpecificInfo[] array at the end it'll pick it up in the while loop
+					}
+					break;
+
+				case DescriptorTag.DecSpecificInfoTag: // DecoderSpecificInfo
+					{
+						// The rest of the info is decoder specific.
+						uint length = ReadLength (box_data, ref offset);
+
+						DecoderConfig = box_data.Mid (offset, (int)length);
+						offset += (int)length; // We're done with the config
+					}
+					break;
+
+
+				case DescriptorTag.SLConfigDescrTag: // SLConfigDescriptor
+					{
+						// The rest of the info is SL specific.
+						uint length = ReadLength (box_data, ref offset);
+
+						offset += (int)length; // Skip the rest of the descriptor as reported in the length so we can move onto the next one
+					}
+					break;
+
+				case DescriptorTag.Forbidden_00:
+				case DescriptorTag.Forbidden_FF:
+					throw new CorruptFileException ("Invalid Descriptor tag.");
+
+				default: {
+						/* TODO: Should we handle other optional descriptor tags?
+						 *  ExtensionDescriptor extDescr[0 .. 255];
+							LanguageDescriptor langDescr[0 .. 1];
+							IPI_DescPointer ipiPtr[0 .. 1];
+							IP_IdentificationDataSet ipIDS[0 .. 1];
+							QoS_Descriptor qosDescr[0 .. 1];
+						 */
+						uint length = ReadLength (box_data, ref offset); // Every descriptor starts with a length
+
+						offset += (int)length; // Skip the rest of the descriptor as reported in the length so we can move onto the next one
+						break;
+					}
+				}
+			}
+		}
+
+		#endregion
+
+
+
+		#region Public Properties
+
+		/// <summary>
+		///    Gets the ID of the stream described by the current
+		///    instance.
+		/// </summary>
+		/// <value>
+		///    A <see cref="ushort" /> value containing the ID of the
+		///    stream described by the current instance.
+		/// </value>
+		public ushort StreamId { get; }
+
+		/// <summary>
+		///    Gets the priority of the stream described by the current
+		///    instance.
+		/// </summary>
+		/// <value>
+		///    A <see cref="byte" /> value containing the priority of
+		///    the stream described by the current instance.
+		/// </value>
+		public byte StreamPriority { get; }
+
+		/// <summary>
+		///    Gets the object type ID of the stream described by the
+		///    current instance.
+		/// </summary>
+		/// <value>
+		///    A <see cref="byte" /> value containing the object type ID
+		///    of the stream described by the current instance.
+		/// </value>
+		public byte ObjectTypeId { get; }
+
+		/// <summary>
+		///    Gets the type the stream described by the current
+		///    instance.
+		/// </summary>
+		/// <value>
+		///    A <see cref="byte" /> value containing the type the
+		///    stream described by the current instance.
+		/// </value>
+		public byte StreamType { get; }
+
+		/// <summary>
+		///    Gets the buffer size DB value the stream described by the
+		///    current instance.
+		/// </summary>
+		/// <value>
+		///    A <see cref="uint" /> value containing the buffer size DB
+		///    value the stream described by the current instance.
+		/// </value>
+		public uint BufferSizeDB { get; }
+
+		/// <summary>
+		///    Gets the maximum bitrate the stream described by the
+		///    current instance.
+		/// </summary>
+		/// <value>
+		///    A <see cref="uint" /> value containing the maximum
+		///    bitrate the stream described by the current instance.
+		/// </value>
+		public uint MaximumBitrate { get { return max_bitrate / 1000; } }
+
+		/// <summary>
+		///    Gets the maximum average the stream described by the
+		///    current instance.
+		/// </summary>
+		/// <value>
+		///    A <see cref="uint" /> value containing the average
+		///    bitrate the stream described by the current instance.
+		/// </value>
+		public uint AverageBitrate { get { return average_bitrate / 1000; } }

         /// <summary>
         ///    Gets the decoder config data of stream described by the
@@ -444,7 +392,7 @@
         ///    config data of the stream described by the current
         ///    instance.
         /// </value>
-        public ByteVector DecoderConfig { get { return decoder_config; } }
+        public ByteVector DecoderConfig { get; }

         #endregion

@@ -468,21 +416,20 @@
         ///    A <see cref="uint" /> value containing the length that
         ///    was read.
         /// </returns>
-        private static uint ReadLength(ByteVector data, ref int offset)
-        {
-            byte b;
-            int end = offset + 4;
-            uint length = 0;
-
-            do
-            {
-                b = data[offset++];
-                length = (uint)(length << 7) | (uint)(b & 0x7f);
-            } while ((b & 0x80) != 0 && offset <= end); // The Length could be between 1 and 4 bytes for each descriptor
-
-            return length;
-        }
-
-        #endregion
-    }
+        static uint ReadLength (ByteVector data, ref int offset)
+		{
+			byte b;
+			int end = offset + 4;
+			uint length = 0;
+
+			do {
+				b = data[offset++];
+				length = (uint)(length << 7) | (uint)(b & 0x7f);
+			} while ((b & 0x80) != 0 && offset <= end); // The Length could be between 1 and 4 bytes for each descriptor
+
+			return length;
+		}
+
+		#endregion
+	}
 }