MailMergeCustomDataSourceRoot example

MailMergeCustomDataSourceRoot example

--- ApiExamples/CSharp/ApiExamples/ExMailMergeCustom.cs
+++ ApiExamples/CSharp/ApiExamples/ExMailMergeCustom.cs
@@ -6,6 +6,7 @@
 //////////////////////////////////////////////////////////////////////////

 using System.Collections;
+using System.Collections.Generic;
 using Aspose.Words;
 using Aspose.Words.MailMerging;
 using NUnit.Framework;
@@ -139,5 +140,171 @@
             private int mRecordIndex;
         }
         //ExEnd
+
+        //ExStart
+        //ExFor:IMailMergeDataSourceRoot
+        //ExFor:IMailMergeDataSourceRoot.GetDataSource(String)
+        //ExFor:MailMerge.ExecuteWithRegions(IMailMergeDataSourceRoot)
+        [Test] //ExSkip
+        public void MailMergeCustomDataSourceRoot()
+        {
+            Document doc = new Document();
+            DocumentBuilder builder = new DocumentBuilder(doc);
+
+            // Create two consecutive mail merge regions
+            builder.Writeln("\nWashington branch: ");
+            builder.InsertField(" MERGEFIELD TableStart:Washington");
+            builder.InsertField(" MERGEFIELD FullName");
+            builder.Write(", ");
+            builder.InsertField(" MERGEFIELD Department");
+            builder.InsertField(" MERGEFIELD TableEnd:Washington");
+
+            builder.Writeln("\n\nSeattle branch: ");
+            builder.InsertField(" MERGEFIELD TableStart:Seattle");
+            builder.InsertField(" MERGEFIELD FullName");
+            builder.Write(", ");
+            builder.InsertField(" MERGEFIELD Department");
+            builder.InsertField(" MERGEFIELD TableEnd:Seattle");
+
+            // Create two data sources
+            EmployeeList employeesWashingtonBranch = new EmployeeList();
+            employeesWashingtonBranch.Add(new Employee("John Doe", "Sales"));
+            employeesWashingtonBranch.Add(new Employee("Jane Doe", "Management"));
+
+            EmployeeList employeesSeattleBranch = new EmployeeList();
+            employeesSeattleBranch.Add(new Employee("John Cardholder", "Management"));
+            employeesSeattleBranch.Add(new Employee("Joe Bloggs", "Sales"));
+
+            // Register our data sources by name in a data source root
+            DataSourceRoot sourceRoot = new DataSourceRoot();
+            sourceRoot.RegisterSource("Washington", new EmployeeListMailMergeSource(employeesWashingtonBranch));
+            sourceRoot.RegisterSource("Seattle", new EmployeeListMailMergeSource(employeesSeattleBranch));
+
+            // Since we have consecutive mail merge regions, we would normally have to perform two mail merges
+            // However, one mail merge source data root call every relevant data source and merge automatically
+            doc.MailMerge.ExecuteWithRegions(sourceRoot);
+
+            doc.Save(ArtifactsDir + "MailMerge.MailMergeCustomDataSourceRoot.docx");
+        }
+
+        /// <summary>
+        /// An example of a "data entity" class in your application.
+        /// </summary>
+        public class Employee
+        {
+            public Employee(string aFullName, string aDepartment)
+            {
+                FullName = aFullName;
+                Department = aDepartment;
+            }
+
+            public string FullName { get; set; }
+            public string Department { get; set; }
+        }
+
+        /// <summary>
+        /// An example of a typed collection that contains your "data" objects.
+        /// </summary>
+        public class EmployeeList : ArrayList
+        {
+            public new Employee this[int index]
+            {
+                get { return (Employee)base[index]; }
+                set { base[index] = value; }
+            }
+        }
+
+        /// <summary>
+        /// Data source root that can be passed directly into a mail merge which can register and contain many child data sources
+        /// These sources must all implement IMailMergeDataSource, and are registered and differentiated by a name
+        /// which corresponds to a mail merge region that will read the respective data
+        /// </summary>
+        private class DataSourceRoot : IMailMergeDataSourceRoot
+        {
+            Dictionary<string, EmployeeListMailMergeSource> sources = new Dictionary<string, EmployeeListMailMergeSource>();
+
+            public IMailMergeDataSource GetDataSource(string tableName)
+            {
+                EmployeeListMailMergeSource source = sources[tableName];
+                source.Reset();
+                return sources[tableName];
+            }
+
+            public void RegisterSource(string sourceName, EmployeeListMailMergeSource source)
+            {
+                sources.Add(sourceName, source);
+            }
+        }
+
+        /// <summary>
+        /// Custom mail merge data source
+        /// </summary>
+        private class EmployeeListMailMergeSource : IMailMergeDataSource
+        {
+            public EmployeeListMailMergeSource(EmployeeList employees)
+            {
+                mEmployees = employees;
+                mRecordIndex = -1;
+            }
+
+            /// <summary>
+            /// A standard implementation for moving to a next record in a collection.
+            /// </summary>
+            public bool MoveNext()
+            {
+                if (!IsEof)
+                    mRecordIndex++;
+
+                return (!IsEof);
+            }
+
+            private bool IsEof
+            {
+                get { return (mRecordIndex >= mEmployees.Count); }
+            }
+
+            public void Reset()
+            {
+                mRecordIndex = -1;
+            }
+
+            /// <summary>
+            /// The name of the data source. Used by Aspose.Words only when executing mail merge with repeatable regions.
+            /// </summary>
+            public string TableName
+            {
+                get { return "Employees"; }
+            }
+
+            /// <summary>
+            /// Aspose.Words calls this method to get a value for every data field.
+            /// </summary>
+            public bool GetValue(string fieldName, out object fieldValue)
+            {
+                switch (fieldName)
+                {
+                    case "FullName":
+                        fieldValue = mEmployees[mRecordIndex].FullName;
+                        return true;
+                    case "Department":
+                        fieldValue = mEmployees[mRecordIndex].Department;
+                        return true;
+                    default:
+                        // A field with this name was not found,
+                        // return false to the Aspose.Words mail merge engine.
+                        fieldValue = null;
+                        return false;
+                }
+            }
+
+            public IMailMergeDataSource GetChildDataSource(string tableName)
+            {
+                throw new System.NotImplementedException();
+            }
+
+            private EmployeeList mEmployees;
+            private int mRecordIndex;
+        }
+        //ExEnd
     }
 }


Remove redundant option

Remove redundant option

--- src/Framework/Framework/Compilation/CompiledAssemblyCache.cs
+++ src/Framework/Framework/Compilation/CompiledAssemblyCache.cs
@@ -156,7 +156,7 @@
                 .SelectMany(a => a.GetLoadableTypes()
                     .Select(t => t.Namespace!)
                     .Where(ns => ns is object))
-                .Distinct(), StringComparer.Ordinal);
+                .Distinct());

         /// <summary>


Fix exception in Node's ctor

Fix exception in Node's ctor

--- NBitcoin/Protocol/Node.cs
+++ NBitcoin/Protocol/Node.cs
@@ -755,13 +755,13 @@
 			_RemoteSocketAddress = ((IPEndPoint)socket.RemoteEndPoint).Address;
 			_RemoteSocketEndpoint = ((IPEndPoint)socket.RemoteEndPoint);
 			_RemoteSocketPort = ((IPEndPoint)socket.RemoteEndPoint).Port;
+			_Peer = peer;
 			Inbound = peerVersion != null;
+			Network = network;
 			_Behaviors = new NodeBehaviorsCollection(this);
 			_MyVersion = parameters.CreateVersion(peer.Endpoint, network);
-			if(peerVersion == null)
-				SetVersion((uint)_MyVersion.Version);
-			Network = network;
-			_Peer = peer;
+			if (peerVersion == null)
+				SetVersion((uint)_MyVersion.Version);
 			_Connection = new NodeConnection(this, socket);
 			_PeerVersion = peerVersion;
 			if(peerVersion != null)
@@ -771,7 +771,7 @@

 			LastSeen = peer.Time;
 			ConnectedAt = DateTimeOffset.UtcNow;
-			Logs.NodeServer.LogInformation("Connected to advertised node {endpoint}", _Peer.Endpoint);
+			Logs.NodeServer.LogInformation("Connected to node {endpoint} (inbound: {inbound})", _Peer.Endpoint, Inbound);
 			State = NodeState.Connected;

 			InitDefaultBehaviors(parameters);


Added comments and fixed stats call

Added comments and fixed stats call

--- DeadCellsStats/Program.cs
+++ DeadCellsStats/Program.cs
@@ -94,19 +94,22 @@
 			}
 		}

