Added URI checking if the scm tag text entered is accessible it will then add the scm tag with the given url.

http://npanday.codeplex.com/WorkItem/View.aspx?WorkItemId=8859

git-svn-id: ee144a4ada4e65570a65b3ba2a4ac9d4eedc8fa4@993979 13f79535-47bb-0310-9956-ffa450edef68

--- assemblies/NPanday.ProjectImporter/Engine/src/main/csharp/NPanday/ProjectImporter/Digest/PomConverter.cs
+++ assemblies/NPanday.ProjectImporter/Engine/src/main/csharp/NPanday/ProjectImporter/Digest/PomConverter.cs
@@ -3,6 +3,7 @@
 using System.Text;
 using System.IO;
 using System.Windows.Forms;
+

 using NPanday.ProjectImporter.Digest;
@@ -71,13 +72,28 @@
                 model.version = version;
                 model.name = string.Format("{0} : {1}", groupId, artifactId);

-                if (!string.Empty.Equals(scmTag) || scmTag != null || scmTag != "<OPTIONAL: svn url>")
+                if (scmTag.Contains("scm:svn:"))
+                {
+                    scmTag = scmTag.Remove(scmTag.IndexOf("scm:svn:"), 8);
+                }
+
+                Uri repoUri;
+                bool isValidUrl = true;
+                try
+                {
+                    repoUri = new Uri(scmTag);
+                }
+                catch(Exception)
+                {
+                    isValidUrl=false;
+                    MessageBox.Show(string.Format("SCM Tag was not added, because the url {0} was not accessible",scmTag), "NPanday Project Import", MessageBoxButtons.OK, MessageBoxIcon.Warning);
+                }
+
+
+                if (!string.Empty.Equals(scmTag) && scmTag != null && !scmTag.ToUpper().Contains("OPTIONAL") && isValidUrl)
                 {
                     scmTag = scmTag.Trim();
-                    if (scmTag.Contains("scm:svn:"))
-                    {
-                        scmTag = scmTag.Remove(scmTag.IndexOf("scm:svn:"), 8);
-                    }
+
                     Scm scmHolder = new Scm();
                     scmHolder.connection = string.Format("scm:svn:{0}",scmTag);
                     scmHolder.developerConnection = string.Format("scm:svn:{0}", scmTag);


Fix spelling.

Fix spelling.

--- cli/src/MsgPack/Unpacking.cs
+++ cli/src/MsgPack/Unpacking.cs
@@ -285,7 +285,7 @@
 			int bytes = source.Read( result, 0, length );
 			if ( bytes < length )
 			{
-				throw new UnpackException( "The underlying stream unepectedly ends." );
+				throw new UnpackException( "The underlying stream unexpectedly ends." );
 			}

 			return result;


Changed TotalAnnualSales type from double? to decimal?

--- PS.Mothership.Core/PS.Mothership.Core.Common/Dto/Application/ApplicationDetailLocationProductDto.cs
+++ PS.Mothership.Core/PS.Mothership.Core.Common/Dto/Application/ApplicationDetailLocationProductDto.cs
@@ -56,7 +56,7 @@

         //Transaction Details section
         [DataMember]
-        public double? TotalAnnualSales { get; set; }
+        public decimal? TotalAnnualSales { get; set; }
         [DataMember]
         public double? MinimumCardTransactionValue { get; set; }
         [DataMember]


Add space before number of documents

Add space before number of documents

--- R7.University.EduProgramProfileDirectory/ViewModels/EduProgramProfileObrnadzorDocumentsViewModel.cs
+++ R7.University.EduProgramProfileDirectory/ViewModels/EduProgramProfileObrnadzorDocumentsViewModel.cs
@@ -154,11 +154,11 @@
         {
             var docCount = documents.Count ();
             if (docCount > 0) {
-                var docCountText = (docCount > 1 || string.IsNullOrEmpty (linkText))? "[" + docCount + "]" : string.Empty;
+                var docCountText = (docCount > 1 || string.IsNullOrEmpty (linkText))? " [" + docCount + "]" : string.Empty;
                 var table = new StringBuilder (
                     $""
                   + $"{linkText}{docCountText}"
+                    + $" data-table=\"doct-{RowId}-{columnSlug}\">{linkText}{docCountText.TrimStart ()}"
                   + $"
"
                   + $"

{GroupColumnHeader}	"
                   + $"{TitleColumnHeader}

"


About fixed!!

About fixed!!

--- Sibelius.Web/Controllers/HomeController.cs
+++ Sibelius.Web/Controllers/HomeController.cs
@@ -33,6 +33,11 @@
         {
             Session["pubadv"] = true;
             return Json("ok");
-        }
+        }
+
+        public ActionResult About()
+        {
+            return View();
+        }
     }
 }


correct function signature

correct function signature

--- SlicerConfiguration/SliceSettingsWidget.cs
+++ SlicerConfiguration/SliceSettingsWidget.cs
@@ -628,7 +628,7 @@
 			return ActiveSliceSettings.Instance.GetActiveValue(slicerConfigName, layerCascade);
 		}

-		private GuiWidget CreateSettingInfoUIControls(OrganizerSettingsData settingData, double rightContentWidth, int extruderIndex)
+		private GuiWidget CreateSettingInfoUIControls(OrganizerSettingsData settingData, int extruderIndex)
 		{
 			GuiWidget container = new GuiWidget();


Improve artist detection

Improve artist detection

--- TicTacTubeCore/Processors/Media/Songs/SongInfoExtractor.cs
+++ TicTacTubeCore/Processors/Media/Songs/SongInfoExtractor.cs
@@ -25,7 +25,7 @@
 		/// <summary>
 		///     All delimiters that indicate another artist following.
 		/// </summary>
-		protected string[] ArtistSeperator = { @"\svs.?\s", @"\s&\s", @",\s", @"\swith\s", @"\sx\s" };
+		protected string[] ArtistSeperator = { @"\s(&|\+|with|vs.?)\s", @",\s", @"(?i)\sx\s" };

 		/// <summary>
 		///     Common delimiters for song titles (seperate songname from main artist)


Add ClosestPointOnTs

Add ClosestPointOnTs

--- SolidworksAddinFramework/CurveExtension.cs
+++ SolidworksAddinFramework/CurveExtension.cs
@@ -16,6 +16,11 @@
         public static double[] PointAt(this ICurve curve, double t)
         {
             return (double[]) curve.Evaluate2(t, 0);
+        }
+
+        public static double[] ClosestPointOnTs(this ICurve curve , double x, double y, double z)
+        {
+            return (double[]) curve.GetClosestPointOn(x, y, z);
         }

         /// <summary>


cleanup

cleanup

--- [C#]-02-CSharp2/05-Using-Classes-And-Objects/09-Arithmetical-Expressions/ArithmeticalExpressions.cs
+++ [C#]-02-CSharp2/05-Using-Classes-And-Objects/09-Arithmetical-Expressions/ArithmeticalExpressions.cs
@@ -108,7 +108,10 @@
                     }
                     else // read an operator
                     {
-                        ReadOperator(InputExpression[curElement].ToString());
+                        ReadOperator(
+                            InputExpression[curElement]
+                            .ToString()
+                            );

                         continue;
                     }
@@ -160,7 +163,11 @@
             }

             // ouput
-            Console.WriteLine(double.Parse(OutputExpression[0]).ToString("F2"));
+            Console.WriteLine(
+                double.Parse(
+                    OutputExpression[0])
+                    .ToString("F2")
+                    );
         }

         // Read A Number
@@ -480,12 +487,14 @@

             // Step 1: Format STring
             // TODO: LN = LOG
-            OutputExpression[OperatorIndex] = OutputExpression[OperatorIndex][0]
-                                              .ToString()
-                                              .ToUpper() +
-                                              OutputExpression[OperatorIndex];
-
-            OutputExpression[OperatorIndex] = OutputExpression[OperatorIndex].Remove(1, 1);
+            OutputExpression[OperatorIndex] =
+                    OutputExpression[OperatorIndex][0]
+                    .ToString()
+                    .ToUpper() +
+                    OutputExpression[OperatorIndex];
+
+            OutputExpression[OperatorIndex] =
+                    OutputExpression[OperatorIndex].Remove(1, 1);

             // ln -> Log
             if (OutputExpression[OperatorIndex] == "Ln")
@@ -496,13 +505,14 @@
             // Step 2: Get method info
             var argsToPass = 0;

