Update User.cs

Update User.cs

Added support for custom fields

--- ZendeskApi_v2/Models/Users/User.cs
+++ ZendeskApi_v2/Models/Users/User.cs
@@ -91,5 +91,8 @@

         [JsonProperty("remote_photo_url")]
         public string RemotePhotoUrl { get; set; }
+
+        [JsonProperty("user_fields")]
+        public IDictionary<string, string> CustomFields { get; set; }
     }
 }


Some refactoring and adding basic tag update methods

--- inbox_net/InboxClient.cs
+++ inbox_net/InboxClient.cs
@@ -49,23 +49,13 @@
         public async Task<Namespace> GetFirstNamespace()
         {
             string json = await HttpGet(GenerateUri(MethodURIs.Namespace));
-            List<Namespace> namespaces = new List<Namespace>();
-            if (json != null)
-            {
-                namespaces = await DeserializeObjectAsync<List<Namespace>>(json);
-            }
-            return namespaces.First();
+            return (await DeserializeObjectAsync<IEnumerable<Namespace>>(json)).First();
         }

         public async Task<Namespace> GetNamespace(string _namespace)
         {
             string json = await HttpGet(GenerateUri(MethodURIs.Namespace + _namespace));
-            Namespace ns = null;
-            if (json != null)
-            {
-                ns = await DeserializeObjectAsync<Namespace>(json);
-            }
-            return ns;
+            return await DeserializeObjectAsync<Namespace>(json);
         }

@@ -77,36 +67,21 @@
         public async Task<IEnumerable<Tag>> GetTags()
         {
             string json = await HttpGet(GenerateUri(string.Format(MethodURIs.Tags, this.Namespace)));
-            IEnumerable<Tag> tags = null;
-            if (json != null)
-            {
-                tags = await DeserializeObjectAsync<IEnumerable<Tag>>(json);
-            }
-            return tags;
+            return await DeserializeObjectAsync<IEnumerable<Tag>>(json);
         }

         public async Task<Tag> GetTag(string tagID)
         {
             string json = await HttpGet(GenerateUri(string.Format(MethodURIs.Tags, this.Namespace) + tagID, null));
-            Tag tag = null;
-            if (json != null)
-            {
-                tag = await DeserializeObjectAsync<Tag>(json);
-            }
-            return tag;
-        }
-
-        public async Task<Tag> NewCustomTag(string tagName)
+            return await DeserializeObjectAsync<Tag>(json);
+        }
+
+        public async Task<Tag> CreateCustomTag(string tagName)
         {
             List<KeyValuePair<string, string>> parameters = new List<KeyValuePair<string, string>>();
             parameters.Add(new KeyValuePair<string, string>("name", tagName));
             string json = await HttpPost(GenerateUri(string.Format(MethodURIs.Tags, this.Namespace)), GenerateRequestBody(parameters));
-            Tag tag = null;
-            if (json != null)
-            {
-                tag = await DeserializeObjectAsync<Tag>(json);
-            }
-            return tag;
+            return await DeserializeObjectAsync<Tag>(json);
         }

         public async Task<Tag> RenameCustomTag(string tagID, string newTagName)
@@ -114,12 +89,7 @@
             List<KeyValuePair<string, string>> parameters = new List<KeyValuePair<string, string>>();
             parameters.Add(new KeyValuePair<string, string>("name", newTagName));
             string json = await HttpPut(GenerateUri(string.Format(MethodURIs.Tags, this.Namespace) + tagID), GenerateRequestBody(parameters));
-            Tag tag = null;
-            if (json != null)
-            {
-                tag = await DeserializeObjectAsync<Tag>(json);
-            }
-            return tag;
+            return await DeserializeObjectAsync<Tag>(json);
         }

 #endregion
@@ -130,12 +100,7 @@
         public async Task<Thread> GetThread(string thread_id)
         {
             string json = await HttpGet(GenerateUri(string.Format(MethodURIs.Thread, this.Namespace, thread_id)));
-            Thread thread = null;
-            if (json != null)
-            {
-                thread = await DeserializeObjectAsync<Thread>(json));
-            }
-            return thread;
+            return await DeserializeObjectAsync<Thread>(json);
         }

         public async Task<IEnumerable<Thread>> GetThreads(string subject = null, string any_email = null, string to = null, string from = null, string cc = null,
@@ -144,27 +109,37 @@
         {
             List<KeyValuePair<string, string>> parameters = ValidateGetThreadsParams(subject, any_email, to, from, cc, bcc, tag, filename, limit, offset, last_message_before, last_message_after, started_before, started_after);
             string json = await HttpGet(GenerateUri(string.Format(MethodURIs.Threads, this.Namespace), parameters));
-            IEnumerable<Thread> threads = null;
-            if (json != null)
-            {
-                threads = await DeserializeObjectAsync<IEnumerable<Thread>>(json);
-            }
-            return threads;
+            return await DeserializeObjectAsync<IEnumerable<Thread>>(json);
         }

         public async Task<Thread> UpdateThreadTags(string thread_id, string[] add_tags)
         {
             List<KeyValuePair<string, string>> parameters = new List<KeyValuePair<string, string>>();
             parameters.Add(new KeyValuePair<string, string>("add_tags", StringsToJsonArray(add_tags)));
+            return await SendUpdateTagsRequest(thread_id, parameters);
+        }
+
+        public async Task<Thread> MarkThreadAsRead(string thread_id)
+        {
+            List<KeyValuePair<string, string>> parameters = new List<KeyValuePair<string, string>>();
+            string[] remove_tags = { "unread" };
+            parameters.Add(new KeyValuePair<string, string>("remove_tags", StringsToJsonArray(remove_tags)));
+            return await SendUpdateTagsRequest(thread_id, parameters);
+        }
+
+        public async Task<Thread> MarkThreadAsUnread(string thread_id)
+        {
+            List<KeyValuePair<string, string>> parameters = new List<KeyValuePair<string, string>>();
+            string[] add_tags = { "unread" };
+            parameters.Add(new KeyValuePair<string, string>("add_tags", StringsToJsonArray(add_tags)));
+            return await SendUpdateTagsRequest(thread_id, parameters);
+        }
+
+        private async Task<Thread> SendUpdateTagsRequest(string thread_id, List<KeyValuePair<string,string>> parameters)
+        {
             string json = await HttpPut(GenerateUri(string.Format(MethodURIs.Thread, this.Namespace, thread_id)), GenerateRequestBody(parameters));
-            Thread thread = null;
-            if (json != null)
-            {
-                thread = await DeserializeObjectAsync<Thread>(json);
-            }
-            return thread;
-        }
-
+            return await DeserializeObjectAsync<Thread>(json);
+        }

@@ -350,7 +325,11 @@

         private async Task<T> DeserializeObjectAsync<T>(string json)
         {
-            return await Task.Factory.StartNew(() => JsonConvert.DeserializeObject<T>(json));
+            if (json != null)
+            {
+                return await Task.Factory.StartNew(() => JsonConvert.DeserializeObject<T>(json));
+            }
+            return default(T);
         }

     }


Show transaction number too.

Show transaction number too.

Note, this is a new page that we didn't have before. We may want to change what is displayed

--- CRP.Mvc/Views/Payments/Receipt.cshtml
+++ CRP.Mvc/Views/Payments/Receipt.cshtml
@@ -6,9 +6,14 @@

Successful Transaction

You have successfully paid for and registered for the following event:

+
Please print for your own records

         Item:
         @Model.Item.Name
+

+

+        Transaction:
+        @Model.Transaction.TransactionNumber

         Amount:


formatting

formatting

--- CRP.Mvc/Views/QuestionSet/List.cshtml
+++ CRP.Mvc/Views/QuestionSet/List.cshtml
@@ -16,7 +16,7 @@

-        @Html.ActionLink("Create", "Create")
+        @Html.ActionLink("Create", "Create", null, new {@class="btn btn-primary"})


add ET support for value keywords

add ET support for value keywords