+		// Check for controller input, used to save the gold spent on items with DPAD
 		static void ControllerCheck() {
 			Controller.XInputState controllerState = new Controller.XInputState();

-			while(true && !stopThread) {
+			while(!stopThread) {
 				Controller.XInputGetState(0, ref controllerState);

 				if(controllerState.Gamepad.IsButtonPressed(0x0001) && goldBeforePurchase > 0) {
+					// DPAD UP
 					int goldAfterPurchase = Memory.ReadPointerInteger(gameProcess, Memory.GoldPointer);
 					purchaseValue += goldBeforePurchase - goldAfterPurchase;
 					goldBeforePurchase = 0;
 					Console.WriteLine("Gold after purchase = " + goldAfterPurchase);
 					Console.WriteLine("Total purchased value = " + purchaseValue);
 				} else if(controllerState.Gamepad.IsButtonPressed(0x0002)) {
+					// DPAD DOWN
 					goldBeforePurchase = Memory.ReadPointerInteger(gameProcess, Memory.GoldPointer);
 					Console.WriteLine("Gold before purchase = " + goldBeforePurchase);
 				}
@@ -170,7 +173,7 @@
 				Thread.Sleep(500);
 			}

-			savedStats = new Stats(currentRun, gameProcess);
+			savedStats = new Stats(currentRun, gameProcess, lastLevel);
 			savedStats.PrintValues();

 			Console.WriteLine("Stats saved successfully!");


Fix RegisteredWaitHandle.Unregister calls

--- DebugStrings/DebugView.cs
+++ DebugStrings/DebugView.cs
@@ -300,7 +300,7 @@

             CancellationTokenRegistration ctr = cancellationToken.Register(() =>
             {
-                rwh.Unregister(this.context.DataReadyEventHandle);
+                rwh.Unregister(null);
                 tcs.TrySetCanceled();
             });

@@ -310,7 +310,7 @@
             }
             finally
             {
-                rwh.Unregister(this.context.DataReadyEventHandle);
+                rwh.Unregister(null);
                 this.context.BufferReadyEventHandle.Set();

                 ctr.Dispose();


Added `Accept-Ranges` header.

Added `Accept-Ranges` header.

--- DefaultResourceServlet.cs
+++ DefaultResourceServlet.cs
@@ -58,6 +58,8 @@

         protected override void OnService()
         {
+            Response.Headers.Add("Accept-Ranges", "bytes");
+
             if (ResourceDirectory != null) {
                 if (EnableCaching) {
                     var etag = Request.Headers["If-None-Match"];


React to OnSendingHeaders rename.

React to OnSendingHeaders rename.

--- src/Microsoft.AspNet.Authentication/AuthenticationHandler.cs
+++ src/Microsoft.AspNet.Authentication/AuthenticationHandler.cs
@@ -76,7 +76,7 @@

             RegisterAuthenticationHandler();

-            Response.OnSendingHeaders(OnSendingHeaderCallback, this);
+            Response.OnResponseStarting(OnSendingHeaderCallback, this);

             await InitializeCoreAsync();


Improve performance when reading connection strings

--- src/Nemo/Configuration/ConnectionStringSettingsExtensions.cs
+++ src/Nemo/Configuration/ConnectionStringSettingsExtensions.cs
@@ -1,5 +1,6 @@
 #if NETSTANDARD
 using System;
+using System.Collections.Concurrent;
 using System.Collections.Generic;
 using System.Linq;
 using Microsoft.Extensions.Configuration;
@@ -9,72 +10,81 @@
 {
     public static class ConnectionStringSettingsExtensions
     {
+        private static readonly ConcurrentDictionary<string, ConnectionStringSettingsCollection> ConnectionStringSettingsCollectionCache = new ConcurrentDictionary<string, ConnectionStringSettingsCollection>();
+        private static readonly ConcurrentDictionary<string, ConnectionStringSettings> ConnectionStringSettingsCache = new ConcurrentDictionary<string, ConnectionStringSettings>();
+
         public static ConnectionStringSettingsCollection ConnectionStrings(this IConfigurationRoot configuration, string section = "ConnectionStrings")
         {
-            var connectionStringCollection = configuration.GetSection(section).Get<ConnectionStringSettingsCollection>();
-            if (connectionStringCollection == null || connectionStringCollection.Count == 0 || connectionStringCollection.All(c => c.Name == null))
+            return ConnectionStringSettingsCollectionCache.GetOrAdd(section, key =>
             {
-                var connectionStrings = configuration.GetSection(section).Get<Dictionary<string, ConnectionStringSettings>>();
-                if (connectionStrings == null || connectionStrings.Count == 0)
+                var connectionStringCollection = configuration.GetSection(section).Get<ConnectionStringSettingsCollection>();
+                if (connectionStringCollection == null || connectionStringCollection.Count == 0 || connectionStringCollection.All(c => c.Name == null))
                 {
-                    var connectionStringMap = configuration.GetSection(section).Get<Dictionary<string, string>>();
-                    if (connectionStringMap == null || connectionStringMap.Count == 0)
+                    var connectionStrings = configuration.GetSection(section).Get<Dictionary<string, ConnectionStringSettings>>();
+                    if (connectionStrings == null || connectionStrings.Count == 0)
                     {
-                        return new ConnectionStringSettingsCollection();
+                        var connectionStringMap = configuration.GetSection(section).Get<Dictionary<string, string>>();
+                        if (connectionStringMap == null || connectionStringMap.Count == 0)
+                        {
+                            return new ConnectionStringSettingsCollection();
+                        }
+                        else
+                        {
+                            return new ConnectionStringSettingsCollection(connectionStringMap.Select(p => new ConnectionStringSettings { Name = p.Key, ConnectionString = p.Value }));
+                        }
                     }
                     else
                     {
-                        return new ConnectionStringSettingsCollection(connectionStringMap.Select(p => new ConnectionStringSettings { Name = p.Key, ConnectionString = p.Value }));
+                        return new ConnectionStringSettingsCollection(connectionStrings.Do(p => p.Value.Name = p.Key).Select(p => p.Value));
                     }
                 }
-                else
-                {
-                    return new ConnectionStringSettingsCollection(connectionStrings.Do(p => p.Value.Name = p.Key).Select(p => p.Value));
-                }
-            }

-            return connectionStringCollection;
+                return connectionStringCollection;
+            });
         }

         public static ConnectionStringSettings ConnectionString(this IConfigurationRoot configuration, string name, string section = "ConnectionStrings")
         {
-            ConnectionStringSettings connectionStringSettings;
+            return ConnectionStringSettingsCache.GetOrAdd("${section}:{name}", key =>
+            {
+                ConnectionStringSettings connectionStringSettings;

-            var connectionStringCollection = configuration.GetSection(section).Get<ConnectionStringSettingsCollection>();
-            if (connectionStringCollection == null || connectionStringCollection.Count == 0 || connectionStringCollection.All(c => c.Name == null))
-            {
-                var connectionStrings = configuration.GetSection(section).Get<Dictionary<string, ConnectionStringSettings>>();
-                if (connectionStrings == null || connectionStrings.Count == 0)
+                var connectionStringCollection = configuration.GetSection(section).Get<ConnectionStringSettingsCollection>();
+                if (connectionStringCollection == null || connectionStringCollection.Count == 0 || connectionStringCollection.All(c => c.Name == null))
                 {
-                    var connectionStringMap = configuration.GetSection(section).Get<Dictionary<string, string>>();
-                    if (connectionStringMap == null || connectionStringMap.Count == 0)
+                    var connectionStrings = configuration.GetSection(section).Get<Dictionary<string, ConnectionStringSettings>>();
+                    if (connectionStrings == null || connectionStrings.Count == 0)
+                    {
+                        var connectionStringMap = configuration.GetSection(section).Get<Dictionary<string, string>>();
+                        if (connectionStringMap == null || connectionStringMap.Count == 0)
+                        {
+                            return null;
+                        }
+                        else if (!connectionStringMap.TryGetValue(name, out var connectionString))
+                        {
+                            return null;
+                        }
+                        else
+                        {
+                            connectionStringSettings = new ConnectionStringSettings { ConnectionString = connectionString, Name = name };
+                        }
+                    }
+                    else if (!connectionStrings.TryGetValue(name, out connectionStringSettings))
                     {
                         return null;
                     }
-                    else if (!connectionStringMap.TryGetValue(name, out var connectionString))
-                    {
-                        return null;
-                    }
-                    else
-                    {
-                        connectionStringSettings = new ConnectionStringSettings { ConnectionString = connectionString, Name = name };
-                    }
                 }
-                else if (!connectionStrings.TryGetValue(name, out connectionStringSettings))
+                else if (!connectionStringCollection.TryGetValue(name, out connectionStringSettings))
                 {
                     return null;
                 }
-            }
-            else if (!connectionStringCollection.TryGetValue(name, out connectionStringSettings))
-            {
-                return null;
-            }

-            if (connectionStringSettings.Name == null)
-            {
-                connectionStringSettings.Name = name;
-            }
-            return connectionStringSettings;
+                if (connectionStringSettings.Name == null)
+                {
+                    connectionStringSettings.Name = name;
+                }
+                return connectionStringSettings;
+            });
         }
     }
 }


Added flag to reload filters.

Added flag to reload filters.

--- Ocell/Pages/Filtering/Filters.xaml.cs
+++ Ocell/Pages/Filtering/Filters.xaml.cs
@@ -49,6 +49,7 @@

                 Config.Filters.Add(DataTransfer.cFilter);
                 Config.SaveFilters();
+                DataTransfer.ShouldReloadFilters = true;
             }
             else
             {


added fixes in client

added fixes in client

--- Octokit/Clients/RepositoriesClient.cs
+++ Octokit/Clients/RepositoriesClient.cs
@@ -879,8 +879,7 @@
             Ensure.ArgumentNotNullOrEmptyString(name, "name");
             Ensure.ArgumentNotNull(options, "options");

-            var repositoryTeams = ApiUrls.RepositoryTeams(owner, name);
-            return ApiConnection.GetAll<Team>(repositoryTeams, options);
+            return ApiConnection.GetAll<Team>(ApiUrls.RepositoryTeams(owner, name), options);
         }

         /// <summary>


add ctors to FileEntryResult

add ctors to FileEntryResult

--- ZKWeb/ZKWeb/Web/ActionResults/FileEntryResult.cs
+++ ZKWeb/ZKWeb/Web/ActionResults/FileEntryResult.cs
@@ -1,5 +1,6 @@
 using System;
 using ZKWeb.Storage;
+using ZKWebStandard.Collections;
 using ZKWebStandard.Extensions;
 using ZKWebStandard.Utils;
 using ZKWebStandard.Web;
@@ -17,15 +18,45 @@
 		/// Cached modify time received from client
 		/// </summary>
 		public DateTime? IfModifiedSince { get; set; }
+		/// <summary>
+		/// Range request in bytes
+		/// </summary>
+		public Pair<long?, long?> BytesRange { get; set; }
+
+		/// <summary>
+		/// Initialize
+		/// </summary>
+		/// <param name="fileEntry">File entry</param>
+		public FileEntryResult(IFileEntry fileEntry) :
+			this(fileEntry, null, Pair.Create<long?, long?>(null, null)) { }

 		/// <summary>
 		/// Initialize
 		/// </summary>
 		/// <param name="fileEntry">File entry</param>
 		/// <param name="ifModifiedSince">Cached modify time received from client</param>
-		public FileEntryResult(IFileEntry fileEntry, DateTime? ifModifiedSince = null) {
+		public FileEntryResult(IFileEntry fileEntry, DateTime? ifModifiedSince) :
+			this(fileEntry, ifModifiedSince, Pair.Create<long?, long?>(null, null)) { }
+
+		/// <summary>
+		/// Initialize
+		/// </summary>
+		/// <param name="fileEntry">File entry</param>
+		/// <param name="bytesRange">Range request in bytes</param>
+		public FileEntryResult(IFileEntry fileEntry, Pair<long?, long?> bytesRange) :
+			this(fileEntry, null, bytesRange) { }
+
+		/// <summary>
+		/// Initialize
+		/// </summary>
+		/// <param name="fileEntry">File entry</param>
+		/// <param name="ifModifiedSince">Cached modify time received from client</param>
+		/// <param name="bytesRange">Range request in bytes</param>
+		public FileEntryResult(
+			IFileEntry fileEntry, DateTime? ifModifiedSince, Pair<long?, long?> bytesRange) {
 			FileEntry = fileEntry;
 			IfModifiedSince = ifModifiedSince;
+			BytesRange = bytesRange;
 		}

 		/// <summary>


Last try worked... wtf ?!

Last try worked... wtf ?!

--- CodeCakeBuilder/Build.cs
+++ CodeCakeBuilder/Build.cs
@@ -174,7 +174,7 @@
                             catch( Exception ex )
                             {
                                 Cake.Error( $"Exception: {ex.Message}" );
-                                foreach( var fLog in Cake.GetFiles( "Back/Tests/Integration/WebApp/WebAppLogs" ) )
+                                foreach( var fLog in Cake.GetFiles( "Back/Tests/Integration/WebApp/WebAppLogs/Textual/*.*" ) )
                                 {
                                     Cake.Information( "=======================================" );
                                     Cake.Information( fLog.FullPath );
@@ -182,6 +182,7 @@
                                     Cake.Information( System.IO.File.ReadAllText( fLog.FullPath ) );
                                     Cake.AppVeyor().UploadArtifact( fLog );
                                 }
+                                throw;
                             }
                         }
                         if( System.IO.File.Exists( test.NetCoreAppDll.FullPath ) )


Trim string at the position of first \0 as it's not necessarily trailing.

git-svn-id: e915c4f8b2ea2a6e63cbe989b51c0994a698cc26@3555 52acb1d6-8a22-11de-b505-999d5b087335

--- OpenMetaverse/Rendering/LindenMesh.cs
+++ OpenMetaverse/Rendering/LindenMesh.cs
@@ -118,7 +118,7 @@
                 byte[] buffer = File.ReadAllBytes(filename);
                 BitPack input = new BitPack(buffer, 0);

-                _header = input.UnpackString(24).TrimEnd(new char[] { '\0' });
+                _header = TrimAt0(input.UnpackString(24));
                 if (!String.Equals(_header, MESH_HEADER))
                     throw new FileLoadException("Unrecognized mesh format");

@@ -189,7 +189,7 @@
             byte[] buffer = File.ReadAllBytes(filename);
             BitPack input = new BitPack(buffer, 0);

-            _header = input.UnpackString(24).TrimEnd(new char[] { '\0' });
+            _header = TrimAt0(input.UnpackString(24));
             if (!String.Equals(_header, MESH_HEADER))
                 throw new FileLoadException("Unrecognized mesh format");

@@ -242,7 +242,9 @@
                 _skinJoints = new string[_numSkinJoints];

                 for (int i = 0; i < _numSkinJoints; i++)
-                    _skinJoints[i] = input.UnpackString(64).TrimEnd(new char[] { '\0' });
+                {
+                    _skinJoints[i] = TrimAt0(input.UnpackString(64));
+                }
             }
             else
             {
@@ -252,7 +254,7 @@

             // Grab morphs
             List<Morph> morphs = new List<Morph>();
-            string morphName = input.UnpackString(64).TrimEnd(new char[] { '\0' });
+            string morphName = TrimAt0(input.UnpackString(64));

             while (morphName != MORPH_FOOTER)
             {
@@ -275,7 +277,7 @@
                 morphs.Add(morph);

                 // Grab the next name
-                morphName = input.UnpackString(64).TrimEnd(new char[] { '\0' });
+                morphName = TrimAt0(input.UnpackString(64));
             }

             _morphs = morphs.ToArray();
@@ -305,5 +307,18 @@
             lod.LoadMesh(filename);
             _lodMeshes[level] = lod;
         }
+
+        public static string TrimAt0(string s)
+        {
+            int pos = s.IndexOf("\0");
+            if (pos >= 0)
+            {
+                return s.Substring(0, pos);
+            }
+            else
+            {
+                return s;
+            }
+        }
     }
 }