-            MethodInfo curMethod = typeof(Math)
-                                   .GetMethod(
-                                       OutputExpression[OperatorIndex],
-                                       new Type[]
-                                       {
-                                           typeof(double)
-                                       });
+            MethodInfo curMethod =
+                    typeof(Math)
+                        .GetMethod(
+                            OutputExpression[OperatorIndex],
+                            new Type[]
+                            {
+                                typeof(double)
+                            });

             if (curMethod != null)
             {
@@ -512,14 +522,15 @@
             else
             {
                 // search for a method taking 2 arguments
-                curMethod = typeof(Math)
-                            .GetMethod(
-                                OutputExpression[OperatorIndex],
-                                new Type[]
-                                {
-                                    typeof(double),
-                                    typeof(double)
-                                });
+                curMethod =
+                    typeof(Math)
+                        .GetMethod(
+                            OutputExpression[OperatorIndex],
+                            new Type[]
+                            {
+                                typeof(double),
+                                typeof(double)
+                            });

                 // method taking 2 argumetns
                 argsToPass = 2;
@@ -532,14 +543,15 @@
             if (argsToPass == 1)
             {
                 // call method
-                OutputExpression[OperatorIndex - 1] = (curMethod.Invoke(
-                                                          typeof(Math),
-                                                          new object[]
-                                                          {
-                                                              double.Parse(OutputExpression[OperatorIndex - 1])
-                                                          }
-                                                      ))
-                                                      .ToString();
+                OutputExpression[OperatorIndex - 1] =
+                        (curMethod.Invoke(
+                            typeof(Math),
+                            new object[]
+                            {
+                                double.Parse(OutputExpression[OperatorIndex - 1])
+                            }
+                        ))
+                        .ToString();

                 // remove extra elements
                 OutputExpression.RemoveAt(OperatorIndex);
@@ -550,15 +562,16 @@
             if (argsToPass == 2)
             {
                 // call method
-                OutputExpression[OperatorIndex - 2] = (curMethod.Invoke(
-                                                          typeof(Math),
-                                                          new object[]
-                                                          {
-                                                              double.Parse(OutputExpression[OperatorIndex - 2]),
-                                                              double.Parse(OutputExpression[OperatorIndex - 1])
-                                                          }
-                                                      ))
-                                                      .ToString();
+                OutputExpression[OperatorIndex - 2] =
+                            (curMethod.Invoke(
+                                typeof(Math),
+                                new object[]
+                                {
+                                    double.Parse(OutputExpression[OperatorIndex - 2]),
+                                    double.Parse(OutputExpression[OperatorIndex - 1])
+                                }
+                            ))
+                            .ToString();

                 // remove extra elements
                 OutputExpression.RemoveAt(OperatorIndex);


attempts to solve "return error 2" issue.

--- Andromeda/Andromeda/Command/RunRemoteCommand.cs
+++ Andromeda/Andromeda/Command/RunRemoteCommand.cs
@@ -34,6 +34,7 @@
             else
             {
                 connOps.Impersonation = ImpersonationLevel.Impersonate;
+                connOps.Authentication = AuthenticationLevel.PacketPrivacy;
             }

             CLI_Prompt newPrompt = new CLI_Prompt();
@@ -79,15 +80,17 @@
             {
                 deviceWMI = netconn.ConnectToRemoteWMI(d, scope, options);
                 ManagementPath p = new ManagementPath("Win32_Process");
-                ManagementClass wmiProcess = new ManagementClass(deviceWMI, p, new ObjectGetOptions());
+                ManagementClass wmiProcess = new ManagementClass(deviceWMI, p, null);
                 ManagementClass startupSettings = new ManagementClass("Win32_ProcessStartup");
                 startupSettings.Scope = deviceWMI;
+                startupSettings["CreateFlags"] = 16777216;
                 ManagementBaseObject inParams = wmiProcess.GetMethodParameters("Create");
                 inParams["CommandLine"] = process;
                 inParams["ProcessStartupInformation"] = startupSettings;
                 ManagementBaseObject outValue = wmiProcess.InvokeMethod("Create", inParams, null);
                 string retval = outValue["ReturnValue"].ToString();
-                ResultConsole.AddConsoleLine(d + "returned exit code: " + retval);
+                //string retval = outValue.Properties.ToString();
+                ResultConsole.AddConsoleLine(d + " returned exit code: " + retval);
             }
             else
             {


Made pens move to offset when put back.

Made pens move to offset when put back.

--- Assets/OCDRoomEscape/Scripts/GrabbableObject.cs
+++ Assets/OCDRoomEscape/Scripts/GrabbableObject.cs
@@ -155,6 +155,28 @@

         // anchor.parent = lastParent;

+        var moveToTargetPos = true;
+
+        var targetPosition = lastPosition + grabMoveOffset;
+
+        while (moveToTargetPos)
+        {
+            var toTarget = targetPosition - anchor.position;
+
+            var moveDistance = Mathf.Min(grabSpeed * Time.deltaTime, toTarget.magnitude);
+
+            anchor.position += toTarget.normalized * moveDistance;
+
+            if (Vector3.Distance(anchor.position, targetPosition) < 0.004f)
+            {
+                moveToTargetPos = false;
+            }
+            else
+            {
+                yield return new WaitForFixedUpdate();
+            }
+        }
+
         while (moveToLastPosition)
         {
             var toTarget = lastPosition - anchor.position;
@@ -178,7 +200,6 @@
                 yield return new WaitForFixedUpdate();
             }
         }
-
     }

     // This anchor will move around this object


Added a LinkifiedText() method to the TwitterDirectMessage class.

--- Twitterizer2/Methods/DirectMessage/TwitterDirectMessage.cs
+++ Twitterizer2/Methods/DirectMessage/TwitterDirectMessage.cs
@@ -281,5 +281,14 @@

             return Core.CommandPerformer.PerformAction(command);
         }
+
+        /// <summary>
+        /// Returns the status text with HTML links to users, urls, and hashtags.
+        /// </summary>
+        /// <returns></returns>
+        public string LinkifiedText()
+        {
+            return TwitterStatus.LinkifiedText(Entities, Text);
+        }
     }
 }


adding filters for skidz

adding filters for skidz

--- Aurora/Framework/Services/IApplicationPlugin.cs
+++ Aurora/Framework/Services/IApplicationPlugin.cs
@@ -265,6 +265,9 @@

         public Dictionary<string, object> andNotFilters = new Dictionary<string, object>();

+        public List<string> andIsNullFilters = new List<string>();
+        public List<string> andIsNotNullFilters = new List<string>();
+
         public List<QueryFilter> subFilters = new List<QueryFilter>();

         public uint Count
@@ -286,7 +289,9 @@
                     andLessThanFilters.Count +
                     orLessThanFilters.Count +
                     andLessThanEqFilters.Count +
-                    andNotFilters.Count
+                    andNotFilters.Count +
+                    andIsNullFilters.Count +
+                    andIsNotNullFilters.Count
                 );

                 subFilters.ForEach(delegate(QueryFilter filter)
@@ -536,6 +541,32 @@

                 #endregion

+                #region NULL
+
+                parts = new List<string>();
+                foreach (string field in andIsNotNullFilters)
+                {
+                    parts.Add(string.Format("{0} IS NOT NULL", field));
+                }
+                if (parts.Count > 0)
+                {
+                    query += (had ? " AND" : string.Empty) + " (" + string.Join(" AND ", parts.ToArray()) + ")";
+                    had = true;
+                }
+
+                parts = new List<string>();
+                foreach (string field in andIsNullFilters)
+                {
+                    parts.Add(string.Format("{0} IS NULL", field));
+                }
+                if (parts.Count > 0)
+                {
+                    query += (had ? " AND" : string.Empty) + " (" + string.Join(" AND ", parts.ToArray()) + ")";
+                    had = true;
+                }
+
+                #endregion
+
                 foreach (QueryFilter subFilter in subFilters)
                 {
                     Dictionary<string, object> sps;


commit

commit

--- AzureMediaPortal/Controllers/MediaController.cs
+++ AzureMediaPortal/Controllers/MediaController.cs
@@ -33,7 +33,6 @@

         }

-
         public ActionResult PublicVideos(string searchString)
         {
             //search functionality, ignores case
@@ -41,10 +40,11 @@
             {
                 return View(db.MediaElements.Where(m => m.IsPublic.Equals(true)).ToList());
             }
-            else
+            else
             {
                 return View(db.MediaElements.Where(v => v.Title.ToLower().Contains(searchString.ToLower()) && v.IsPublic.Equals(true)).ToList());
             }
+
         }

         // GET: /Media/Details/


not a counseling, a 5500

not a counseling, a 5500

--- Battery-Commander.Web/Views/ABCP/Details.cshtml
+++ Battery-Commander.Web/Views/ABCP/Details.cshtml
@@ -11,7 +11,7 @@

 @if (!Model.IsPassing && Model.Measurements.Any())
 {
-    @Html.ActionLink("Generate Counseling", "Counseling", "ABCP", new { Model.Id }, new { @class = "btn btn-default" })
+    @Html.ActionLink("Generate DA5500", "Counseling", "ABCP", new { Model.Id }, new { @class = "btn btn-default" })
 }

 <div class="panel panel-default">


Correccion Bug parseo fecha en ingles

Correccion Bug parseo fecha en ingles

--- BeatIt!/AppCode/Controllers/FacadeController.cs
+++ BeatIt!/AppCode/Controllers/FacadeController.cs
@@ -1,5 +1,6 @@
 using System;
 using System.Collections.Generic;
+using System.Globalization;
 using System.IO.IsolatedStorage;
 using System.Linq;
 using BeatIt_.AppCode.Challenges;
@@ -202,7 +203,8 @@
                                     Finished = (bool)jObject["finished"],
                                     LastScore = (int)jObject["lastScore"],
                                     BestScore = (int)jObject["bestScore"],
-                                    StartDate = Convert.ToDateTime((string)jObject["start_date"])
+                                    //StartDate = Convert.ToDateTime((string)jObject["start_date"])
+                                    StartDate = DateTime.ParseExact((string)jObject["start_date"], "dd/MM/yyyy HH:mm:ss",CultureInfo.InvariantCulture)
                                 };

                                 _currentRound.Challenges[(int)jObject["id"]].State = s;


update Modeller version

update Modeller version

--- Blueprint41.Modeller/Properties/AssemblyInfo.cs
+++ Blueprint41.Modeller/Properties/AssemblyInfo.cs
@@ -32,5 +32,5 @@
 // You can specify all the values or you can default the Build and Revision Numbers
 // by using the '*' as shown below:
 // [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.1.0.0")]
-[assembly: AssemblyFileVersion("1.1.0.0")]
+[assembly: AssemblyVersion("1.2.0.0")]
+[assembly: AssemblyFileVersion("1.2.0.0")]


Unified how program searches for dll with rest of program

--- SourceEngineConsoleParser/ClassCompiler.cs
+++ SourceEngineConsoleParser/ClassCompiler.cs
@@ -55,7 +55,7 @@
             }
             newDomain = AppDomain.CreateDomain("newDomain");
             newDomain.SetupInformation.ShadowCopyFiles = "true";
-            byte[] rawAssembly = loadFile(extensionName + ".dll");
+            byte[] rawAssembly = loadFile(Application.StartupPath + "\\" + extensionName + ".dll");
             assembly = newDomain.Load(rawAssembly, null);
            parserExtensionClass = (Parser)assembly.CreateInstance("SourceEngineConsoleParser." + extensionName);


Added Opne/CloseBlock.

Added Opne/CloseBlock.

--- CK.CodeGen.Abstractions/CodeWriterExtensions.cs
+++ CK.CodeGen.Abstractions/CodeWriterExtensions.cs
@@ -101,6 +101,22 @@
         /// <param name="this">This code writer.</param>
         /// <returns>This code writer to enable fluent syntax.</returns>
         static public T NewLine<T>( this T @this ) where T : ICodeWriter => @this.Append( Environment.NewLine );
+
+        /// <summary>
+        /// Appends a "{" on a new independent line.
+        /// </summary>
+        /// <typeparam name="T">Actual type of the code writer.</typeparam>
+        /// <param name="this">This code writer.</param>
+        /// <returns>This code writer to enable fluent syntax.</returns>
+        static public T OpenBlock<T>( this T @this ) where T : ICodeWriter => @this.Append( Environment.NewLine ).Append( "{" ).NewLine();
+
+        /// <summary>
+        /// Appends a "}" on a new independent line.
+        /// </summary>
+        /// <typeparam name="T">Actual type of the code writer.</typeparam>
+        /// <param name="this">This code writer.</param>
+        /// <returns>This code writer to enable fluent syntax.</returns>
+        static public T CloseBlock<T>( this T @this ) where T : ICodeWriter => @this.Append( Environment.NewLine ).Append( "{" ).NewLine();

         /// <summary>
         /// Appends the C# type name. Handles generic definition (either opened or closed).


added transaction for orderconfirmation

added transaction for orderconfirmation