--- CobaltAHK/ExpressionTree/Generator.cs
+++ CobaltAHK/ExpressionTree/Generator.cs
@@ -24,6 +24,12 @@
 				return GenerateFunctionDefinition((FunctionDefinitionExpression)expr, scope);
 			} else if (expr is CustomVariableExpression) {
 				return scope.ResolveVariable(((CustomVariableExpression)expr).Name);
+			} else if (expr is ValueKeywordExpression) {
+				switch (((ValueKeywordExpression)expr).Keyword) {
+					case Syntax.ValueKeyword.False: return DLR.Expression.Constant(false);
+					case Syntax.ValueKeyword.True:  return DLR.Expression.Constant(true);
+					case Syntax.ValueKeyword.Null:  return DLR.Expression.Constant(null);
+				}
 			} else if (expr is BinaryExpression) {
 				return GenerateBinaryExpression((BinaryExpression)expr, scope);
 			} else if (expr is StringLiteralExpression) {


Add missing xmldoc

Add missing xmldoc

--- Source/tusdotnet/Interfaces/ITusConfiguration.cs
+++ Source/tusdotnet/Interfaces/ITusConfiguration.cs
@@ -5,10 +5,13 @@

 namespace tusdotnet.Interfaces
 {
+    /// <summary>
+    /// Represents the configuration used by tusdotnet.
+    /// </summary>
     public interface ITusConfiguration
     {
         /// <summary>
-        /// The url path to listen for uploads on, e.g. "/files"
+        /// The url path to listen for uploads on (e.g. "/files").
         /// If the site is located in a subpath (e.g. https://example.org/mysite) it must also be included (e.g. /mysite/files)
         /// </summary>
         string UrlPath { get; }


MemoryRender update

MemoryRender update

更新OSU b20170222.3的内存地址

--- OtherPlugins/MemoryReader/Listen/OSUListenerManager.cs
+++ OtherPlugins/MemoryReader/Listen/OSUListenerManager.cs
@@ -99,8 +99,8 @@
             m_memory_finder = new MemoryFinder(osu);
             m_memory_scanner = new MemoryScanner(osu)
             {
-                BeginAddress = 0x3004A8C,
-                EndAddress = 0x8004A8C,
+                BeginAddress = 0x3004430,
+                EndAddress = 0x8004430,
                 InterVal = 0x0010000,
                 BufferSize = 4,
                 AddressFilter = (address,target) =>
@@ -259,7 +259,7 @@
             double acc = 0.0;
             try
             {
-                acc = m_memory_finder.GetMemoryDouble(new List<int>() { -0x320, 0x124, 0x384, 0x3c, 0x24, 0x25c, 0x48, 0x14 });
+                acc = m_memory_finder.GetMemoryDouble(new List<int>() { (Int32)m_beatmap_id_address+0x214, 0x48, 0x14 },false);
             }
             catch (ThreadStackNoFoundException)
             {
@@ -273,7 +273,7 @@
             double hp = 0.0;
             try
             {
-                hp = m_memory_finder.GetMemoryDouble(new List<int>() { -0x320, 0x124, 0x384, 0x3c, 0x24, 0x25c, 0x40, 0x1c });
+                hp = m_memory_finder.GetMemoryDouble(new List<int>() { (Int32)m_beatmap_id_address + 0x214, 0x40, 0x1c },false);
             }
             catch (ThreadStackNoFoundException)
             {
@@ -287,7 +287,7 @@
             int cb = 0;
             try
             {
-                cb = m_memory_finder.GetMemoryInt(new List<int>() { -0x320, 0x124, 0x384, 0x3c, 0x24, 0x25c, 0x34, 0x18 });
+                cb = m_memory_finder.GetMemoryInt(new List<int>() { (Int32)m_beatmap_id_address + 0x214, 0x34, 0x18 },false);
             }
             catch (ThreadStackNoFoundException)
             {
@@ -315,8 +315,8 @@
             ModsInfo mods = new ModsInfo();
             try
             {
-                int salt = m_memory_finder.GetMemoryInt(new List<Int32>() { -0x320, 0x124, 0x384, 0x3c, 0x24, 0x25c, 0x38, 0x1c, 0x8 });
-                int mod = m_memory_finder.GetMemoryInt(new List<Int32>() { -0x320, 0x124, 0x384, 0x3c, 0x24, 0x25c, 0x38, 0x1c, 0xc });//混淆后的mods
+                int salt = m_memory_finder.GetMemoryInt(new List<Int32>() { (Int32)m_beatmap_id_address + 0x214, 0x38, 0x1c, 0x8 },false);
+                int mod = m_memory_finder.GetMemoryInt(new List<Int32>() { (Int32)m_beatmap_id_address + 0x214, 0x38, 0x1c, 0xc },false);//混淆后的mods
                 mods.Mod = (ModsInfo.Mods)(mod ^ salt);
             }
             catch (ThreadStackNoFoundException)


Make Sharpmake.Error serializable

Make Sharpmake.Error serializable

--- Sharpmake/Exception.cs
+++ Sharpmake/Exception.cs
@@ -16,6 +16,7 @@

 namespace Sharpmake
 {
+    [Serializable]
     public class Error : Exception
     {
         public Error()


IPv4 over IPv4 support. Thanks wolfson292.

--- PcapDotNet/src/PcapDotNet.Packets/IpV4/IpV4Datagram.cs
+++ PcapDotNet/src/PcapDotNet.Packets/IpV4/IpV4Datagram.cs
@@ -227,6 +227,19 @@
             get { return Tcp; }
         }

+         /// <summary>
+        /// The payload of the datagram as an IPv4 datagram (IP over IP).
+        /// </summary>
+        public IpV4Datagram IpV4
+        {
+            get
+            {
+                if (_ipV4 == null && Length >= HeaderLength)
+                    _ipV4 = new IpV4Datagram(Buffer, StartOffset + HeaderLength, Length - HeaderLength);
+                return _ipV4;
+            }
+        }
+
         /// <summary>
         /// The payload of the datagram as an ICMP datagram.
         /// </summary>
@@ -436,6 +449,7 @@
         private bool? _isHeaderChecksumCorrect;
         private bool? _isTransportChecksumCorrect;
         private IpV4Options _options;
+        private IpV4Datagram _ipV4;
         private IcmpDatagram _icmp;
         private IgmpDatagram _igmp;
         private GreDatagram _gre;


Made devices disconnect/reconnect when sleeping and resuming

Might fix #1028

--- Project-Aurora/Project-Aurora/Devices/DeviceManager.cs
+++ Project-Aurora/Project-Aurora/Devices/DeviceManager.cs
@@ -7,6 +7,7 @@
 using System.Drawing;
 using System.IO;
 using System.Threading;
+using Microsoft.Win32;

 namespace Aurora.Devices
 {
@@ -155,6 +156,23 @@
                     }
                 }
             }
+
+            SystemEvents.PowerModeChanged += SystemEvents_PowerModeChanged;
+        }
+
+        private void SystemEvents_PowerModeChanged(object sender, PowerModeChangedEventArgs e)
+        {
+            switch (e.Mode)
+            {
+                case PowerModes.Suspend:
+                    Global.logger.Info("Suspending Devices");
+                    this.Shutdown();
+                    break;
+                case PowerModes.Resume:
+                    Global.logger.Info("Resuming Devices");
+                    this.InitializeOnce();
+                    break;
+            }
         }

         public void RegisterVariables()


Fix for devices not resuming after pc wakes from sleep

fixes #1361
fixes #1301

--- Project-Aurora/Project-Aurora/Devices/DeviceManager.cs
+++ Project-Aurora/Project-Aurora/Devices/DeviceManager.cs
@@ -78,7 +78,7 @@
         private bool anyInitialized = false;
         private bool retryActivated = false;
         private const int retryInterval = 5000;
-        private const int retryAttemps = 3;
+        private const int retryAttemps = 5;
         private int retryAttemptsLeft = retryAttemps;
         private Thread retryThread;
         private bool suspended = false;
@@ -162,14 +162,16 @@
             SystemEvents.PowerModeChanged += SystemEvents_PowerModeChanged;
             SystemEvents.SessionSwitch += SystemEvents_SessionSwitch;
         }
-
+        bool resumed = false;
         private void SystemEvents_SessionSwitch(object sender, SessionSwitchEventArgs e)
         {
-            if (e.Reason.Equals(SessionSwitchReason.SessionUnlock) && suspended)
-            {
-                Global.logger.Info("Resuming Devices");
+            Global.logger.Info($"SessionSwitch triggered with {e.Reason}");
+            if (e.Reason.Equals(SessionSwitchReason.SessionUnlock) && (suspended || resumed))
+            {
+                Global.logger.Info("Resuming Devices -- Session Switch Session Unlock");
                 suspended = false;
-                this.InitializeOnce();
+                resumed = false;
+                this.Initialize(true);
             }
         }

@@ -183,8 +185,11 @@
                     this.Shutdown();
                     break;
                 case PowerModes.Resume:
-                    //Global.logger.Info("Resuming Devices");
-                    //this.InitializeOnce();
+                    Global.logger.Info("Resuming Devices -- PowerModes.Resume");
+                    Thread.Sleep(TimeSpan.FromSeconds(2));
+                    resumed = true;
+                    suspended = false;
+                    this.InitializeOnce();
                     break;
             }
         }
@@ -196,7 +201,7 @@
                 Global.Configuration.VarRegistry.Combine(device.Device.GetRegisteredVariables());
         }

-        public void Initialize()
+        public void Initialize(bool forceRetry = false)
         {
             if (suspended)
                 return;
@@ -222,9 +227,11 @@
                 NewDevicesInitialized?.Invoke(this, new EventArgs());
             }

-            if (devicesToRetryNo > 0 && !retryActivated)
+            if (devicesToRetryNo > 0 && (retryThread == null || forceRetry || retryThread?.ThreadState == System.Threading.ThreadState.Stopped))
             {
                 retryActivated = true;
+                if (forceRetry)
+                    retryThread?.Abort();
                 retryThread = new Thread(RetryInitialize);
                 retryThread.Start();
                 return;
@@ -238,6 +245,8 @@
             for (int try_count = 0; try_count < retryAttemps; try_count++)
             {
                 Global.logger.Info("Retrying Device Initialization");
+                if (suspended)
+                    continue;
                 int devicesAttempted = 0;
                 bool _anyInitialized = false;
                 foreach (DeviceContainer device in devices)


fixing sqlite tests

fixing sqlite tests

--- src/dexih.connections.sql/dexih.connections.sql.cs
+++ src/dexih.connections.sql/dexih.connections.sql.cs
@@ -408,7 +408,7 @@
                                     var param = cmd.CreateParameter();
                                     param.ParameterName = "@col" + i.ToString();
                                     param.DbType = GetDbType(query.UpdateColumns[i].Column.DataType);
-                                    param.Size = -1;
+                                    // param.Size = -1;

                                     // GUID's get parameterized as binary.  So need to explicitly convert to string.
                                     if (query.UpdateColumns[i].Column.DataType == ETypeCode.Guid)
@@ -618,31 +618,29 @@
         {
             try
             {
-                using (var cmd = connection.CreateCommand())
-                {
-                    cmd.CommandText = table.UseQuery ? table.QueryString : BuildSelectQuery(table, query);
-                    DbDataReader reader;
-
-                    try
-                    {
-                        reader = await cmd.ExecuteReaderAsync(cancellationToken);
-                    }
-                    catch (Exception ex)
-                    {
+                var cmd = connection.CreateCommand();
+                cmd.CommandText = table.UseQuery ? table.QueryString : BuildSelectQuery(table, query);
+                DbDataReader reader;
+
+                try
+                {
+                    reader = await cmd.ExecuteReaderAsync(cancellationToken);
+                }
+                catch (Exception ex)
+                {
 #if DEBUG
-                        throw new ConnectionException($"The reader for table {table.Name} returned failed.  {ex.Message}.  The command was: {cmd.CommandText}", ex);
+                    throw new ConnectionException($"The reader for table {table.Name} returned failed.  {ex.Message}.  The command was: {cmd.CommandText}", ex);
 #else
                         throw new ConnectionException($"The reader for table {table.Name} returned failed.  {ex.Message}", ex);
 #endif
-                    }
-
-                    if (reader == null)
-                    {
-                        throw new ConnectionException($"The reader for table {table.Name} returned null.");
-                    }
-
-                    return reader;
-                }
+                }
+
+                if (reader == null)
+                {
+                    throw new ConnectionException($"The reader for table {table.Name} returned null.");
+                }
+                return reader;
+
             }
             catch (Exception ex)
             {


Fix #283: ignore language specific punctuation in Resource warnings

--- ResXManager.Model/ResourceTableEntryRulePunctuation.cs
+++ ResXManager.Model/ResourceTableEntryRulePunctuation.cs
@@ -79,7 +79,8 @@
         /// <returns></returns>
         private static bool IsPunctuation(char value)
         {
-            const string excluded = "'#\"\\&_";
+            // exclude quotes, special chars (\#), hot-key prefixes (&_), language specifics with no common equivalent (¡¿).
+            const string excluded = "'\"\\#&_¡¿";

             // ReSharper disable once SwitchStatementMissingSomeCases
             switch (char.GetUnicodeCategory(value))


Added implicit conversion operator to SafeCoTaskMemStruct and SafeHGlobalStruct from nullable struct.

--- Core/InteropServices/SafeMemStruct.cs
+++ Core/InteropServices/SafeMemStruct.cs
@@ -151,6 +151,11 @@
 		/// <param name="allocatedBytes">The number of bytes allocated to <paramref name="ptr"/>.</param>
 		[ExcludeFromCodeCoverage]
 		public SafeCoTaskMemStruct(IntPtr ptr, bool ownsHandle = true, SizeT allocatedBytes = default) : base(ptr, ownsHandle, allocatedBytes) { }
+
+		/// Performs an implicit conversion from <see cref="System.Nullable{TStruct}"/> to <see cref="SafeCoTaskMemStruct{TStruct}"/>.
+		/// <param name="s">The value of the <typeparamref name="TStruct"/> instance or <see langword="null"/>.</param>
+		/// <returns>The resulting <see cref="SafeCoTaskMemStruct{TStruct}"/> instance from the conversion.</returns>
+		public static implicit operator SafeCoTaskMemStruct<TStruct>(TStruct? s) => s.HasValue ? new SafeCoTaskMemStruct<TStruct>(s.Value) : new SafeCoTaskMemStruct<TStruct>(IntPtr.Zero);
 	}

 	///
@@ -175,5 +180,10 @@
 		/// <param name="allocatedBytes">The number of bytes allocated to <paramref name="ptr"/>.</param>
 		[ExcludeFromCodeCoverage]
 		public SafeHGlobalStruct(IntPtr ptr, bool ownsHandle = true, SizeT allocatedBytes = default) : base(ptr, ownsHandle, allocatedBytes) { }
+
+		/// Performs an implicit conversion from <see cref="System.Nullable{TStruct}"/> to <see cref="SafeHGlobalStruct{TStruct}"/>.
+		/// <param name="s">The value of the <typeparamref name="TStruct"/> instance or <see langword="null"/>.</param>
+		/// <returns>The resulting <see cref="SafeHGlobalStruct{TStruct}"/> instance from the conversion.</returns>
+		public static implicit operator SafeHGlobalStruct<TStruct>(TStruct? s) => s.HasValue ? new SafeHGlobalStruct<TStruct>(s.Value) : new SafeHGlobalStruct<TStruct>(IntPtr.Zero);
 	}
 }


Missing using

Missing using

--- RoslynTools/Controllers/Api/ConvertToHtmlController.cs
+++ RoslynTools/Controllers/Api/ConvertToHtmlController.cs
@@ -5,6 +5,7 @@
 using System.Web.Http;
 using Microsoft.CodeAnalysis;
 using Microsoft.CodeAnalysis.Classification;
+using Microsoft.CodeAnalysis.Formatting;
 using Microsoft.CodeAnalysis.Text;

 namespace RoslynTools.Controllers.Api
@@ -17,33 +18,37 @@

             try
             {
-                var workspace = new CustomWorkspace();
-                var solution = workspace.CurrentSolution;
-                var project = solution.AddProject("projectName", "assemblyName", LanguageNames.CSharp);
-                var document = project.AddDocument("name.cs", code);
-                var text = await document.GetTextAsync();
+                using (var workspace = new CustomWorkspace())
+                {
+                    var solution = workspace.CurrentSolution;
+                    var project = solution.AddProject("newproject", "newassembly", LanguageNames.CSharp);
+                    var document = project.AddDocument("newfile.cs", code);
+                    var text = await document.GetTextAsync();

-                var classifiedSpans =
-                    (await Classifier.GetClassifiedSpansAsync(document, TextSpan.FromBounds(0, text.Length)))
-                        .ToList();
+                    document = await Formatter.FormatAsync(document);

-                var sb = new StringBuilder();
-                var current = 0;
-                foreach (var classifiedSpan in classifiedSpans)
-                {
-                    var span = classifiedSpan.TextSpan;
-                    if (span.Start > current)
+                    var classifiedSpans =
+                        (await Classifier.GetClassifiedSpansAsync(document, TextSpan.FromBounds(0, text.Length)))
+                            .ToList();
+
+                    var sb = new StringBuilder();
+                    var current = 0;
+                    foreach (var classifiedSpan in classifiedSpans)
                     {
-                        sb.Append(code.Substring(current, span.Start - current));
+                        var span = classifiedSpan.TextSpan;
+                        if (span.Start > current)
+                        {
+                            sb.Append(code.Substring(current, span.Start - current));
+                        }
+
+                        sb.AppendFormat("{0}", code.Substring(span.Start, span.Length),
+                            classifiedSpan.ClassificationType.Replace(' ', '-'));
+
+                        current = span.End;
                     }

-                    sb.AppendFormat("{0}", code.Substring(span.Start, span.Length),
-                        classifiedSpan.ClassificationType.Replace(' ', '-'));
-
-                    current = span.End;
+                    return sb.ToString();
                 }
-
-                return sb.ToString();
             }
             catch (Exception)
             {


FixtureState tests fixed

FixtureState tests fixed

--- SS.Integration.Adapter.Tests/FixtureStateActorTests.cs
+++ SS.Integration.Adapter.Tests/FixtureStateActorTests.cs
@@ -45,9 +45,13 @@
         public void SetupTest()
         {
             SetupTestLogging();
-
+
             SettingsMock = new Mock<ISettings>();
-            var fi = new  FileInfo("../../Data/fixtureStates.json");
+            var location = Assembly.GetExecutingAssembly().Location ;
+            var directory = Path.GetDirectoryName(location);
+            string fileName = @"Data\fixtureStates.json";
+            var fullName = Path.Combine(directory, fileName);
+            var fi = new  FileInfo(fullName);
             var fixtureStatesFilePath = fi.FullName;
             Assert.IsTrue(File.Exists(fixtureStatesFilePath));
             SettingsMock.SetupGet(a => a.StateProviderPath).Returns(GetType().Assembly.Location);


use new net40 utility class for task delay

--- Samples/Metrics.StupidBenchmarks/FixedTimeBenchmark.cs
+++ Samples/Metrics.StupidBenchmarks/FixedTimeBenchmark.cs
@@ -45,7 +45,7 @@
                     var done = new CancellationTokenSource(duration);
 #else
                     var done = new CancellationTokenSource();
-                    ActionScheduler.Delay(duration.TotalMilliseconds)
+                    TaskUtils.Delay(duration)
                         .ContinueWith(t => done.Cancel());
 #endif
                     while (!done.IsCancellationRequested)


- v4.1.1

- v4.1.1

--- Shuttle.Core.Infrastructure/Properties/AssemblyInfo.cs
+++ Shuttle.Core.Infrastructure/Properties/AssemblyInfo.cs
@@ -26,10 +26,10 @@
 [assembly: AssemblyTitle("Shuttle.Core.Infrastructure for .NET Framework 4.6.1")]
 #endif

-[assembly: AssemblyVersion("4.1.0.0")]
+[assembly: AssemblyVersion("4.1.1.0")]
 [assembly: AssemblyCopyright("Copyright © Eben Roux 2010-2015")]
 [assembly: AssemblyProduct("Shuttle.Core")]
 [assembly: AssemblyCompany("Shuttle")]
 [assembly: AssemblyConfiguration("Release")]
-[assembly: AssemblyInformationalVersion("4.1.0")]
+[assembly: AssemblyInformationalVersion("4.1.1")]
 [assembly: ComVisible(false)]


fix using WorkflowActivityInfo.Scope

fix using WorkflowActivityInfo.Scope

--- Signum.Engine.Extensions/Workflow/CaseActivityLogic.cs
+++ Signum.Engine.Extensions/Workflow/CaseActivityLogic.cs
@@ -828,54 +828,54 @@
                 }
             }

-
+
             private static void ExecuteStep(CaseActivityEntity ca, DoneType doneType, WorkflowConnectionEntity firstConnection)
             {
                 using (WorkflowActivityInfo.Scope(new WorkflowActivityInfo { CaseActivity = ca, Connection = firstConnection }))
                 {
                     SaveEntity(ca.Case.MainEntity);
-
-                    ca.DoneBy = UserEntity.Current.ToLite();
-                    ca.DoneDate = TimeZoneManager.Now;
-                    ca.DoneType = doneType;
-                    ca.Case.Description = ca.Case.MainEntity.ToString().Trim().Etc(100);
-                    ca.Save();
-
-                    ca.Notifications()
-                       .UnsafeUpdate()
-                       .Set(a => a.State, a => a.User == UserEntity.Current.ToLite() ? CaseNotificationState.Done : CaseNotificationState.DoneByOther)
-                       .Execute();
-
-                    var ctx = new WorkflowExecuteStepContext
-                    {
-                        Case = ca.Case,
-                        CaseActivity = ca,
-                    };
-
-                    if (firstConnection != null)
-                    {
-                        if (firstConnection.Condition != null)
-                        {
-                            var jumpCtx = new WorkflowTransitionContext(ca.Case, ca, firstConnection);
-                            var alg = firstConnection.Condition.RetrieveFromCache().Eval.Algorithm;
-                            var result = alg.EvaluateUntyped(ca.Case.MainEntity, jumpCtx);
-                            if (!result)
-                                throw new ApplicationException(WorkflowMessage.JumpTo0FailedBecause1.NiceToString(firstConnection.To, firstConnection.Condition));
-                        }
-
-                        ctx.ExecuteConnection(firstConnection);
-                        if (!FindNext(firstConnection.To, ctx))
-                            return;
+                }
+
+                ca.DoneBy = UserEntity.Current.ToLite();
+                ca.DoneDate = TimeZoneManager.Now;
+                ca.DoneType = doneType;
+                ca.Case.Description = ca.Case.MainEntity.ToString().Trim().Etc(100);
+                ca.Save();
+
+                ca.Notifications()
+                   .UnsafeUpdate()
+                   .Set(a => a.State, a => a.User == UserEntity.Current.ToLite() ? CaseNotificationState.Done : CaseNotificationState.DoneByOther)
+                   .Execute();
+
+                var ctx = new WorkflowExecuteStepContext
+                {
+                    Case = ca.Case,
+                    CaseActivity = ca,
+                };
+
+                if (firstConnection != null)
+                {
+                    if (firstConnection.Condition != null)
+                    {
+                        var jumpCtx = new WorkflowTransitionContext(ca.Case, ca, firstConnection);
+                        var alg = firstConnection.Condition.RetrieveFromCache().Eval.Algorithm;
+                        var result = alg.EvaluateUntyped(ca.Case.MainEntity, jumpCtx);
+                        if (!result)
+                            throw new ApplicationException(WorkflowMessage.JumpTo0FailedBecause1.NiceToString(firstConnection.To, firstConnection.Condition));
                     }
-                    else
-                    {
-                        var connection = ca.WorkflowActivity.NextConnectionsFromCache(ConnectionType.Normal).SingleEx();
-                        if (!FindNext(connection, ctx))
-                            return;
-                    }
-
-                    FinishStep(ca.Case, ctx, ca);
-                }
+
+                    ctx.ExecuteConnection(firstConnection);
+                    if (!FindNext(firstConnection.To, ctx))
+                        return;
+                }
+                else
+                {
+                    var connection = ca.WorkflowActivity.NextConnectionsFromCache(ConnectionType.Normal).SingleEx();
+                    if (!FindNext(connection, ctx))
+                        return;
+                }
+
+                FinishStep(ca.Case, ctx, ca);
             }

             private static void FinishStep(CaseEntity @case, WorkflowExecuteStepContext ctx, CaseActivityEntity ca)
@@ -932,27 +932,24 @@
             {
                 var connection = boundaryEvent.NextConnectionsFromCache(ConnectionType.Normal).SingleEx();

-                using (WorkflowActivityInfo.Scope(new WorkflowActivityInfo { CaseActivity = ca, Connection= connection }))
-                {
-                    var @case = ca.Case;
-                    var ctx = new WorkflowExecuteStepContext
-                    {
-                        Case = @case,
-                        CaseActivity = ca,
-                    };
-
-                    ctx.ExecuteConnection(connection);
-                    if (!FindNext(connection.To, ctx))
-                        return;
-
-                    CreateNextActivities(@case, ctx, ca);
-
-                    new CaseActivityExecutedTimerEntity
-                    {
-                        BoundaryEvent = boundaryEvent.ToLite(),
-                        CaseActivity = ca.ToLite(),
-                    }.Save();
-                }
+                var @case = ca.Case;
+                var ctx = new WorkflowExecuteStepContext
+                {
+                    Case = @case,
+                    CaseActivity = ca,
+                };
+
+                ctx.ExecuteConnection(connection);
+                if (!FindNext(connection.To, ctx))
+                    return;
+
+                CreateNextActivities(@case, ctx, ca);
+
+                new CaseActivityExecutedTimerEntity
+                {
+                    BoundaryEvent = boundaryEvent.ToLite(),
+                    CaseActivity = ca.ToLite(),
+                }.Save();
             }

             private static void ExecuteInitialStep(CaseEntity  @case, WorkflowEventEntity @event, WorkflowConnectionEntity transition)


Web SearchControl - Add css class when searching for testing purposes

--- Signum.Web.Extensions.Selenium/SearchTestExtensions.cs
+++ Signum.Web.Extensions.Selenium/SearchTestExtensions.cs
@@ -23,8 +23,10 @@

         public static void Search(this ISelenium selenium, string prefix)
         {
-            selenium.Click(SearchSelector(prefix));
-            selenium.WaitAjaxFinished(() => selenium.IsElementPresent(RowSelector(selenium, 1, prefix)));
+            string searchButton = SearchSelector(prefix);
+            selenium.Click(searchButton);
+            selenium.WaitAjaxFinished(() => selenium.IsElementPresent(searchButton) &&
+                !selenium.IsElementPresent("{0}.sf-searching".Formato(searchButton)));
         }

         public static void SetElementsPerPageToFinder(this ISelenium selenium, string elementsPerPage)


Hotfix for profile generation nullptr

Hotfix for profile generation nullptr

--- SoraBot/SoraBot.Data/Repositories/ProfileRepository.cs
+++ SoraBot/SoraBot.Data/Repositories/ProfileRepository.cs
@@ -4,6 +4,7 @@
 using Microsoft.EntityFrameworkCore;
 using SoraBot.Data.Dtos.Profile;
 using SoraBot.Data.Extensions;
+using SoraBot.Data.Models.SoraDb;
 using SoraBot.Data.Repositories.Interfaces;

 namespace SoraBot.Data.Repositories
@@ -31,7 +32,7 @@

                 var guildUser = await context.GuildUsers
                     .FirstOrDefaultAsync(x => x.UserId == userId && x.GuildId == guildId)
-                    .ConfigureAwait(false);
+                    .ConfigureAwait(false) ?? new GuildUser(0,0,0); // Just so we have default values to work with

                 var localRank = await context.GuildUsers
                     .Where(g => g.Exp > guildUser.Exp)


Pushed new version

Pushed new version

--- Source/AssemblyInfo.cs
+++ Source/AssemblyInfo.cs
@@ -33,5 +33,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.3.4.0")]
+[assembly: AssemblyVersion("1.3.5.0")]
 [assembly: AssemblyFileVersion("1.0.0.0")]


Removing temporary test code.

Removing temporary test code.

--- Source/CILAssemblyManipulator.Tests/Logical/Interop.cs
+++ Source/CILAssemblyManipulator.Tests/Logical/Interop.cs
@@ -34,12 +34,6 @@
    public class LogicalInteropTest : AbstractCAMTest
    {
       [Test]
-      public void AAA()
-      {
-         PerformRoundtripTest( @"C:\PortablePrograms\TurboHUD\TurboHUD.exe" );
-      }
-
-      [Test]
       public void TestPhysicalInteropCAMPhysicalAssembly()
       {
          PerformRoundtripTest( CAMPhysicalLocation );


[BFOMFKO-1230] Доработка при работе с ltree полем

--- Source/DataProvider/PostgreSQL/PostgreSQLSqlBuilder.cs
+++ Source/DataProvider/PostgreSQL/PostgreSQLSqlBuilder.cs
@@ -177,7 +177,16 @@
 	    {
 	        var expr1 = predicate.Expr1;
 	        var sqlField = expr1 as SqlField;
-            if (sqlField != null && sqlField.ColumnDescriptor.IsHierarchical)
+	        if (sqlField == null)
+	        {
+	            var column = expr1 as SelectQuery.Column;
+	            if (column != null)
+	            {
+	                sqlField = column.Expression as SqlField;
+	            }
+	        }
+
+	        if (sqlField != null && sqlField.ColumnDescriptor.IsHierarchical)
             {
                 var expr2 = predicate.Expr2;


CrunchyrollBot: Continue to next episode instead of returning early

--- CrunchyrollBot/CrunchyrollBot/Show.cs
+++ CrunchyrollBot/CrunchyrollBot/Show.cs
@@ -58,15 +58,15 @@
                 {
                     ParseCrunchyrollData(XElement);

-                    // Early return since the episode is a preview clip
+                    // Skip this episode since it is a preview clip
                     if (CrunchyrollIsClip)
-                        return;
+                        continue;

                     GetDatabaseData();
                 }
                 else
                 {
-                    return;
+                    continue;
                 }
             }
         }


Initial work with cached properties.

Initial work with cached properties.

--- DataGenerator/SimpleValueGenerator.cs
+++ DataGenerator/SimpleValueGenerator.cs
@@ -42,93 +42,110 @@
         /// <returns>True if a value was created, false otherwise.</returns>
         public bool TryCreateValue(Type t, string propertyName, out object result)
         {
-            if (t.IsClass && t != typeof(string))
+            var creator = ValueCreator(t);
+            if (creator == null)
             {
                 result = null;
                 return false;
             }
+            else
+            {
+                result = creator(propertyName);
+                return true;
+            }
+        }

+        /// <summary>
+        /// Returns a value creating delegate for the given type.
+        /// </summary>
+        /// <param name="t">The type for which to create values.</param>
+        /// <returns></returns>
+        public Func<string, object> ValueCreator(Type t)
+        {
             if (t.IsGenericType && t.GetGenericTypeDefinition() == typeof(Nullable<>))
             {
-                if (this.Random.Next(0, 1) == 0)
+                t = Nullable.GetUnderlyingType(t);
+                var inner = ValueCreator(t);
+                if (inner == null)
                 {
-                    result = null;
-                    return true;
+                    return null;
                 }
-                else
+
+                return s =>
                 {
-                    t = Nullable.GetUnderlyingType(t);
-                }
+                    if (this.Random.Next(0, 1) == 0)
+                    {
+                        return null;
+                    }
+                    else
+                    {
+                        return inner(s);
+                    }
+                };
             }

             if (t.IsEnum)
             {
                 var values = Enum.GetValues(t);
-                result = values.GetValue(this.Random.Next(0, values.Length - 1));
+                return _ => values.GetValue(this.Random.Next(0, values.Length - 1));
             }
             else if (t == typeof(string))
             {
-                result = propertyName + BitConverter.ToString(Enumerable.Range(0, 20).Select(_ => (byte)this.Random.Next(0, 255)).ToArray()).Replace("-", string.Empty);
+                return s => s + BitConverter.ToString(Enumerable.Range(0, 20).Select(_ => (byte)this.Random.Next(0, 255)).ToArray()).Replace("-", string.Empty);
             }
             else if (t == typeof(byte))
             {
-                result = (byte)this.Random.Next(byte.MinValue, byte.MaxValue);
+                return _ => (byte)this.Random.Next(byte.MinValue, byte.MaxValue);
             }
             else if (t == typeof(short))
             {
-                result = (short)this.Random.Next(short.MinValue, short.MaxValue);
+                return _ => (short)this.Random.Next(short.MinValue, short.MaxValue);
             }
             else if (t == typeof(ushort))
             {
-                result = (ushort)this.Random.Next(ushort.MinValue, ushort.MaxValue);
+                return _ => (ushort)this.Random.Next(ushort.MinValue, ushort.MaxValue);
             }
             else if (t == typeof(int))
             {
-                result = this.Random.Next(int.MinValue, int.MaxValue);
+                return _ => this.Random.Next(int.MinValue, int.MaxValue);
             }
             else if (t == typeof(uint))
             {
-                result = (uint)this.Random.Next(int.MinValue, int.MaxValue);
+                return _ => (uint)this.Random.Next(int.MinValue, int.MaxValue);
             }
             else if (t == typeof(long))
             {
-                result = BitConverter.ToInt64(Enumerable.Range(0, 16).Select(_ => (byte)this.Random.Next(0, 255)).ToArray(), 0);
+                return __ => BitConverter.ToInt64(Enumerable.Range(0, 16).Select(_ => (byte)this.Random.Next(0, 255)).ToArray(), 0);
             }
             else if (t == typeof(ulong))
             {
-                result = BitConverter.ToUInt64(Enumerable.Range(0, 16).Select(_ => (byte)this.Random.Next(0, 255)).ToArray(), 0);
+                return __ => BitConverter.ToUInt64(Enumerable.Range(0, 16).Select(_ => (byte)this.Random.Next(0, 255)).ToArray(), 0);
             }
             else if (t == typeof(double))
             {
-                result = (this.Random.NextDouble() - 0.5) * double.MaxValue;
+                return _ => (this.Random.NextDouble() - 0.5) * double.MaxValue;
             }
             else if (t == typeof(float))
             {
-                result = (float)(this.Random.NextDouble() - 0.5) * float.MaxValue;
+                return _ => (float)(this.Random.NextDouble() - 0.5) * float.MaxValue;
             }
             else if (t == typeof(decimal))
             {
-                result = (decimal)(this.Random.NextDouble() - 0.5) * 1e2m; // TODO look into overflows?
+                return _ => (decimal)(this.Random.NextDouble() - 0.5) * 1e2m; // TODO look into overflows?
             }
             else if (t == typeof(bool))
             {
-                result = this.Random.Next(0, 1) == 1;
+                return _ => this.Random.Next(0, 1) == 1;
             }
             else if (t == typeof(Guid))
             {
-                result = new Guid(Enumerable.Range(0, 16).Select(_ => (byte)this.Random.Next(0, 255)).ToArray());
+                return __ => new Guid(Enumerable.Range(0, 16).Select(_ => (byte)this.Random.Next(0, 255)).ToArray());
             }
             else if (t == typeof(DateTimeOffset))
             {
-                result = DateTimeOffset.Now + TimeSpan.FromMilliseconds((this.Random.NextDouble() - 0.5) * 62e9);
+                return _ => DateTimeOffset.Now + TimeSpan.FromMilliseconds((this.Random.NextDouble() - 0.5) * 62e9);
             }
-            else
-            {
-                result = null;
-                return false;
-            }
-
-            return true;
+            return null;
         }
     }
 }


improve perf for TableSharedKeyPipelinePolicy (#20044)

* improve perf for TableSharedKeyPipelinePolicy


Hide the client update button by default. Added null check.

Signed-off-by: Konstantina Chremmou <a7d1f757a659045fb6db8c1e3849a1c8ad00b97a@citrix.com>

--- XenAdmin/MainWindow.cs
+++ XenAdmin/MainWindow.cs
@@ -245,6 +245,8 @@
             licenseTimer = new LicenseTimer(licenseManagerLauncher);
             GeneralPage.LicenseLauncher = licenseManagerLauncher;

+            updateClientToolStripMenuItem.Visible = false;
+
             xenSourceOnTheWebToolStripMenuItem.Text = string.Format(xenSourceOnTheWebToolStripMenuItem.Text,
                 BrandManager.ProductBrand);
             viewApplicationLogToolStripMenuItem.Text = string.Format(viewApplicationLogToolStripMenuItem.Text, BrandManager.BrandConsole);
@@ -3340,7 +3342,7 @@
         private void dismissToolStripMenuItem_Click(object sender, EventArgs e)
         {
             Program.Invoke(this, () => { updateClientToolStripMenuItem.Visible = false; });
-            updateAlert.Dismiss();
+            updateAlert?.Dismiss();
         }

         private void downloadInstallToolStripMenuItem_Click(object sender, EventArgs e)


Implemented random falling meteors.

Implemented random falling meteors.

--- SpaceGame/Game/Game.cs
+++ SpaceGame/Game/Game.cs
@@ -1,206 +1,227 @@
-using System;
-using System.Collections.Generic;
-using System.Threading;
-
-namespace SpaceGame
-{
-	class Game
-	{
-		// Set console max width and height
-		private const int maxWidth = 40;
-		private const int maxHeight = 40;
-
-		// Keeps the x coordinate of our spaceship position
-		static readonly int playerPosX = Console.BufferWidth / 2;
-		static readonly int playerPosY = Console.BufferHeight - 1;
-
-		// Keeps x and y coordinates of enemies spaceships
-		static List<List<int>> enemies = new List<List<int>>();
-
-		// Keeps x and y coordinates of our shots
-		static List<List<int>> shots = new List<List<int>>();
-
-		// Set spaceships and shots icons
-		private const char playerIcon = 'Ä';
-		private const char enemyIcon = '#';
-		private const char shotIcon = '"';
-
-		// Set spaceships and shots colors
-		private const ConsoleColor playerColor = ConsoleColor.Cyan;
-		private const ConsoleColor enemiesColor = ConsoleColor.DarkRed;
-		private const ConsoleColor shotsColor = ConsoleColor.DarkYellow;
-
-		// Set amount of spaceship lives
-		private const int livesCount = 5;
-
-		// Make global random variable
-		static readonly Random rnd = new Random();
-
-		static void Main()
-		{
-			Console.BufferHeight = Console.WindowHeight = maxHeight;
-			Console.BufferWidth = Console.WindowWidth = maxWidth;
-
-
-			//Menu with instructions
-			DrawMenuScreen();
-
-			while (livesCount >= 0)
-			{
-				// Game World
-
-				GenerateEnemyAtRandomPosition();
-
-				Update();
-
-				Draw();
-
-				if (Console.KeyAvailable)
-				{
-					// Set player game keys
-					ControlPlayer();
-				}
-
-				// After certian amount of meteors destyoed increase speed
-				IncreaseLevel();
-
-				Thread.Sleep(200);
-
-				Console.Clear();
-			}
-
-			// Store points per meteor hit
-			StorePoints();
-
-			// Draw final scores
-			DrawScoreBoard();
-			Console.WriteLine("You are dead! Continue (Y/N):");
-		}
-
-
-
-
-		private static void Update()
-		{
-			// Update Game World
-			UpdateEnemies();
-			UpdateShots();
-			CollisionsEnemiesShots();
-			CollisionsEnemiesPlayer();
-		}
-
-		private static void CollisionsEnemiesPlayer()
-		{
-
-		}
-
-		private static void CollisionsEnemiesShots()
-		{
-
-		}
-
-		private static void UpdateShots()
-		{
-
-		}
-
-		private static void UpdateEnemies()
-		{
-
-		}
-
-		private static void GenerateEnemyAtRandomPosition()
-		{
-			int randomEnemyPosition = rnd.Next(0, Console.WindowWidth);
-		}
-
-		private static void Shoot()
-		{
-
-		}
-
-		private static void Draw()
-		{
-			DrawPlayer();
-			DrawEnemies();
-			DrawShots();
-		}
-
-		private static void DrawShots()
-		{
-
-		}
-
-		private static void DrawEnemies()
-		{
-
-		}
-
-		private static void DrawPlayer()
-		{
-			List<int> playerCoordinates = new List<int>(){ playerPosX, playerPosY};
-
-
-			DrawSymbolAtSpecificCoordinates(playerCoordinates, playerIcon, playerColor);
-		}
-
-		private static void DrawSymbolAtSpecificCoordinates(List<int> playerCoordinates, char c, ConsoleColor playerColor)
-		{
-
-		}
-
-		private static void ControlPlayer()
-		{
-			ConsoleKeyInfo userInput = Console.ReadKey(true);
-			while (Console.KeyAvailable)
-			{
-				Console.ReadKey(true);
-			}
-			if (userInput.Key == ConsoleKey.Spacebar)
-			{
-				Shoot();
-			}
-			else if (userInput.Key == ConsoleKey.LeftArrow)
-			{
-				MovePlane();
-			}
-
-			else if (userInput.Key == ConsoleKey.RightArrow)
-			{
-				MovePlane();
-			}
-
-			else if (userInput.Key == ConsoleKey.UpArrow)
-			{
-				MovePlane();
-			}
-
-			else if (userInput.Key == ConsoleKey.DownArrow)
-			{
-				MovePlane();
-			}
-		}
-
-		private static void MovePlane()
-		{
-
-		}
-		private static void DrawMenuScreen()
-		{
-
-		}
-
-		private static void IncreaseLevel()
-		{
-		}
-
-		private static void DrawScoreBoard()
-		{
-		}
-
-		private static void StorePoints()
-		{
-
-		}
-	}
+using System;
+using System.Collections.Generic;
+using System.Threading;
+
+namespace SpaceGame
+{
+    public class Game
+    {
+        // Set console max width and height
+        private const int maxWidth = 40;
+        private const int maxHeight = 40;
+
+        // Keeps the x coordinate of our spaceship position
+        static readonly int playerPosX = Console.BufferWidth / 2;
+        static readonly int playerPosY = Console.BufferHeight - 1;
+
+        // Keeps x and y coordinates of enemies spaceships
+        static List<List<int>> enemies = new List<List<int>>();
+
+        static List<Meteor> meteors = new List<Meteor>();
+
+        // Keeps x and y coordinates of our shots
+        static List<List<int>> shots = new List<List<int>>();
+
+        // Set spaceships and shots icons
+        private const char playerIcon = 'Ä';
+        public  static char[] enemyIcons =  new char[] {'#', '*', '@'};
+        private const char shotIcon = '"';
+
+        // Set spaceships and shots colors
+        private const ConsoleColor playerColor = ConsoleColor.Cyan;
+        public static ConsoleColor[] enemiesColors =  {ConsoleColor.Red, ConsoleColor.DarkCyan,
+                                                      ConsoleColor.Blue, ConsoleColor.Magenta,
+                                                      ConsoleColor.DarkYellow, ConsoleColor.DarkRed,
+                                                      ConsoleColor.DarkGreen, ConsoleColor.DarkBlue};
+
+        private const ConsoleColor shotsColor = ConsoleColor.DarkYellow;
+
+        // Set amount of spaceship lives
+        private const int livesCount = 5;
+
+        // Make global random variable
+        static readonly Random rnd = new Random();
+
+        static void Main()
+        {
+            Console.BufferHeight = Console.WindowHeight = maxHeight;
+            Console.BufferWidth = Console.WindowWidth = maxWidth;
+
+
+            //Menu with instructions
+            DrawMenuScreen();
+
+            while (livesCount >= 0)
+            {
+                // Game World
+
+                GenerateEnemyAtRandomPosition();
+
+                Update();
+
+                Draw();
+
+                if (Console.KeyAvailable)
+                {
+                    // Set player game keys
+                    ControlPlayer();
+                }
+
+                // After certian amount of meteors destyoed increase speed
+                IncreaseLevel();
+
+                Console.Clear();
+            }
+
+            // Store points per meteor hit
+            StorePoints();
+
+            // Draw final scores
+            DrawScoreBoard();
+            Console.WriteLine("You are dead! Continue (Y/N):");
+        }
+
+
+
+
+        private static void Update()
+        {
+            // Update Game World
+            UpdateEnemies();
+            UpdateShots();
+            CollisionsEnemiesShots();
+            CollisionsEnemiesPlayer();
+        }
+
+        private static void CollisionsEnemiesPlayer()
+        {
+
+        }
+
+        private static void CollisionsEnemiesShots()
+        {
+
+        }
+
+        private static void UpdateShots()
+        {
+
+        }
+
+        private static void UpdateEnemies()
+        {
+
+        }
+
+        private static void GenerateEnemyAtRandomPosition()
+        {
+            Meteor meteor = new Meteor();
+            meteor.SetRandom(maxWidth);
+            meteors.Add(meteor);
+
+            for (int meteorIndex = 0; meteorIndex < meteors.Count; meteorIndex++)
+            {
+                meteors[meteorIndex].Y += 1;
+                if (meteors[meteorIndex].Y >= maxHeight)
+                {
+                    meteors.Remove(meteors[meteorIndex]);
+                }
+            }
+        }
+
+        private static void Shoot()
+        {
+
+        }
+
+        private static void Draw()
+        {
+            DrawPlayer();
+            DrawEnemies();
+            DrawShots();
+        }
+
+        private static void DrawShots()
+        {
+
+        }
+
+        private static void DrawEnemies()
+        {
+            foreach (var meteor in meteors)
+            {
+                meteor.Print();
+            }
+        }
+
+        private static void DrawPlayer()
+        {
+            List<int> playerCoordinates = new List<int>() { playerPosX, playerPosY };
+
+
+            DrawSymbolAtSpecificCoordinates(playerCoordinates, playerIcon, playerColor);
+        }
+
+        private static void DrawSymbolAtSpecificCoordinates(List<int> playerCoordinates, char c, ConsoleColor playerColor)
+        {
+
+        }
+
+        private static void ControlPlayer()
+        {
+            ConsoleKeyInfo userInput = Console.ReadKey(true);
+            while (Console.KeyAvailable)
+            {
+                Console.ReadKey(true);
+            }
+            if (userInput.Key == ConsoleKey.Spacebar)
+            {
+                Shoot();
+            }
+            else if (userInput.Key == ConsoleKey.LeftArrow)
+            {
+                MovePlane();
+            }
+
+            else if (userInput.Key == ConsoleKey.RightArrow)
+            {
+                MovePlane();
+            }
+
+            else if (userInput.Key == ConsoleKey.UpArrow)
+            {
+                MovePlane();
+            }
+
+            else if (userInput.Key == ConsoleKey.DownArrow)
+            {
+                MovePlane();
+            }
+        }
+
+        private static void MovePlane()
+        {
+
+        }
+        private static void DrawMenuScreen()
+        {
+
+        }
+
+        private static void IncreaseLevel()
+        {
+
+            // Thread sleep will be changed when level is increased
+            Thread.Sleep(300);
+        }
+
+        private static void DrawScoreBoard()
+        {
+        }
+
+        private static void StorePoints()
+        {
+
+        }
+    }
 }


* adding discovery test: what do string encodings do when given non-printable chars? Answer: the right thing, not blow up!

--- source/PeanutButter.RandomGenerators.Tests/TestRandomValueGen.cs
+++ source/PeanutButter.RandomGenerators.Tests/TestRandomValueGen.cs
@@ -1,6 +1,7 @@
 using System;
 using System.Collections.Generic;
 using System.Linq;
+using System.Text;
 using NSubstitute;
 using NUnit.Framework;
 using PeanutButter.Utils;
@@ -768,6 +769,24 @@
             Assert.IsNotNull(item.Date);
         }

+        [Test]
+        [Ignore("Discovery purposes only")]
+        public void Discovery_WhatDoesEncodingGetString_DoWithNonPrintableCharacters()
+        {
+            //---------------Set up test pack-------------------
+            var bytes = RandomValueGen.GetRandomCollection(() => RandomValueGen.GetRandomInt(0, 255))
+                .Select(i => (byte) i)
+                .ToArray();
+            //---------------Assert Precondition----------------
+
+            //---------------Execute Test ----------------------
+            var result = Encoding.UTF8.GetString(bytes);
+
+            //---------------Test Result -----------------------
+            Console.WriteLine(result);
+
+        }
+


Added display of break on exception process error in the errors/warning list.

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

--- Dataphor/Dataphoria/Debug/Debugger.cs
+++ Dataphor/Dataphoria/Debug/Debugger.cs
@@ -9,7 +9,7 @@

 namespace Alphora.Dataphor.Dataphoria
 {
-	public class Debugger : INotifyMultiPropertyChanged
+	public class Debugger : IDisposable, INotifyMultiPropertyChanged, Frontend.Client.Windows.IErrorSource
 	{
 		public Debugger(IDataphoria ADataphoria)
 		{
@@ -19,6 +19,21 @@
 			FDataphoria.Disconnected += new EventHandler(DataphoriaDisconnected);
 			UpdateDebuggerState();
 		}
+
+		public void Dispose()
+		{
+			InternalClearState();
+			if (FDataphoria != null)
+			{
+				FDataphoria.Connected -= new EventHandler(DataphoriaConnected);
+				FDataphoria.Disconnected -= new EventHandler(DataphoriaDisconnected);
+				FDataphoria = null;
+			}
+			if (Disposed != null)
+				Disposed(this, EventArgs.Empty);
+		}
+
+		public event EventHandler Disposed;

 		// TODO: Improve the debugger performance by implementing a property notification service which
 		//  allows multiple properties to be included in a single notification.
@@ -104,6 +119,7 @@
 			NotifyPropertyChanged(new string[] { "IsStarted", "IsPaused", "BreakOnException", "BreakOnStart", "SelectedProcessID", "SelectedCallStackIndex", "CurrentLocation" });

 			RefreshBreakpoints();
+			ClearSelectedError();
 		}

 		// IsStarted
@@ -299,6 +315,7 @@
 			var LProcesses = FDataphoria.OpenCursor(".System.Debug.GetProcesses() where IsPaused");
 			try
 			{
+				ClearSelectedError();
 				int LCandidateID = -1;
 				Row LRow = null;
 				while (LProcesses.Next())
@@ -309,7 +326,15 @@
 						LProcesses.Select(LRow);
 					LCandidateID = (int)LRow["Process_ID"];
 					if (LRow.HasValue("DidBreak") && (bool)LRow["DidBreak"])
+					{
+						if (LRow.HasValue("Error"))
+						{
+							var LErrorMessage = (string)LRow["Error"];
+							if (LErrorMessage != null)
+								SetSelectedError(LErrorMessage);
+						}
 						break;
+					}
 				}
 				SelectedProcessID = LCandidateID;
 			}
@@ -317,6 +342,18 @@
 			{
 				FDataphoria.CloseCursor(LProcesses);
 			}
+		}
+
+		// SelectedError
+
+		private void SetSelectedError(string AMessage)
+		{
+			Dataphoria.Warnings.AppendError(this, new Exception(AMessage), false);
+		}
+
+		private void ClearSelectedError()
+		{
+			Dataphoria.Warnings.ClearErrors(this);
 		}

 		// SelectedCallStackIndex
@@ -541,6 +578,20 @@
 				InternalUnpause();
 			}
 		}
+
+		#region IErrorSource Members
+
+		public void ErrorHighlighted(Exception AException)
+		{
+			// Nothing
+		}
+
+		public void ErrorSelected(Exception AException)
+		{
+			// Nothing
+		}
+
+		#endregion
 	}

 	public interface INotifyMultiPropertyChanged


refactoring

refactoring

--- Dev/Editor/EffekseerCore/IO/EfkEfc.cs
+++ Dev/Editor/EffekseerCore/IO/EfkEfc.cs
@@ -143,14 +143,14 @@
 			Func<System.Xml.XmlNodeList, List<Element>> visit = null;
 			visit = (System.Xml.XmlNodeList xmlNodes) =>
 			{
-				List<Element> elements = new List<Element>();
+				var elements = new List<Element>();

 				for (int i = 0; i < xmlNodes.Count; i++)
 				{
 					if (xmlNodes[i].NodeType == System.Xml.XmlNodeType.XmlDeclaration)
 						continue;

-					Element element = new Element();
+					var element = new Element();

 					element.Name = xmlNodes[i].Name;

@@ -173,9 +173,9 @@

 			var visits = visit(xml.ChildNodes);

-			// compress...
-			Dictionary<string, Int16> keys = new Dictionary<string, Int16>();
-			Dictionary<string, Int16> values = new Dictionary<string, Int16>();
+			// compress
+			var keys = new Dictionary<string, Int16>();
+			var values = new Dictionary<string, Int16>();
 			Func<List<Element>, byte[]> comp = null;
 			comp = (elements) =>
 			{
@@ -188,14 +188,14 @@
 						keys[item.Name] = (Int16)keys.Count();
 					res.Push(keys[item.Name]);

-					bool isHaveValue = item.Value != null && (string)item.Value != "";
+					var valueStr = item.Value as string;
+					bool isHaveValue = !string.IsNullOrEmpty(valueStr);
 					res.Push(isHaveValue);
 					if (isHaveValue)
 					{
-						var value = (string)item.Value;
-						if (!values.ContainsKey(value))
-							values[value] = (Int16)values.Count();
-						res.Push(values[value]);
+						if (!values.ContainsKey(valueStr))
+							values[valueStr] = (Int16)values.Count();
+						res.Push(values[valueStr]);
 					}

 					bool isHaveChildren = item.Children != null && item.Children.Count != 0;
@@ -206,7 +206,7 @@
 				return res.GetBinary();
 			};

-			Utils.BinaryWriter binary = new Utils.BinaryWriter();
+			var binary = new Utils.BinaryWriter();

 			var valueBuf = comp(visits);

@@ -229,7 +229,7 @@
 			using (var compressStream = new System.IO.MemoryStream())
 			using (var compressor = new System.IO.Compression.DeflateStream(compressStream, System.IO.Compression.CompressionMode.Compress))
 			{
-				byte[] buffer = binary.GetBinary();
+				var buffer = binary.GetBinary();
 				compressor.Write(buffer, 0, buffer.Count());
 				compressor.Close();
 				return compressStream.ToArray();
@@ -238,7 +238,7 @@

 		System.Xml.XmlDocument Decompress(byte[] buffer)
 		{
-			List<byte> decompressBuffer = new List<byte>();
+			var decompressBuffer = new List<byte>();
 			using (var decompressStream = new System.IO.MemoryStream(buffer))
 			using (var decompressor = new System.IO.Compression.DeflateStream(decompressStream, System.IO.Compression.CompressionMode.Decompress))
 			{
@@ -369,7 +369,7 @@
 				headerData = data.SelectMany(_ => _).ToArray();
 			}

-			Chunk chunk = new Chunk();
+			var chunk = new Chunk();
 			chunk.AddChunk("INFO", infoData);
 			chunk.AddChunk("EDIT", Compress(editorData));
 			chunk.AddChunk("BIN_", binaryData);
@@ -405,9 +405,9 @@
 			if (allData.Length < 24) return false;

 			if (allData[3] != 'E' ||
-	allData[2] != 'F' ||
-	allData[1] != 'K' ||
-	allData[0] != 'P')
+				allData[2] != 'F' ||
+				allData[1] != 'K' ||
+				allData[0] != 'P')
 			{
 				return false;
 			}


Set LastWriteTime on importing package

Set LastWriteTime on importing package

--- Dev/Editor/EffekseerCore/IO/EfkPkg.cs
+++ Dev/Editor/EffekseerCore/IO/EfkPkg.cs
@@ -379,6 +379,7 @@
 				// Write effect file
 				byte[] data = efkefc.Save(root, Core.SaveAsXmlDocument(root));
 				File.WriteAllBytes(filePath, data);
+				File.SetLastWriteTime(filePath, file.LastWriteTime);
 			}

 			// Extract resource files
@@ -400,6 +401,7 @@
 				if (data != null)
 				{
 					File.WriteAllBytes(filePath, data);
+					File.SetLastWriteTime(filePath, file.LastWriteTime);
 				}
 			}


version #

version #

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


git-svn-id: https://gorgonlib.googlecode.com/svn/branches/2.x@866 a61f9e97-bd4c-0410-8c65-85b29eaa70ff

--- Dorian/Gorgon/Gorgon.Graphics/Test.cs
+++ Dorian/Gorgon/Gorgon.Graphics/Test.cs
@@ -1,814 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Runtime.InteropServices;
-using SlimMath;
-using DX = SharpDX;
-using GorgonLibrary.Math;
-using GI = SharpDX.DXGI;
-using D3D = SharpDX.Direct3D11;
-using D3DCommon = SharpDX.Direct3D;
-using Shaders = SharpDX.D3DCompiler;
-
-namespace GorgonLibrary.Graphics
-{
-	/// <summary>
-	///
-	/// </summary>
-	[StructLayout(LayoutKind.Explicit, Size = 128, Pack=1)]
-	public struct TEMPGUY
-	{
-		/// <summary>
-		///
-		/// </summary>
-		[FieldOffset(0)]
-		public float value1;
-		/// <summary>
-		///
-		/// </summary>
-		[FieldOffset(16)]
-		public Matrix value2;
-		/// <summary>
-		///
-		/// </summary>
-		[FieldOffset(80), MarshalAs(UnmanagedType.ByValArray, SizeConst=3)]
-		public Vector4[] tempArray;
-	}
-
-	/// <summary>
-	///
-	/// </summary>
-	[StructLayout(LayoutKind.Explicit, Size = 304, Pack=1)]
-	public struct MatrixBuffer
-	{
-		/// <summary>
-		/// /
-		/// </summary>
-		[FieldOffset(0)]
-		public Matrix Projection;
-		/// <summary>
-		///
-		/// </summary>
-		[FieldOffset(64)]
-		public Matrix View;
-		/// <summary>
-		///
-		/// </summary>
-		[FieldOffset(128), MarshalAs(UnmanagedType.ByValArray, SizeConst=3)]
-		public Vector4[] Array;
-		/// <summary>
-		///
-		/// </summary>
-		[FieldOffset(176)]
-		public TEMPGUY valueType;
-	}
-
-	/// <summary>
-	///
-	/// </summary>
-	[StructLayout(LayoutKind.Explicit, Size = 80,Pack =1)]
-	public struct UpdateBuffer
-	{
-		/// <summary>
-		///
-		/// </summary>
-		[FieldOffset(0)]
-		public Matrix World;
-		/// <summary>
-		///
-		/// </summary>
-		[FieldOffset(64)]
-		public GorgonColor Alpha;
-		///// <summary>
-		///// Padding because the struct must be divisble by 16.
-		///// </summary>
-		//[FieldOffset(68)]
-		//public long Dummy1;
-		///// <summary>
-		/////
-		///// </summary>
-		//[FieldOffset(76)]
-		//public int Dummy2;
-	}
-
-	/// <summary>
-	///
-	/// </summary>
-	public struct SpriteBall
-	{
-		/// <summary>
-		///
-		/// </summary>
-		public Vector3 Position;
-		/// <summary>
-		///
-		/// </summary>
-		public Vector3 Velocity;
-		/// <summary>
-		///
-		/// </summary>
-		public float Scale;
-		/// <summary>
-		///
-		/// </summary>
-		public float ScaleDelta;
-		/// <summary>
-		///
-		/// </summary>
-		public float Angle;
-		/// <summary>
-		///
-		/// </summary>
-		public float AngleDelta;
-		/// <summary>
-		///
-		/// </summary>
-		public Vector4 Color;
-		/// <summary>
-		///
-		/// </summary>
-		public float AlphaDelta;
-		/// <summary>
-		///
-		/// </summary>
-		public bool XBounce;
-		/// <summary>
-		///
-		/// </summary>
-		public bool YBounce;
-		/// <summary>
-		///
-		/// </summary>
-		public bool ZBounce;
-		/// <summary>
-		///
-		/// </summary>
-		public bool ScaleBouce;
-		/// <summary>
-		///
-		/// </summary>
-		public bool Checkered;
-		/// <summary>
-		///
-		/// </summary>
-		public bool AlphaBounce;
-	}
-
-	/// <summary>
-	///
-	/// </summary>
-	public class Test
-		: IDisposable
-	{
-		/// <summary>
-		///
-		/// </summary>
-		public const int count = 1024;
-		private D3D.Device _device = null;
-		private GorgonGraphics _graphics = null;
-		private GorgonSwapChain _swapChain = null;
-		private bool _disposed = false;
-		private string _shader = string.Empty;
-		private System.Windows.Forms.Form _form = null;
-		//private Shaders.ShaderBytecode _vsShaderCode = null;
-		//private Shaders.ShaderBytecode _psShaderCode = null;
-		//private D3D.Effect _effect = null;
-		//private D3D.InputLayout _layout = null;
-		//private D3D.Buffer _vertices = null;
-		private GorgonVertexBuffer _vertices = null;
-		//private GorgonVertexBuffer _uvs = null;
-		//private GorgonVertexBuffer _cols = null;
-		private GorgonIndexBuffer _index = null;
-		//private D3D.EffectPass _pass = null;
-		//private D3D.VertexBufferBinding _binding = default(D3D.VertexBufferBinding);
-		//private D3D.VertexBufferBinding _binding2 = default(D3D.VertexBufferBinding);
-		//private D3D.VertexBufferBinding _binding3 = default(D3D.VertexBufferBinding);
-		//private float _rot = 0.0f;
-		//private float _degreesPerSecond = 0.0f;
-		//private D3D.EffectScalarVariable _alpha = null;
-		//private D3D.EffectConstantBuffer _matrix = null;
-		//private float _currentTime = 0;
-		//private int _maxPasses = 0;
-		//private bool _timeSwitch = false;
-		//private float _passes = 8.0f;
-		private GorgonTexture2D _texture = null;
-		//private D3D.Texture2D _texture = null;
-		//private D3D.ShaderResourceView _textureView = null;
-		private GorgonTexture2D _texture2 = null;
-		//private D3D.SamplerState _sampler = null;
-		//private D3D.VertexShader _vs = null;
-		//private D3D.PixelShader _ps = null;
-		//private D3D.Buffer _changeBuffer = null;
-		//private GorgonConstantBuffer _noChangeBuffer = null;
-		//private GorgonConstantBuffer _changeBuffer = null;
-		//private GorgonConstantBuffer _alphaTestData = null;
-		//private D3D.Buffer _noChangeBuffer = null;
-		//private GorgonDepthStencilState _depthStateAlpha = null;
-		private GorgonDepthStencilStates _depthStateAlpha = GorgonDepthStencilStates.DefaultStates;
-		//private DX.DataStream _changeStream = null;
-		Random _rnd = new Random();
-		private GorgonVertexShader _vs = null;
-		private GorgonPixelShader _ps = null;
-		private Vector4[] _pos = new Vector4[4];
-		private vertex[] _sprite = null;
-		private Matrix pvw = Matrix.Identity;
-		private GorgonDataStream _tempStream = null;
-		private float _aspect = 0.0f;
-		private float _camPos = -0.75f;
-		private bool _3d = false;
-		private SpriteBall[] _balls = new SpriteBall[count];
-
-
-		struct vertex
-		{
-			[InputElement(0, "POSITION")]
-			public Vector4 Position;
-			//[InputElement("COLOR", BufferFormat.R32G32B32A32_Float, 0, 0, 1)]
-			[InputElement(1, "COLOR")]
-			public Vector4 Color;
-			//[InputElement("TEXTURECOORD", BufferFormat.R32G32_Float, 0, 0, 2)]
-			[InputElement(2, "TEXTURECOORD")]
-			public Vector2 UV;
-		}
-
-
-		private void Destroy()
-		{
-			_swapChain.Settings.Window.Resize -= new EventHandler(Window_Resize);
-
-			if (_tempStream != null)
-				_tempStream.Dispose();
-			//if (_depthStateAlpha != null)
-				//_depthStateAlpha.Dispose();
-			//if (_changeStream != null)
-			//    _changeStream.Dispose();
-			//if (_changeBuffer != null)
-			//    _changeBuffer.Dispose();
-			//if (_noChangeBuffer != null)
-			//    _noChangeBuffer.Dispose();
-			//if (_vsShaderCode != null)
-				//_vsShaderCode.Dispose();
-			//if (_psShaderCode != null)
-			//    _psShaderCode.Dispose();
-			//if (_vs != null)
-				//_vs.Dispose();
-			//if (_ps != null)
-			//    _ps.Dispose();
-			//if (_effect != null)
-			//    _effect.Dispose();
-			//if (_layout != null)
-				//_layout.Dispose();
-			//if (_textureView != null)
-			//    _textureView.Dispose();
-			//if (_texture != null)
-			//    _texture.Dispose();
-			//if (_textureView2 != null)
-			//    _textureView2.Dispose();
-			//if (_texture2 != null)
-			//    _texture2.Dispose();
-			//if (_sampler != null)
-				//_sampler.Dispose();
-			//if (_vertices != null)
-			//    _vertices.Dispose();
-			//if (_index != null)
-			//    _index.Dispose();
-		}
-
-		private void Initialize()
-		{
-			string errors = string.Empty;
-
-			_graphics = _swapChain.Graphics;
-			_swapChain.Settings.Window.Resize += new EventHandler(Window_Resize);
-			_swapChain.AfterStateTransition += new EventHandler(Window_Resize);
-
-			_shader = Encoding.UTF8.GetString(Properties.Resources.Test);
-
-			_device = _graphics.D3DDevice;
-
-			_vs = _graphics.Shaders.CreateVertexShader("TestVShader", "VS", _shader);
-			_ps = _graphics.Shaders.CreatePixelShader("TestPShader", "PS", _shader);
-
-			GorgonInputLayout layout = _graphics.Input.CreateInputLayout("Test Layout", typeof(vertex), _vs);
-
-			int vertexSize = layout.GetSlotSize(0);
-
-			_vertices = _graphics.Input.CreateVertexBuffer(4 * vertexSize * count, BufferUsage.Dynamic, null);
-			//_cols = _graphics.CreateVertexBuffer(4 * 16 * count, BufferUsage.Dynamic, null);
-			using (GorgonDataStream stream = new GorgonDataStream(count * 6 * sizeof(int)))
-			{
-				int index = 0;
-				for (int i = 0; i < count; i++)
-				{
-					stream.Write<int>(index);
-					stream.Write<int>(index + 1);
-					stream.Write<int>(index + 2);
-					stream.Write<int>(index + 1);
-					stream.Write<int>(index + 3);
-					stream.Write<int>(index + 2);
-					index += 4;
-				}
-
-				stream.Position = 0;
-				_index = _graphics.Input.CreateIndexBuffer((int)stream.Length, BufferUsage.Default, true, stream);
-			}
-
-			//D3D.ImageLoadInformation info = new D3D.ImageLoadInformation();
-			//info.BindFlags = D3D.BindFlags.ShaderResource;
-			//info.CpuAccessFlags = D3D.CpuAccessFlags.None;
-			//info.Depth = 0;
-			//info.Filter = D3D.FilterFlags.None;
-			//info.FirstMipLevel = 0;
-			//info.Format = GI.Format.B8G8R8A8_UNorm;
-			//info.Height = 0;
-			//info.Width = 0;
-			//info.MipFilter = D3D.FilterFlags.Point;
-			//info.MipLevels = 1;
-			//info.OptionFlags = D3D.ResourceOptionFlags.None;
-			//info.Usage = D3D.ResourceUsage.Default;
-
-			//byte[] textureDataBytes = new byte[256 * 256 * 4];
-			//_rnd.NextBytes(textureDataBytes);
-
-			//GorgonTexture2DData data = new GorgonTexture2DData(9);
-			//GorgonDataStream textureStream = new GorgonDataStream(textureDataBytes);
-			//for (int i = 0; i < data.Data.Length; i++)
-			//{
-			//    int width = 256 / (i + 1);
-			//    data.Pitch[i] = width * GorgonBufferFormatInfo.GetInfo(BufferFormat.R8G8B8A8_UIntNormal).SizeInBytes;
-			//    data.Data[i] = textureStream;
-			//}
-
-			//_texture = _graphics.Textures.CreateTexture("Test Texture", new GorgonTexture2DSettings()
-			//                                            {
-			//                                                Width = 256,
-			//                                                Height = 256,
-			//                                                Format = BufferFormat.R8G8B8A8_UIntNormal,
-			//                                                MipCount = 0,
-			//                                                ArrayCount = 1,// <-- This needs to be 1.
-			//                                                Usage = BufferUsage.Default
-			//                                            }
-			//                                            , data);
-
-			//data.Data[0].Dispose();
-
-			_texture = _graphics.Textures.FromFile("Balls", @"..\..\..\..\Resources\BallDemo\BallDemo.png", GorgonTexture2DSettings.FromFile);
-
-			//_texture = D3D.Resource.FromFile<D3D.Texture2D>(_device, @"..\..\..\..\Resources\Images\TextureTest.png", info);
-			//_texture = D3D.Resource.FromFile<D3D.Texture2D>(_device, @"..\..\..\..\Resources\BallDemo\BallDemo.png", info);
-			//_texture.DebugName = _swapChain.Name + " Test texture.";
-			//_textureView = new D3D.ShaderResourceView(_device, _texture);
-			//_textureView.DebugName = _swapChain.Name + " Test texture view.";
-
-			_texture2 = _graphics.Textures.FromFile("VBBack", @"..\..\..\..\Resources\Images\VBback.jpg", GorgonTexture2DSettings.FromFile);
-
-			//_texture2 = D3D.Resource.FromFile<D3D.Texture2D>(_device, @"..\..\..\..\Resources\Images\VBback.jpg", info);
-			//_texture2.DebugName = _swapChain.Name + " Test texture 2.";
-			//_textureView2 = new D3D.ShaderResourceView(_device, _texture2);
-			//_textureView2.DebugName = _swapChain.Name + " Test texture view 2.";
-
-			_form = Gorgon.GetTopLevelForm(_swapChain.Settings.Window);
-			_form.KeyDown += new System.Windows.Forms.KeyEventHandler(_form_KeyDown);
-
-			MatrixBuffer matrix = new MatrixBuffer();
-			_aspect = (float)(_swapChain.Settings.VideoMode.Width) / (float)(_swapChain.Settings.VideoMode.Height);
-			//matrix.Projection = Matrix.PerspectiveFovLH(GorgonLibrary.Math.GorgonMathUtility.Radians(100.39f), _aspect, 0.01f, 1000.0f);
-			matrix.Projection = Matrix.OrthoLH(320.0f, 240.0f, 0.1f, 1000.0f);
-			//matrix.Projection = Matrix.OrthoOffCenterLH((1.0f * 1.6f), 0, 0, -1.0f, 0.1f, 1000.0f);
-			//matrix.Projection.Transpose();
-			matrix.View = Matrix.LookAtLH(new Vector3(0, 0, _camPos), new Vector3(0, 0, 1.0f), Vector3.UnitY);
-			//matrix.View.Transpose();
-
-			//Matrix.PerspectiveFovLH(GorgonLibrary.Math.GorgonMathUtility.Radians(75.0f), (float)(_swapChain.Settings.VideoMode.Width) / (float)(_swapChain.Settings.VideoMode.Height), 0.1f, 1000.0f);
-			//matrix.Projection = Matrix.Identity;
-
-			//matrix.View = Matrix.LookAtLH(new Vector3(0, 0, 0.75f), new Vector3(0, 0, -1.0f), Vector3.UnitY);
-			matrix.Array = new Vector4[3];
-			matrix.Array[0] = new Vector4(1.0f, 1.0f, 1.0f, 1.0f);
-			matrix.Array[1] = new Vector4(1.0f, 1.0f, 1.0f, 1.0f);
-			matrix.Array[2] = new Vector4(1.0f, 1.0f, 1.0f, 1.0f);
-			matrix.valueType = new TEMPGUY();
-			matrix.valueType.value2 = matrix.View;
-			matrix.valueType.tempArray = new Vector4[3];
-
-			UpdateBuffer updatebuffer = new UpdateBuffer();
-			updatebuffer.World = Matrix.Identity;
-			updatebuffer.Alpha = new GorgonColor(1.0f, 1.0f, 1.0f, 1.0f);
-
-			_depthStateAlpha.IsDepthEnabled = false;
-			_depthStateAlpha.IsDepthWriteEnabled = false;
-
-			_graphics.Input.Layout = layout;
-			_graphics.Shaders.VertexShader.Current = _vs;
-			_graphics.Shaders.PixelShader.Current = _ps;
-
-			//_graphics.VertexShader.ConstantBuffers.SetRange(0, new GorgonConstantBuffer[] { _noChangeBuffer, _changeBuffer });
-			//_graphics.VertexShader.ConstantBuffers[0] = _graphics.PixelShader.ConstantBuffers[0] = _noChangeBuffer;
-
-
-			//_graphics.PixelShader.Samplers[1] = GorgonTextureSamplerStates.DefaultStates;
-
-			//using (GorgonDataStream stream = new GorgonDataStream(count * layout.GetSlotSize(2) * 4))
-			//{
-			//    for (int i = 0; i < (count * 4); i+=4)
-			//    {
-			//        stream.Write(_sprite[i].UV);
-			//        stream.Write(_sprite[i + 1].UV);
-			//        stream.Write(_sprite[i + 2].UV);
-			//        stream.Write(_sprite[i + 3].UV);
-			//        //stream.Position += 32;
-			//    }
-			//    stream.Position = 0;
-
-			//    _uvs = _graphics.CreateVertexBuffer((int)stream.Length, BufferUsage.Immutable, stream);
-			//}
-
-			//_cols = _graphics.CreateVertexBuffer(layout.GetSlotSize(1) * count * 4, BufferUsage.Dynamic);
-
-			//_device.ImmediateContext.OutputMerger.SetTargets((_swapChain.DepthStencil != null ? _swapChain.DepthStencil.D3DDepthStencilView : null), _swapChain.D3DRenderTarget);
-			//_binding = new D3D.VertexBufferBinding(_vertices.D3DVertexBuffer, vertexSize, 0);
-			//_binding2 = new D3D.VertexBufferBinding(_cols.D3DVertexBuffer, layout.GetSlotSize(1), 0);
-			//_binding3 = new D3D.VertexBufferBinding(_uvs.D3DVertexBuffer, layout.GetSlotSize(2), 0);
-			//_device.ImmediateContext.InputAssembler.SetVertexBuffers(0, _binding);
-			//_device.ImmediateContext.InputAssembler.SetVertexBuffers(1, _binding2);
-			//_device.ImmediateContext.InputAssembler.SetVertexBuffers(2, _binding3);
-
-			//_graphics.Shaders.PixelShader.TextureSamplers[0] = GorgonTextureSamplerStates.DefaultStates;
-			_graphics.Shaders.PixelShader.TextureSamplers.SetRange(0, new[] { GorgonTextureSamplerStates.DefaultStates, GorgonTextureSamplerStates.DefaultStates });
-
-			_graphics.Output.RenderTargets[0] = _swapChain;
-			_graphics.Input.VertexBuffers[0] = new GorgonVertexBufferBinding(_vertices, vertexSize);
-			_graphics.Input.IndexBuffer = _index;
-			//_device.ImmediateContext.PixelShader.SetShaderResource(0, _texture.D3DResourceView);
-			_graphics.Shaders.PixelShader.Textures.SetRange(0, new[] { _texture, _texture2 });
-			//_graphics.Shaders.PixelShader.Textures[0] = _texture;
-			//_graphics.Shaders.PixelShader.Textures[1] = _texture2;
-			//_device.ImmediateContext.PixelShader.SetShaderResource(1, _textureView2);
-			pvw = matrix.valueType.value2 * matrix.Projection;
-
-			_tempStream = new GorgonDataStream(_sprite.Length * vertexSize);
-		}
-
-		/// <summary>
-		/// Handles the KeyDown event of the _form control.
-		/// </summary>
-		/// <param name="sender">The source of the event.</param>
-		/// <param name="e">The <see cref="System.Windows.Forms.KeyEventArgs"/> instance containing the event data.</param>
-		void _form_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
-		{
-			if (e.KeyCode == System.Windows.Forms.Keys.Down)
-				_camPos -= 0.01f;
-
-			if (e.KeyCode == System.Windows.Forms.Keys.Up)
-				_camPos += 0.01f;
-
-			if (_camPos < -1.0f)
-				_camPos = -1.0f;
-
-			if (_camPos > 1.0f)
-				_camPos = 1.0f;
-
-			if (e.KeyCode == System.Windows.Forms.Keys.D3)
-				_3d = !_3d;
-			Matrix matrix = Matrix.LookAtLH(new Vector3(0, 0, _camPos), new Vector3(0, 0, 1.0f), Vector3.UnitY);
-			Matrix projection = Matrix.PerspectiveFovLH(GorgonLibrary.Math.GorgonMathUtility.Radians(100.39f), _aspect, 0.1f, 1000.0f);
-			pvw = matrix * projection;
-		}
-
-		/// <summary>
-		/// Handles the Resize event of the Window control.
-		/// </summary>
-		/// <param name="sender">The source of the event.</param>
-		/// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
-		void Window_Resize(object sender, EventArgs e)
-		{
-			MatrixBuffer matrix = new MatrixBuffer();
-
-			_graphics.Rasterizer.SetViewport(_swapChain.Viewport);
-			_aspect = (float)(_swapChain.Settings.VideoMode.Width) / (float)(_swapChain.Settings.VideoMode.Height);
-			matrix.Projection = Matrix.PerspectiveFovLH(GorgonLibrary.Math.GorgonMathUtility.Radians(100.39f), _aspect, 0.1f, 1000.0f);
-			matrix.View = Matrix.LookAtLH(new Vector3(0, 0, -0.75f), new Vector3(0, 0, 1.0f), Vector3.UnitY);
-			//matrix.Projection.Transpose();
-			//matrix.View.Transpose();
-/*			matrix.Array = new Vector4[3];
-			matrix.Array[0] = new Vector4(0.50f, 1.0f, 1.0f, 1.0f);
-			matrix.Array[1] = new Vector4(1.0f, 1.0f, 1.0f, 1.0f);
-			matrix.Array[2] = new Vector4(1.0f, 1.0f, 1.0f, 1.0f);
-			matrix.valueType.value2 = matrix.View;
-			matrix.valueType.tempArray = new Vector4[3];
-
-			using (var stream = _noChangeBuffer.GetBuffer())
-			{
-				stream.Position = 0;
-				stream.Write(matrix.Projection);
-				stream.Position = 192;
-				stream.Write(matrix.View);
-			}*/
-
-			_graphics.Output.RenderTargets[0] = _swapChain;
-
-			pvw = matrix.View * matrix.Projection;
-		}
-
-		/// <summary>
-		/// Initializes a new instance of the <see cref="Test"/> class.
-		/// </summary>
-		/// <param name="swapChain">The swap chain.</param>
-		public Test(GorgonSwapChain swapChain)
-		{
-			_swapChain = swapChain;
-			_sprite = new vertex[count * 4];
-
-			Gorgon.Log.Print("Test: Creating objects.", Diagnostics.LoggingLevel.Verbose);
-
-
-			for (int i = 0; i < count; i++)
-			{
-				_balls[i].Scale = 1.0f;
-				_balls[i].ScaleDelta = ((float)_rnd.NextDouble() * 1.5f) + 0.25f;
-				_balls[i].AlphaBounce = _balls[i].ScaleBouce = false;
-				_balls[i].XBounce = _rnd.Next(0, 100) > 50;
-				_balls[i].YBounce = _rnd.Next(0, 100) > 50;
-				_balls[i].ZBounce = _rnd.Next(0, 100) > 50;
-				_balls[i].Velocity = new Vector3(((float)_rnd.NextDouble() * 0.5f), ((float)_rnd.NextDouble() * 0.5f), ((float)_rnd.NextDouble() * 0.5f));
-				_balls[i].Angle = 0.0f;
-				_balls[i].AngleDelta = 1.0f;
-				_balls[i].Color = new Vector4(1.0f);
-				_balls[i].AlphaDelta = (float)_rnd.NextDouble() * 0.5f;
-				_balls[i].Checkered = _rnd.Next(0, 100) > 50;
-				_balls[i].Position = new Vector3(((float)_rnd.NextDouble() * 2.0f) - 1.0f, ((float)_rnd.NextDouble() * 2.0f) - 1.0f, (float)_rnd.NextDouble());
-
-				//pos[i] = Vector2.Zero;
-
-				int spriteIndex = i * 4;
-/*				_sprite[spriteIndex].UV = Vector2.Zero;
-				_sprite[spriteIndex + 1].UV = new Vector2(1.0f, 0.0f);
-				_sprite[spriteIndex + 2].UV = new Vector2(0.0f, 1.0f);
-				_sprite[spriteIndex + 3].UV = new Vector2(1.0f);*/
-			}
-
-			Initialize();
-		}
-
-		private bool _needsUpdate = true;
-
-		/// <summary>
-		/// Transform.
-		/// </summary>
-		/// <param name="delta"></param>
-		public void Transform(float delta)
-		{
-
-			for (int i = 0; i < count; i++)
-			{
-				_balls[i].Angle += _balls[i].AngleDelta * delta;
-
-				if (_balls[i].Angle > 360.0f)
-				{
-					_balls[i].Angle = _balls[i].Angle - 360.0f;
-					_balls[i].AngleDelta = (float)_rnd.NextDouble() * 90.0f;
-				}
-
-				if ((_balls[i].ScaleBouce) || (!_balls[i].ZBounce))
-					_balls[i].Color.W -= _balls[i].Velocity.Z * delta;
-				else
-					_balls[i].Color.W += _balls[i].Velocity.Z * delta;
-
-				if (_balls[i].Color.W > 1.0f)
-					_balls[i].Color.W = 1.0f;
-
-				if (_balls[i].Color.W < 0.0f)
-				{
-					_balls[i].Color.W = 0.0f;
-					_balls[i].Color = new Vector4(((float)_rnd.NextDouble() * 0.961f) + 0.039f, ((float)_rnd.NextDouble() * 0.961f) + 0.039f, ((float)_rnd.NextDouble() * 0.961f) + 0.039f, 0.0f);
-				}
-
-				//_balls[i].Color = new Vector4(1.0f);
-
-				/*if (_balls[i].ScaleBouce)
-					_balls[i].Scale -= _balls[i].ScaleDelta * delta;
-				else
-					_balls[i].Scale += _balls[i].ScaleDelta * delta;*/
-
-				//_balls[i].Scale = 1.05f;
-
-/*				if ((_balls[i].Scale < 0.05f) || (_balls[i].Scale > 1.0f))
-				{
-					if (_balls[i].Scale > 1.0f)
-						_balls[i].Scale = 1.0f;
-					if (_balls[i].Scale < 0.05f)
-					{
-						_balls[i].Scale = 0.05f;
-						_balls[i].Color = new Vector4(((float)_rnd.NextDouble() * 0.961f) + 0.039f, ((float)_rnd.NextDouble() * 0.961f) + 0.039f, ((float)_rnd.NextDouble() * 0.961f) + 0.039f, _balls[i].Color.W);
-					}
-					_balls[i].ScaleBouce = !_balls[i].ScaleBouce;
-					_balls[i].ScaleDelta = ((float)_rnd.NextDouble() * 1.5f) + 0.25f;
-				}*/
-
-
-				if (_balls[i].YBounce)
-					_balls[i].Position.Y -= (_balls[i].Velocity.Y * delta);
-				else
-					_balls[i].Position.Y += (_balls[i].Velocity.Y * delta);
-
-				if (_balls[i].XBounce)
-					_balls[i].Position.X -= (_balls[i].Velocity.X * delta);
-				else
-					_balls[i].Position.X += (_balls[i].Velocity.X * delta);
-				if (_balls[i].ZBounce)
-					_balls[i].Position.Z -= (_balls[i].Velocity.Z * delta);
-				else
-					_balls[i].Position.Z += (_balls[i].Velocity.Z * delta);
-
-				if (_balls[i].Position.X > (1.0f * _aspect))
-				{
-					_balls[i].Position.X = (1.0f * _aspect);
-					_balls[i].Velocity.X = ((float)_rnd.NextDouble() * 0.5f);
-					_balls[i].XBounce = !_balls[i].XBounce;
-				}
-				if (_balls[i].Position.Y > (1.0f * _aspect))
-				{
-					_balls[i].Position.Y = (1.0f * _aspect);
-					_balls[i].Velocity.Y = ((float)_rnd.NextDouble() * 0.5f);
-					_balls[i].YBounce = !_balls[i].YBounce;
-				}
-
-				if (_balls[i].Position.X < (-1.0f * _aspect))
-				{
-					_balls[i].Position.X = (-1.0f * _aspect);
-					_balls[i].Velocity.X = (float)_rnd.NextDouble() * 0.5f;
-					_balls[i].XBounce = !_balls[i].XBounce;
-				}
-				if (_balls[i].Position.Y < (-1.0f * _aspect))
-				{
-					_balls[i].Position.Y = (-1.0f * _aspect);
-					_balls[i].Velocity.Y = (float)_rnd.NextDouble() * 0.5f;
-					_balls[i].YBounce = !_balls[i].YBounce;
-				}
-
-
-				if (_balls[i].Position.Z < -1.0f)
-				{
-					_balls[i].Position.Z = -1.0f;
-					_balls[i].Velocity.Z = (float)_rnd.NextDouble() * 0.5f;
-					_balls[i].ZBounce = !_balls[i].ZBounce;
-				}
-
-				if (_balls[i].Position.Z > 1.0f)
-				{
-					_balls[i].Position.Z = 1.0f;
-					_balls[i].Velocity.Z = (float)_rnd.NextDouble() * 0.5f;
-					_balls[i].ZBounce = !_balls[i].ZBounce;
-				}
-			}
-
-			//if (frames == 0)
-			{
-
-				Matrix trans = Matrix.Identity;
-				Matrix world = Matrix.Identity;
-				Quaternion rot = Quaternion.Identity;
-				var sortPos = _balls.OrderByDescending(item => item.Position.Z).ToArray();
-				for (int i = 0; i < count * 4; i += 4)
-				{
-					int arrayindex = i / 4;
-
-					trans = Matrix.Identity;
-					//buffer.World = Matrix.Scaling(0.248f, 0.248f, 1.0f);// *Matrix.Translation(-0.5f + ((float)(i / 4) / (float)count), 0.25f, 0.0f);
-
-					//buffer.World = Matrix.RotationZ(angle[arrayindex]);
-					if (_3d)
-					{
-						rot = Quaternion.RotationYawPitchRoll(0.0f, GorgonMathUtility.Sin(-sortPos[arrayindex].Angle) * 2.0f, -sortPos[arrayindex].Angle);
-						Matrix.RotationQuaternion(ref rot, out world);
-					}
-					else
-						world = Matrix.RotationZ(-sortPos[arrayindex].Angle);
-					world = world * (Matrix.Scaling(sortPos[arrayindex].Scale, sortPos[arrayindex].Scale, 1.0f)) * Matrix.Translation(sortPos[arrayindex].Position.X, sortPos[arrayindex].Position.Y, sortPos[arrayindex].Position.Z);
-					Matrix.Multiply(ref world, ref pvw, out trans);
-
-
-
-
-					/*				buffer.World = Matrix.Identity;
-									buffer.World = Matrix.Scaling(0.125f, 0.125f, 1.0f) * Matrix.Translation(-0.5f + ((float)i / 32767.0f), 0.25f, 0.0f);
-									//buffer.World = Matrix.Transpose(buffer.World);
-									buffer.Alpha.Alpha = 1.0f;
-									using (GorgonDataStream stream = _changeBuffer.GetBuffer())
-									{
-										stream.Write(buffer);
-									}*/
-					_sprite[i].Color = new GorgonColor(sortPos[arrayindex].Color.X, sortPos[arrayindex].Color.Y, sortPos[arrayindex].Color.Z, sortPos[arrayindex].Color.W);
-					//_sprite[i].Color = new GorgonColor(System.Drawing.Color.White);
-					_sprite[i + 1].Color = _sprite[i].Color;
-					_sprite[i + 2].Color = _sprite[i].Color;
-					_sprite[i + 3].Color = _sprite[i].Color;
-
-					_sprite[i].Position = Vector3.Transform(new Vector3(-0.1401f, 0.1401f, 0.0f), trans);
-					_sprite[i + 1].Position = Vector3.Transform(new Vector3(0.1401f, 0.1401f, 0.0f), trans);
-					_sprite[i + 2].Position = Vector3.Transform(new Vector3(-0.1401f, -0.1401f, 0.0f), trans);
-					_sprite[i + 3].Position = Vector3.Transform(new Vector3(0.1401f, -0.1401f, 0.0f), trans);
-
-					//_sprite[i].Position = new Vector4(-0.5f, 0.5f, 0.0f, 1.0f);
-					//_sprite[i + 1].Position = new Vector4(0.5f, 0.5f, 0.0f, 1.0f);
-					//_sprite[i + 2].Position = new Vector4(-0.5f, -0.5f, 0.0f, 1.0f);
-					//_sprite[i + 3].Position = new Vector4(0.5f, -0.5f, 0.0f, 1.0f);
-
-					if (sortPos[arrayindex].Checkered)
-					{
-						_sprite[i].UV = new Vector2(0.503f, 0.0f);
-						_sprite[i + 1].UV = new Vector2(1.0f, 0.0f);
-						_sprite[i + 2].UV = new Vector2(0.503f, 0.5f);
-						_sprite[i + 3].UV = new Vector2(1.0f, 0.5f);
-					}
-					else
-					{
-						_sprite[i].UV = new Vector2(0.0f, 0.503f);
-						_sprite[i + 1].UV = new Vector2(0.5f, 0.503f);
-						_sprite[i + 2].UV = new Vector2(0.0f, 1.0f);
-						_sprite[i + 3].UV = new Vector2(0.5f, 1.0f);
-					}
-				}
-
-//				_tempStream.Position = 0;
-//				_tempStream.WriteRange(_sprite);
-				//_graphics.Context.UpdateSubresource(new DX.DataBox { DataPointer = _tempStream.BasePointer, RowPitch = (int)_tempStream.Length }, _vertices);
-				/*_graphics.Context.UpdateSubresource(new DX.DataBox { DataPointer = _tempStream.BasePointer, RowPitch = (int)_tempStream.Length }, _vertices, 0, new D3D.ResourceRegion()
-					{
-						Left = 0,
-						Right = 81920,
-						Top = 0,
-						Bottom = 1,
-						Front = 0,
-						Back = 1
-					});*/
-				//frames = Int32.MaxValue;
-			}
-
-			_needsUpdate = true;
-
-			//_tempStream.Position = 0;
-			//_tempStream.WriteRange(_sprite);
-			//_tempStream.Position = 0;
-			//_vertices.Update(_tempStream);
-		}
-
-		//int frames = 0;
-		//int textPos = 0;
-
-		/// <summary>
-		///
-		/// </summary>
-		public void Draw()
-		{
-			if (_needsUpdate)
-			{
-				using (GorgonDataStream vstream = _vertices.Lock(BufferLockFlags.Write | BufferLockFlags.Discard))
-				{
-					vstream.WriteRange(_sprite);
-					//using (GorgonDataStream cstream = _cols.Lock(BufferLockFlags.Write | BufferLockFlags.Discard))
-					//{
-					//    for (int i = 0; i < count * 4; i++)
-					//    {
-					//        vstream.Write(_sprite[i].Position);
-					//        cstream.Write(_sprite[i].Color);
-					//    }
-					//    _cols.Unlock();
-					_vertices.Unlock();
-					//}
-				}
-				_needsUpdate = false;
-			}
-		}
-
-		#region IDisposable Members
-		/// <summary>
-		/// Releases unmanaged and - optionally - managed resources
-		/// </summary>
-		/// <param name="disposing"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param>
-		private void Dispose(bool disposing)
-		{
-			if (!_disposed)
-			{
-				if (disposing)
-				{
-					Gorgon.Log.Print("Test: Destroy objects.", Diagnostics.LoggingLevel.Verbose);
-					Destroy();
-				}
-
-				_disposed = true;
-			}
-		}
-
-		/// <summary>
-		/// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
-		/// </summary>
-		public void Dispose()
-		{
-			Dispose(true);
-			GC.SuppressFinalize(this);
-		}
-		#endregion
-	}
-}


Fixed a bug with r1278

Fixed a bug with r1278

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

--- Duplicati/Library/Main/BackupEntry.cs
+++ Duplicati/Library/Main/BackupEntry.cs
@@ -125,7 +125,8 @@
         {
             m_filename = filename;
             m_fileentry = entry;
-            m_size = entry.Size;
+            if (entry != null)
+                m_size = entry.Size;
             m_time = time;
             m_isFull = isFull;
             m_timeString = timeString;


Added tooltip for Galactic POI dropdown in 3D map

--- EDDiscovery/3DMap/FormMap.Designer.cs
+++ EDDiscovery/3DMap/FormMap.Designer.cs
@@ -52,7 +52,7 @@
             {
             this.components = new System.ComponentModel.Container();
             System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormMap));
-            this.glControlContainer = new Panel();
+            this.glControlContainer = new System.Windows.Forms.Panel();
             this.textboxFrom = new ExtendedControls.AutoCompleteTextBox();
             this.labelSystemCoords = new System.Windows.Forms.Label();
             this.toolStripShowAllStars = new System.Windows.Forms.ToolStrip();
@@ -461,6 +461,7 @@
             this.toolStripDropDownButtonGalObjects.Name = "toolStripDropDownButtonGalObjects";
             this.toolStripDropDownButtonGalObjects.Size = new System.Drawing.Size(29, 37);
             this.toolStripDropDownButtonGalObjects.Text = "toolStripDropDownButton1";
+            this.toolStripDropDownButtonGalObjects.ToolTipText = "Enable or Disable the Display of Galactic Objects and other POIs";
             //
             // toolStripButtonGrid
             //


Update copyright.

Update copyright.

--- ExifRename/Properties/AssemblyInfo.cs
+++ ExifRename/Properties/AssemblyInfo.cs
@@ -10,7 +10,7 @@
 [assembly: AssemblyConfiguration("")]
 [assembly: AssemblyCompany("Defiant Technologies, LLC")]
 [assembly: AssemblyProduct("ExifRename")]
-[assembly: AssemblyCopyright("Copyright © Defiant Technologies 2011")]
+[assembly: AssemblyCopyright("Copyright © Defiant Technologies 2011-2018")]
 [assembly: AssemblyTrademark("")]
 [assembly: AssemblyCulture("")]


Simplify branching

Simplify branching

--- src/Build/BackEnd/Components/ProjectCache/ProjectCacheService.cs
+++ src/Build/BackEnd/Components/ProjectCache/ProjectCacheService.cs
@@ -251,19 +251,21 @@
                 // TODO: remove after we change VS to set the cache descriptor via build parameters.
                 // VS workaround needs to wait until the first project is evaluated to extract enough information to initialize the plugin.
                 // No cache request can progress until late initialization is complete.
-                if (_projectCacheDescriptor.VsWorkaround &&
-                    Interlocked.CompareExchange(
-                        ref LateInitializationForVSWorkaroundCompleted,
-                        new TaskCompletionSource<bool>(),
-                        null) is null)
-                {
-                    await LateInitializePluginForVsWorkaround(request);
-                    LateInitializationForVSWorkaroundCompleted.SetResult(true);
-                }
-                else if (_projectCacheDescriptor.VsWorkaround)
-                {
-                    // Can't be null. If the thread got here it means another thread initialized the completion source.
-                    await LateInitializationForVSWorkaroundCompleted!.Task;
+                if (_projectCacheDescriptor.VsWorkaround)
+                {
+                    if (Interlocked.CompareExchange(
+                            ref LateInitializationForVSWorkaroundCompleted,
+                            new TaskCompletionSource<bool>(),
+                            null) is null)
+                    {
+                        await LateInitializePluginForVsWorkaround(request);
+                        LateInitializationForVSWorkaroundCompleted.SetResult(true);
+                    }
+                    else
+                    {
+                        // Can't be null. If the thread got here it means another thread initialized the completion source.
+                        await LateInitializationForVSWorkaroundCompleted!.Task;
+                    }
                 }

                 ErrorUtilities.VerifyThrowInternalError(


add 489 to skipped snapshots

add 489 to skipped snapshots

ref #200

--- src/FilterLists.Data/Seed/Extensions/SeedFilterListsDbContext.cs
+++ src/FilterLists.Data/Seed/Extensions/SeedFilterListsDbContext.cs
@@ -112,7 +112,7 @@
         //TODO: https://github.com/collinbarrett/FilterLists/issues/201
         private static void SetCantSnapshot(DbContext dbContext)
         {
-            const string rawSqlString = "UPDATE filterlists SET CantSnapshot = 1 WHERE id IN(48, 149, 173, 185, 188, 189, 352)";
+            const string rawSqlString = "UPDATE filterlists SET CantSnapshot = 1 WHERE id IN(48, 149, 173, 185, 188, 189, 352, 489)";
             dbContext.Database.ExecuteSqlCommand(rawSqlString);
             dbContext.SaveChanges();
         }