Encapsulated scripted importer in Fungus.EditorUtils namespace

--- Assets/Fungus/Scripts/Editor/LuaScriptedImporter.cs
+++ Assets/Fungus/Scripts/Editor/LuaScriptedImporter.cs
@@ -2,13 +2,16 @@
 using UnityEditor.Experimental.AssetImporters;
 using System.IO;

-[ScriptedImporter(1, "lua")]
-public class LuaScriptedImporter : ScriptedImporter
+namespace Fungus.EditorUtils
 {
-    public override void OnImportAsset(AssetImportContext ctx)
-    {
-        TextAsset lua = new TextAsset(File.ReadAllText(ctx.assetPath));
-        ctx.AddObjectToAsset("main", lua);
-        ctx.SetMainObject(lua);
-    }
-}
+	[ScriptedImporter(1, "lua")]
+	public class LuaScriptedImporter : ScriptedImporter
+	{
+	    public override void OnImportAsset(AssetImportContext ctx)
+	    {
+	        TextAsset lua = new TextAsset(File.ReadAllText(ctx.assetPath));
+	        ctx.AddObjectToAsset("main", lua);
+	        ctx.SetMainObject(lua);
+	    }
+	}
+}


fixes triggering onChange on root structure.

--- Assets/Plugins/Colyseus/Serializer/Schema/Schema.cs
+++ Assets/Plugins/Colyseus/Serializer/Schema/Schema.cs
@@ -199,16 +199,17 @@
 			if (it == null) { it = new Iterator(); }
 			if (refs == null) { refs = new ReferenceTracker(); }

-			this.refs = refs;
-
 			var totalBytes = bytes.Length;

 			int refId = 0;
 			IRef _ref = this;
+
+			this.refs = refs;
+			refs.Add(refId, _ref);
+
 			var changes = new List<DataChange>();
-
 			var allChanges = new OrderedDictionary(); // Dictionary<int, List<DataChange>>