--- e-commerce/Controllers/CheckoutController.cs
+++ e-commerce/Controllers/CheckoutController.cs
@@ -42,77 +42,92 @@
         {
             string CartId = Request.Cookies["shoppingCart"].Value;
             int OrderId;
-            int CustomerId = 0;
-            List<CheckoutViewModel> Products;
+
+

             using (var connection = new SqlConnection(this.connectionString))
             {
+                //start sql transaction
+                connection.Open();
+                SqlCommand command = connection.CreateCommand();
+                SqlTransaction transaction;
+
+                transaction = connection.BeginTransaction("orderTransaction");
+                // assign the command to local transaction
+                command.Connection = connection;
+                command.Transaction = transaction;
                 try
                 {
-                    // add customer to db and get last inserted customer id
-                    var insert = "insert into Customer (Firstname, Lastname, Email, Phone, Street, PostalCode, City) values (@Firstname, @Lastname, @Email, @Phone, @Street, @PostalCode, @City)";
-                    var parameters = new { Firstname = Firstname, Lastname = Lastname, Email = Email, Phone = Phone, Street = Street, PostalCode = PostalCode, City = City };
-                    connection.Execute(insert, parameters);
-                    CustomerId = connection.Query<int>("SELECT MAX(Id) from Customer").First();
-                } catch (SqlException)
+                    // add customer to db
+                    command.CommandText = "insert into Customer (Firstname, Lastname, Email, Phone, Street, PostalCode, City) values (@Firstname, @Lastname, @Email, @Phone, @Street, @PostalCode, @City)";
+                    command.Parameters.AddWithValue("@Firstname", Firstname);
+                    command.Parameters.AddWithValue("@Lastname", Lastname);
+                    command.Parameters.AddWithValue("@Email", Email);
+                    command.Parameters.AddWithValue("@Phone", Phone);
+                    command.Parameters.AddWithValue("@Street", Street);
+                    command.Parameters.AddWithValue("@PostalCode", PostalCode);
+                    command.Parameters.AddWithValue("@City", City);
+                    command.ExecuteNonQuery();
+
+
+                    // add order to db
+                    command.CommandText = "insert into Orders (Orderstatus, CustomerId, CartId) values (@Orderstatus, (SELECT MAX(Id) from Customer), @AddCartId)";
+                    command.Parameters.AddWithValue("@Orderstatus", 1);
+                    command.Parameters.AddWithValue("AddCartId", CartId);
+                    command.ExecuteNonQuery();
+
+
+                    //get products
+                    command.CommandText = "select C.ProductId, C.Quantity, P.ProductPrice from Cart as C join Products as P on C.ProductId = P.Id where C.CartId = @CartId";
+                    command.Parameters.AddWithValue("@CartId", CartId);
+                    var products = new List<CheckoutViewModel>();
+                    SqlDataReader ProductsReader = command.ExecuteReader();
+                    //reader loops through all the cart items
+                    while (ProductsReader.Read())
+                    {
+                        var product = new CheckoutViewModel();
+                        product.ProductId = Int32.Parse(ProductsReader["ProductId"].ToString());
+                        product.Quantity = Int32.Parse(ProductsReader["Quantity"].ToString());
+                        product.ProductPrice = Int32.Parse(ProductsReader["ProductPrice"].ToString());
+                        products.Add(product);
+                    }
+                    //close reader
+                    ProductsReader.Close();
+
+                //add products to order item in db
+                var count = 0;
+                    foreach (CheckoutViewModel CartProduct in products)
+                    {
+                        command.CommandText = "insert into OrderProducts (OrderId, ProductId, Quantity, Price) values ((SELECT MAX(OrderId) from Orders), @ProductId" + count + ", @Quantity" + count + ", @Price" + count + ")";
+                        command.Parameters.AddWithValue("@ProductId" + count + "", CartProduct.ProductId);
+                        command.Parameters.AddWithValue("@Quantity" + count + "", CartProduct.Quantity);
+                        command.Parameters.AddWithValue("@Price" + count + "", CartProduct.ProductPrice);
+                        command.ExecuteNonQuery();
+                        count++;
+                    }
+
+                    //delete cart from db
+                    command.CommandText = "delete from Cart where CartId = @deleteCartId";
+                    command.Parameters.AddWithValue("@deleteCartId", CartId);
+                    command.ExecuteNonQuery();
+
+                    //get last inserted id from orders
+                    command.CommandText = "select MAX(OrderId) from Orders";
+                    OrderId = Convert.ToInt32(command.ExecuteScalar());
+
+                    // delete cart cookie
+                    var CartCookie = new HttpCookie("shoppingCart");
+                    CartCookie.Expires = DateTime.Now.AddDays(-1);
+                    Response.Cookies.Add(CartCookie);
+
+                    transaction.Commit();
+
+                } catch (Exception)
                 {
+                    transaction.Rollback();
                     return View("Error");
-                }
-
-                try
-                {
-                    // add order to db and get last inserted order id
-                    var insertOrder = "insert into Orders (Orderstatus, CustomerId, CartId) values (@Orderstatus, @CustomerId, @CartId)";
-                    var OrderParameters = new { Orderstatus = 1, CustomerId = CustomerId, CartId = CartId };
-                    connection.Execute(insertOrder, OrderParameters);
-                    OrderId = connection.Query<int>("SELECT MAX(OrderId) from Orders").First();
-                } catch (SqlException)
-                {
-                    return View("Error");
-                }
-
-                try
-                {
-                    //get products
-                    var selectProducts = "select C.ProductId, C.Quantity, P.ProductPrice from Cart as C join Products as P on C.ProductId = P.Id where C.CartId = @CartId";
-                    var productsParameters = new { CartId = CartId };
-                    Products = connection.Query<CheckoutViewModel>(selectProducts, productsParameters).ToList();
-                } catch (SqlException)
-                {
-                    return View("Error");
-                }
-
-                try
-                {
-                    //add products to order item in db
-                    foreach (CheckoutViewModel CartProduct in Products)
-                    {
-                        var OrderProducts = "insert into OrderProducts (OrderId, ProductId, Quantity, Price) values (@OrderId, @ProductId, @Quantity, @Price)";
-                        var OrderParam = new { OrderId = OrderId, ProductId = CartProduct.ProductId, Quantity = CartProduct.Quantity, Price = CartProduct.ProductPrice };
-                        connection.Execute(OrderProducts, OrderParam);
-                    }
-                } catch (SqlException)
-                {
-                    return View("Error");
-                }
-
-                try {
-                    //delete cart from db
-                    var deleteCart = "delete from Cart where CartId = @CartId";
-                    var DeleteParam = new { CartId = CartId };
-                    connection.Execute(deleteCart, DeleteParam);
-                } catch (SqlException)
-                {
-                    return View("Error");
-                }
-
+                }
             }
-
-
-            // delete cart cookie
-            var CartCookie = new HttpCookie("shoppingCart");
-            CartCookie.Expires = DateTime.Now.AddDays(-1);
-            Response.Cookies.Add(CartCookie);

             return RedirectToAction("ConfirmOrder", new { OrderId = OrderId });
         }


Covered OpCodes test

Covered OpCodes test

--- SpirvNet/SpirvNet/Tests/InstructionTest.cs
+++ SpirvNet/SpirvNet/Tests/InstructionTest.cs
@@ -1,6 +1,7 @@
 using System;
 using System.Collections.Generic;
 using System.Linq;
+using System.Reflection;
 using System.Text;
 using System.Threading.Tasks;
 using NUnit.Framework;
@@ -75,5 +76,14 @@
             Assert.AreEqual(3, op.WordCount);
             Assert.AreEqual(2 + 2 + 3, code.Count);
         }
+
+        [Test]
+        public void CoveredOpCodes()
+        {
+            var op2type = Assembly.GetExecutingAssembly().GetTypes().Where(t => t.IsSubclassOf(typeof(Instruction))).ToDictionary(type => type.Name);
+
+            foreach (var value in Enum.GetValues(typeof(OpCode)))
+                Assert.That(op2type.ContainsKey("Op" + value));
+        }
     }
 }


Added all extended instructions (openCL12/20/21)

--- SpirvSpecToJson/SpirvSpecToJson/Program.cs
+++ SpirvSpecToJson/SpirvSpecToJson/Program.cs
@@ -232,7 +232,7 @@
                                 // Linked Types
                                 else if (td.InnerHtml.Contains("<a href="))
                                 {
-                                    var a = text.GetLinkedNameAndType();
+                                    var a = text.GetLinkedNameAndType(true, true);
                                     operand["Name"] = a[0].Replace(".", "");
                                     operand["Type"] = a[1];
                                     operands.Add(operand);
@@ -240,7 +240,7 @@
                                 // Optionals
                                 else if (text.Contains("Optional"))
                                 {
-                                    var a = text.GetLinkedNameAndType();
+                                    var a = text.GetLinkedNameAndType(true, true);
                                     operand["Name"] = a[0] == "[Bias]" ? "Bias" : a[0];
                                     operand["Type"] = "ID?";
                                     operands.Add(operand);
@@ -258,7 +258,7 @@
                     }
                 }

-                #endregion
+                #endregion

                 #region Enums

@@ -666,11 +666,16 @@
                             var tr = tbody.FirstChild.NextSibling;
                             var td = tr.FirstChild.NextSibling;

-                            //TODO
-                            // Enums
-                            if (tbody.ParentNode.ParentNode.FirstChild.NextSibling.Id ==
-                                "_a_id_imageformatenc_a_image_format_encoding")
-                                continue;
+
+                            // Enums => ignore
+                            {
+
+                                if (tbody.ParentNode.ParentNode.FirstChild.NextSibling.Id ==
+                                    "_a_id_imageformatenc_a_image_format_encoding")
+                                {
+                                    continue;
+                                }
+                            }

                             var name = td.FirstChild.FirstChild.NextSibling.InnerText;

@@ -682,6 +687,7 @@
                                 var comment = new StringBuilder();
                                 var commentPlain = new StringBuilder();