-			refs.Add(refId, this);
+			allChanges.Add(refId, changes);

 			while (it.Offset < totalBytes)
 			{


fix bug

fix bug

--- Assets/Scenes/SelectMusic/Scripts/MenuController.cs
+++ Assets/Scenes/SelectMusic/Scripts/MenuController.cs
@@ -199,6 +199,12 @@
 					if ((position.x - 0.5) * (lx - 0.5) < 0){
 						if(playingsong != item.GetComponent<GUIText> ().text){
 							// play this item music
+							foreach (var in_item in menulist) {
+								Vector3 in_postion = in_item.transform.position;
+								in_postion.x -= 0.5f * lastmotion * Time.deltaTime;
+								in_item.transform.position = in_postion;
+							}
+
 							string folder = this.song [item.GetComponent<GUIText> ().text];
 							string name = this.songname[item.GetComponent<GUIText> ().text];
 							var music = GetComponent<AudioSource> ();


changed arraystrike back to 5 skill cost

--- Assets/Scripts/Game/Defined/Serialized/SpellList.cs
+++ Assets/Scripts/Game/Defined/Serialized/SpellList.cs
@@ -201,7 +201,7 @@
     public class Arraystrike : BasicSpellbook {

         public Arraystrike() : base("Arraystrike", Util.GetSprite("sword-array"), TargetType.ALL_FOES, SpellType.OFFENSE, PriorityType.LOW) {
-            AddCost(StatType.SKILL, 2);
+            AddCost(StatType.SKILL, 5);
         }

         protected override string CreateDescriptionHelper() {


1498: CssValueParser.ParseCssColor(), #AARRGGBB

--- src/PixelFarm/PaintLab.WebDom/1_Css_Parser/CssValueParser.cs
+++ src/PixelFarm/PaintLab.WebDom/1_Css_Parser/CssValueParser.cs
@@ -213,33 +213,40 @@
             //    Each pair of hexadecimal digits, in the range 0 to F, represents one sRGB color component in the order red, green and blue.
             //    The digits A to F may be in either uppercase or lowercase.
             //    This syntactical form, originally introduced by HTML, can represent 16777216 colors.
+            //3) 9 digit hex  #rrggbb
             //... more...

-            int r = -1;
-            int g = -1;
-            int b = -1;
-            if (length == 7)
-            {
-                r = ParseHexInt(str, idx + 1, 2);
-                g = ParseHexInt(str, idx + 3, 2);
-                b = ParseHexInt(str, idx + 5, 2);
-            }
-            else if (length == 4)
-            {
-                r = ParseHexInt(str, idx + 1, 1);
-                r = r * 16 + r;
-                g = ParseHexInt(str, idx + 2, 1);
-                g = g * 16 + g;
-                b = ParseHexInt(str, idx + 3, 1);
-                b = b * 16 + b;
-            }
-            if (r > -1 && g > -1 && b > -1)
-            {
-                color = PixelFarm.Drawing.Color.FromArgb(r, g, b);
-                return true;
-            }
-            color = PixelFarm.Drawing.Color.Empty;
-            return false;
+            switch (length)
+            {
+                default:
+                    color = PixelFarm.Drawing.Color.Empty;
+                    return false;
+                case 4:
+                    {
+                        int r = ParseHexInt(str, idx + 1, 1);
+                        r = r * 16 + r;
+                        int g = ParseHexInt(str, idx + 2, 1);
+                        g = g * 16 + g;
+                        int b = ParseHexInt(str, idx + 3, 1);
+                        b = b * 16 + b;
+                        color = PixelFarm.Drawing.Color.FromArgb(r, g, b);
+                        return true;
+                    }
+                case 7:
+                    color = PixelFarm.Drawing.Color.FromArgb(
+                        ParseHexInt(str, idx + 1, 2),//r
+                        ParseHexInt(str, idx + 3, 2),//g
+                        ParseHexInt(str, idx + 5, 2));//b
+                    return true;
+                case 9:
+                    color = PixelFarm.Drawing.Color.FromArgb(
+                       ParseHexInt(str, idx + 1, 2),//a
+                       ParseHexInt(str, idx + 3, 2),//r
+                       ParseHexInt(str, idx + 5, 2),//g
+                       ParseHexInt(str, idx + 7, 2));//b
+                    return true;
+
+            }
         }

         /// <summary>


628: ushort as glyphIndex

628: ushort as glyphIndex

--- src/PixelFarm/Typography/FontAtlas/SimpleFontAtlasBuilder.cs
+++ src/PixelFarm/Typography/FontAtlas/SimpleFontAtlasBuilder.cs
@@ -12,7 +12,7 @@
     public class SimpleFontAtlasBuilder
     {
         GlyphImage _latestGenGlyphImage;
-        Dictionary<int, CacheGlyph> _glyphs = new Dictionary<int, CacheGlyph>();
+        Dictionary<ushort, CacheGlyph> _glyphs = new Dictionary<ushort, CacheGlyph>();

         public SimpleFontAtlasBuilder()
         {
@@ -20,18 +20,17 @@
             MaxAtlasWidth = 800;
         }
         public int MaxAtlasWidth { get; set; }
-
         public TextureKind TextureKind { get; private set; }
         public float FontSizeInPoints { get; private set; }
-
-
+        public string FontFilename { get; set; }
+        public CompactOption SpaceCompactOption { get; set; }
+        //
         public enum CompactOption
         {
             None,
             BinPack,
             ArrangeByHeight
         }
-

         /// <summary>
         /// add or replace
@@ -52,8 +51,6 @@
             this.TextureKind = textureKind;
             this.FontSizeInPoints = fontSizeInPts;
         }
-
-        public CompactOption SpaceCompactOption { get; set; }

         public GlyphImage BuildSingleImage()
         {


JimEvans: Fixing compile error introduced from previous commit.

git-svn-id: aa1aa1384423cb28c2b1e29129bb3a91de1d9196@14139 07704840-8298-11de-bf8c-fd130f914ac9

--- dotnet/src/WebDriver/Remote/RemoteKeyboard.cs
+++ dotnet/src/WebDriver/Remote/RemoteKeyboard.cs
@@ -58,7 +58,7 @@
             Dictionary<string, object> parameters = new Dictionary<string, object>();
             parameters.Add("value", keyToPress);
             parameters.Add("isdown", true);
-            this.driver.InternalExecute(DriverCommand.SendModifierKeyToActiveElement, parameters);
+            this.driver.InternalExecute(DriverCommand.SendKeysToActiveElement, parameters);
         }

         /// <summary>
@@ -71,7 +71,7 @@
             Dictionary<string, object> parameters = new Dictionary<string, object>();
             parameters.Add("value", keyToRelease);
             parameters.Add("isdown", false);
-            this.driver.InternalExecute(DriverCommand.SendModifierKeyToActiveElement, parameters);
+            this.driver.InternalExecute(DriverCommand.SendKeysToActiveElement, parameters);
         }
         #endregion
     }


back to use of source as key in previuscompiled scripts

--- Aurora/AuroraDotNetEngine/ScriptProtectionModule.cs
+++ Aurora/AuroraDotNetEngine/ScriptProtectionModule.cs
@@ -1,333 +1,333 @@
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using System.Reflection;
-using System.Net.Mail;
-using log4net;
-using Nini.Config;
-using OpenMetaverse;
-using OpenSim.Framework;
-using OpenSim.Framework.Client;
-using OpenSim.Region.Framework.Interfaces;
-using OpenSim.Region.Framework.Scenes;
-
-namespace Aurora.ScriptEngine.AuroraDotNetEngine
-{
-    public class ScriptProtectionModule
-	{
-		#region Declares
-
-        private IConfig m_config;
-        private bool allowHTMLLinking = true;
-
-        //Threat Level for scripts.
-        private ThreatLevel m_MaxThreatLevel = 0;
-        //List of all enabled APIs for scripts
-        private List<string> EnabledAPIs = new List<string>();
-        //Which owners have access to which functions
-        private Dictionary<string, List<UUID> > m_FunctionPerms = new Dictionary<string, List<UUID> >();
-        //Keeps track of whether the source has been compiled before
-        public Dictionary<string, string> PreviouslyCompiled = new Dictionary<string, string>();
-
-        public Dictionary<UUID, UUID> ScriptsItems = new Dictionary<UUID, UUID>();
-        public Dictionary<UUID, Dictionary<UUID, ScriptData>> Scripts = new Dictionary<UUID, Dictionary<UUID, ScriptData>>();
-
-        public bool AllowHTMLLinking
-        {
-            get
-            {
-                return allowHTMLLinking;
-            }
-        }
-
-        #endregion
-
-        #region Constructor
-
-        public ScriptProtectionModule(IConfig config)
-		{
-            m_config = config;
-            EnabledAPIs = new List<string>(config.GetString("AllowedAPIs", "LSL").Split(','));
-
-            allowHTMLLinking = config.GetBoolean("AllowHTMLLinking", true);
-            GetThreatLevel();
-		}
-
-		#endregion
-
-		#region ThreatLevels
-
-		public ThreatLevel GetThreatLevel()
-		{
-			if(m_MaxThreatLevel != 0)
-				return m_MaxThreatLevel;
-            string risk = m_config.GetString("FunctionThreatLevel", "VeryLow");
-			switch (risk)
-			{
-				case "None":
-					m_MaxThreatLevel = ThreatLevel.None;
-					break;
-				case "VeryLow":
-					m_MaxThreatLevel = ThreatLevel.VeryLow;
-					break;
-				case "Low":
-					m_MaxThreatLevel = ThreatLevel.Low;
-					break;
-				case "Moderate":
-					m_MaxThreatLevel = ThreatLevel.Moderate;
-					break;
-				case "High":
-					m_MaxThreatLevel = ThreatLevel.High;
-					break;
-				case "VeryHigh":
-					m_MaxThreatLevel = ThreatLevel.VeryHigh;
-					break;
-				case "Severe":
-					m_MaxThreatLevel = ThreatLevel.Severe;
-					break;
-				default:
-					break;
-			}
-            return m_MaxThreatLevel;
-		}
-
-        public bool CheckAPI(string Name)
-        {
-            if (!EnabledAPIs.Contains(Name))
-                return false;
-            return true;
-        }
-
-		public void CheckThreatLevel(ThreatLevel level, string function, SceneObjectPart m_host, string API)
-        {
-            List<UUID> FunctionPerms = new List<UUID>();
-            if (!m_FunctionPerms.TryGetValue(function, out FunctionPerms))
-            {
-                string perm = m_config.GetString("Allow_" + function, "");
-                if (perm == "")
-                {
-                    FunctionPerms = null;// a null value is default
-                }
-                else
-                {
-                    bool allowed;
-
-                    if (bool.TryParse(perm, out allowed))
-                    {
-                        // Boolean given
-                        if (allowed)
-                        {
-                            FunctionPerms = new List<UUID>();
-                            FunctionPerms.Add(UUID.Zero);
-                        }
-                        else
-                            FunctionPerms = new List<UUID>(); // Empty list = none
-                    }
-                    else
-                    {
-                        FunctionPerms = new List<UUID>();
-
-                        string[] ids = perm.Split(new char[] {','});
-                        foreach (string id in ids)
-                        {
-                            string current = id.Trim();
-                            UUID uuid;
-
-                            if (UUID.TryParse(current, out uuid))
-                            {
-                                if (uuid != UUID.Zero)
-                                    FunctionPerms.Add(uuid);
-                            }
-                        }
-                    }
-                }
-                m_FunctionPerms[function] = FunctionPerms;
-            }
-
-            // If the list is null, then the value was true / undefined
-            // Threat level governs permissions in this case
-            //
-            // If the list is non-null, then it is a list of UUIDs allowed
-            // to use that particular function. False causes an empty
-            // list and therefore means "no one"
-            //
-            // To allow use by anyone, the list contains UUID.Zero
-            //
-            if (FunctionPerms == null) // No list = true
-            {
-                if (level > m_MaxThreatLevel)
-                    Error("Runtime Error: ",
-                        String.Format(
-                            "{0} permission denied.  Allowed threat level is {1} but function threat level is {2}.",
-                            function, m_MaxThreatLevel, level));
-            }
-            else
-            {
-                if (!FunctionPerms.Contains(UUID.Zero))
-                {
-                    if (!FunctionPerms.Contains(m_host.OwnerID))
-                        Error("Runtime Error: ",
-                            String.Format("{0} permission denied.  Prim owner is not in the list of users allowed to execute this function.",
-                            function));
-                }
-            }
-        }
-
-		internal void Error(string surMessage, string msg)
-        {
-            throw new Exception(surMessage + msg);
-        }
-
-		#endregion
-
-        #region Previously Compiled Scripts
-
-        /// <summary>
-        /// Reset all lists (if hard), if not hard, just reset previously compiled
-        /// </summary>
-        /// <param name="hard"></param>
-        public void Reset(bool hard)
-        {
-            lock (PreviouslyCompiled)
-            {
-                PreviouslyCompiled.Clear();
-            }
-            if (hard)
-            {
-                lock (ScriptsItems)
-                {
-                    ScriptsItems.Clear();
-                }
-                lock (Scripts)
-                {
-                    Scripts.Clear();
-                }
-            }
-        }
-
-        public void AddPreviouslyCompiled(string source, ScriptData ID)
-            {
-            string key = source.Length.ToString() + source.GetHashCode().ToString();
-            lock (PreviouslyCompiled)
-                {
-
-                if (!PreviouslyCompiled.ContainsKey(key))
-                    {
-                    PreviouslyCompiled.Add(key, ID.AssemblyName);
-                    }
-                }
-            }
-
-        public void RemovePreviouslyCompiled(string source)
-            {
-            string key = source.Length.ToString() + source.GetHashCode().ToString();
-            lock (PreviouslyCompiled)
-                {
-                if (PreviouslyCompiled.ContainsKey(key))
-                    {
-                    PreviouslyCompiled.Remove(key);
-                    }
-                }
-            }
-
-        public string TryGetPreviouslyCompiledScript(string source)
-            {
-            string key = source.Length.ToString() + source.GetHashCode().ToString();
-            string assemblyName = "";
-            PreviouslyCompiled.TryGetValue(key,out assemblyName);
-
-            return assemblyName;
-            }
-
-        public ScriptData GetScript(UUID primID, UUID itemID)
-        {
-            Dictionary<UUID, ScriptData> Instances;
-            lock (Scripts)
-            {
-                if (Scripts.TryGetValue(primID, out Instances))
-                {
-                    ScriptData ID = null;
-                    Instances.TryGetValue(itemID, out ID);
-                    return ID;
-                }
-            }
-            return null;
-        }
-
-        public ScriptData GetScript(UUID itemID)
-        {
-            lock (ScriptsItems)
-            {
-                UUID primID;
-                if (ScriptsItems.TryGetValue(itemID, out primID))
-                    return GetScript(primID, itemID);
-                return null;
-            }
-        }
-
-        public ScriptData[] GetScripts(UUID primID)
-        {
-            Dictionary<UUID, ScriptData> Instances;
-            lock (Scripts)
-            {
-                if (Scripts.TryGetValue(primID, out Instances))
-                    return new List<ScriptData>(Instances.Values).ToArray();
-            }
-            return null;
-        }
-
-        public void AddNewScript(ScriptData ID)
-        {
-            lock (ScriptsItems)
-            {
-                if(ID.part != null)
-                    ScriptsItems[ID.ItemID] = ID.part.UUID;
-            }
-            lock (Scripts)
-            {
-                Dictionary<UUID, ScriptData> Instances = new Dictionary<UUID, ScriptData>();
-                if (!Scripts.TryGetValue(ID.part.UUID, out Instances))
-                    Instances = new Dictionary<UUID, ScriptData>();
-
-                Instances[ID.ItemID] = ID;
-                Scripts[ID.part.UUID] = Instances;
-            }
-        }
-
-        public ScriptData[] GetAllScripts()
-        {
-        	List<ScriptData> Ids = new List<ScriptData>();
-            lock (Scripts)
-            {
-                foreach (Dictionary<UUID, ScriptData> Instances in Scripts.Values)
-                {
-                    foreach (ScriptData ID in Instances.Values)
-                    {
-                        Ids.Add(ID);
-                    }
-                }
-            }
-        	return Ids.ToArray();
-        }
-
-        public void RemoveScript(ScriptData Data)
-        {
-            lock (ScriptsItems)
-            {
-                ScriptsItems.Remove(Data.ItemID);
-            }
-            lock (Scripts)
-            {
-                Dictionary<UUID, ScriptData> Instances = new Dictionary<UUID, ScriptData>();
-                if (Scripts.ContainsKey(Data.part.UUID))
-                {
-                    Instances = Scripts[Data.part.UUID];
-                    Instances.Remove(Data.ItemID);
-                }
-                Scripts[Data.part.UUID] = Instances;
-            }
-        }
-
-        #endregion
-    }
-}
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Reflection;
+using System.Net.Mail;
+using log4net;
+using Nini.Config;
+using OpenMetaverse;
+using OpenSim.Framework;
+using OpenSim.Framework.Client;
+using OpenSim.Region.Framework.Interfaces;
+using OpenSim.Region.Framework.Scenes;
+
+namespace Aurora.ScriptEngine.AuroraDotNetEngine
+{
+    public class ScriptProtectionModule
+	{
+		#region Declares
+
+        private IConfig m_config;
+        private bool allowHTMLLinking = true;
+
+        //Threat Level for scripts.
+        private ThreatLevel m_MaxThreatLevel = 0;
+        //List of all enabled APIs for scripts
+        private List<string> EnabledAPIs = new List<string>();
+        //Which owners have access to which functions
+        private Dictionary<string, List<UUID> > m_FunctionPerms = new Dictionary<string, List<UUID> >();
+        //Keeps track of whether the source has been compiled before
+        public Dictionary<string, string> PreviouslyCompiled = new Dictionary<string, string>();
+
+        public Dictionary<UUID, UUID> ScriptsItems = new Dictionary<UUID, UUID>();
+        public Dictionary<UUID, Dictionary<UUID, ScriptData>> Scripts = new Dictionary<UUID, Dictionary<UUID, ScriptData>>();
+
+        public bool AllowHTMLLinking
+        {
+            get
+            {
+                return allowHTMLLinking;
+            }
+        }
+
+        #endregion
+
+        #region Constructor
+
+        public ScriptProtectionModule(IConfig config)
+		{
+            m_config = config;
+            EnabledAPIs = new List<string>(config.GetString("AllowedAPIs", "LSL").Split(','));
+
+            allowHTMLLinking = config.GetBoolean("AllowHTMLLinking", true);
+            GetThreatLevel();
+		}
+
+		#endregion
+
+		#region ThreatLevels
+
+		public ThreatLevel GetThreatLevel()
+		{
+			if(m_MaxThreatLevel != 0)
+				return m_MaxThreatLevel;
+            string risk = m_config.GetString("FunctionThreatLevel", "VeryLow");
+			switch (risk)
+			{
+				case "None":
+					m_MaxThreatLevel = ThreatLevel.None;
+					break;
+				case "VeryLow":
+					m_MaxThreatLevel = ThreatLevel.VeryLow;
+					break;
+				case "Low":
+					m_MaxThreatLevel = ThreatLevel.Low;
+					break;
+				case "Moderate":
+					m_MaxThreatLevel = ThreatLevel.Moderate;
+					break;
+				case "High":
+					m_MaxThreatLevel = ThreatLevel.High;
+					break;
+				case "VeryHigh":
+					m_MaxThreatLevel = ThreatLevel.VeryHigh;
+					break;
+				case "Severe":
+					m_MaxThreatLevel = ThreatLevel.Severe;
+					break;
+				default:
+					break;
+			}
+            return m_MaxThreatLevel;
+		}
+
+        public bool CheckAPI(string Name)
+        {
+            if (!EnabledAPIs.Contains(Name))
+                return false;
+            return true;
+        }
+
+		public void CheckThreatLevel(ThreatLevel level, string function, SceneObjectPart m_host, string API)
+        {
+            List<UUID> FunctionPerms = new List<UUID>();
+            if (!m_FunctionPerms.TryGetValue(function, out FunctionPerms))
+            {
+                string perm = m_config.GetString("Allow_" + function, "");
+                if (perm == "")
+                {
+                    FunctionPerms = null;// a null value is default
+                }
+                else
+                {
+                    bool allowed;
+
+                    if (bool.TryParse(perm, out allowed))
+                    {
+                        // Boolean given
+                        if (allowed)
+                        {
+                            FunctionPerms = new List<UUID>();
+                            FunctionPerms.Add(UUID.Zero);
+                        }
+                        else
+                            FunctionPerms = new List<UUID>(); // Empty list = none
+                    }
+                    else
+                    {
+                        FunctionPerms = new List<UUID>();
+
+                        string[] ids = perm.Split(new char[] {','});
+                        foreach (string id in ids)
+                        {
+                            string current = id.Trim();
+                            UUID uuid;
+
+                            if (UUID.TryParse(current, out uuid))
+                            {
+                                if (uuid != UUID.Zero)
+                                    FunctionPerms.Add(uuid);
+                            }
+                        }
+                    }
+                }
+                m_FunctionPerms[function] = FunctionPerms;
+            }
+
+            // If the list is null, then the value was true / undefined
+            // Threat level governs permissions in this case
+            //
+            // If the list is non-null, then it is a list of UUIDs allowed
+            // to use that particular function. False causes an empty
+            // list and therefore means "no one"
+            //
+            // To allow use by anyone, the list contains UUID.Zero
+            //
+            if (FunctionPerms == null) // No list = true
+            {
+                if (level > m_MaxThreatLevel)
+                    Error("Runtime Error: ",
+                        String.Format(
+                            "{0} permission denied.  Allowed threat level is {1} but function threat level is {2}.",
+                            function, m_MaxThreatLevel, level));
+            }
+            else
+            {
+                if (!FunctionPerms.Contains(UUID.Zero))
+                {
+                    if (!FunctionPerms.Contains(m_host.OwnerID))
+                        Error("Runtime Error: ",
+                            String.Format("{0} permission denied.  Prim owner is not in the list of users allowed to execute this function.",
+                            function));
+                }
+            }
+        }
+
+		internal void Error(string surMessage, string msg)
+        {
+            throw new Exception(surMessage + msg);
+        }
+
+		#endregion
+
+        #region Previously Compiled Scripts
+
+        /// <summary>
+        /// Reset all lists (if hard), if not hard, just reset previously compiled
+        /// </summary>
+        /// <param name="hard"></param>
+        public void Reset(bool hard)
+        {
+            lock (PreviouslyCompiled)
+            {
+                PreviouslyCompiled.Clear();
+            }
+            if (hard)
+            {
+                lock (ScriptsItems)
+                {
+                    ScriptsItems.Clear();
+                }
+                lock (Scripts)
+                {
+                    Scripts.Clear();
+                }
+            }
+        }
+
+        public void AddPreviouslyCompiled(string source, ScriptData ID)
+            {
+//            string key = source.Length.ToString() + source.GetHashCode().ToString();
+            lock (PreviouslyCompiled)
+                {
+
+                if (!PreviouslyCompiled.ContainsKey(source))
+                    {
+                    PreviouslyCompiled.Add(source, ID.AssemblyName);
+                    }
+                }
+            }
+
+        public void RemovePreviouslyCompiled(string source)
+            {
+//            string key = source.Length.ToString() + source.GetHashCode().ToString();
+            lock (PreviouslyCompiled)
+                {
+                if (PreviouslyCompiled.ContainsKey(source))
+                    {
+                    PreviouslyCompiled.Remove(source);
+                    }
+                }
+            }
+
+        public string TryGetPreviouslyCompiledScript(string source)
+            {
+//            string key = source.Length.ToString() + source.GetHashCode().ToString();
+            string assemblyName = "";
+            PreviouslyCompiled.TryGetValue(source,out assemblyName);
+
+            return assemblyName;
+            }
+
+        public ScriptData GetScript(UUID primID, UUID itemID)
+        {
+            Dictionary<UUID, ScriptData> Instances;
+            lock (Scripts)
+            {
+                if (Scripts.TryGetValue(primID, out Instances))
+                {
+                    ScriptData ID = null;
+                    Instances.TryGetValue(itemID, out ID);
+                    return ID;
+                }
+            }
+            return null;
+        }
+
+        public ScriptData GetScript(UUID itemID)
+        {
+            lock (ScriptsItems)
+            {
+                UUID primID;
+                if (ScriptsItems.TryGetValue(itemID, out primID))
+                    return GetScript(primID, itemID);
+                return null;
+            }
+        }
+
+        public ScriptData[] GetScripts(UUID primID)
+        {
+            Dictionary<UUID, ScriptData> Instances;
+            lock (Scripts)
+            {
+                if (Scripts.TryGetValue(primID, out Instances))
+                    return new List<ScriptData>(Instances.Values).ToArray();
+            }
+            return null;
+        }
+
+        public void AddNewScript(ScriptData ID)
+        {
+            lock (ScriptsItems)
+            {
+                if(ID.part != null)
+                    ScriptsItems[ID.ItemID] = ID.part.UUID;
+            }
+            lock (Scripts)
+            {
+                Dictionary<UUID, ScriptData> Instances = new Dictionary<UUID, ScriptData>();
+                if (!Scripts.TryGetValue(ID.part.UUID, out Instances))
+                    Instances = new Dictionary<UUID, ScriptData>();
+
+                Instances[ID.ItemID] = ID;
+                Scripts[ID.part.UUID] = Instances;
+            }
+        }
+
+        public ScriptData[] GetAllScripts()
+        {
+        	List<ScriptData> Ids = new List<ScriptData>();
+            lock (Scripts)
+            {
+                foreach (Dictionary<UUID, ScriptData> Instances in Scripts.Values)
+                {
+                    foreach (ScriptData ID in Instances.Values)
+                    {
+                        Ids.Add(ID);
+                    }
+                }
+            }
+        	return Ids.ToArray();
+        }
+
+        public void RemoveScript(ScriptData Data)
+        {
+            lock (ScriptsItems)
+            {
+                ScriptsItems.Remove(Data.ItemID);
+            }
+            lock (Scripts)
+            {
+                Dictionary<UUID, ScriptData> Instances = new Dictionary<UUID, ScriptData>();
+                if (Scripts.ContainsKey(Data.part.UUID))
+                {
+                    Instances = Scripts[Data.part.UUID];
+                    Instances.Remove(Data.ItemID);
+                }
+                Scripts[Data.part.UUID] = Instances;
+            }
+        }
+
+        #endregion
+    }
+}


enhance boundary tests for no terrain.  Put in a null load test for land.

--- OpenSim/Data/Tests/BasicRegionTest.cs
+++ OpenSim/Data/Tests/BasicRegionTest.cs
@@ -40,6 +40,7 @@
     public class BasicRegionTest
     {
         public IRegionDataStore db;
+        public UUID zero = UUID.Zero;
         public UUID region1;
         public UUID region2;
         public UUID prim1;
@@ -168,9 +169,9 @@
         public void T021_PrimInventoryStore()
         {
             SceneObjectGroup sog = FindSOG("object1", region1);
-            InventoryItemBase i = NewItem(item1, UUID.Zero, UUID.Zero, itemname1, UUID.Zero);
-
-            Assert.That(sog.AddInventoryItem(null, sog.RootPart.LocalId, i, UUID.Zero), Is.True);
+            InventoryItemBase i = NewItem(item1, zero, zero, itemname1, zero);
+
+            Assert.That(sog.AddInventoryItem(null, sog.RootPart.LocalId, i, zero), Is.True);
             TaskInventoryItem t = sog.GetInventoryItem(sog.RootPart.LocalId, item1);
             Assert.That(t.Name, Is.EqualTo(itemname1));

@@ -255,7 +256,10 @@
         [Test]
         public void T300_NoTerrain()
         {
-            db.LoadTerrain(region1);
+            Assert.That(db.LoadTerrain(zero), Is.Null);
+            Assert.That(db.LoadTerrain(region1), Is.Null);
+            Assert.That(db.LoadTerrain(region2), Is.Null);
+            Assert.That(db.LoadTerrain(UUID.Random()), Is.Null);
         }

         [Test]
@@ -263,6 +267,11 @@
         {
             double[,] t1 = GenTerrain(height1);
             db.StoreTerrain(t1, region1);
+
+            Assert.That(db.LoadTerrain(zero), Is.Null);
+            Assert.That(db.LoadTerrain(region1), Is.Not.Null);
+            Assert.That(db.LoadTerrain(region2), Is.Null);
+            Assert.That(db.LoadTerrain(UUID.Random()), Is.Null);
         }

         [Test]
@@ -286,6 +295,16 @@
             Assert.That(CompareTerrain(t1, baseterrain1), Is.False);
             Assert.That(CompareTerrain(t1, baseterrain2), Is.True);
         }
+
+        [Test]
+        public void T400_EmptyLand()
+        {
+            Assert.That(db.LoadLandObjects(zero).Count, Is.EqualTo(0));
+            Assert.That(db.LoadLandObjects(region1).Count, Is.EqualTo(0));
+            Assert.That(db.LoadLandObjects(region2).Count, Is.EqualTo(0));
+            Assert.That(db.LoadLandObjects(UUID.Random()).Count, Is.EqualTo(0));
+        }
+

         // Extra private methods


handle diferente number of wearables on getting assets form another appearance

--- OpenSim/Framework/AvatarAppearance.cs
+++ OpenSim/Framework/AvatarAppearance.cs
@@ -251,9 +251,17 @@

         public void GetAssetsFrom(AvatarAppearance app)
         {
-            for (int i = 0; i < m_wearables.Length; i++)
-            {
-                for (int j = 0; j < m_wearables[i].Count; j++)
+            int len =  m_wearables.Length;
+            if(len > app.m_wearables.Length)
+                len = app.m_wearables.Length;
+
+            for (int i = 0; i < len; i++)
+            {
+                int count =  m_wearables[i].Count;
+                if(count > app.m_wearables[i].Count)
+                    count = app.m_wearables[i].Count;
+
+                for (int j = 0; j < count; j++)
                 {
                     UUID itemID = m_wearables[i][j].ItemID;
                     UUID assetID = app.Wearables[i].GetAsset(itemID);


* Fix edit scale command - was looking for one too few arguments

--- OpenSim/Region/Application/OpenSim.cs
+++ OpenSim/Region/Application/OpenSim.cs
@@ -389,7 +389,7 @@

         private void HandleEditScale(string module, string[] args)
         {
-            if (args.Length == 5)
+            if (args.Length == 6)
             {
                 m_sceneManager.HandleEditCommandOnCurrentScene(args);
             }


Fix regression from refactoring

Fix regression from refactoring

--- Battery-Commander.Web/Controllers/HomeController.cs
+++ Battery-Commander.Web/Controllers/HomeController.cs
@@ -40,21 +40,21 @@
                         Unit = unit,
                         APFT = new UnitStatsViewModel.Stat
                         {
-                            Assigned = soldiers.Count,
+                            Assigned = soldiers.Count(),
                             Passed = soldiers.Where(soldier => soldier.ApftStatus == Soldier.EventStatus.Passed).Count(),
                             Failed = soldiers.Where(soldier => soldier.ApftStatus == Soldier.EventStatus.Failed).Count(),
                             NotTested = soldiers.Where(soldier => soldier.ApftStatus == Soldier.EventStatus.NotTested).Count()
                         },
                         ABCP = new UnitStatsViewModel.Stat
                         {
-                            Assigned = soldiers.Count,
+                            Assigned = soldiers.Count(),
                             Passed = soldiers.Where(soldier => soldier.AbcpStatus == Soldier.EventStatus.Passed).Count(),
                             Failed = soldiers.Where(soldier => soldier.AbcpStatus == Soldier.EventStatus.Failed).Count(),
                             NotTested = soldiers.Where(soldier => soldier.AbcpStatus == Soldier.EventStatus.NotTested).Count()
                         },
                         DSCA = new UnitStatsViewModel.Stat
                         {
-                            Assigned = soldiers.Count,
+                            Assigned = soldiers.Count(),
                             Passed = soldiers.Where(soldier => soldier.DscaQualified).Count(),
                             Failed = soldiers.Where(soldier => soldier.DscaQualificationDate.HasValue && !soldier.DscaQualified).Count(),
                             NotTested = soldiers.Where(soldier => !soldier.DscaQualificationDate.HasValue).Count()


Don't show SSD on details page if officer

--- Battery-Commander.Web/Views/Soldiers/Details.cshtml
+++ Battery-Commander.Web/Views/Soldiers/Details.cshtml
@@ -68,8 +68,8 @@

-

-
+@if (!Model.Soldier.IsOfficer)
+{

@Html.DisplayNameFor(_ => _.Soldier.SSDStatus)

@@ -102,186 +102,188 @@

-
+}
+
+
+

+
+

+
@Html.DisplayNameFor(_ => _.Soldier.APFTs) @Html.ActionLink("Add New", "New", "APFT", new { soldier = Model.Soldier.Id }, new { @class = "btn btn-default btn-xs" })

+

+
+

+

+

+

+                    @Html.DisplayNameFor(_ => _.Soldier.APFTs.FirstOrDefault().Date)
+                    @Html.DisplayNameFor(_ => _.Soldier.APFTs.FirstOrDefault().PushUps)
+                    @Html.DisplayNameFor(_ => _.Soldier.APFTs.FirstOrDefault().SitUps)
+                    @Html.DisplayNameFor(_ => _.Soldier.APFTs.FirstOrDefault().Run)
+                    @Html.DisplayNameFor(_ => _.Soldier.APFTs.FirstOrDefault().TotalScore)
+                    @Html.DisplayNameFor(_ => _.Soldier.APFTs.FirstOrDefault().IsPassing)
+
+

+

+
+

+                @foreach (var apft in Model.Soldier.APFTs.OrderByDescending(_ => _.Date))
+                {
+

+                        @Html.DisplayFor(_ => apft.Date)
+                        @Html.DisplayFor(_ => apft.PushUps)
+                        @Html.DisplayFor(_ => apft.SitUps)
+                        @Html.DisplayFor(_ => apft.Run)
+                        @Html.DisplayFor(_ => apft.TotalScore)
+
+                            @if (apft.IsPassing)
+                            {
+                                Passing
+                            }
+                            else
+                            {
+                                Failure
+                            }
+
+                        @Html.ActionLink("Details", "Details", "APFT", new { apft.Id })
+

+                }
+

+

+
+

+

+

+
+

+
+

+
@Html.DisplayNameFor(_ => _.Soldier.ABCPs) @Html.ActionLink("Add New", "New", "ABCP", new { soldier = Model.Soldier.Id }, new { @class = "btn btn-default btn-xs" })

+

+
+

+

+

+

+                    @Html.DisplayNameFor(_ => _.Soldier.ABCPs.FirstOrDefault().Date)
+                    @Html.DisplayNameFor(_ => _.Soldier.ABCPs.FirstOrDefault().Weight)
+                    @Html.DisplayNameFor(_ => _.Soldier.ABCPs.FirstOrDefault().Screening_Weight)
+                    @Html.DisplayNameFor(_ => _.Soldier.ABCPs.FirstOrDefault().IsPassing)
+
+

+

+
+

+                @foreach (var abcp in Model.Soldier.ABCPs.OrderByDescending(_ => _.Date))
+                {
+

+                        @Html.DisplayFor(_ => abcp.Date)
+                        @Html.DisplayFor(_ => abcp.Weight)
+                        @Html.DisplayFor(_ => abcp.Screening_Weight)
+
+                            @if (abcp.IsPassing)
+                            {
+                                Passing
+                            }
+                            else
+                            {
+                                Failure
+                            }
+
+                        @Html.ActionLink("Details", "Details", "ABCP", new { abcp.Id })
+

+                }
+

+

+
+

+

+

+
+@if (Model.Evaluations.Any())
+{

-
@Html.DisplayNameFor(_ => _.Soldier.APFTs) @Html.ActionLink("Add New", "New", "APFT", new { soldier = Model.Soldier.Id }, new { @class = "btn btn-default btn-xs" })

+
@Html.DisplayNameFor(_ => _.Evaluations) @Html.ActionLink("Add New", "New", "Evaluations", null, new { @class = "btn btn-default btn-xs" })

-                        @Html.DisplayNameFor(_ => _.Soldier.APFTs.FirstOrDefault().Date)
-                        @Html.DisplayNameFor(_ => _.Soldier.APFTs.FirstOrDefault().PushUps)
-                        @Html.DisplayNameFor(_ => _.Soldier.APFTs.FirstOrDefault().SitUps)
-                        @Html.DisplayNameFor(_ => _.Soldier.APFTs.FirstOrDefault().Run)
-                        @Html.DisplayNameFor(_ => _.Soldier.APFTs.FirstOrDefault().TotalScore)
-                        @Html.DisplayNameFor(_ => _.Soldier.APFTs.FirstOrDefault().IsPassing)

+                        @Html.DisplayNameFor(_ => _.Evaluations.FirstOrDefault().Role)
+                        @Html.DisplayNameFor(_ => _.Evaluations.FirstOrDefault().Evaluation.Ratee)
+                        @Html.DisplayNameFor(_ => _.Evaluations.FirstOrDefault().Evaluation.Status)
+                        @Html.DisplayNameFor(_ => _.Evaluations.FirstOrDefault().Evaluation.Delinquency)

-                    @foreach (var apft in Model.Soldier.APFTs.OrderByDescending(_ => _.Date))
-                    {
+                    @foreach (var evaluation in Model.Evaluations)
+                {

-                            @Html.DisplayFor(_ => apft.Date)
-                            @Html.DisplayFor(_ => apft.PushUps)
-                            @Html.DisplayFor(_ => apft.SitUps)
-                            @Html.DisplayFor(_ => apft.Run)
-                            @Html.DisplayFor(_ => apft.TotalScore)
+                            @Html.ActionLink("Details", "Details", "Evaluations", new { evaluation.Evaluation.Id })
+                            @Html.DisplayFor(_ => evaluation.Role)
+                            @Html.DisplayFor(_ => evaluation.Evaluation.Ratee)
+                            @Html.DisplayFor(_ => evaluation.Evaluation.Status)

-                                @if (apft.IsPassing)
+                                @if (evaluation.Evaluation.Delinquency > TimeSpan.Zero)
                                 {
-                                    Passing
+                                    Due in @Html.DisplayFor(_ => evaluation.Evaluation.DelinquencyHumanized)
                                 }
                                 else
                                 {
-                                    Failure
+                                    Overdue @Html.DisplayFor(_ => evaluation.Evaluation.DelinquencyHumanized)
                                 }

-                            @Html.ActionLink("Details", "Details", "APFT", new { apft.Id })

                     }

-
-

-
-

-
-

-
@Html.DisplayNameFor(_ => _.Soldier.ABCPs) @Html.ActionLink("Add New", "New", "ABCP", new { soldier = Model.Soldier.Id }, new { @class = "btn btn-default btn-xs" })

-

-
-

-

-

-

-                        @Html.DisplayNameFor(_ => _.Soldier.ABCPs.FirstOrDefault().Date)
-                        @Html.DisplayNameFor(_ => _.Soldier.ABCPs.FirstOrDefault().Weight)
-                        @Html.DisplayNameFor(_ => _.Soldier.ABCPs.FirstOrDefault().Screening_Weight)
-                        @Html.DisplayNameFor(_ => _.Soldier.ABCPs.FirstOrDefault().IsPassing)
-
-

-

-
-

-                    @foreach (var abcp in Model.Soldier.ABCPs.OrderByDescending(_ => _.Date))
-                    {
-

-                            @Html.DisplayFor(_ => abcp.Date)
-                            @Html.DisplayFor(_ => abcp.Weight)
-                            @Html.DisplayFor(_ => abcp.Screening_Weight)
-
-                                @if (abcp.IsPassing)
-                                {
-                                    Passing
-                                }
-                                else
-                                {
-                                    Failure
-                                }
-
-                            @Html.ActionLink("Details", "Details", "ABCP", new { abcp.Id })
-

-                    }
-

-

-
-

-

-

-
-    @if (Model.Evaluations.Any())
-    {
-

-
-

-
@Html.DisplayNameFor(_ => _.Evaluations) @Html.ActionLink("Add New", "New", "Evaluations", null, new { @class = "btn btn-default btn-xs" })

-

-
-

-

-

-

-
-                            @Html.DisplayNameFor(_ => _.Evaluations.FirstOrDefault().Role)
-                            @Html.DisplayNameFor(_ => _.Evaluations.FirstOrDefault().Evaluation.Ratee)
-                            @Html.DisplayNameFor(_ => _.Evaluations.FirstOrDefault().Evaluation.Status)
-                            @Html.DisplayNameFor(_ => _.Evaluations.FirstOrDefault().Evaluation.Delinquency)
-

-

-
-

-                        @foreach (var evaluation in Model.Evaluations)
-                {
-

-                                @Html.ActionLink("Details", "Details", "Evaluations", new { evaluation.Evaluation.Id })
-                                @Html.DisplayFor(_ => evaluation.Role)
-                                @Html.DisplayFor(_ => evaluation.Evaluation.Ratee)
-                                @Html.DisplayFor(_ => evaluation.Evaluation.Status)
-
-                                    @if (evaluation.Evaluation.Delinquency > TimeSpan.Zero)
-                                    {
-                                        Due in @Html.DisplayFor(_ => evaluation.Evaluation.DelinquencyHumanized)
-                                    }
-                                    else
-                                    {
-                                        Overdue @Html.DisplayFor(_ => evaluation.Evaluation.DelinquencyHumanized)
-                                    }
-
-

-                        }
-

-

-

-

+}
+
+

+    @using (Html.BeginForm("Delete", "Soldiers", new { Model.Soldier.Id }, FormMethod.Post))
+            {
+        @Html.AntiForgeryToken()
+        <button type="submit" class="btn btn-danger">Delete</button>
     }
-
-

-        @using (Html.BeginForm("Delete", "Soldiers", new { Model.Soldier.Id }, FormMethod.Post))
+

+
+@section Scripts
+{
+    @{
+        var apft_data =
+            Model
+            .Soldier
+            .APFTs
+            .OrderBy(apft => apft.Date)
+            .Select(apft => new
             {
-            @Html.AntiForgeryToken()
-            <button type="submit" class="btn btn-danger">Delete</button>
-        }
-

-
-    @section Scripts
-{
-        @{
-            var apft_data =
-                Model
-                .Soldier
-                .APFTs
-                .OrderBy(apft => apft.Date)
-                .Select(apft => new
-                {
-                    date = apft.Date.ToString("yyyy-MM-dd"),
-                    score = apft.TotalScore
-                })
-                .ToList();
-
-            var abcp_data =
-                Model
-                .Soldier
-                .ABCPs
-                .OrderBy(abcp => abcp.Date)
-                .Select(abcp => new
-                {
-                    date = abcp.Date.ToString("yyyy-MM-dd"),
-                    weight = abcp.Weight
-                })
-                .ToList();
-        }
-
-
-
-
+
-    }
+    </script>
+}


Optimize usings.

Optimize usings.

--- test/AsmResolver.DotNet.Tests/MetadataResolverTest.cs
+++ test/AsmResolver.DotNet.Tests/MetadataResolverTest.cs
@@ -1,14 +1,9 @@
 using System;
 using System.IO;
 using System.Linq;
-using AsmResolver.DotNet.Code.Cil;
-using AsmResolver.DotNet.Serialized;
 using AsmResolver.DotNet.Signatures;
-using AsmResolver.DotNet.Signatures.Types;
 using AsmResolver.DotNet.TestCases.NestedClasses;
-using AsmResolver.IO;
 using AsmResolver.PE.DotNet.Cil;
-using AsmResolver.PE.DotNet.Metadata.Tables.Rows;
 using Xunit;

 namespace AsmResolver.DotNet.Tests


Don't show framework folder options for content and tools folder.

--- PackageExplorer/PackageViewer.xaml.cs
+++ PackageExplorer/PackageViewer.xaml.cs
@@ -342,7 +342,7 @@
             var visibilityBinding = new Binding("Path")
                                     {
                                         Converter = new StringToVisibilityConverter(),
-                                        ConverterParameter = "lib;content;tools"
+                                        ConverterParameter = "lib"
                                     };

             var commandBinding = new Binding("AddContentFolderCommand");


Bump for v0.8.1 (#223)

Bump for v0.8.1 (#223)

--- Paymetheus/Properties/AssemblyInfo.cs
+++ Paymetheus/Properties/AssemblyInfo.cs
@@ -52,5 +52,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.8.0.0")]
-[assembly: AssemblyFileVersion("0.8.0.0")]
+[assembly: AssemblyVersion("0.8.1.0")]
+[assembly: AssemblyFileVersion("0.8.1.0")]


Bump for v0.2.0 (#128)

Bump for v0.2.0 (#128)

Fix copyright date.

--- Paymetheus/Properties/AssemblyInfo.cs
+++ Paymetheus/Properties/AssemblyInfo.cs
@@ -12,7 +12,7 @@
 [assembly: AssemblyConfiguration("")]
 [assembly: AssemblyCompany("")]
 [assembly: AssemblyProduct("Paymetheus")]
-[assembly: AssemblyCopyright("Copyright ©  2015")]
+[assembly: AssemblyCopyright("Copyright ©  2016")]
 [assembly: AssemblyTrademark("")]
 [assembly: AssemblyCulture("")]
 [assembly: AssemblyMetadata("Organization", "Decred")]
@@ -52,5 +52,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.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
+[assembly: AssemblyVersion("0.2.0.0")]
+[assembly: AssemblyFileVersion("0.2.0.0")]


[Network] bugfix listen socket

[Network] bugfix listen socket

--- OGL/Network/TCP/Server.cs
+++ OGL/Network/TCP/Server.cs
@@ -71,6 +71,11 @@
 			callbackConn(state.clientID);
 			connections.Add(handler);
 			connectionsMap.Add(state.clientID, handler);
+
+			// 다시 연결 대기
+			listener.BeginAccept(
+							new AsyncCallback(AcceptCallback),
+							listener);
 		}

 		public bool Send(uint clientID, byte[] data)


Triple colon test

Triple colon test

--- src/R/Editor/Application.Test/Completion/IntellisenseTest.cs
+++ src/R/Editor/Application.Test/Completion/IntellisenseTest.cs
@@ -505,6 +505,21 @@
             }
         }

+        [Test]
+        public async Task R_PackageMemberCompletion() {
+            using (var script = await _editorHost.StartScript(ExportProvider, RContentTypeDefinition.ContentType, Workflow.RSessions)) {
+                PrimeIntellisenseProviders(script);
+                script.DoIdle(500);
+
+                script.Type("AIC");
+                script.MoveLeft(3);
+                script.Type("stats:::");
+                script.DoIdle(100);
+                script.EditorText.Should().Be("stats:::AIC");
+                script.View.Caret.Position.BufferPosition.Position.Should().Be(8);
+            }
+        }
+
         private void PrimeIntellisenseProviders(IEditorScript script) {
             // Prime variable provider
             UIThreadHelper.Instance.Invoke(() => {


Add deprecated 'tree list' type to formatter, because that's what __base templates still is :)

--- src/Rainbow/Formatting/FieldFormatters/MultilistFormatter.cs
+++ src/Rainbow/Formatting/FieldFormatters/MultilistFormatter.cs
@@ -11,7 +11,7 @@
 		{
 			get
 			{
-				return new[] { "Checklist", "Multilist", "Multilist with Search", "Treelist", "Treelist with Search", "TreelistEx" };
+				return new[] { "Checklist", "Multilist", "Multilist with Search", "Treelist", "Treelist with Search", "TreelistEx", "tree list" };
 			}
 		}


Add extension methods explicitly converting System.Nullable

--- CSharpFunctionalExtensions/Maybe/MaybeExtensions.cs
+++ CSharpFunctionalExtensions/Maybe/MaybeExtensions.cs
@@ -403,7 +403,7 @@
             hasValue = result.HasValue;
             value = result.GetValueOrDefault();
         }
-
+
         /// <summary>
         /// Flattens nested <see cref="Maybe{T}"/>s into a single <see cref="Maybe{T}"/>.
         /// </summary>
@@ -412,5 +412,48 @@
         {
             return maybe.GetValueOrDefault();
         }
+
+        /// <summary>
+        /// Converts the <see cref="Nullable{T}"/> struct to a <see cref="Maybe{T}"/>.
+        /// </summary>
+        /// <returns>Returns the <see cref="Maybe{T}"/> equivalent to the <see cref="Nullable{T}"/>.</returns>
+        public static Maybe<T> ToMaybe<T>(in this Nullable<T> value)
+            where T : struct
+        {
+            if (value.HasValue)
+            {
+                return value.Value;
+            }
+            return default;
+        }
+
+        /// <summary>
+        /// Converts the <see cref="Maybe{T}"/> to a <see cref="Nullable{T}"/> struct.
+        /// </summary>
+        /// <returns>Returns the <see cref="Nullable{T}"/> equivalent to the <see cref="Maybe{T}"/>.</returns>
+        public static Nullable<T> ToMaybe<T>(in this Maybe<T> value)
+            where T : struct
+        {
+            if (value.TryGetValue(out var result))
+            {
+                return result;
+            }
+            return default;
+        }
+
+        /// <summary>
+        /// Wraps the class instance in a <see cref="Maybe{T}"/>.
+        /// </summary>
+        /// <returns>Returns <see cref="Maybe.None"/> if the class instance is null, otherwise returns <see cref="Maybe.From(T)"/>.</returns>
+        public static Maybe<T> ToMaybe<T>(this T? value)
+            where T : class
+        {
+            if (value is not null)
+            {
+                return value!;
+            }
+
+            return default;
+        }
     }
 }


Removed unneeded variable/parameter

Removed unneeded variable/parameter

--- CarTracker/CarTracker.Logic/Services/TripService.cs
+++ CarTracker/CarTracker.Logic/Services/TripService.cs
@@ -19,12 +19,10 @@
     {

         private readonly CarTrackerDbContext _db;
-        private readonly IRequestInformation _requestInformation;
-
-        public TripService(CarTrackerDbContext db, IRequestInformation requestInformation)
+
+        public TripService(CarTrackerDbContext db)
         {
             this._db = db;
-            this._requestInformation = requestInformation;
         }

         public Trip Get(long id)


Update App.axaml.cs

Update App.axaml.cs

--- samples/Demo/App.axaml.cs
+++ samples/Demo/App.axaml.cs
@@ -28,12 +28,14 @@
             var serviceProvider = container.Resolve<IServiceProvider>();

             var editor = serviceProvider.GetService<ProjectEditorViewModel>();
+            if (editor is { })
+            {
+                editor.CurrentTool = editor.Tools.FirstOrDefault(t => t.Title == "Selection");
+                editor.CurrentPathTool = editor.PathTools.FirstOrDefault(t => t.Title == "Line");
+                editor.IsToolIdle = true;

-            editor.CurrentTool = editor.Tools.FirstOrDefault(t => t.Title == "Selection");
-            editor.CurrentPathTool = editor.PathTools.FirstOrDefault(t => t.Title == "Line");
-            editor.IsToolIdle = true;
-
-            editor.OnNewProject();
+                editor.OnNewProject();
+            }

             if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
             {


Fix for scenario specifc nodeweights

Fix for scenario specifc nodeweights

--- vs/LCIAToolAPI/Services/FragmentTraversalV2.cs
+++ vs/LCIAToolAPI/Services/FragmentTraversalV2.cs
@@ -220,16 +220,7 @@
             //do not save to NodeCache and abandon recursion if nodeweight == 0
             if (nodeWeight != 0)
             {
-                var nodeCache = new NodeCache
-                {
-                    FragmentFlowID = fragmentFlowId,
-                    ScenarioID = scenarioId,
-                    FlowMagnitude = flowMagnitude,
-                    NodeWeight = nodeWeight
-                };
-
-                _nodeCacheService.InsertGraph(nodeCache);
-                _unitOfWork.Save();
+

                 var outFlows = _fragmentFlowService.Query().Get()
                     .Where(x => x.ParentFragmentFlowID == fragmentFlowId)
@@ -292,20 +283,34 @@
                 {
                     foreach (var item in outFlows)
                     {
-                        double outflowMagnitude = Convert.ToDouble(nodeWeight * item.Result);
-                        int outflowScenarioId = Convert.ToInt32(item.ScenarioID);
-                        int outflowFragmentFlowID = Convert.ToInt32(item.FragmentFlowID);
-                        if (item.ParamValue == null)
+
+                        if (item.Result == null)
                         {
                             throw new ArgumentNullException("This value cannot be null.");
                         }
                         else
                         {
-                            item.Result = item.ParamValue;
-                            NodeRecurse(outflowFragmentFlowID, outflowScenarioId, outflowMagnitude);
+                            if (item.ParamValue != 0  && scenarioId != 0)
+                            {
+                                item.Result = item.ParamValue;
+                            }
+                            double outflowMagnitude = Convert.ToDouble(nodeWeight * item.Result);
+                            int outflowFragmentFlowID = Convert.ToInt32(item.FragmentFlowID);
+                            NodeRecurse(outflowFragmentFlowID, scenarioId, outflowMagnitude);
                         }
                     }
                 }
+
+                var nodeCache = new NodeCache
+                {
+                    FragmentFlowID = fragmentFlowId,
+                    ScenarioID = scenarioId,
+                    FlowMagnitude = flowMagnitude,
+                    NodeWeight = nodeWeight
+                };
+
+                _nodeCacheService.InsertGraph(nodeCache);
+                _unitOfWork.Save();
             }

         }


Add RowCol.OffsetTo overload returning tuple

--- src/RowCol.cs
+++ src/RowCol.cs
@@ -56,6 +56,10 @@
             && Row <= b.Row;

         [Pure]
+        public (int Rows, int Cols) OffsetTo(RowCol other) =>
+            OffsetTo(other, ValueTuple.Create);
+
+        [Pure]
         public T OffsetTo<T>(RowCol other, Func<int, int, T> selector)
         {
             if (selector == null) throw new ArgumentNullException(nameof(selector));


Ensure global listeners do not crash input system

--- Assets/MixedRealityToolkit/Services/BaseEventSystem.cs
+++ Assets/MixedRealityToolkit/Services/BaseEventSystem.cs
@@ -94,7 +94,15 @@
                         continue;
                     }

-                    eventHandler.Invoke((T)handlerEntry.handler, eventData);
+                    try
+                    {
+                        // Ensure client code does not crash our input system
+                        eventHandler.Invoke((T)handlerEntry.handler, eventData);
+                    }
+                    catch (Exception ex)
+                    {
+                        Debug.LogException(ex);
+                    }
                 }
             }


Missed view bag

Missed view bag

--- Battery-Commander.Web/Controllers/ReportsController.cs
+++ Battery-Commander.Web/Controllers/ReportsController.cs
@@ -23,6 +23,8 @@
         [Route("~/Units/{unitId}/Reports", Name = "Unit.Reports")]
         public async Task<IActionResult> Index(int unitId)
         {
+            ViewBag.UnitId = unitId;
+
             return View(await UnitService.Get(db, unitId));
         }


add additional assertions to Wait_is_Awaitable

--- CSharp/Tests/Microsoft.Bot.Builder.Tests/FiberTests.cs
+++ CSharp/Tests/Microsoft.Bot.Builder.Tests/FiberTests.cs
@@ -171,9 +171,18 @@
             IWait wait = completion;
             Assert.AreEqual(Need.None, wait.Need, "at initial state");

+            IFiber<object> fiber = new Mock<IFiber<object>>(MockBehavior.Strict).Object;
+            object context = new object();
+
             IWait<object, Guid> typed = completion;
             typed.Wait(async (f, c, item) => {
                 Assert.AreEqual(Need.Call, wait.Need, "inside callback state");
+
+                Assert.AreEqual(fiber, f);
+                Assert.AreEqual(context, c);
+
+                Assert.AreEqual(expected, item.GetAwaiter().GetResult());
+                Assert.AreEqual(expected, await item);
                 return null;
             });
             Assert.AreEqual(Need.Wait, wait.Need, "waiting state");
@@ -182,8 +191,6 @@
             post.Post(expected);
             Assert.AreEqual(Need.Poll, wait.Need, "need to poll state");

-            IFiber<object> fiber = null;
-            object context = null;
             await typed.PollAsync(fiber, context);
             Assert.AreEqual(Need.Done, wait.Need, "done state");


IBufferSource

IBufferSource

--- CSharpGL/Scene/SceneNodes/RenderUnits/IBufferSource.cs
+++ CSharpGL/Scene/SceneNodes/RenderUnits/IBufferSource.cs
@@ -1,4 +1,5 @@
-namespace CSharpGL
+using System.Collections.Generic;
+namespace CSharpGL
 {
     /// <summary>
     /// Data for CPU(model) -> Data for GPU(opengl buffer)
@@ -12,12 +13,12 @@
         /// </summary>
         /// <param name="bufferName">CPU代码指定的buffer名字，用以区分各个用途的buffer。</param>
         /// <returns></returns>
-        VertexBuffer GetVertexAttributeBuffer(string bufferName);
+        IEnumerable<VertexBuffer> GetVertexAttributeBuffer(string bufferName);

         /// <summary>
         /// </summary>
         /// <returns></returns>
-        IDrawCommand GetDrawCommand();
+        IEnumerable<IDrawCommand> GetDrawCommand();

     }
 }


Tests added for Marketplace products and products with a size

--- Cdiscount.OpenApi.ProxyClient.Tests/PushToCartTests.cs
+++ Cdiscount.OpenApi.ProxyClient.Tests/PushToCartTests.cs
@@ -2,6 +2,9 @@
 using Microsoft.VisualStudio.TestTools.UnitTesting;
 using Cdiscount.OpenApi.ProxyClient.Contract.PushToCart;
 using Cdiscount.OpenApi.ProxyClient.Tests.Helper;
+using System.Collections.Generic;
+using Cdiscount.OpenApi.ProxyClient.Contract.GetProduct;
+using System.Linq;

 namespace Cdiscount.OpenApi.ProxyClient.Tests
 {
@@ -69,5 +72,79 @@
             Assert.IsNotNull(response.CheckoutUrl);
             Assert.AreEqual(cart.CartGuid, response.CartGuid);
         }
+
+        [TestMethod]
+        public void PushToCart_AddItemMkp_OperationSuccess()
+        {
+            var getProduct = _openApiProxyClient.GetProduct(new GetProductRequest
+            {
+                ProductIdList = new List<string> { "nikd52001855vr2" },
+                Scope = new GetProductRequestScope
+                {
+                    Ean = true,
+                    Offers = true
+                }
+            });
+
+            Assert.IsTrue(getProduct.OperationSuccess);
+            Assert.IsTrue(getProduct.Products != null && getProduct.Products.Any());
+
+            var offer = getProduct.Products[0].Offers.First(o => o.Seller.Id > 0);
+
+            var request = new PushToCartRequest
+            {
+                ProductId = getProduct.Products[0].Id,
+                OfferId = offer.Id,
+                SellerId = offer.Seller.Id,
+                Quantity = 1,
+                SizeId = null
+            };
+
+            var response = _openApiProxyClient.PushToCart(request);
+
+            Assert.IsNotNull(response);
+            Assert.IsTrue(response.OperationSuccess);
+            Assert.AreEqual("NoError", response.ErrorType);
+            Assert.IsTrue(string.IsNullOrEmpty(response.ErrorMessage));
+            Assert.IsNotNull(response.CartGuid);
+            Assert.IsNotNull(response.CheckoutUrl);
+        }
+
+        [TestMethod]
+        public void PushToCart_AddItemMkpWithVariant_OperationSuccess()
+        {
+            var getProduct = _openApiProxyClient.GetProduct(new GetProductRequest
+            {
+                ProductIdList = new List<string> { "mp02814077" },
+                Scope = new GetProductRequestScope
+                {
+                    Ean = true,
+                    Offers = true
+                }
+            });
+
+            Assert.IsTrue(getProduct.OperationSuccess);
+            Assert.IsTrue(getProduct.Products != null && getProduct.Products.Any());
+
+            var offer = getProduct.Products[0].Offers.First(o => o.Seller.Id > 0);
+
+            var request = new PushToCartRequest
+            {
+                ProductId = getProduct.Products[0].Id,
+                OfferId = offer.Id,
+                SellerId = offer.Seller.Id,
+                Quantity = 1,
+                SizeId = offer.Sizes.First(s => s.IsAvailable).Id
+            };
+
+            var response = _openApiProxyClient.PushToCart(request);
+
+            Assert.IsNotNull(response);
+            Assert.IsTrue(response.OperationSuccess);
+            Assert.AreEqual("NoError", response.ErrorType);
+            Assert.IsTrue(string.IsNullOrEmpty(response.ErrorMessage));
+            Assert.IsNotNull(response.CartGuid);
+            Assert.IsNotNull(response.CheckoutUrl);
+        }
     }
 }


fix e3 schedule lookup

fix e3 schedule lookup

--- CompatBot/Commands/E3.cs
+++ CompatBot/Commands/E3.cs
@@ -49,8 +49,8 @@
                     return;
                 }

-                var currentEvent = await db.E3Schedule.OrderBy(e => e.End).FirstOrDefaultAsync(e => e.End >= currentTicks).ConfigureAwait(false);
-                var nextEvent = await db.E3Schedule.OrderBy(e => e.Start).FirstOrDefaultAsync(e => e.Start >= currentTicks).ConfigureAwait(false);
+                var currentEvent = await db.E3Schedule.OrderBy(e => e.End).FirstOrDefaultAsync(e => e.Start <= currentTicks && e.End >= currentTicks).ConfigureAwait(false);
+                var nextEvent = await db.E3Schedule.OrderBy(e => e.Start).FirstOrDefaultAsync(e => e.Start > currentTicks).ConfigureAwait(false);
                 var msg = $"E3 {current.Year} is already in progress!\n";
                 if (currentEvent != null)
                     msg += $"Current event: {currentEvent.Name} (going for {FormatCountdown(current - currentEvent.Start.AsUtc())})\n";


Piccolissima Correzione diretta

Piccolissima Correzione diretta


language is weird

language is weird

--- CompatBot/EventHandlers/IsTheGamePlayableHandler.cs
+++ CompatBot/EventHandlers/IsTheGamePlayableHandler.cs
@@ -15,7 +15,7 @@
     {
         private const RegexOptions DefaultOptions = RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.Singleline | RegexOptions.ExplicitCapture;
         private static readonly Regex GameNameStatusMention1 = new Regex(
-            @"(\b((is|does|can I play|any(one|1) tr(y|ied)|(wonder(ing)?|me|knows?) if)\s+)(?<game_title_1>.+?)\s+((now|currently|at all|possibly|fully|(on (this|the) )emu(lator))\s+)?((it?s )?playable|work(s|ing)?|runs?))\b" +
+            @"(\b((is|does|can I play|any(one|1) tr(y|ied)|how's|(wonder(ing)?|me|knows?) if)\s+)(?<game_title_1>.+?)\s+((now|currently|at all|possibly|fully|(on (this|the) )emu(lator))\s+)?((it?s )?playable|work(s|ing)?|runs?|doing))\b" +
             @"|(\b((can I (play|run)|any(one|1) tr(y|ied)|compat[ai]bility (with|of))\s+)(?<game_title_2>.+?)(\s+((now|currently|at all|possibly|fully)\s+)?((it?s )?playable|work(s|ing)?|on (it|this))\b|\?|$))" +
             @"|(^(?<game_title_3>.+?)\s+((is )?(playable|work(s|ing)?))\?)",
             DefaultOptions


Removed whitespace

Removed whitespace

git-svn-id: 95472bb50cfb75dbf91fed26dc933cae36d5c45c@37 1ca100b6-b014-4248-a4f8-5dbb9f49130a

--- Example3/CustomComponentBase.cs
+++ Example3/CustomComponentBase.cs
@@ -10,7 +10,7 @@
     {
         public CustomComponentBase(iCalObject parent) : base(parent) { }
         static public new ComponentBase Create(iCalObject parent, string name)
-        {
+        {
             switch (name)
             {
                 case "VEVENT":


Improve notification muting by pausing instead of clearing it

--- Core/FormNotification.cs
+++ Core/FormNotification.cs
@@ -77,6 +77,15 @@
         public EventHandler Initialized;
         private bool isInitialized;

+        private int pauseCounter;
+        private bool pausedDuringNotification;
+
+        public bool IsPaused{
+            get{
+                return pauseCounter > 0;
+            }
+        }
+
         private static int BaseClientWidth{
             get{
                 int level = TweetNotification.FontSizeLevel;
@@ -127,6 +136,10 @@
             if (flags.HasFlag(NotificationFlags.AutoHide)){
                 Program.UserConfig.MuteToggled += Config_MuteToggled;
                 Disposed += (sender, args) => Program.UserConfig.MuteToggled -= Config_MuteToggled;
+
+                if (Program.UserConfig.MuteNotifications){
+                    PauseNotification();
+                }
             }

             mouseHookDelegate = MouseHookProc;
@@ -186,10 +199,10 @@

         private void Config_MuteToggled(object sender, EventArgs e){
             if (Program.UserConfig.MuteNotifications){
-                HideNotification(true);
-            }
-            else if (tweetQueue.Count > 0){
-                LoadNextNotification();
+                PauseNotification();
+            }
+            else{
+                ResumeNotification();
             }
         }

@@ -236,7 +249,7 @@
         // notification methods

         public void ShowNotification(TweetNotification notification){
-            if (Program.UserConfig.MuteNotifications){
+            if (IsPaused){
                 tweetQueue.Enqueue(notification);
             }
             else{
@@ -286,6 +299,29 @@
             }
             else{
                 timerProgress.Stop();
+            }
+        }
+
+        public void PauseNotification(){
+            if (pauseCounter++ == 0){
+                pausedDuringNotification = IsNotificationVisible;
+
+                if (IsNotificationVisible){
+                    Location = ControlExtensions.InvisibleLocation;
+                    timerProgress.Stop();
+                    StopMouseHook();
+                }
+            }
+        }
+
+        public void ResumeNotification(){
+            if (pauseCounter > 0 && --pauseCounter == 0){
+                if (pausedDuringNotification){
+                    OnNotificationReady();
+                }
+                else if (tweetQueue.Count > 0){
+                    LoadNextNotification();
+                }
             }
         }


Changed texted to required value

Changed texted to required value

--- src/SFA.DAS.EAS.Web/Views/EmployerAgreement/NextSteps.cshtml
+++ src/SFA.DAS.EAS.Web/Views/EmployerAgreement/NextSteps.cshtml
@@ -9,7 +9,7 @@

-            What's next
+            What next?

         <form method="POST" action="@Url.Action("NextSteps")">
             @Html.AntiForgeryToken()


Update for auto load in plugins and bin folder.

--- Core/Simulation/World.cs
+++ Core/Simulation/World.cs
@@ -301,10 +301,18 @@
 		#region Public Static Methods

 		public static ArrayList GetAvailableRaces() {
-
+			// Init
 			ArrayList races = new ArrayList();
+
+			// Get from bin - this has prio
 			races.AddRange(getAvailableRacesFromFolder("bin"));
-			races.AddRange(getAvailableRacesFromFolder("plugins"));
+
+			// Get from plugins - only add if new
+			ArrayList plugins = getAvailableRacesFromFolder("plugins");
+			foreach(System.Type type in plugins) {
+				if(races.Contains(type) == false) races.Add(type);
+			}
+
 			return races;
 		}


[CupCake.Debug] Throw an exception if something wrong happens

--- CupCake.Debug/Program.cs
+++ CupCake.Debug/Program.cs
@@ -10,7 +10,7 @@
 {
     internal class Program
     {
-        private static void Main(string[] args)
+        private static int Main(string[] args)
         {
             if (args.Length > 0)
             {
@@ -27,12 +27,15 @@
                 else
                 {
                     Console.WriteLine("Invalid command specified.");
+                    return 1;
                 }
             }
             else
             {
                 Console.WriteLine("Please specify a command to run");
+                return 1;
             }
+            return 0;
         }

         private static void Deploy(IEnumerable<string> args)
@@ -88,10 +91,9 @@
                     }
                 }
             }
-            catch (SocketException)
+            catch (SocketException ex)
             {
-                Console.WriteLine("Problem communicating with the client, make sure it is running.");
-                return;
+                throw new Exception("Problem communicating with the client, make sure it is running.", ex);
             }

             AppDomain.CurrentDomain.ExecuteAssembly(path + "\\CupCake.Server.exe", new[] { "--envpath", path, "--debug" });


less code

less code

--- King.Service/RoleTaskManager.cs
+++ King.Service/RoleTaskManager.cs
@@ -130,15 +130,21 @@

             if (null == this.tasks)
             {
-                var t = (from f in this.factories
-                         where f != null
-                         select f.Tasks(passthrough)).Where(f => f != null).SelectMany(f => f);
-
-                if (null != t && t.Any())
+                var tsks = new List<IRunnable>();
+
+                foreach (var t in from f in this.factories select f.Tasks(passthrough))
+                {
+                    if (t != null)
+                    {
+                        tsks.AddRange(t);
+                    }
+                }
+
+                if (null != tsks && tsks.Any())
                 {
                     Trace.TraceInformation("Tasks loading");

-                    this.tasks = new ReadOnlyCollection<IRunnable>(t.ToList());
+                    this.tasks = new ReadOnlyCollection<IRunnable>(tsks.ToList());

                     Trace.TraceInformation("Tasks loaded");
                 }


Revert "Let FindOuter throw when no outer point can be found."

This reverts commit a5d37af02f792977f2d610d871fa35fbb6db5c86.

--- LibItemCollage/ItemExtractor.cs
+++ LibItemCollage/ItemExtractor.cs
@@ -67,9 +67,8 @@
         private Point FindOuter(Bitmap bmp, int x, int y, int step = 1, int searchWidth = 20)
         {
             var delta = step < 0 ? -1 : 1;
-            // this throws if no outer point can be found
             var target = Helper.Range(1, searchWidth, Math.Abs(step))
-                .First(dx => bmp.IsBlackAt(x + delta * dx, y));
+                .FirstOrDefault(dx => bmp.IsBlackAt(x + delta * dx, y));
             target = x + delta * target;

             // if possible, move slightly to the left or right to get to the