+                                // The complete comment is written in different rows => get all
                                 foreach (var commentBlock in td.ChildNodes)
                                 {
                                     comment.Append(commentBlock.InnerHtml);
@@ -691,13 +697,15 @@
                                 var comInnerHtml = comment.ToString();
                                 var comInnerText = commentPlain.ToString();

+                                // Replace
 to

                                 comInnerHtml = comInnerHtml == name
                                     ? ""
-                                    : comInnerHtml.Substring(2*name.Length +
+                                    : comInnerHtml.Substring(2 * name.Length +
                                                              "".Length)
                                         .Trim()
                                         .Replace("
", "
");

+                                // Delete "/n" or "
 at beginning and at the end
                                 if (comInnerHtml.StartsWith("
\n"))
                                     comInnerHtml = comInnerHtml.Substring("
\n".Length);
                                 if (comInnerHtml.EndsWith("\n
"))
@@ -711,11 +719,11 @@
                                 extInst["DescriptionPlain"] = comInnerText;
                             }

-
-                            // TODO: Category
-                            {
-                                var cat = tbody.ParentNode.ParentNode.FirstChild.NextSibling.InnerText;
-                                cat = cat.Substring(cat.IndexOf(" ")).Trim().ToCamelCase();
+
+                            // Category
+                            var cat = tbody.ParentNode.ParentNode.FirstChild.NextSibling.InnerText;
+                            {
+                                cat = cat.Substring(cat.IndexOf(" ")).Trim().ToCamelCase();
                                 extInst["Category"] = cat;
                             }

@@ -724,7 +732,13 @@
                                 var row = tbody.LastChild.PreviousSibling;

                                 var operands = new JArray();
-
+
+                                //TODO: implement ImageEncoding
+                                if (cat == "ImageEncoding" || cat == "SamplerEncoding")
+                                    continue;
+
+                                // Start at 6th column (Number)
+                                // After Number there are only params
                                 for (int i = 11; i < row.ChildNodes.Count; i++)
                                 {
                                     var column = row.ChildNodes[i];
@@ -741,9 +755,27 @@
                                     // Operands
                                     else
                                     {
-                                        operand["Name"] = WebUtility.HtmlDecode(column.InnerText).GetName(false);
-                                        operand["Tpe"] = "ID";
-                                        operands.Add(operand);
+                                        // LiteralNumber
+                                        if (column.InnerText.Contains("Literal Number"))
+                                        {
+                                            var a = column.InnerText.GetLinkedNameAndType(false, true);
+                                            operand["Name"] = a[0];
+                                            operand["Type"] = a[1];
+                                            operands.Add(operand);
+                                        }
+                                        // printf -> addionalArguemnts as ID Array
+                                        else if (column.InnerText.StartsWith("<id>, <id>,"))
+                                        {
+                                            operand["Name"] = "AdditionalArguments";
+                                            operand["Type"] = "ID[]";
+                                        }
+                                        // IDs
+                                        else
+                                        {
+                                            operand["Name"] = WebUtility.HtmlDecode(column.InnerText).GetName(false);
+                                            operand["Tpe"] = "ID";
+                                            operands.Add(operand);
+                                        }
                                     }
                                 }

@@ -753,11 +785,475 @@
                             extendedInstructions.Add(extInst);

                         }
-
                         extCL12["ExtendedInstructions"] = extendedInstructions;
                     }

+                    // Enums
+                    {
+                        var enums = new JArray();
+
+                        foreach (var tbody in rootExt.SelectNodes("//tbody"))
+                        {
+                            var enu = new JObject();
+
+                            // Enums ID
+                            if (tbody.ParentNode.ParentNode.FirstChild.NextSibling.Id ==
+                                "_a_id_imageformatenc_a_image_format_encoding")
+                            {
+                                var values = new JArray();
+
+                                Debug.Assert(tbody.ParentNode.ChildNodes.Count > 5);
+
+                                enu["Name"] = tbody.ParentNode.ChildNodes[5].InnerText.Trim();
+
+                                // Values
+                                foreach (var tr in tbody.ChildNodes)
+                                {
+                                    var val = new JObject();
+                                    if (tr.Name == "tr")
+                                    {
+                                        Debug.Assert(tr.ChildNodes.Count > 3);
+
+                                        val["Value"] = int.Parse(tr.ChildNodes[1].InnerText);
+                                        val["Name"] = tr.ChildNodes[3].InnerText;
+
+                                        values.Add(val);
+                                    }
+                                }
+
+                                enu["Values"] = values;
+
+                                enums.Add(enu);
+
+                            }
+                        }
+
+                        extCL12["Enums"] = enums;
+                    }
+
                     extJson.Add(extCL12);
+
+                }
+
+                #endregion
+
+                #region CL20
+                {
+                    // Load File
+
+                    // cached spec
+                    Console.WriteLine("Read HTML from " + cacheFileExtOpenCL20);
+                    var htmlExt = File.ReadAllText(cacheFileExtOpenCL20);
+
+                    // html doc
+                    Console.WriteLine("Initialize HTML Doc");
+                    var docExt = new HtmlDocument();
+                    docExt.LoadHtml(htmlExt);
+                    var rootExt = docExt.DocumentNode;
+
+                    var extCL20 = new JObject();
+
+                    // Metadata
+                    {
+                        var metaData = new JObject();
+
+                        metaData["Language"] = "Open CL";
+                        metaData["Version"] = 2.0;
+                        metaData["Title"] = rootExt.SelectSingleNode("//div[@id='header']/h1").InnerText;
+                        metaData["Author"] = rootExt.SelectSingleNode("//span[@id='author']").InnerText;
+                        metaData["Revnumber"] = rootExt.SelectSingleNode("//span[@id='revnumber']").InnerText;
+                        metaData["LastUpdate"] = rootExt.SelectSingleNode("//div[@id='footer-text']").LastChild.InnerText.Trim();
+
+                        extCL20["Metadata"] = metaData;
+                    }
+
+                    // Extended Instructions
+                    {
+                        var extendedInstructions = new JArray();
+
+                        foreach (var tbody in rootExt.SelectNodes("//tbody"))
+                        {
+                            var extInst = new JObject();
+
+                            var tr = tbody.FirstChild.NextSibling;
+                            var td = tr.FirstChild.NextSibling;
+
+                            // Enums => ignore
+                            {
+
+                                if (tbody.ParentNode.ParentNode.FirstChild.NextSibling.Id ==
+                                    "_a_id_imageformatenc_a_image_format_encoding")
+                                {
+                                    continue;
+                                }
+                            }
+
+                            var name = td.FirstChild.FirstChild.NextSibling.InnerText;
+
+                            extInst["Name"] = name.ToCamelCase();
+                            extInst["OriginalName"] = name;
+
+                            // Description
+                            {
+                                var comment = new StringBuilder();
+                                var commentPlain = new StringBuilder();
+
+                                // The complete comment is written in different rows => get all
+                                foreach (var commentBlock in td.ChildNodes)
+                                {
+                                    comment.Append(commentBlock.InnerHtml);
+                                    commentPlain.Append(commentBlock.InnerText);
+                                }
+
+                                var comInnerHtml = comment.ToString();
+                                var comInnerText = commentPlain.ToString();
+
+                                // Replace
 to

+                                comInnerHtml = comInnerHtml == name
+                                    ? ""
+                                    : comInnerHtml.Substring(2 * name.Length +
+                                                             "".Length)
+                                        .Trim()
+                                        .Replace("
", "
");
+
+                                // Delete "/n" or "
 at beginning and at the end
+                                if (comInnerHtml.StartsWith("
\n"))
+                                    comInnerHtml = comInnerHtml.Substring("
\n".Length);
+                                if (comInnerHtml.EndsWith("\n
"))
+                                    comInnerHtml = comInnerHtml.Remove(comInnerHtml.Length - "\n
".Length);
+                                if (comInnerText.StartsWith(name + "\n\n"))
+                                    comInnerText = comInnerText.Substring(name.Length + "\n\n".Length);
+                                if (comInnerText.EndsWith("\n"))
+                                    comInnerText = comInnerText.Remove(comInnerText.Length - "\n".Length);
+
+                                extInst["Description"] = comInnerHtml;
+                                extInst["DescriptionPlain"] = comInnerText;
+                            }
+
+
+                            // Category
+                            var cat = tbody.ParentNode.ParentNode.FirstChild.NextSibling.InnerText;
+                            {
+                                cat = cat.Substring(cat.IndexOf(" ")).Trim().ToCamelCase();
+                                extInst["Category"] = cat;
+                            }
+
+                            // Number and Params
+                            {
+                                var row = tbody.LastChild.PreviousSibling;
+
+                                var operands = new JArray();
+
+                                //TODO: implement ImageEncoding
+                                if (cat == "ImageEncoding" || cat == "SamplerEncoding")
+                                    continue;
+
+                                // Start at 6th column (Number)
+                                // After Number there are only params
+                                for (int i = 11; i < row.ChildNodes.Count; i++)
+                                {
+                                    var column = row.ChildNodes[i];
+                                    int nr;
+                                    var operand = new JObject();
+
+                                    // No empty content
+                                    if (column.InnerText == "" || column.InnerText == "\n")
+                                        continue;
+
+                                    // Number
+                                    else if (int.TryParse(column.InnerText, out nr))
+                                        extInst["Number"] = nr;
+                                    // Operands
+                                    else
+                                    {
+                                        // LiteralNumber
+                                        if (column.InnerText.Contains("Literal Number"))
+                                        {
+                                            var a = column.InnerText.GetLinkedNameAndType(false, true);
+                                            operand["Name"] = a[0];
+                                            operand["Type"] = a[1];
+                                            operands.Add(operand);
+                                        }
+                                        // printf -> addionalArguemnts as ID Array
+                                        else if (column.InnerText.StartsWith("<id>, <id>,"))
+                                        {
+                                            operand["Name"] = "AdditionalArguments";
+                                            operand["Type"] = "ID[]";
+                                        }
+                                        // IDs
+                                        else
+                                        {
+                                            operand["Name"] = WebUtility.HtmlDecode(column.InnerText).GetName(false);
+                                            operand["Tpe"] = "ID";
+                                            operands.Add(operand);
+                                        }
+                                    }
+                                }
+
+                                extInst["Operands"] = operands;
+                            }
+
+                            extendedInstructions.Add(extInst);
+
+                        }
+                        extCL20["ExtendedInstructions"] = extendedInstructions;
+                    }
+
+                    // Enums
+                    {
+                        var enums = new JArray();
+
+                        foreach (var tbody in rootExt.SelectNodes("//tbody"))
+                        {
+                            var enu = new JObject();
+
+                            // Enums ID
+                            if (tbody.ParentNode.ParentNode.FirstChild.NextSibling.Id ==
+                                "_a_id_imageformatenc_a_image_format_encoding")
+                            {
+                                var values = new JArray();
+
+                                Debug.Assert(tbody.ParentNode.ChildNodes.Count > 5);
+
+                                enu["Name"] = tbody.ParentNode.ChildNodes[5].InnerText.Trim();
+
+                                // Values
+                                foreach (var tr in tbody.ChildNodes)
+                                {
+                                    var val = new JObject();
+                                    if (tr.Name == "tr")
+                                    {
+                                        Debug.Assert(tr.ChildNodes.Count > 3);
+
+                                        val["Value"] = int.Parse(tr.ChildNodes[1].InnerText);
+                                        val["Name"] = tr.ChildNodes[3].InnerText;
+
+                                        values.Add(val);
+                                    }
+                                }
+
+                                enu["Values"] = values;
+
+                                enums.Add(enu);
+
+                            }
+                        }
+
+                        extCL20["Enums"] = enums;
+                    }
+
+                    extJson.Add(extCL20);
+
+                }
+
+                #endregion
+
+                #region CL21
+                {
+                    // Load File
+
+                    // cached spec
+                    Console.WriteLine("Read HTML from " + cacheFileExtOpenCL21);
+                    var htmlExt = File.ReadAllText(cacheFileExtOpenCL21);
+
+                    // html doc
+                    Console.WriteLine("Initialize HTML Doc");
+                    var docExt = new HtmlDocument();
+                    docExt.LoadHtml(htmlExt);
+                    var rootExt = docExt.DocumentNode;
+
+                    var extCL21 = new JObject();
+
+                    // Metadata
+                    {
+                        var metaData = new JObject();
+
+                        metaData["Language"] = "Open CL";
+                        metaData["Version"] = 2.0;
+                        metaData["Title"] = rootExt.SelectSingleNode("//div[@id='header']/h1").InnerText;
+                        metaData["Author"] = rootExt.SelectSingleNode("//span[@id='author']").InnerText;
+                        metaData["Revnumber"] = rootExt.SelectSingleNode("//span[@id='revnumber']").InnerText;
+                        metaData["LastUpdate"] = rootExt.SelectSingleNode("//div[@id='footer-text']").LastChild.InnerText.Trim();
+
+                        extCL21["Metadata"] = metaData;
+                    }
+
+                    // Extended Instructions
+                    {
+                        var extendedInstructions = new JArray();
+
+                        foreach (var tbody in rootExt.SelectNodes("//tbody"))
+                        {
+                            var extInst = new JObject();
+
+                            var tr = tbody.FirstChild.NextSibling;
+                            var td = tr.FirstChild.NextSibling;
+
+                            // Enums => ignore
+                            {
+
+                                if (tbody.ParentNode.ParentNode.FirstChild.NextSibling.Id ==
+                                    "_a_id_imageformatenc_a_image_format_encoding")
+                                {
+                                    continue;
+                                }
+                            }
+
+                            var name = td.FirstChild.FirstChild.NextSibling.InnerText;
+
+                            extInst["Name"] = name.ToCamelCase();
+                            extInst["OriginalName"] = name;
+
+                            // Description
+                            {
+                                var comment = new StringBuilder();
+                                var commentPlain = new StringBuilder();
+
+                                // The complete comment is written in different rows => get all
+                                foreach (var commentBlock in td.ChildNodes)
+                                {
+                                    comment.Append(commentBlock.InnerHtml);
+                                    commentPlain.Append(commentBlock.InnerText);
+                                }
+
+                                var comInnerHtml = comment.ToString();
+                                var comInnerText = commentPlain.ToString();
+
+                                // Replace
 to

+                                comInnerHtml = comInnerHtml == name
+                                    ? ""
+                                    : comInnerHtml.Substring(2 * name.Length +
+                                                             "".Length)
+                                        .Trim()
+                                        .Replace("
", "
");
+
+                                // Delete "/n" or "
 at beginning and at the end
+                                if (comInnerHtml.StartsWith("
\n"))
+                                    comInnerHtml = comInnerHtml.Substring("
\n".Length);
+                                if (comInnerHtml.EndsWith("\n
"))
+                                    comInnerHtml = comInnerHtml.Remove(comInnerHtml.Length - "\n
".Length);
+                                if (comInnerText.StartsWith(name + "\n\n"))
+                                    comInnerText = comInnerText.Substring(name.Length + "\n\n".Length);
+                                if (comInnerText.EndsWith("\n"))
+                                    comInnerText = comInnerText.Remove(comInnerText.Length - "\n".Length);
+
+                                extInst["Description"] = comInnerHtml;
+                                extInst["DescriptionPlain"] = comInnerText;
+                            }
+
+
+                            // Category
+                            var cat = tbody.ParentNode.ParentNode.FirstChild.NextSibling.InnerText;
+                            {
+                                cat = cat.Substring(cat.IndexOf(" ")).Trim().ToCamelCase();
+                                extInst["Category"] = cat;
+                            }
+
+                            // Number and Params
+                            {
+                                var row = tbody.LastChild.PreviousSibling;
+
+                                var operands = new JArray();
+
+                                //TODO: implement ImageEncoding
+                                if (cat == "ImageEncoding" || cat == "SamplerEncoding")
+                                    continue;
+
+                                // Start at 6th column (Number)
+                                // After Number there are only params
+                                for (int i = 11; i < row.ChildNodes.Count; i++)
+                                {
+                                    var column = row.ChildNodes[i];
+                                    int nr;
+                                    var operand = new JObject();
+
+                                    // No empty content
+                                    if (column.InnerText == "" || column.InnerText == "\n")
+                                        continue;
+
+                                    // Number
+                                    else if (int.TryParse(column.InnerText, out nr))
+                                        extInst["Number"] = nr;
+                                    // Operands
+                                    else
+                                    {
+                                        // LiteralNumber
+                                        if (column.InnerText.Contains("Literal Number"))
+                                        {
+                                            var a = column.InnerText.GetLinkedNameAndType(false, true);
+                                            operand["Name"] = a[0];
+                                            operand["Type"] = a[1];
+                                            operands.Add(operand);
+                                        }
+                                        // printf -> addionalArguemnts as ID Array
+                                        else if (column.InnerText.StartsWith("<id>, <id>,"))
+                                        {
+                                            operand["Name"] = "AdditionalArguments";
+                                            operand["Type"] = "ID[]";
+                                        }
+                                        // IDs
+                                        else
+                                        {
+                                            operand["Name"] = WebUtility.HtmlDecode(column.InnerText).GetName(false);
+                                            operand["Tpe"] = "ID";
+                                            operands.Add(operand);
+                                        }
+                                    }
+                                }
+
+                                extInst["Operands"] = operands;
+                            }
+
+                            extendedInstructions.Add(extInst);
+
+                        }
+                        extCL21["ExtendedInstructions"] = extendedInstructions;
+                    }
+
+                    // Enums
+                    {
+                        var enums = new JArray();
+
+                        foreach (var tbody in rootExt.SelectNodes("//tbody"))
+                        {
+                            var enu = new JObject();
+
+                            // Enums ID
+                            if (tbody.ParentNode.ParentNode.FirstChild.NextSibling.Id ==
+                                "_a_id_imageformatenc_a_image_format_encoding")
+                            {
+                                var values = new JArray();
+
+                                Debug.Assert(tbody.ParentNode.ChildNodes.Count > 5);
+
+                                enu["Name"] = tbody.ParentNode.ChildNodes[5].InnerText.Trim();
+
+                                // Values
+                                foreach (var tr in tbody.ChildNodes)
+                                {
+                                    var val = new JObject();
+                                    if (tr.Name == "tr")
+                                    {
+                                        Debug.Assert(tr.ChildNodes.Count > 3);
+
+                                        val["Value"] = int.Parse(tr.ChildNodes[1].InnerText);
+                                        val["Name"] = tr.ChildNodes[3].InnerText;
+
+                                        values.Add(val);
+                                    }
+                                }
+
+                                enu["Values"] = values;
+
+                                enums.Add(enu);
+
+                            }
+                        }
+
+                        extCL21["Enums"] = enums;
+                    }
+
+                    extJson.Add(extCL21);

                 }


Fixing tests after changing LastFourDigits to string

--- SpreedlyCoreSharp.Test/CoreServiceTests.cs
+++ SpreedlyCoreSharp.Test/CoreServiceTests.cs
@@ -102,7 +102,7 @@
             Assert.AreEqual("transaction1_payment_token", paymentMethod.Token);
             Assert.AreEqual(new DateTime(2012, 11, 16, 20, 36, 03), paymentMethod.CreatedAt);
             Assert.AreEqual(new DateTime(2012, 11, 16, 20, 36, 04), paymentMethod.UpdatedAt);
-            Assert.AreEqual(3886, paymentMethod.LastFourDigits);
+            Assert.AreEqual("3886", paymentMethod.LastFourDigits);
             Assert.AreEqual("visa", paymentMethod.CardType);
             Assert.AreEqual("Bob", paymentMethod.FirstName);
             Assert.AreEqual("Smith", paymentMethod.LastName);
@@ -141,7 +141,7 @@
             Assert.AreEqual("PJH85K9VZ2iTgqPr2yoafwjEewG", transaction.TransactionPaymentMethod.Token);
             Assert.AreEqual(new DateTime(2012, 11, 09, 14, 05, 56), transaction.TransactionPaymentMethod.CreatedAt);
             Assert.AreEqual(new DateTime(2012, 11, 26, 21, 34, 19), transaction.TransactionPaymentMethod.UpdatedAt);
-            Assert.AreEqual(1111, transaction.TransactionPaymentMethod.LastFourDigits);
+            Assert.AreEqual("1111", transaction.TransactionPaymentMethod.LastFourDigits);
             Assert.AreEqual("visa", transaction.TransactionPaymentMethod.CardType);
             Assert.AreEqual("Juvenal", transaction.TransactionPaymentMethod.FirstName);
             Assert.AreEqual("Volkman", transaction.TransactionPaymentMethod.LastName);
@@ -399,5 +399,37 @@
                 Assert.IsTrue(actual);
             }
         }
+
+        [Test]
+        public void Transaction_AmountInDecimal_SetsCorrectly()
+        {
+            var transaction = new Transaction { AmountInDecimal = 3.45m };
+
+            Assert.AreEqual(345, transaction.Amount);
+        }
+
+        [Test]
+        public void Transaction_AmountInDecimal_SetZero()
+        {
+            var transaction = new Transaction { AmountInDecimal = 0 };
+
+            Assert.AreEqual(0, transaction.Amount);
+        }
+
+        [Test]
+        public void Transaction_AmountInDecimal_GetCorrectly()
+        {
+            var transaction = new Transaction { Amount = 3495 };
+
+            Assert.AreEqual(34.95, transaction.AmountInDecimal);
+        }
+
+        [Test]
+        public void Transaction_AmountInDecimal_GetsZero()
+        {
+            var transaction = new Transaction {  Amount = 0 };
+
+            Assert.AreEqual(0, transaction.AmountInDecimal);
+        }
     }
 }


0.3 for release.

0.3 for release.

--- SymbolicAlgebra/Properties/AssemblyInfo.cs
+++ SymbolicAlgebra/Properties/AssemblyInfo.cs
@@ -6,12 +6,12 @@
 // set of attributes. Change these attribute values to modify the information
 // associated with an assembly.
 [assembly: AssemblyTitle("Symbolic Algebra")]
-[assembly: AssemblyDescription("Attempt for another algebric expressions library")]
+[assembly: AssemblyDescription("Library for symbolic calculations")]
 [assembly: AssemblyConfiguration("")]
 [assembly: AssemblyCompany("Lost Particles Network http://www.lostparticles.net")]
 [assembly: AssemblyProduct("Symbolic Algebra")]
-[assembly: AssemblyCopyright("Copyright © Lost Particles 2010")]
-[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCopyright("Copyright © Lost Particles 2010-2011")]
+[assembly: AssemblyTrademark("Lost particles is an internet domain name owned by Ahmed Sadek")]
 [assembly: AssemblyCulture("")]

 // Setting ComVisible to false makes the types in this assembly not visible
@@ -32,5 +32,5 @@
 // You can specify all the values or you can default the Build and Revision Numbers
 // by using the '*' as shown below:
 // [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("0.1.0.0")]
-[assembly: AssemblyFileVersion("0.1.0.0")]
+[assembly: AssemblyVersion("0.2.0.0")]
+[assembly: AssemblyFileVersion("0.2.0.0")]


Added new config file save for vehicle re-mappings

--- Templates/Full/game/scripts/client/init.cs
+++ Templates/Full/game/scripts/client/init.cs
@@ -111,7 +111,8 @@

    if (isFile("./config.cs"))
       exec("./config.cs");
-
+   if (isFile("./config_vehicle.cs"))
+      exec("./config_vehicle.cs");
    loadMaterials();

    // Really shouldn't be starting the networking unless we are


Fix test

Fix test

--- Tests/Core/Functions/AsyncFunctionTests.cs
+++ Tests/Core/Functions/AsyncFunctionTests.cs
@@ -11,27 +11,20 @@
     public class AsyncFunctionTests
     {
         [TestMethod]
-        public async Task ResolvedPromiseShouldBeReturnedAsCompletedTask()
+        public Task ResolvedPromiseShouldBeReturnedAsCompletedTask()
         {
             var context = new Context();

             context.DefineVariable("testAwaitable").Assign(JSValue.Marshal(new Func<string, Task<string>>((input) =>
             {
-                var task = new Task<string>(() =>
-                {
-                    return input;
-                });
-
-                task.Start();
-
-                return task;
+                return Task.FromResult(input);
             })));

             context.Eval("async function testAsync() { return await testAwaitable('test'); }");

-            var result = await context.GetVariable("testAsync").As<Function>().Call(new Arguments()).As<Promise>().Task;
+            var task = context.GetVariable("testAsync").As<Function>().Call(new Arguments()).As<Promise>().Task;

-            Assert.AreEqual("test", result.ToString());
+            Assert.AreEqual("test", task.Result.ToString());
         }

         [TestMethod]


Removd methods to fix warnings about CLS compliance

--- DPSBase/XPlatformHelper/DateTimeExtenensions.cs
+++ DPSBase/XPlatformHelper/DateTimeExtenensions.cs
@@ -47,72 +47,7 @@
         public static string ToLongTimeString(this DateTime dt)
         {
             return dt.ToString(System.Globalization.DateTimeFormatInfo.CurrentInfo.LongTimePattern);
-        }
-
-        /// <summary>
-        /// Creates a DateTimeFormatter object that is initialized by a format template string.
-        /// </summary>
-        /// <param name="dt"></param>
-        /// <param name="formatTemplate">A format template string that specifies the requested components. The order of the components is irrelevant.  This can also be a format pattern.</param>
-        /// <returns></returns>
-        public static string Format(this DateTime dt, string formatTemplate)
-        {
-            var formatter = new Windows.Globalization.DateTimeFormatting.DateTimeFormatter(formatTemplate);
-            return formatter.Format(dt);
-        }
-
-        public static string Format(this DateTime dt, string formatTemplate, IEnumerable<string> languages)
-        {
-            var formatter = new Windows.Globalization.DateTimeFormatting.DateTimeFormatter(formatTemplate, languages);
-            return formatter.Format(dt);
-        }
-
-        /// <summary>
-        /// Creates a DateTimeFormatter object that is initialized with hour, minute, and second formats.
-        /// </summary>
-        /// <param name="dt"></param>
-        /// <param name="hourFormat">The desired hour format to include in the template.</param>
-        /// <param name="minuteFormat">The desired minute format to include in the template.</param>
-        /// <param name="secondFormat">The desired second format to include in the template.</param>
-        /// <returns></returns>
-        public static string Format(this DateTime dt, HourFormat hourFormat, MinuteFormat minuteFormat, SecondFormat secondFormat)
-        {
-            var formatter = new Windows.Globalization.DateTimeFormatting.DateTimeFormatter(hourFormat, minuteFormat, secondFormat);
-            return formatter.Format(dt);
-        }
-
-        /// <summary>
-        /// Creates a DateTimeFormatter object that is initialized with year, month, day, and day of week formats.
-        /// </summary>
-        /// <param name="dt"></param>
-        /// <param name="yearFormat">The desired year format to include in the template.</param>
-        /// <param name="monthFormat">The desired month format to include in the template.</param>
-        /// <param name="dayFormat">The desired day format to include in the template.</param>
-        /// <param name="dayOfWeekFormat">The desired day of week format to include in the template.</param>
-        /// <returns></returns>
-        public static string Format(this DateTime dt, YearFormat yearFormat, MonthFormat monthFormat, DayFormat dayFormat, DayOfWeekFormat dayOfWeekFormat)
-        {
-            var formatter = new Windows.Globalization.DateTimeFormatting.DateTimeFormatter(yearFormat, monthFormat, dayFormat, dayOfWeekFormat);
-            return formatter.Format(dt);
-        }
-
-        public static string Format(this DateTime dt, string formatTemplate, IEnumerable<string> languages, string geographicRegion, string calendar, string clock)
-        {
-            var formatter = new Windows.Globalization.DateTimeFormatting.DateTimeFormatter(formatTemplate, languages, geographicRegion, calendar, clock);
-            return formatter.Format(dt);
-        }
-
-        public static string Format(this DateTime dt, YearFormat yearFormat, MonthFormat monthFormat, DayFormat dayFormat, DayOfWeekFormat dayOfWeekFormat, HourFormat hourFormat, MinuteFormat minuteFormat, SecondFormat secondFormat, IEnumerable<string> languages)
-        {
-            var formatter = new Windows.Globalization.DateTimeFormatting.DateTimeFormatter(yearFormat, monthFormat, dayFormat, dayOfWeekFormat, hourFormat, minuteFormat, secondFormat, languages);
-            return formatter.Format(dt);
-        }
-
-        public static string Format(this DateTime dt, YearFormat yearFormat, MonthFormat monthFormat, DayFormat dayFormat, DayOfWeekFormat dayOfWeekFormat, HourFormat hourFormat, MinuteFormat minuteFormat, SecondFormat secondFormat, IEnumerable<string> languages, string geographicRegion, string calendar, string clock)
-        {
-            var formatter = new Windows.Globalization.DateTimeFormatting.DateTimeFormatter(yearFormat, monthFormat, dayFormat, dayOfWeekFormat, hourFormat, minuteFormat, secondFormat, languages, geographicRegion, calendar, clock);
-            return formatter.Format(dt);
-        }
+        }
     }
 }
 #endif


Unused field

Unused field

--- src/AutoMapper/Execution/TypeMapPlanBuilder.cs
+++ src/AutoMapper/Execution/TypeMapPlanBuilder.cs
@@ -68,8 +68,6 @@
                 return Lambda(typeMap.CustomProjection.ReplaceParameters(srcParam), srcParam, destParam, ctxtParam);
             }

-            ParameterExpression contextToReuse = null;
-
             var destinationFunc = CreateDestinationFunc(typeMap, typeMapRegistry, srcParam, destParam, ctxtParam);

             var assignmentFunc = CreateAssignmentFunc(typeMap, configurationProvider, typeMapRegistry, srcParam, destParam, ctxtParam, destinationFunc);


Move field definitions

Move field definitions

--- src/Avalonia.Controls.PanAndZoom/ZoomBorder.cs
+++ src/Avalonia.Controls.PanAndZoom/ZoomBorder.cs
@@ -226,6 +226,12 @@
         private double _offsetX = 0.0;
         private double _offsetY = 0.0;
         private bool _captured = false;
+        private Size _extent = new Size();
+        private Size _viewport = new Size();
+        private Vector _offset = new Vector();
+        private bool _canHorizontallyScroll = false;
+        private bool _canVerticallyScroll = false;
+        private EventHandler? _scrollInvalidated;

         /// <summary>
         /// Zoom changed event.
@@ -971,13 +977,6 @@
             AutoFit(Bounds.Width, Bounds.Height, _element.Bounds.Width, _element.Bounds.Height);
         }

-        private Size _extent = new Size();
-        private Size _viewport = new Size();
-        private Vector _offset = new Vector();
-        private bool _canHorizontallyScroll = false;
-        private bool _canVerticallyScroll = false;
-        private EventHandler? _scrollInvalidated;
-
         /// <inheritdoc/>
         Size IScrollable.Extent => _extent;


Layout 673 do BB - Desconsiderar linhas com codigo de Boleto Cedente (opcional de acordo com a doc do BB)

--- src/Boleto.Net/Arquivo/ArquivoRetornoCRB643.cs
+++ src/Boleto.Net/Arquivo/ArquivoRetornoCRB643.cs
@@ -1,4 +1,5 @@
 using System.IO;
+using System.Text.RegularExpressions;
 using BoletoNet.Arquivo.Reader;

 namespace BoletoNet.Arquivo
@@ -12,6 +13,11 @@
             var textPosReader = new TextPosReader();
             while (!string.IsNullOrEmpty(linha))
             {
+                if (Regex.Match(linha, "[0-9]{8}\\.[0-9]{3}\\.[0-9]{3}").Success)
+                {
+                    linha = streamReader.ReadLine();
+                    continue;
+                }
                 var linhaCbr643 = textPosReader.Read(linha);
                 OnLinhaLida(linhaCbr643);
                 linha = streamReader.ReadLine();


[Modify] Polish it

[Modify] Polish it

--- websocket-sharp/WebSocket.cs
+++ websocket-sharp/WebSocket.cs
@@ -2242,6 +2242,7 @@
       if (_proxyUri != null) {
         _tcpClient = new TcpClient (_proxyUri.DnsSafeHost, _proxyUri.Port);
         _stream = _tcpClient.GetStream ();
+
         sendProxyConnectRequest ();
       }
       else {
@@ -2252,27 +2253,36 @@
       if (_secure) {
         var conf = getSslConfiguration ();
         var host = conf.TargetHost;
-        if (host != _uri.DnsSafeHost)
+
+        if (host != _uri.DnsSafeHost) {
+          var msg = "An invalid host name is specified.";
+
           throw new WebSocketException (
-            CloseStatusCode.TlsHandshakeFailure, "An invalid host name is specified.");
+                  CloseStatusCode.TlsHandshakeFailure, msg
+                );
+        }

         try {
           var sslStream = new SslStream (
-            _stream,
-            false,
-            conf.ServerCertificateValidationCallback,
-            conf.ClientCertificateSelectionCallback);
+                            _stream,
+                            false,
+                            conf.ServerCertificateValidationCallback,
+                            conf.ClientCertificateSelectionCallback
+                          );

           sslStream.AuthenticateAsClient (
             host,
             conf.ClientCertificates,
             conf.EnabledSslProtocols,
-            conf.CheckCertificateRevocation);
+            conf.CheckCertificateRevocation
+          );

           _stream = sslStream;
         }
         catch (Exception ex) {
-          throw new WebSocketException (CloseStatusCode.TlsHandshakeFailure, ex);
+          throw new WebSocketException (
+                  CloseStatusCode.TlsHandshakeFailure, ex
+                );
         }
       }
     }


[Modify] Polish it

[Modify] Polish it

--- websocket-sharp/WebSocket.cs
+++ websocket-sharp/WebSocket.cs
@@ -1691,7 +1691,6 @@
     private bool processFragmentFrame (WebSocketFrame frame)
     {
       if (!_inContinuation) {
-        // Must process first fragment.
         if (frame.IsContinuation)
           return true;

@@ -1702,13 +1701,16 @@
       }

       _fragmentsBuffer.WriteBytes (frame.PayloadData.ApplicationData, 1024);
+
       if (frame.IsFinal) {
         using (_fragmentsBuffer) {
           var data = _fragmentsCompressed
                      ? _fragmentsBuffer.DecompressToArray (_compression)
                      : _fragmentsBuffer.ToArray ();

-          enqueueToMessageEventQueue (new MessageEventArgs (_fragmentsOpcode, data));
+          var e = new MessageEventArgs (_fragmentsOpcode, data);
+
+          enqueueToMessageEventQueue (e);
         }

         _fragmentsBuffer = null;


Added static method to AuctionInfo to calculate the previous bid from another known bid value.

--- UltimateTeam.Toolkit/Models/AuctionInfo.cs
+++ UltimateTeam.Toolkit/Models/AuctionInfo.cs
@@ -57,6 +57,26 @@
             return currentBid + 1000;
         }

+        public static uint CalculatePreviousBid(uint currentBid)
+        {
+            if (currentBid <= MinBid)
+                return 0;
+
+            if (currentBid <= 1000)
+                return currentBid - 50;
+
+            if (currentBid <= 10000)
+                return currentBid - 100;
+
+            if (currentBid <= 50000)
+                return currentBid - 250;
+
+            if (currentBid <= 100000)
+                return currentBid - 500;
+
+            return currentBid - 1000;
+        }
+
         public long CalculateBaseId()
         {
             return ItemData.ResourceId.CalculateBaseId();


Support file share paths for Cmdlet parameters.

--- src/Common/Commands.Common/CmdletExtensions.cs
+++ src/Common/Commands.Common/CmdletExtensions.cs
@@ -58,7 +58,7 @@

             if (result != null && result.Count > 0)
             {
-                fullPath = result[0].Path;
+                fullPath = result[0].ProviderPath;
             }

             return fullPath;


[Modify] Edit it

[Modify] Edit it

--- websocket-sharp/WebSocket.cs
+++ websocket-sharp/WebSocket.cs
@@ -3369,8 +3369,8 @@
     }

     /// <summary>
-    /// Sends the specified <paramref name="data"/> asynchronously using
-    /// the WebSocket connection.
+    /// Sends <paramref name="data"/> asynchronously using the WebSocket
+    /// connection.
     /// </summary>
     /// <remarks>
     /// This method does not wait for the send to be complete.
@@ -3379,9 +3379,17 @@
     /// A <see cref="string"/> that represents the text data to send.
     /// </param>
     /// <param name="completed">
-    /// An <c>Action<bool></c> delegate that invokes the method called when
-    /// the send is complete. A <see cref="bool"/> passed to this delegate will be
-    /// <c>true</c> if the send has done with no error.
+    ///   <para>
+    ///   An <c>Action<bool></c> delegate or <see langword="null"/>
+    ///   if not needed.
+    ///   </para>
+    ///   <para>
+    ///   The delegate invokes the method called when the send is complete.
+    ///   </para>
+    ///   <para>
+    ///   <c>true</c> is passed to the method if the send has done with
+    ///   no error; otherwise, <c>false</c>.
+    ///   </para>
     /// </param>
     /// <exception cref="InvalidOperationException">
     /// The current state of the connection is not Open.


parse cancellation dates to detect refunds

--- src/Core/Models/Business/AppleReceiptStatus.cs
+++ src/Core/Models/Business/AppleReceiptStatus.cs
@@ -47,6 +47,22 @@
         public string GetReceiptData()
         {
             return LatestReceipt;
+        }
+
+        public DateTime? GetLastCancellationDate()
+        {
+            return LatestReceiptInfo?.LastOrDefault()?.CancellationDate;
+        }
+
+        public bool IsRefunded()
+        {
+            var cancellationDate = GetLastCancellationDate();
+            var expiresDate = GetLastCancellationDate();
+            if(cancellationDate.HasValue && expiresDate.HasValue)
+            {
+                return cancellationDate.Value <= expiresDate.Value;
+            }
+            return false;
         }

         public Transaction BuildTransactionFromLastTransaction(decimal amount, Guid userId)
@@ -111,8 +127,13 @@
             [JsonProperty("expires_date_ms")]
             [JsonConverter(typeof(MsEpochConverter))]
             public DateTime ExpiresDate { get; set; }
+            [JsonProperty("cancellation_date_ms")]
+            [JsonConverter(typeof(MsEpochConverter))]
+            public DateTime? CancellationDate { get; set; }
             [JsonProperty("web_order_line_item_id")]
             public string WebOrderLineItemId { get; set; }
+            [JsonProperty("cancellation_reason")]
+            public string CancellationReason { get; set; }
         }

         public class MsEpochConverter : DateTimeConverterBase


Created version 3.1.0.0.

Created version 3.1.0.0.

--- WastedgeQuerier/Properties/AssemblyInfo.cs
+++ WastedgeQuerier/Properties/AssemblyInfo.cs
@@ -15,5 +15,5 @@

 [assembly: Guid("97c2349d-eb63-40f8-8b33-aef4d50b52e7")]

-[assembly: AssemblyVersion("3.0.0.0")]
-[assembly: AssemblyFileVersion("3.0.0.0")]
+[assembly: AssemblyVersion("3.1.0.0")]
+[assembly: AssemblyFileVersion("3.1.0.0")]


Test and debug identity-by-convention for imports. Ready to go.

--- src/Dsl/CustomCode/Utilities/FileDropHelper.cs
+++ src/Dsl/CustomCode/Utilities/FileDropHelper.cs
@@ -1,15 +1,13 @@
-using System;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.VisualStudio.Modeling;
+using Sawczyn.EFDesigner.EFModel.Annotations;
+using Sawczyn.EFDesigner.EFModel.CustomCode.Extensions;
+using System;
 using System.Collections.Generic;
 using System.IO;
 using System.Linq;
-
-using Microsoft.CodeAnalysis;
-using Microsoft.CodeAnalysis.CSharp;
-using Microsoft.CodeAnalysis.CSharp.Syntax;
-using Microsoft.VisualStudio.Modeling;
-
-using Sawczyn.EFDesigner.EFModel.Annotations;
-using Sawczyn.EFDesigner.EFModel.CustomCode.Extensions;

 namespace Sawczyn.EFDesigner.EFModel
 {
@@ -79,17 +77,36 @@
                foreach (EnumDeclarationSyntax enumDecl in enumDecls)
                   ProcessEnum(store, enumDecl);

+               List<ModelClass> processedClasses = new List<ModelClass>();
                foreach (ClassDeclarationSyntax classDecl in classDecls)
-                  ProcessClass(store, classDecl);
+                  processedClasses.Add(ProcessClass(store, classDecl));

                // process last so all classes and enums are already in the model
                foreach (ClassDeclarationSyntax classDecl in classDecls)
                   ProcessProperties(store, classDecl);
+
+               // now that all the properties are in, go through the classes again and ensure identities are present based on convention
+               // ReSharper disable once LoopCanBePartlyConvertedToQuery
+               foreach (ModelClass modelClass in processedClasses.Where(c => !c.AllIdentityAttributes.Any()))
+               {
+                  // no identity attribute. Only look in current class for attributes that could be identity by convention
+                  List<ModelAttribute> identitiesByConvention = modelClass.Attributes.Where(a => a.Name == "Id" || a.Name == $"{modelClass.Name}Id").ToList();
+
+                  // if both 'Id' and '[ClassName]Id' are present, don't do anything since we don't know which to make the identity
+                  if (identitiesByConvention.Count == 1)
+                  {
+                     using (Transaction transaction = store.TransactionManager.BeginTransaction("Add identity"))
+                     {
+                        identitiesByConvention[0].IsIdentity = true;
+                        transaction.Commit();
+                     }
+                  }
+               }
             }
          }
          catch
          {
-            ErrorDisplay.Show("Error interpretting " + filename);
+            ErrorDisplay.Show("Error interpreting " + filename);

             return false;
          }
@@ -194,15 +211,18 @@
                   }
                }

-               // if we'ref here, it's just a property (CLR or enum)
+               // if we're here, it's just a property (CLR or enum)
                try
                {
                   // ReSharper disable once UseObjectOrCollectionInitializer
-                  ModelAttribute modelAttribute = new ModelAttribute(store, new PropertyAssignment(ModelAttribute.NameDomainPropertyId, propertyName));
-                  modelAttribute.Type = ModelAttribute.ToCLRType(propertyDecl.Type.ToString()).Trim('?');
-                  modelAttribute.Required = propertyDecl.HasAttribute("RequiredAttribute") || !propertyShowsNullable;
-                  modelAttribute.Indexed = propertyDecl.HasAttribute("IndexedAttribute");
-                  modelAttribute.Virtual = propertyDecl.DescendantTokens().Any(t => t.IsKind(SyntaxKind.VirtualKeyword));
+                  ModelAttribute modelAttribute = new ModelAttribute(store, new PropertyAssignment(ModelAttribute.NameDomainPropertyId, propertyName))
+                  {
+                     Type = ModelAttribute.ToCLRType(propertyDecl.Type.ToString()).Trim('?'),
+                     Required = propertyDecl.HasAttribute("RequiredAttribute") || !propertyShowsNullable,
+                     Indexed = propertyDecl.HasAttribute("IndexedAttribute"),
+                     IsIdentity = propertyDecl.HasAttribute("KeyAttribute"),
+                     Virtual = propertyDecl.DescendantTokens().Any(t => t.IsKind(SyntaxKind.VirtualKeyword))
+                  };

                   if (modelAttribute.Type.ToLower() == "string")
                   {
@@ -241,15 +261,6 @@
                   XMLDocumentation xmlDocumentation = new XMLDocumentation(propertyDecl);
                   modelAttribute.Summary = xmlDocumentation.Summary;
                   modelAttribute.Description = xmlDocumentation.Description;
-
-                  // Tag a property as identity if
-                  //    1) the code says so, or
-                  //    2) it's named 'Id' (case insensitive), there are no other identity properties, and it's a valid identity type
-                  modelAttribute.IsIdentity = propertyDecl.HasAttribute("KeyAttribute") ||
-                                              (propertyName.ToLower() == "id" &&
-                                               !modelClass.Attributes.Any(a => a.IsIdentity) &&
-                                               ModelAttribute.ValidIdentityAttributeTypes.Contains(modelAttribute.Type));
-
                   modelClass.Attributes.Add(modelAttribute);
                }
                catch
@@ -329,8 +340,11 @@
          }
       }

-      private static void ProcessEnum([NotNull] Store store, [NotNull] EnumDeclarationSyntax enumDecl, NamespaceDeclarationSyntax namespaceDecl = null)
-      {
+      // ReSharper disable once UnusedMethodReturnValue.Local
+      private static ModelEnum ProcessEnum([NotNull] Store store, [NotNull] EnumDeclarationSyntax enumDecl, NamespaceDeclarationSyntax namespaceDecl = null)
+      {
+         ModelEnum result = null;
+
          if (store == null)
             throw new ArgumentNullException(nameof(store));

@@ -349,7 +363,8 @@
          {
             ErrorDisplay.Show($"'{enumName}' already exists in model.");

-            return;
+            // ReSharper disable once ExpressionIsAlwaysNull
+            return result;
          }

          Transaction tx = store.TransactionManager.CurrentTransaction == null
@@ -358,11 +373,12 @@

          try
          {
-            ModelEnum modelEnum = new ModelEnum(store, new PropertyAssignment(ModelEnum.NameDomainPropertyId, enumName))
-                                  {
-                                     Namespace = namespaceName
-                                   , IsFlags = enumDecl.HasAttribute("Flags")
-                                  };
+            result = new ModelEnum(store,
+                                   new PropertyAssignment(ModelEnum.NameDomainPropertyId, enumName))
+                                   {
+                                      Namespace = namespaceName,
+                                      IsFlags = enumDecl.HasAttribute("Flags")
+                                   };

             SimpleBaseTypeSyntax baseTypeSyntax = enumDecl.DescendantNodes().OfType<SimpleBaseTypeSyntax>().FirstOrDefault();

@@ -372,17 +388,17 @@
                {
                   case "Int16":
                   case "short":
-                     modelEnum.ValueType = EnumValueType.Int16;
+                     result.ValueType = EnumValueType.Int16;

                      break;
                   case "Int32":
                   case "int":
-                     modelEnum.ValueType = EnumValueType.Int32;
+                     result.ValueType = EnumValueType.Int32;

                      break;
                   case "Int64":
                   case "long":
-                     modelEnum.ValueType = EnumValueType.Int64;
+                     result.ValueType = EnumValueType.Int64;

                      break;
                   default:
@@ -406,14 +422,14 @@
                enumValue.Summary = xmlDocumentation.Summary;
                enumValue.Description = xmlDocumentation.Description;

-               modelEnum.Values.Add(enumValue);
+               result.Values.Add(enumValue);
             }

             xmlDocumentation = new XMLDocumentation(enumDecl);
-            modelEnum.Summary = xmlDocumentation.Summary;
-            modelEnum.Description = xmlDocumentation.Description;
-
-            modelRoot.Enums.Add(modelEnum);
+            result.Summary = xmlDocumentation.Summary;
+            result.Description = xmlDocumentation.Description;
+
+            modelRoot.Enums.Add(result);
          }
          catch
          {
@@ -425,10 +441,14 @@
          {
             tx?.Commit();
          }
-      }
-
-      private static void ProcessClass([NotNull] Store store, [NotNull] ClassDeclarationSyntax classDecl, NamespaceDeclarationSyntax namespaceDecl = null)
-      {
+
+         return result;
+      }
+
+      private static ModelClass ProcessClass([NotNull] Store store, [NotNull] ClassDeclarationSyntax classDecl, NamespaceDeclarationSyntax namespaceDecl = null)
+      {
+         ModelClass result = null;
+
          if (store == null)
             throw new ArgumentNullException(nameof(store));

@@ -445,14 +465,16 @@
          {
             ErrorDisplay.Show($"'{className}' already exists in model as an Enum.");

-            return;
+            // ReSharper disable once ExpressionIsAlwaysNull
+            return result;
          }

          if (classDecl.TypeParameterList != null)
          {
             ErrorDisplay.Show($"Can't add generic class '{className}'.");

-            return;
+            // ReSharper disable once ExpressionIsAlwaysNull
+            return result;
          }

          Transaction tx = store.TransactionManager.CurrentTransaction == null
@@ -463,7 +485,7 @@
          {
             ModelClass superClass = null;
             List<string> customInterfaces = new List<string>();
-            ModelClass modelClass = store.ElementDirectory.AllElements.OfType<ModelClass>().FirstOrDefault(c => c.Name == className);
+            result = store.ElementDirectory.AllElements.OfType<ModelClass>().FirstOrDefault(c => c.Name == className);

             // Base classes and interfaces
             // Check these first. If we need to add new models, we want the base class already in the store
@@ -474,7 +496,7 @@
                   string baseName = type.ToString();

                   // INotifyPropertyChanged is special. We know it's an interface, and it'll turn into a class property later
-                  if (baseName == "INotifyPropertyChanged" || superClass != null || modelClass?.Superclass != null)
+                  if (baseName == "INotifyPropertyChanged" || superClass != null || result?.Superclass != null)
                   {
                      customInterfaces.Add(baseName);

@@ -497,45 +519,46 @@
                }
             }

-            if (modelClass == null)
-            {
-               modelClass = new ModelClass(store, new PropertyAssignment(ModelClass.NameDomainPropertyId, className))
-                            {
-                               Namespace = namespaceDecl?.Name?.ToString() ?? modelRoot.Namespace
-                             , IsAbstract = classDecl.DescendantNodes().Any(n => n.Kind() == SyntaxKind.AbstractKeyword)
-                            };
-
-               modelRoot.Types.Add(modelClass);
+            if (result == null)
+            {
+               result = new ModelClass(store, new PropertyAssignment(ModelClass.NameDomainPropertyId, className))
+               {
+                  Namespace = namespaceDecl?.Name?.ToString() ?? modelRoot.Namespace
+                             ,
+                  IsAbstract = classDecl.DescendantNodes().Any(n => n.Kind() == SyntaxKind.AbstractKeyword)
+               };
+
+               modelRoot.Types.Add(result);
             }

             if (superClass != null)
-               modelClass.Superclass = superClass;
-
-            if (modelClass.CustomInterfaces != null)
-            {
-               customInterfaces.AddRange(modelClass.CustomInterfaces
-                                                   .Split(',')
-                                                   .Where(i => !string.IsNullOrEmpty(i))
-                                                   .Select(i => i.Trim()));
+               result.Superclass = superClass;
+
+            if (result.CustomInterfaces != null)
+            {
+               customInterfaces.AddRange(result.CustomInterfaces
+                                               .Split(',')
+                                               .Where(i => !string.IsNullOrEmpty(i))
+                                               .Select(i => i.Trim()));
             }

             if (customInterfaces.Contains("INotifyPropertyChanged"))
             {
-               modelClass.ImplementNotify = true;
+               result.ImplementNotify = true;
                customInterfaces.Remove("INotifyPropertyChanged");
             }

-            if (modelClass.Superclass != null && customInterfaces.Contains(modelClass.Superclass.Name))
-               customInterfaces.Remove(modelClass.Superclass.Name);
-
-            modelClass.CustomInterfaces = customInterfaces.Any()
+            if (result.Superclass != null && customInterfaces.Contains(result.Superclass.Name))
+               customInterfaces.Remove(result.Superclass.Name);
+
+            result.CustomInterfaces = customInterfaces.Any()
                                              ? string.Join(",", customInterfaces.Distinct())
                                              : null;

             XMLDocumentation xmlDocumentation = new XMLDocumentation(classDecl);
-            modelClass.Summary = xmlDocumentation.Summary;
-            modelClass.Description = xmlDocumentation.Description;
+            result.Summary = xmlDocumentation.Summary;
+            result.Description = xmlDocumentation.Description;
          }
          catch
          {
@@ -547,6 +570,8 @@
          {
             tx?.Commit();
          }
+
+         return result;
       }

    }


Removes a full array allocation from the AggregateVariableModel.Resize method.

--- src/Dyna.Core/Models/AggregateVariableModel.cs
+++ src/Dyna.Core/Models/AggregateVariableModel.cs
@@ -59,13 +59,12 @@
         public void Resize(int newSize)
         {
             if (this.variables.Length == newSize) return;
-            var newVariables = new VariableModel[newSize];
-            var originalVariablesToCopyCount = this.variables.Length > newSize ? newSize : this.variables.Length;
-            Array.Copy(this.variables, newVariables, originalVariablesToCopyCount);
+            var originalVariableCount = this.variables.Length;
+            Array.Resize(ref this.variables, newSize);
+            var originalVariablesToCopyCount = originalVariableCount > newSize ? newSize : originalVariableCount;
             // Fill the new array elements with a default variable model
-            for (int i = originalVariablesToCopyCount; i < newSize; i++)
-                newVariables[i] = new VariableModel();
-            this.variables = newVariables;
+            for (var i = originalVariablesToCopyCount; i < newSize; i++)
+                this.variables[i] = new VariableModel();
         }
     }
 }


Typos

Typos

--- src/IdentityModel/Client/AccessTokenHandler.cs
+++ src/IdentityModel/Client/AccessTokenHandler.cs
@@ -12,7 +12,7 @@
 namespace IdentityModel.Client
 {
     /// <summary>
-    /// HTTP message handler that encapsulates access token handling and renew
+    /// HTTP message handler that encapsulates access token handling and renewment
     /// </summary>
     public class AccessTokenHandler : DelegatingHandler
     {
@@ -57,7 +57,7 @@
         public event EventHandler<TokenRenewedEventArgs> TokenRenewed = delegate { };

         /// <summary>
-        /// Initializes a new instance of the <see cref="RefreshTokenHandler"/> class.
+        /// Initializes a new instance of the <see cref="AccessTokenHandler"/> class.
         /// </summary>
         /// <param name="tokenEndpoint">The token endpoint.</param>
         /// <param name="clientId">The client identifier.</param>
@@ -70,7 +70,7 @@
         { }

         /// <summary>
-        /// Initializes a new instance of the <see cref="RefreshTokenHandler"/> class.
+        /// Initializes a new instance of the <see cref="AccessTokenHandler"/> class.
         /// </summary>
         /// <param name="client">The client.</param>
         /// <param name="scope">The scope.</param>


Add conditional logging

Add conditional logging

--- src/IdentityServer4.Mock/MockIdentityServer.cs
+++ src/IdentityServer4.Mock/MockIdentityServer.cs
@@ -30,7 +30,10 @@
             var server = new TestServer(new WebHostBuilder().Configure(app => {
                 app.UseIdentityServer();
                 cfg.AppConfig(app);
-                app.ApplicationServices.GetRequiredService<ILoggerFactory>().AddConsole();
+                if(cfg.UseRequestLogging)
+                {
+                    app.ApplicationServices.GetRequiredService<ILoggerFactory>().AddConsole();
+                }
             }).ConfigureServices(s => {
                 var idServerCfg = s.AddIdentityServer();
                 if(cfg.UseRequestLogging)


fix visual glitch on Field edit page

fix visual glitch on Field edit page

--- src/JoinRpg.Portal/Views/GameField/Edit.cshtml
+++ src/JoinRpg.Portal/Views/GameField/Edit.cshtml
@@ -1,6 +1,4 @@
-.Web.App_Code
-
-@using JoinRpg.Web.Models.FieldSetup
+@using JoinRpg.Web.Models.FieldSetup
 @using JoinRpg.Web.Models
 @model GameFieldEditViewModel


Added InternalsVisibleTo for LiveDomain.Enterprise

--- src/LiveDomain.Core/Properties/AssemblyInfo.cs
+++ src/LiveDomain.Core/Properties/AssemblyInfo.cs
@@ -35,4 +35,5 @@
 [assembly: AssemblyVersion("1.0.0.0")]
 [assembly: AssemblyFileVersion("1.0.0.0")]

+[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("LiveDomain.Enterprise")]
 [assembly: System.Runtime.CompilerServices.InternalsVisibleTo("LiveDomain.Core.Test")]