Changed accessibility of the SQLiteMembershipUtils class. Added CreateDatabaseIfRequired method that takes in an SQLiteConnection. Refactored utils methods to wrap every command in a using statement. ValidateDatabase commands are now wrapped in a transaction.

--- SQLiteMembership/SQLiteMembership/SQLiteMembershipUtils.cs
+++ SQLiteMembership/SQLiteMembership/SQLiteMembershipUtils.cs
@@ -4,7 +4,7 @@

 namespace SQLiteMembership
 {
-    static class SQLiteMembershipUtils
+    public static class SQLiteMembershipUtils
     {
         private static readonly object SyncObject = new object();

@@ -21,8 +21,16 @@
                 if (string.IsNullOrWhiteSpace(sdfPath))
                     return;

-                ValidateDatabase(connectionString, applicationName);
-            }
+                using (var connection = new SQLiteConnection(connectionString))
+                {
+                    ValidateDatabase(connection, applicationName);
+                }
+            }
+        }
+
+        public static void CreateDatabaseIfRequired(SQLiteConnection connection, string applicationName)
+        {
+            ValidateDatabase(connection, applicationName);
         }

         public static string GetApplicationId(string connectionString, string applicationName)
@@ -72,150 +80,189 @@
             return System.IO.Path.Combine(data, inputString.Substring(length));
         }

-        private static void ValidateDatabase(string connectionString, string applicationName)
-        {
-            using (var con = SQLiteUtils.GetConnection(connectionString))
-            {
-                con.Open();
-
-                using (var cmd = con.CreateCommand())
-                {
-                    CreateApplications(cmd, applicationName);
-                    CreateRoles(cmd);
-                    CreateUsers(cmd);
-                    CreateUsersInRoles(cmd);
-                    CreateProfile(cmd);
-                }
-            }
-        }
-
-        private static void CreateApplications(IDbCommand cmd, string applicationName)
-        {
-            cmd.CommandText = "CREATE TABLE IF NOT EXISTS [aspnet_Applications] (" +
-                              "[ApplicationId] TEXT PRIMARY KEY NOT NULL," +
-                              "[ApplicationName] NVARCHAR(256) NOT NULL," +
-                              "[LoweredApplicationName] NVARCHAR(256) NOT NULL," +
-                              "[Description] NVARCHAR(256) NULL" +
-                              ")";
-            cmd.ExecuteNonQuery();
-
-            cmd.CommandText = "CREATE INDEX IF NOT EXISTS [aspnet_Applications_Index] " +
-                              "ON [aspnet_Applications] ([LoweredApplicationName] ASC);";
-            cmd.ExecuteNonQuery();
-
-            cmd.CommandText = "CREATE UNIQUE INDEX IF NOT EXISTS [UQ__A__3091033107020F21] " +
-                              "ON [aspnet_Applications] ([ApplicationName] ASC);";
-            cmd.ExecuteNonQuery();
-
-            cmd.CommandText = "INSERT OR IGNORE INTO [aspnet_Applications] (" +
-                              "[ApplicationName]," +
-                              "[LoweredApplicationName]," +
-                              "[ApplicationId]" +
-                              ") VALUES (" +
-                              "@ApplicationName," +
-                              "@LoweredApplicationName," +
-                              "@ApplicationId" +
-                              ")";
-            cmd.Parameters.Add(cmd.CreateParameter("@ApplicationName", applicationName));
-            cmd.Parameters.Add(cmd.CreateParameter("@LoweredApplicationName", applicationName.ToLowerInvariant()));
-            cmd.Parameters.Add(cmd.CreateParameter("@ApplicationId", Guid.NewGuid().ToString()));
-            cmd.ExecuteNonQuery();
-        }
-
-        private static void CreateRoles(IDbCommand cmd)
-        {
-            cmd.CommandText = "CREATE TABLE IF NOT EXISTS [aspnet_Roles] (" +
-                              "[ApplicationId] TEXT NOT NULL," +
-                              "[RoleId] TEXT PRIMARY KEY NOT NULL," +
-                              "[RoleName] NVARCHAR(256) NOT NULL," +
-                              "[LoweredRoleName] NVARCHAR(256) NOT NULL," +
-                              "[Description] NVARCHAR(256) NULL," +
-                              "FOREIGN KEY ([ApplicationId]) REFERENCES [aspnet_Applications]([ApplicationId]) ON DELETE NO ACTION ON UPDATE NO ACTION" +
-                              ");";
-            cmd.ExecuteNonQuery();
-        }
-
-        private static void CreateUsers(IDbCommand cmd)
-        {
-            cmd.CommandText = "CREATE TABLE IF NOT EXISTS [aspnet_Users] (" +
-                              "[ApplicationId] TEXT NOT NULL," +
-                              "[UserId] TEXT PRIMARY KEY NOT NULL," +
-                              "[UserName] NVARCHAR(256) NOT NULL," +
-                              "[LoweredUserName] NVARCHAR(256) NOT NULL," +
-                              "[MobileAlias] NVARCHAR(16) NULL," +
-                              "[IsAnonymous] INTEGER NOT NULL CHECK ([IsAnonymous] IN (0, 1))," +
-                              "[LastActivityDate] DATETIME NOT NULL," +
-                              "FOREIGN KEY ([ApplicationId]) REFERENCES [aspnet_Applications]([ApplicationId]) ON DELETE NO ACTION ON UPDATE NO ACTION" +
-                              ");";
-            cmd.ExecuteNonQuery();
-
-            cmd.CommandText = "CREATE UNIQUE INDEX IF NOT EXISTS [aspnet_Users_Index] " +
-                              "ON [aspnet_Users] ([ApplicationId] ASC,[LoweredUserName] ASC);";
-            cmd.ExecuteNonQuery();
-
-            cmd.CommandText = "CREATE INDEX IF NOT EXISTS [aspnet_Users_Index2] " +
-                              "ON [aspnet_Users] ([ApplicationId] ASC,[LastActivityDate] ASC);";
-            cmd.ExecuteNonQuery();
-
-            cmd.CommandText = "CREATE TABLE IF NOT EXISTS [aspnet_Membership] (" +
-                              "[ApplicationId] TEXT NOT NULL," +
-                              "[UserId] TEXT PRIMARY KEY NOT NULL," +
-                              "[Password] NVARCHAR(128) NOT NULL," +
-                              "[PasswordFormat] INTEGER NOT NULL," +
-                              "[PasswordSalt] NVARCHAR(128) NOT NULL," +
-                              "[MobilePIN] NVARCHAR(16) NULL," +
-                              "[Email] NVARCHAR(256) NULL," +
-                              "[LoweredEmail] NVARCHAR(256) NULL," +
-                              "[PasswordQuestion] NVARCHAR(256) NULL," +
-                              "[PasswordAnswer] NVARCHAR(256) NULL," +
-                              "[IsApproved] INTEGER NOT NULL CHECK ([IsApproved] IN (0, 1))," +
-                              "[IsLockedOut] INTEGER NOT NULL CHECK ([IsLockedOut] IN (0, 1))," +
-                              "[CreateDate] DATETIME DEFAULT (datetime('now','localtime')) NOT NULL," +
-                              "[LastLoginDate] DATETIME NOT NULL," +
-                              "[LastPasswordChangedDate] DATETIME NOT NULL," +
-                              "[LastLockoutDate] DATETIME NOT NULL," +
-                              "[FailedPasswordAttemptCount] INTEGER NOT NULL," +
-                              "[FailedPasswordAttemptWindowStart] DATETIME NOT NULL," +
-                              "[FailedPasswordAnswerAttemptCount] INTEGER NOT NULL," +
-                              "[FailedPasswordAnswerAttemptWindowStart] DATETIME NOT NULL," +
-                              "[Comment] NTEXT NULL," +
-                              "FOREIGN KEY ([ApplicationId]) REFERENCES [aspnet_Applications]([ApplicationId]) ON DELETE NO ACTION ON UPDATE NO ACTION," +
-                              "FOREIGN KEY ([UserId]) REFERENCES [aspnet_Users]([UserId]) ON DELETE NO ACTION ON UPDATE NO ACTION" +
-                              ");";
-            cmd.ExecuteNonQuery();
-
-            cmd.CommandText = "CREATE INDEX IF NOT EXISTS [aspnet_Membership_index] " +
-                              "ON [aspnet_Membership] ([ApplicationId] ASC,[LoweredEmail] ASC);";
-            cmd.ExecuteNonQuery();
-        }
-
-        private static void CreateUsersInRoles(IDbCommand cmd)
-        {
-            cmd.CommandText = "CREATE TABLE IF NOT EXISTS [aspnet_UsersInRoles] (" +
-                              "[UserId] TEXT NOT NULL," +
-                              "[RoleId] TEXT NOT NULL," +
-                              "PRIMARY KEY ([UserId], [RoleId])," +
-                              "FOREIGN KEY ([UserId]) REFERENCES [aspnet_Users]([UserId]) ON DELETE NO ACTION ON UPDATE NO ACTION," +
-                              "FOREIGN KEY ([RoleId]) REFERENCES [aspnet_Roles]([RoleId]) ON DELETE NO ACTION ON UPDATE NO ACTION" +
-                              ");";
-            cmd.ExecuteNonQuery();
-
-            cmd.CommandText = "CREATE INDEX IF NOT EXISTS [aspnet_UsersInRoles_index] " +
-                              "ON [aspnet_UsersInRoles] ([RoleId] ASC);";
-            cmd.ExecuteNonQuery();
-        }
-
-        private static void CreateProfile(IDbCommand cmd)
-        {
-            cmd.CommandText = "CREATE TABLE IF NOT EXISTS [aspnet_Profile] (" +
-                              "[UserId] TEXT PRIMARY KEY NOT NULL," +
-                              "[property_names] NTEXT NOT NULL," +
-                              "[property_values_string] NTEXT NOT NULL," +
-                              "[property_values_binary] BLOB NOT NULL," +
-                              "[last_updated_date] DATETIME NOT NULL," +
-                              "FOREIGN KEY ([UserId]) REFERENCES [aspnet_Users]([UserId]) ON DELETE NO ACTION ON UPDATE NO ACTION" +
-                              ");";
-            cmd.ExecuteNonQuery();
+        private static void ValidateDatabase(SQLiteConnection connection, string applicationName)
+        {
+            if (connection.State != ConnectionState.Open)
+                connection.Open();
+
+            using (var transaction = connection.BeginTransaction())
+            {
+                CreateApplications(connection, applicationName);
+                CreateRoles(connection);
+                CreateUsers(connection);
+                CreateUsersInRoles(connection);
+                CreateProfile(connection);
+
+                transaction.Commit();
+            }
+        }
+
+        private static void CreateApplications(SQLiteConnection connection, string applicationName)
+        {
+            using (var cmd = connection.CreateCommand())
+            {
+                cmd.CommandText = "CREATE TABLE IF NOT EXISTS [aspnet_Applications] (" +
+                                  "[ApplicationId] TEXT PRIMARY KEY NOT NULL," +
+                                  "[ApplicationName] NVARCHAR(256) NOT NULL," +
+                                  "[LoweredApplicationName] NVARCHAR(256) NOT NULL," +
+                                  "[Description] NVARCHAR(256) NULL" +
+                                  ")";
+                cmd.ExecuteNonQuery();
+            }
+
+            using (var cmd = connection.CreateCommand())
+            {
+                cmd.CommandText = "CREATE INDEX IF NOT EXISTS [aspnet_Applications_Index] " +
+                                  "ON [aspnet_Applications] ([LoweredApplicationName] ASC);";
+                cmd.ExecuteNonQuery();
+            }
+
+            using (var cmd = connection.CreateCommand())
+            {
+                cmd.CommandText = "CREATE UNIQUE INDEX IF NOT EXISTS [UQ__A__3091033107020F21] " +
+                                  "ON [aspnet_Applications] ([ApplicationName] ASC);";
+                cmd.ExecuteNonQuery();
+            }
+
+            using (var cmd = connection.CreateCommand())
+            {
+                cmd.CommandText = "INSERT OR IGNORE INTO [aspnet_Applications] (" +
+                                  "[ApplicationName]," +
+                                  "[LoweredApplicationName]," +
+                                  "[ApplicationId]" +
+                                  ") VALUES (" +
+                                  "@ApplicationName," +
+                                  "@LoweredApplicationName," +
+                                  "@ApplicationId" +
+                                  ")";
+                cmd.Parameters.Add(cmd.CreateParameter("@ApplicationName", applicationName));
+                cmd.Parameters.Add(cmd.CreateParameter("@LoweredApplicationName", applicationName.ToLowerInvariant()));
+                cmd.Parameters.Add(cmd.CreateParameter("@ApplicationId", Guid.NewGuid().ToString()));
+                cmd.ExecuteNonQuery();
+            }
+        }
+
+        private static void CreateRoles(SQLiteConnection connection)
+        {
+            using (var cmd = connection.CreateCommand())
+            {
+                cmd.CommandText = "CREATE TABLE IF NOT EXISTS [aspnet_Roles] (" +
+                                  "[ApplicationId] TEXT NOT NULL," +
+                                  "[RoleId] TEXT PRIMARY KEY NOT NULL," +
+                                  "[RoleName] NVARCHAR(256) NOT NULL," +
+                                  "[LoweredRoleName] NVARCHAR(256) NOT NULL," +
+                                  "[Description] NVARCHAR(256) NULL," +
+                                  "FOREIGN KEY ([ApplicationId]) REFERENCES [aspnet_Applications]([ApplicationId]) ON DELETE NO ACTION ON UPDATE NO ACTION" +
+                                  ");";
+                cmd.ExecuteNonQuery();
+            }
+        }
+
+        private static void CreateUsers(SQLiteConnection connection)
+        {
+            using (var cmd = connection.CreateCommand())
+            {
+                cmd.CommandText = "CREATE TABLE IF NOT EXISTS [aspnet_Users] (" +
+                                  "[ApplicationId] TEXT NOT NULL," +
+                                  "[UserId] TEXT PRIMARY KEY NOT NULL," +
+                                  "[UserName] NVARCHAR(256) NOT NULL," +
+                                  "[LoweredUserName] NVARCHAR(256) NOT NULL," +
+                                  "[MobileAlias] NVARCHAR(16) NULL," +
+                                  "[IsAnonymous] INTEGER NOT NULL CHECK ([IsAnonymous] IN (0, 1))," +
+                                  "[LastActivityDate] DATETIME NOT NULL," +
+                                  "FOREIGN KEY ([ApplicationId]) REFERENCES [aspnet_Applications]([ApplicationId]) ON DELETE NO ACTION ON UPDATE NO ACTION" +
+                                  ");";
+                cmd.ExecuteNonQuery();
+            }
+
+            using (var cmd = connection.CreateCommand())
+            {
+                cmd.CommandText = "CREATE UNIQUE INDEX IF NOT EXISTS [aspnet_Users_Index] " +
+                                  "ON [aspnet_Users] ([ApplicationId] ASC,[LoweredUserName] ASC);";
+                cmd.ExecuteNonQuery();
+            }
+
+            using (var cmd = connection.CreateCommand())
+            {
+                cmd.CommandText = "CREATE INDEX IF NOT EXISTS [aspnet_Users_Index2] " +
+                                  "ON [aspnet_Users] ([ApplicationId] ASC,[LastActivityDate] ASC);";
+                cmd.ExecuteNonQuery();
+            }
+
+            using (var cmd = connection.CreateCommand())
+            {
+                cmd.CommandText = "CREATE TABLE IF NOT EXISTS [aspnet_Membership] (" +
+                                  "[ApplicationId] TEXT NOT NULL," +
+                                  "[UserId] TEXT PRIMARY KEY NOT NULL," +
+                                  "[Password] NVARCHAR(128) NOT NULL," +
+                                  "[PasswordFormat] INTEGER NOT NULL," +
+                                  "[PasswordSalt] NVARCHAR(128) NOT NULL," +
+                                  "[MobilePIN] NVARCHAR(16) NULL," +
+                                  "[Email] NVARCHAR(256) NULL," +
+                                  "[LoweredEmail] NVARCHAR(256) NULL," +
+                                  "[PasswordQuestion] NVARCHAR(256) NULL," +
+                                  "[PasswordAnswer] NVARCHAR(256) NULL," +
+                                  "[IsApproved] INTEGER NOT NULL CHECK ([IsApproved] IN (0, 1))," +
+                                  "[IsLockedOut] INTEGER NOT NULL CHECK ([IsLockedOut] IN (0, 1))," +
+                                  "[CreateDate] DATETIME DEFAULT (datetime('now','localtime')) NOT NULL," +
+                                  "[LastLoginDate] DATETIME NOT NULL," +
+                                  "[LastPasswordChangedDate] DATETIME NOT NULL," +
+                                  "[LastLockoutDate] DATETIME NOT NULL," +
+                                  "[FailedPasswordAttemptCount] INTEGER NOT NULL," +
+                                  "[FailedPasswordAttemptWindowStart] DATETIME NOT NULL," +
+                                  "[FailedPasswordAnswerAttemptCount] INTEGER NOT NULL," +
+                                  "[FailedPasswordAnswerAttemptWindowStart] DATETIME NOT NULL," +
+                                  "[Comment] NTEXT NULL," +
+                                  "FOREIGN KEY ([ApplicationId]) REFERENCES [aspnet_Applications]([ApplicationId]) ON DELETE NO ACTION ON UPDATE NO ACTION," +
+                                  "FOREIGN KEY ([UserId]) REFERENCES [aspnet_Users]([UserId]) ON DELETE NO ACTION ON UPDATE NO ACTION" +
+                                  ");";
+                cmd.ExecuteNonQuery();
+            }
+
+            using (var cmd = connection.CreateCommand())
+            {
+                cmd.CommandText = "CREATE INDEX IF NOT EXISTS [aspnet_Membership_index] " +
+                                  "ON [aspnet_Membership] ([ApplicationId] ASC,[LoweredEmail] ASC);";
+                cmd.ExecuteNonQuery();
+            }
+        }
+
+        private static void CreateUsersInRoles(SQLiteConnection connection)
+        {
+            using (var cmd = connection.CreateCommand())
+            {
+                cmd.CommandText = "CREATE TABLE IF NOT EXISTS [aspnet_UsersInRoles] (" +
+                                  "[UserId] TEXT NOT NULL," +
+                                  "[RoleId] TEXT NOT NULL," +
+                                  "PRIMARY KEY ([UserId], [RoleId])," +
+                                  "FOREIGN KEY ([UserId]) REFERENCES [aspnet_Users]([UserId]) ON DELETE NO ACTION ON UPDATE NO ACTION," +
+                                  "FOREIGN KEY ([RoleId]) REFERENCES [aspnet_Roles]([RoleId]) ON DELETE NO ACTION ON UPDATE NO ACTION" +
+                                  ");";
+                cmd.ExecuteNonQuery();
+            }
+
+            using (var cmd = connection.CreateCommand())
+            {
+                cmd.CommandText = "CREATE INDEX IF NOT EXISTS [aspnet_UsersInRoles_index] " +
+                                  "ON [aspnet_UsersInRoles] ([RoleId] ASC);";
+                cmd.ExecuteNonQuery();
+            }
+        }
+
+        private static void CreateProfile(SQLiteConnection connection)
+        {
+            using (var cmd = connection.CreateCommand())
+            {
+                cmd.CommandText = "CREATE TABLE IF NOT EXISTS [aspnet_Profile] (" +
+                                  "[UserId] TEXT PRIMARY KEY NOT NULL," +
+                                  "[property_names] NTEXT NOT NULL," +
+                                  "[property_values_string] NTEXT NOT NULL," +
+                                  "[property_values_binary] BLOB NOT NULL," +
+                                  "[last_updated_date] DATETIME NOT NULL," +
+                                  "FOREIGN KEY ([UserId]) REFERENCES [aspnet_Users]([UserId]) ON DELETE NO ACTION ON UPDATE NO ACTION" +
+                                  ");";
+                cmd.ExecuteNonQuery();
+            }
         }
     }
 }


Removed AmazonS3DataStore Abstract and added code to existing S3DataStore.  Started implementation of pulling study setup from url for #514.  I am waiting to hear back from Dylan on push error.

--- Sensus.Shared/DataStores/Remote/AmazonS3RemoteDataStore.cs
+++ Sensus.Shared/DataStores/Remote/AmazonS3RemoteDataStore.cs
@@ -88,8 +88,17 @@
     /// The preceding command will not delete your bucket or data.
     ///
     /// </summary>
-    public class AmazonS3RemoteDataStore : AmazonS3DataStore
+    public class AmazonS3RemoteDataStore : RemoteDataStore
     {
+        private string _region;
+        private string _bucket;
+        private string _folder;
+        private string _iamAccessKey;
+        private string _iamSecretKey;
+        private string _pinnedServiceURL;
+        private string _pinnedPublicKey;
+        private int _putCount;
+        private int _successfulPutCount;

         /// <summary>
         /// The AWS region in which <see cref="Bucket"/> resides (e.g., us-east-2).
@@ -253,5 +262,234 @@
             _pinnedPublicKey = null;
             _putCount = _successfulPutCount = 0;
         }
+
+        public override void Start()
+        {
+            if (_pinnedServiceURL != null)
+            {
+                // ensure that we have a pinned public key if we're pinning the service URL
+                if (string.IsNullOrWhiteSpace(_pinnedPublicKey))
+                {
+                    throw new Exception("Ensure that a pinned public key is provided to the AWS S3 remote data store.");
+                }
+                // set up a certificate validation callback if we're pinning and have a public key
+                else
+                {
+                    ServicePointManager.ServerCertificateValidationCallback += ServerCertificateValidationCallback;
+                }
+            }
+
+            if (string.IsNullOrWhiteSpace(_iamAccessKey) || string.IsNullOrWhiteSpace(_iamSecretKey))
+            {
+                throw new Exception("Must specify an IAM account within the S3 remote data store.");
+            }
+
+            // start base last so we're set up for any callbacks that get scheduled
+            base.Start();
+        }
+
+        private bool ServerCertificateValidationCallback(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sllPolicyErrors)
+        {
+            if (certificate == null)
+            {
+                return false;
+            }
+
+            if (certificate.Subject == "CN=" + _pinnedServiceURL.Substring("https://".Length))
+            {
+                return Convert.ToBase64String(certificate.GetPublicKey()) == _pinnedPublicKey;
+            }
+            else
+            {
+                return true;
+            }
+        }
+
+        private AmazonS3Client InitializeS3()
+        {
+            AWSConfigs.LoggingConfig.LogMetrics = false;  // getting many uncaught exceptions from AWS S3 related to logging metrics
+            AmazonS3Config clientConfig = new AmazonS3Config();
+            clientConfig.ForcePathStyle = true;  // when using pinning via CloudFront reverse proxy, the bucket name is prepended to the host if the path style is not used. the resulting host does not exist for our reverse proxy, causing DNS name resolution errors. by using the path style, the bucket is appended to the reverse-proxy host and everything goes through fine.
+
+            if (_pinnedServiceURL == null)
+            {
+                clientConfig.RegionEndpoint = RegionEndpoint.GetBySystemName(_region);
+            }
+            else
+            {
+                clientConfig.ServiceURL = _pinnedServiceURL;
+            }
+
+            return new AmazonS3Client(_iamAccessKey, _iamSecretKey, clientConfig);
+        }
+
+        public override Task WriteDataStreamAsync(Stream stream, string name, string contentType, CancellationToken cancellationToken)
+        {
+            return Task.Run(async () =>
+            {
+                AmazonS3Client s3 = null;
+
+                try
+                {
+                    s3 = InitializeS3();
+
+                    await Put(s3, stream, (string.IsNullOrWhiteSpace(_folder) ? "" : _folder + "/") + (string.IsNullOrWhiteSpace(Protocol.ParticipantId) ? "" : Protocol.ParticipantId + "/") + name, contentType, cancellationToken);
+                }
+                finally
+                {
+                    DisposeS3(s3);
+                }
+            });
+        }
+
+        public override Task WriteDatumAsync(Datum datum, CancellationToken cancellationToken)
+        {
+            return Task.Run(async () =>
+            {
+                AmazonS3Client s3 = null;
+
+                try
+                {
+                    s3 = InitializeS3();
+                    string datumJSON = datum.GetJSON(Protocol.JsonAnonymizer, true);
+                    byte[] datumJsonBytes = Encoding.UTF8.GetBytes(datumJSON);
+                    MemoryStream dataStream = new MemoryStream();
+                    dataStream.Write(datumJsonBytes, 0, datumJsonBytes.Length);
+                    dataStream.Position = 0;
+
+                    await Put(s3, dataStream, GetDatumKey(datum), "application/json", cancellationToken);
+                }
+                finally
+                {
+                    DisposeS3(s3);
+                }
+            });
+        }
+
+        private Task Put(AmazonS3Client s3, Stream stream, string key, string contentType, CancellationToken cancellationToken)
+        {
+            return Task.Run(async () =>
+            {
+                _putCount++;
+
+                try
+                {
+                    PutObjectRequest putRequest = new PutObjectRequest
+                    {
+                        BucketName = _bucket,
+                        CannedACL = S3CannedACL.BucketOwnerFullControl,  // without this, the bucket owner will not have access to the uploaded data
+                        InputStream = stream,
+                        Key = key,
+                        ContentType = contentType
+                    };
+
+                    HttpStatusCode putStatus = (await s3.PutObjectAsync(putRequest, cancellationToken)).HttpStatusCode;
+
+                    if (putStatus == HttpStatusCode.OK)
+                    {
+                        _successfulPutCount++;
+                    }
+                    else
+                    {
+                        throw new Exception("Bad status code:  " + putStatus);
+                    }
+                }
+                catch (WebException ex)
+                {
+                    if (ex.Status == WebExceptionStatus.TrustFailure)
+                    {
+                        string message = "A trust failure has occurred between Sensus and the AWS S3 endpoint. This is likely the result of a failed match between the server's public key and the pinned public key within the Sensus AWS S3 remote data store.";
+                        SensusException.Report(message, ex);
+                    }
+
+                    throw ex;
+                }
+                catch (Exception ex)
+                {
+                    string message = "Failed to write data stream to Amazon S3 bucket \"" + _bucket + "\":  " + ex.Message;
+                    SensusServiceHelper.Get().Logger.Log(message + " " + ex.Message, LoggingLevel.Normal, GetType());
+                    throw new Exception(message, ex);
+                }
+            });
+        }
+
+        public override string GetDatumKey(Datum datum)
+        {
+            return (string.IsNullOrWhiteSpace(_folder) ? "" : _folder + "/") + (string.IsNullOrWhiteSpace(Protocol.ParticipantId) ? "" : Protocol.ParticipantId + "/") + datum.GetType().Name + "/" + datum.Id + ".json";
+        }
+
+        public override async Task<T> GetDatumAsync<T>(string datumKey, CancellationToken cancellationToken)
+        {
+            AmazonS3Client s3 = null;
+
+            try
+            {
+                s3 = InitializeS3();
+
+                Stream responseStream = (await s3.GetObjectAsync(_bucket, datumKey, cancellationToken)).ResponseStream;
+                T datum = null;
+                using (StreamReader reader = new StreamReader(responseStream))
+                {
+                    string datumJSON = reader.ReadToEnd().Trim();
+                    datumJSON = SensusServiceHelper.Get().ConvertJsonForCrossPlatform(datumJSON);
+                    datum = Datum.FromJSON(datumJSON) as T;
+                }
+
+                return datum;
+            }
+            catch (Exception ex)
+            {
+                string message = "Failed to get datum from Amazon S3:  " + ex.Message;
+                SensusServiceHelper.Get().Logger.Log(message, LoggingLevel.Normal, GetType());
+                throw new Exception(message);
+            }
+            finally
+            {
+                DisposeS3(s3);
+            }
+        }
+
+        public override void Stop()
+        {
+            base.Stop();
+
+            // remove the callback
+            if (_pinnedServiceURL != null && !string.IsNullOrWhiteSpace(_pinnedPublicKey))
+            {
+                ServicePointManager.ServerCertificateValidationCallback -= ServerCertificateValidationCallback;
+            }
+        }
+
+        private void DisposeS3(AmazonS3Client s3)
+        {
+            if (s3 != null)
+            {
+                try
+                {
+                    s3.Dispose();
+                }
+                catch (Exception ex)
+                {
+                    SensusServiceHelper.Get().Logger.Log("Failed to dispose Amazon S3 client:  " + ex.Message, LoggingLevel.Normal, GetType());
+                }
+            }
+        }
+
+        public override bool TestHealth(ref List<Tuple<string, Dictionary<string, string>>> events)
+        {
+            bool restart = base.TestHealth(ref events);
+
+            string eventName = TrackedEvent.Health + ":" + GetType().Name;
+            Dictionary<string, string> properties = new Dictionary<string, string>
+            {
+                { "Put Success", Convert.ToString(_successfulPutCount.RoundToWholePercentageOf(_putCount, 5)) }
+            };
+
+            Analytics.TrackEvent(eventName, properties);
+
+            events.Add(new Tuple<string, Dictionary<string, string>>(eventName, properties));
+
+            return restart;
+        }
     }
 }


unit tolerance associated to the CRSData

--- src/GIS.cs
+++ src/GIS.cs
@@ -132,6 +132,14 @@
             }

             /// <summary>
+            /// retrieve measure unit tolerance based on the domain default length tolerance
+            /// </summary>
+            public double UnitTolerance(MUDomain mud)
+            {
+                return mud.Length.DefaultTolerance.Convert(mud.Length.MU, Unit);
+            }
+
+            /// <summary>
             /// Retrieve proj4 string
             /// </summary>
             public string Proj4String


US5690: error labels when signing in text

--- SignInCheckIn/SignInCheckIn/Services/ChildSigninService.cs
+++ SignInCheckIn/SignInCheckIn/Services/ChildSigninService.cs
@@ -104,12 +104,12 @@

                 if (!mpEventParticipant.HasKidsClubGroup)
                 {
-                    eventParticipant.SignInErrorMessage = $"{eventDto.EventTitle}: {eventParticipant.FirstName} is not in a Kids Club Group";
+                    eventParticipant.SignInErrorMessage = $"Please go to the Kids Club Info Desk and give them this label.  ERROR: {eventParticipant.FirstName} is not in a Kids Club Group ({eventDto.EventTitle})";
                 }
                 else if (!mpEventParticipant.HasRoomAssignment)
                 {
                     var group = mpEventParticipant.GroupId.HasValue ? _groupRepository.GetGroup(null, mpEventParticipant.GroupId.Value) : null;
-                    eventParticipant.SignInErrorMessage = $"{eventDto.EventTitle}: {eventParticipant.FirstName} is in '{group?.Name}', but group is not configured on event.";
+                    eventParticipant.SignInErrorMessage = $"Please go to the Kids Club Info Desk and give them this label.  ERROR: '{group?.Name}' is not assigned to any rooms for {eventDto.EventTitle} for {eventParticipant.FirstName}";
                 }
                 else
                 {


(TFS CS 5983)

(TFS CS 5983)

--- Signum.Web.Extensions/ScriptCombiner/CombinerHtmlHelper.cs
+++ Signum.Web.Extensions/ScriptCombiner/CombinerHtmlHelper.cs
@@ -51,7 +51,7 @@
             string content = "";
 #if (DEBUG)
             content = files.ToString(f => "<link href=\"{0}\" rel='stylesheet' type='text/css' />\n"
-                .Formato(Path.Combine("content", f)), "");
+                .Formato(Path.Combine("content/", f)), "");
             html.ViewContext.HttpContext.Response.Write(content);
             return;
 #endif


Add more client side checks (#1547)

Add more client side checks (#1547)

Add more client side checks

--- WalletWasabi/Services/CcjClient.cs
+++ WalletWasabi/Services/CcjClient.cs
@@ -358,7 +358,8 @@
 				var mineCount = myOutputs.Count(x => x.Value == denomPair.value);

 				Money denomination = denomPair.value;
-				Money expectedCoordinatorFee = denomination.Percentage(ongoingRound.State.CoordinatorFeePercent * denomPair.count);
+				int anonset = Math.Min(110, denomPair.count); // https://github.com/zkSNACKs/WalletWasabi/issues/1379
+				Money expectedCoordinatorFee = denomination.Percentage(ongoingRound.State.CoordinatorFeePercent * anonset);
 				for (int i = 0; i < mineCount; i++)
 				{
 					minAmountBack -= expectedCoordinatorFee; // Minus expected coordinator fee.


Condensed PhasorHub initialization to web Startup.

--- Source/Applications/openHistorian/openHistorian/Startup.cs
+++ Source/Applications/openHistorian/openHistorian/Startup.cs
@@ -97,17 +97,18 @@
             // Load phasor hub into application domain, initializing default status and exception handlers
             try
             {
-                using (new PhasorHub(
+                using (PhasorHub hub = new PhasorHub(
                     (message, updateType) => Program.Host.LogWebHostStatusMessage(message, updateType),
                     Program.Host.LogException
-                )) { }
+                ))
+                {
+                    WebExtensions.AddEmbeddedResourceAssembly(hub.GetType().Assembly);
+                }
             }
             catch (Exception ex)
             {
                 Program.Host.LogException(new SecurityException($"Failed to load Phasor Hub: {ex.Message}", ex));
             }
-
-            Load_PhasorWebUIAssembly();

             Load_ModbusAssembly();

@@ -238,25 +239,6 @@
             httpConfig.EnsureInitialized();
         }

-        private void Load_PhasorWebUIAssembly()
-        {
-            try
-            {
-                // Wrap class reference in lambda function to force
-                // assembly load errors to occur within the try-catch
-                new Action(() =>
-                {
-                    // Make embedded resources of PhasorWebUI available to web server
-                    using (PhasorHub hub = new PhasorHub())
-                        WebExtensions.AddEmbeddedResourceAssembly(hub.GetType().Assembly);
-                })();
-            }
-            catch (Exception ex)
-            {
-                Program.Host.LogException(new InvalidOperationException($"Failed to load Modbus assembly: {ex.Message}", ex));
-            }
-        }
-
         private void Load_ModbusAssembly()
         {
             try


GSF.TimeSeries: In DataPublisher, added proper locking around calls to SendNotifications.

git-tfs-id: [https://tfs.codeplex.com/tfs/TFS07]$/gsf/Main;C84234

--- Source/Libraries/GSF.TimeSeries/Transport/DataPublisher.cs
+++ Source/Libraries/GSF.TimeSeries/Transport/DataPublisher.cs
@@ -2449,7 +2449,12 @@
                                     message = string.Format("Registered subscriber \"{0}\" {1} was successfully authenticated.", connection.SubscriberName, connection.ConnectionID);
                                     SendClientResponse(clientID, ServerResponse.Succeeded, ServerCommand.Authenticate, message);
                                     OnStatusMessage(message);
-                                    SendNotifications(connection);
+
+                                    lock (m_clientNotificationsLock)
+                                    {
+                                        // Send any queued notifications to authenticated client
+                                        SendNotifications(connection);
+                                    }
                                 }
                                 else
                                 {
@@ -3235,8 +3240,14 @@

             OnStatusMessage("Client connected to command channel.");

-            if (!RequireAuthentication || connection.Authenticated)
-                SendNotifications(connection);
+            if (connection.Authenticated)
+            {
+                lock (m_clientNotificationsLock)
+                {
+                    // Send any queued notifications to authenticated client
+                    SendNotifications(connection);
+                }
+            }
         }

         private void m_commandChannel_ClientDisconnected(object sender, EventArgs<Guid> e)


Fix a typo in a comment. ***NO_CI***  (changeset 1395705)

--- Src/Compilers/CSharp/Portable/Binder/Binder_Expressions.cs
+++ Src/Compilers/CSharp/Portable/Binder/Binder_Expressions.cs
@@ -6311,7 +6311,7 @@
             if ((!accessType.IsReferenceType && !accessType.IsValueType) || accessType.IsPointerType())
             {
                 // Assume result type of the access is void when result value isn't used and cannot be made nullable.
-                // We are not doing this for types that can be made nullable to still allow expression evalualuator to
+                // We are not doing this for types that can be made nullable to still allow expression evaluator to
                 // to get the value.
                 if (node.Parent?.Kind() == SyntaxKind.ExpressionStatement)
                 {


bump version

bump version

--- CommonAssemblyInfo.cs
+++ CommonAssemblyInfo.cs
@@ -1,4 +1,4 @@
 using System.Reflection;

-[assembly: AssemblyVersion("1.5.0")]
-[assembly: AssemblyFileVersion("1.5.0")]
+[assembly: AssemblyVersion("1.5.1")]
+[assembly: AssemblyFileVersion("1.5.1")]


bump version 2.2.1

bump version 2.2.1

--- CommonAssemblyInfo.cs
+++ CommonAssemblyInfo.cs
@@ -4,4 +4,4 @@
 [assembly: AssemblyProduct("PropertyChanged")]
 [assembly: AssemblyCompany("Simon Cropp and Contributors")]
 [assembly: AssemblyDescription("Fody add-in for injecting INotifyPropertyChanged code into properties.")]
-[assembly: AssemblyVersion("2.2.0")]+[assembly: AssemblyVersion("2.2.1")]


Refactor: updating version to 1.1.2.0

Refactor: updating version to 1.1.2.0

--- CommonAssemblyInfo.cs
+++ CommonAssemblyInfo.cs
@@ -8,5 +8,5 @@
 [assembly: AssemblyTrademark("")]
 [assembly: AssemblyCulture("")]
 [assembly: ComVisible(false)]
-[assembly: AssemblyVersion("0.1.1.0")]
-[assembly: AssemblyFileVersion("0.1.1.0")]+[assembly: AssemblyVersion("0.1.2.0")]
+[assembly: AssemblyFileVersion("0.1.2.0")]


Incremented version number...

Incremented version number...

--- CommonAssemblyInfo.cs
+++ CommonAssemblyInfo.cs
@@ -14,5 +14,5 @@
 [assembly: ComVisible(false)]
 [assembly: CLSCompliant(true)]

-[assembly: AssemblyVersion("0.1.0.11")]
-[assembly: AssemblyFileVersion("0.1.0.11")]+[assembly: AssemblyVersion("0.1.0.12")]
+[assembly: AssemblyFileVersion("0.1.0.12")]


Fixed NRE in AddUI

Fixed NRE in AddUI

--- CommunityEntity.UI.cs
+++ CommunityEntity.UI.cs
@@ -1,4 +1,4 @@
-using UnityEngine;
+using UnityEngine;
 using System.Collections;
 using System.Collections.Generic;
 using System.Linq;
@@ -43,7 +43,12 @@
     public void AddUI( RPCMessage msg )
     {
         var str = msg.read.String();
+
+        if ( string.IsNullOrEmpty( str ) ) return;
+
         var jsonArray = JSON.Array.Parse( str );
+
+        if ( jsonArray == null ) return;

         foreach ( var value in jsonArray )
         {


fixed navigation bug in back button

fixed navigation bug in back button

--- platform/wp7/RhoRubyLib/common/RhodesApp.cs
+++ platform/wp7/RhoRubyLib/common/RhodesApp.cs
@@ -324,10 +324,13 @@
         private void processToolBarCommand(object sender, EventArgs e,  String strAction)
         {

-            if (strAction == "back" && m_backHistory.Count > 0)
-            {
-                Uri destination = m_backHistory.Peek();
-                m_webBrowser.Navigate(destination);
+            if (strAction == "back")
+            {
+                if (m_backHistory.Count > 0)
+                {
+                    Uri destination = m_backHistory.Peek();
+                    m_webBrowser.Navigate(destination);
+                }
                 return;
             }


Adding stub for the test.

Adding stub for the test.

--- eFormSDK.Integration.Tests/SqlControllerTest.cs
+++ eFormSDK.Integration.Tests/SqlControllerTest.cs
@@ -650,6 +650,18 @@
         #region public site
         #region site
         //         public List<SiteName_Dto> SiteGetAll(bool includeRemoved)
+
+        [Test]
+
+        public void SQL_Site_SiteGetAll_DoesReturnAllSites()
+        {
+            // Arrance
+
+            // Act
+
+            // Assert
+            Assert.True(true);
+        }
         #endregion
         #endregion


patch working directory

patch working directory

--- DockerfileTemplate.cs
+++ DockerfileTemplate.cs
@@ -20,6 +20,7 @@
 RUN mkdir /projectBinaries
 {addUser}
 ADD {chownOnAdd}./publish/ /projectBinaries/
+WORKDIR /projectBinaries/

 CMD /projectBinaries/{outputBinaryName}
 ";


Update SmallAppliances.cs

Update SmallAppliances.cs

--- TeamworkStarFruit/CatalogueLib/Products/SmallAppliances.cs
+++ TeamworkStarFruit/CatalogueLib/Products/SmallAppliances.cs
@@ -26,11 +26,15 @@
         public int Affixes { get; private set; }

        public override string ToString()
-        {
-            StringBuilder stroitel = new StringBuilder();
-            stroitel = stroitel.Append(string.Format("{0}", base.ToString()));
-            stroitel = stroitel.Append(string.Format(" Capacity: {0}\n Cable length: {1}\n Affixes: {2}", this.Capacity, this.CableLength, this.Affixes));
-            return stroitel.AppendLine().ToString();
+        {
+            StringBuilder result = new StringBuilder();
+            result = result.Append(string.Format("{0}", base.ToString()));
+            result = result.Append(string.Format(" Capacity: {0}",this.Capacity));
+            result = result.AppendLine();
+            result = result.Append(string.Format(" Cable length: {0}",this.CableLength));
+            result = result.AppendLine();
+            result = result.Append(string.Format(" Affixes: {0}", this.Affixes));
+            return result.AppendLine().ToString();
         }
     }
 }


test if datatype

test if datatype

--- Terradue.Tep/Terradue/Tep/WebServer/Service/Wps.Service.cs
+++ Terradue.Tep/Terradue/Tep/WebServer/Service/Wps.Service.cs
@@ -420,23 +420,25 @@

                 if (execResponse.ProcessOutputs != null) {
                     foreach (OutputDataType output in execResponse.ProcessOutputs) {
-                        if (output.Item != null && ((DataType)(output.Item)).Item != null) {
-                            var item = ((DataType)(output.Item)).Item as ComplexDataType;
-                            if (item.Reference != null && output.Identifier.Value.Equals("result_osd")) {
-                                var reference = item.Reference as OutputReferenceType;
-                                reference.href = context.BaseUrl + "/proxy?url=" + HttpUtility.UrlEncode(reference.href);
-                                item.Reference = reference;
-                                ((DataType)(output.Item)).Item = item;
-                            } else if (item.Any != null) {
-                                var reference = new OutputReferenceType();
-                                reference.mimeType = "application/opensearchdescription+xml";
-                                reference.href = context.BaseUrl + "/proxy/gpod/" + wpsjob.Identifier + "/description";
-                                item.Reference = reference;
-                                item.Any = null;
-                                item.mimeType = "application/xml";
-                                output.Identifier = new CodeType{ Value = "result_osd" };
+                        try{
+                            if(output.Item != null && output.Item is DataType && ((DataType)(output.Item)).Item != null) {
+                                var item = ((DataType)(output.Item)).Item as ComplexDataType;
+                                if (item.Reference != null && output.Identifier.Value.Equals("result_osd")) {
+                                    var reference = item.Reference as OutputReferenceType;
+                                    reference.href = context.BaseUrl + "/proxy?url=" + HttpUtility.UrlEncode(reference.href);
+                                    item.Reference = reference;
+                                    ((DataType)(output.Item)).Item = item;
+                                } else if (item.Any != null) {
+                                    var reference = new OutputReferenceType();
+                                    reference.mimeType = "application/opensearchdescription+xml";
+                                    reference.href = context.BaseUrl + "/proxy/gpod/" + wpsjob.Identifier + "/description";
+                                    item.Reference = reference;
+                                    item.Any = null;
+                                    item.mimeType = "application/xml";
+                                    output.Identifier = new CodeType{ Value = "result_osd" };
+                                }
                             }
-                        }
+                        }catch(Exception){}
                     }
                 }
                 uri = new Uri(execResponse.serviceInstance);


webdav portal fixes

webdav portal fixes

--- WebsitePanel/Sources/WebsitePanel.WebDav.Core/IResource.cs
+++ WebsitePanel/Sources/WebsitePanel.WebDav.Core/IResource.cs
@@ -260,7 +260,7 @@
             {
                 get
                 {
-                    string displayName = _href.AbsoluteUri.Trim('/').Replace(_baseUri.AbsoluteUri.Trim('/'), "");
+                    string displayName = _href.ToString().Trim('/').Replace(_baseUri.ToString().Trim('/'), "");
                     displayName = Regex.Replace(displayName, "\\/$", "");
                     Match displayNameMatch = Regex.Match(displayName, "([\\/]+)$");
                     if (displayNameMatch.Success)


Updated live tile to cycle through front and back

--- WindowsSolution/WindowsStore/UnityProject/MainPage.xaml.cs
+++ WindowsSolution/WindowsStore/UnityProject/MainPage.xaml.cs
@@ -173,48 +173,105 @@

         void UpdateLiveTiles()
         {
-            var content = TileUpdateManager.GetTemplateContent(TileTemplateType.TileSquare150x150Text01);
-            var contentWide = TileUpdateManager.GetTemplateContent(TileTemplateType.TileWide310x150SmallImageAndText02);
-            var resources = ResourceLoader.GetForViewIndependentUse();
-
-            Debug.WriteLine(content.GetXml());
-            Debug.WriteLine(contentWide.GetXml());
-
             try
             {
-                var wideBinding = (XmlElement)contentWide.GetElementsByTagName("binding").Single();
-                wideBinding.SetAttribute("branding", "name");
-
-                var xTexts = content.GetElementsByTagName("text");
-                var xWideTexts = wideBinding.GetElementsByTagName("text");
-
-                xWideTexts[0].InnerText = xTexts[0].InnerText = "UnityProject"; // update with localized game value
-                xWideTexts[1].InnerText = xTexts[1].InnerText = "UnityProject"; // update with localized game value
-                xWideTexts[2].InnerText = xTexts[2].InnerText = "UnityProject"; // update with localized game value
-
-                xTexts[3].InnerText = "UnityProject"; // update with localized game value
-                xWideTexts[3].InnerText = "UnityProject"; // update with localized game value
-
-                var xImage = wideBinding.GetElementsByTagName("image");
-                ((XmlElement)xImage[0]).SetAttribute("src", "/Assets/WideLogo.png");
-                //((XmlElement)xImage[1]).SetAttribute("src", "/Assets/Logo.png");
-
-                var xVisual = (XmlElement)content.GetElementsByTagName("visual").Single();
-                xVisual.AppendChild(content.ImportNode(wideBinding, true));
-                Debug.WriteLine(content.GetXml());
-
-                var notificiation = new TileNotification(content)
-                {
-                    Tag = content.GetHashCode().ToString(),
-                };
-
-                TileUpdateManager.CreateTileUpdaterForApplication().Update(notificiation);
+                //***********************************************
+                //Adjust these parameters with appropriate values
+                string frontMediumImagePath = "/Assets/Logo.png";
+                string frontWideImagePath = "/Assets/WideLogo.png";
+                string backWideImagePath = "/Assets/Logo.png";
+
+                string mediumText1 = "Level"; // Don't forget to localise
+                string mediumText2 = "Score";
+                string mediumText3 = "Time";
+                string mediumText4 = "Coins";
+
+                string mediumData1 = "99"; // This data should come from a game class
+                string mediumData2 = "1234";
+                string mediumData3 = "11:22";
+                string mediumData4 = "7";
+
+                string wideText1 = "Highest Level"; // Wide tile can only display three lines of text
+                string wideText2 = "High Score";
+                string wideText3 = "Total Time";
+
+                string wideData1 = "99";
+                string wideData2 = "1234";
+                string wideData3 = "11:22";
+                //
+                //***********************************************
+
+                // Retrieve the XML that defines the appearance of the tiles
+                XmlDocument frontMediumTemplate = TileUpdateManager.GetTemplateContent(TileTemplateType.TileSquare150x150Image);
+                XmlDocument backMediumTemplate = TileUpdateManager.GetTemplateContent(TileTemplateType.TileSquare150x150Text01);
+                XmlDocument frontWideTemplate = TileUpdateManager.GetTemplateContent(TileTemplateType.TileWide310x150Image);
+                XmlDocument backWideTemplate = TileUpdateManager.GetTemplateContent(TileTemplateType.TileWide310x150SmallImageAndText02);
+
+                // Tiles should display game name on the back, but not on the front, as it will be in the image
+                // retrieve the 'binding' element from the xml
+                XmlElement frontMediumBinding = (XmlElement)frontMediumTemplate.GetElementsByTagName("binding").Single();
+                XmlElement backMediumBinding = (XmlElement)backMediumTemplate.GetElementsByTagName("binding").Single();
+                XmlElement frontWideBinding = (XmlElement)frontWideTemplate.GetElementsByTagName("binding").Single();
+                XmlElement backWideBinding = (XmlElement)backWideTemplate.GetElementsByTagName("binding").Single();
+
+                // Set 'branding' attribute on 'binding' element
+                // fronts need 'none' backs need 'name'
+                frontMediumBinding.SetAttribute("branding", "none");
+                backMediumBinding.SetAttribute("branding", "name");
+                frontWideBinding.SetAttribute("branding", "none");
+                backWideBinding.SetAttribute("branding", "name");
+
+                // Set 'src' attribute in 'image' elements
+                // Both front tiles need images
+                // only wide tile has image on back
+                // Access elements
+                XmlElement frontMediumImage = (XmlElement)frontMediumTemplate.GetElementsByTagName("image").Single();
+                XmlElement frontWideImage = (XmlElement)frontWideTemplate.GetElementsByTagName("image").Single();
+                XmlElement backWideImage = (XmlElement)backWideTemplate.GetElementsByTagName("image").Single();
+                // Set attributes
+                frontMediumImage.SetAttribute("src", frontMediumImagePath);
+                frontWideImage.SetAttribute("src", frontWideImagePath);
+                backWideImage.SetAttribute("src", backWideImagePath);
+
+                // Set lines of text to appear on back of tiles.
+                // Retrieve lists of text elements
+                XmlNodeList mediumTextList = backMediumTemplate.GetElementsByTagName("text");
+                XmlNodeList wideTextList = backWideTemplate.GetElementsByTagName("text");
+                // Set text for each element
+                mediumTextList[0].InnerText = string.Format("{0}: {1}", mediumText1, mediumData1);
+                mediumTextList[1].InnerText = string.Format("{0}: {1}", mediumText2, mediumData2);
+                mediumTextList[2].InnerText = string.Format("{0}: {1}", mediumText3, mediumData3);
+                mediumTextList[3].InnerText = string.Format("{0}: {1}", mediumText4, mediumData4);
+                wideTextList[0].InnerText = string.Format("{0}: {1}", wideText1, wideData1);
+                wideTextList[1].InnerText = string.Format("{0}: {1}", wideText2, wideData2);
+                wideTextList[2].InnerText = string.Format("{0}: {1}", wideText3, wideData3);
+
+                // Each notification requires the data for the wide and medium tiles
+                // One notification for the front, and one for the back
+                // Join the templates.
+                // Access 'visual' element of medium which contains medium 'binding' element
+                XmlElement frontVisual = frontMediumTemplate.GetElementsByTagName("visual").Single();
+                XmlElement backVisual = backMediumTemplate.GetElementsByTagName("visual").Single();
+                //add 'wide' binding element to it
+                frontVisual.AppendChild(frontMediumTemplate.ImportNode(frontWideBinding, true));
+                backVisual.AppendChild(backMediumTemplate.ImportNode(backWideBinding, true));
+
+                TileNotification frontNotification = new TileNotification(frontMediumTemplate); // Both contains medium and wide after join.
+                TileNotification BackNotification = new TileNotification(backMediumTemplate);
+
+                TileUpdater tileUpdater = TileUpdateManager.CreateTileUpdaterForApplication();  // Access tile updater
+                tileUpdater.EnableNotificationQueue(true);                                      // Enable queing to cycle through front and back
+                tileUpdater.Clear();                                                            // Make sure queue is empty
+                tileUpdater.Update(BackNotification);                                           // Switch to back tile
+                tileUpdater.Update(frontNotification);                                          // Queue up front tile
+
+                // Reading the actual Xml help to understand what is happening here.
+                Debug.WriteLine(frontMediumTemplate.GetXml());
+                Debug.WriteLine(backMediumTemplate.GetXml());
             }
             catch (Exception ex)
             {
                 Debug.WriteLine(ex);
-
-                MarkerMetro.Unity.WinIntegration.ExceptionLogger.Instance.Send(ex);
             }
         }


Remove failing test that is testing dead code

--- XenAdminTests/DialogTests/DialogsWithDefaultConstructor.cs
+++ XenAdminTests/DialogTests/DialogsWithDefaultConstructor.cs
@@ -53,9 +53,6 @@
     public class AboutDialogTest : DialogWithDefaultConstructorTest<AboutDialog> { }

     [TestFixture, Category(TestCategories.UICategoryA)]
-    public class AddStorageLinkSystemDialogTest : DialogWithDefaultConstructorTest<AddStorageLinkSystemDialog> { }
-
-    [TestFixture, Category(TestCategories.UICategoryA)]
     public class BondPropertiesTest : DialogWithDefaultConstructorTest<BondProperties> { }

     [TestFixture, Category(TestCategories.UICategoryA)]


Fix formatting.

Fix formatting.

--- src/AutoMoq/AutoMoqer.cs
+++ src/AutoMoq/AutoMoqer.cs
@@ -51,13 +51,13 @@
             return result;
         }

-		public virtual object Create(Type type)
-		{
-			ResolveType = type;
-			var result = container.Resolve(type);
-			ResolveType = null;
-			return result;
-		}
+        public virtual object Create(Type type)
+        {
+            ResolveType = type;
+            var result = container.Resolve(type);
+            ResolveType = null;
+            return result;
+        }

         /// <summary>
         ///   Gets the mock that was or will be passed to any object created by Create/Resolve.
@@ -157,4 +157,4 @@
             GetMock<T>().Verify(expression, times, failMessage);
         }
     }
-}+}


script that enables repeated events when long-pressing a button

--- unity/UnityUIUtil.cs
+++ unity/UnityUIUtil.cs
@@ -625,6 +625,61 @@

+
+
+    /// <summary>
+    /// Attach this script to a unity UI widget and then you will get onLongPress() event
+    /// after pressing down for HoldTime. If RepeatTime > 0, then onLongPress will continue
+    /// to fire at that time interval until button is released.
+    /// Notes: https://forum.unity.com/threads/long-press-gesture-on-ugui-button.264388/
+    /// </summary>
+    public class ButtonLongPress : MonoBehaviour, IPointerDownHandler, IPointerUpHandler, IPointerExitHandler
+    {
+        public float HoldTime = 1.0f;
+        public float RepeatTime = 0.0f;
+
+        // todo: use this to avoid Button.OnClick() from also firing during a longpress?
+        //private bool held = false;
+        //public UnityEvent onClick = new UnityEvent();
+
+        public UnityEvent onLongPress = new UnityEvent();
+
+        public void OnPointerDown(PointerEventData eventData)
+        {
+            //held = false;
+            Invoke("OnLongPress", HoldTime);
+        }
+
+        public void OnPointerUp(PointerEventData eventData)
+        {
+            CancelInvoke("OnLongPress");
+
+            //if (!held)
+            //    onClick.Invoke();
+        }
+
+        public void OnPointerExit(PointerEventData eventData)
+        {
+            CancelInvoke("OnLongPress");
+        }
+
+        void OnLongPress()
+        {
+            //held = true;
+            onLongPress.Invoke();
+
+            // spawn repeat
+            if (RepeatTime > 0) {
+                Invoke("OnLongPress", RepeatTime);
+            }
+        }
+    }
+
+
+
+
+
+
     // create text mesh
     // [TODO] only used by HUDRadialMenu, can get rid of when
     //   we replace that with fText...


Add default 404/500 messages

Add default 404/500 messages

--- Expresharp/Express.cs
+++ Expresharp/Express.cs
@@ -523,11 +523,19 @@
                     Exception err = o as Exception;
                     if (err != null)
                     {
-                        res.StatusCode = 500;
+                        if (res.StatusCode < 500)
+                            res.StatusCode = 500;
+
+#if DEBUG
+                        res.Send("<pre>" + HttpUtility.HtmlEncode(err.ToString()) + "</pre>");
+#else
+                        res.Send(err.Message);
+#endif
                     }
                     else
                     {
                         res.StatusCode = 404;
+                        res.Send(String.Format("Cannot {0} {1}\n", HttpUtility.HtmlEncode(req.HttpMethod), HttpUtility.HtmlEncode(req.RawUrl)));
                     }

                     res.End();


Load imobiledevice-1.0

Load imobiledevice-1.0

--- iMobileDevice-net/NativeLibraries.cs
+++ iMobileDevice-net/NativeLibraries.cs
@@ -150,7 +150,7 @@

                 string[] linuxLibariesToLoad = new string[]
                     {
-                        "libimobiledevice",
+                        "libimobiledevice-1.0",
                     };

                 // Clear any value from dlerror


Slightly changed the way that heartbeat failures are detected and dealt with.

--- src/HarmonyHub/Client.cs
+++ src/HarmonyHub/Client.cs
@@ -277,6 +277,10 @@
         /// <returns>A <see cref="cref="Task"/>.</returns>
         private async Task FireAndForgetAsync(XmlElement message, int timeout = 50)
         {
+            // Heartbeat check
+            if (!_heartbeat.Enabled)
+                throw new ConnectionException("Connection already closed or not authenticated");
+
             var messageId = message.Attributes["id"].Value;

             // Prepare the TaskCompletionSource, which is used to await the result
@@ -304,6 +308,10 @@
         /// <returns>Response message.</returns>
         private async Task<XmlElement> RequestResponseAsync(XmlElement message, int timeout = 2000)
         {
+            // Heartbeat check
+            if (!_heartbeat.Enabled)
+                throw new ConnectionException("Connection already closed or not authenticated");
+
             var messageId = message.Attributes["id"].Value;

             // Prepate the TaskCompletionSource, which is used to await the result
@@ -443,7 +451,8 @@
         }

         /// <summary>
-        /// Heartbeat ping.
+        /// Heartbeat ping. Failure will result in the heartbeat being stopped, which will
+        /// make any future calls throw an exception as the heartbeat indicator will be disabled.
         /// </summary>
         /// <param name="sender"></param>
         /// <param name="e"></param>


Change logger to singleton

Change logger to singleton

--- src/JobSample/Program.cs
+++ src/JobSample/Program.cs
@@ -18,7 +18,7 @@
                     return;

                 container.RegisterSingleton<ILoggerFactory>(loggerFactory);
-                container.Register(typeof(ILogger<>), typeof(Logger<>));
+                container.RegisterSingleton(typeof(ILogger<>), typeof(Logger<>));

                 container.AddStartupAction<EnqueuePings>();


fix: missing resources in Configurable part

--- src/Modules/Configure.cs
+++ src/Modules/Configure.cs
@@ -196,24 +196,31 @@
         double amount = Lib.Parse.ToDouble(cr.amount);
         double capacity = Lib.Parse.ToDouble(cr.maxAmount);

-        // if the setup was previously selected
-        if (prev_active)
-        {
-          // remove the resources
-          // note: in flight do not remove amount
-          Lib.RemoveResource(part, cr.name, Lib.IsFlight() ? 0.0 : amount, capacity);
-        }
-
-        // if selected, and one of the following apply
+        // (de)install resource, but only if the following apply
         // - in the editor
         // - in flight, reconfigurable and not first time it is configured
-        if ((active && capacity > 0.0) && (Lib.IsEditor() || (reconfigure_cs && initialized)))
-        {
-          // add the resources
-          // note: in flight do not add amount
-          Lib.AddResource(part, cr.name, Lib.IsFlight() ? 0.0 : amount, capacity);
-
-          // add extra cost
+        if (Lib.IsEditor() || (reconfigure_cs && initialized))
+        {
+          // if previously selected
+          if (prev_active)
+          {
+            // remove the resources
+            // - in flight, do not remove amount
+            Lib.RemoveResource(part, cr.name, Lib.IsFlight() ? 0.0 : amount, capacity);
+          }
+
+          // if selected
+          if (active && capacity > 0.0)
+          {
+            // add the resources
+            // - in flight, do not add amount
+            Lib.AddResource(part, cr.name, Lib.IsFlight() ? 0.0 : amount, capacity);
+          }
+        }
+
+        // add resource cost
+        if (active)
+        {
           extra_cost += amount * unit_cost;
         }
       }


Trying to catch all exceptions from exception handling.

--- src/Money.UI/App.xaml.cs
+++ src/Money.UI/App.xaml.cs
@@ -23,6 +23,7 @@
 using Windows.Storage;
 using Windows.UI.Core;
 using Windows.UI.Input;
+using Windows.UI.Popups;
 using Windows.UI.ViewManagement;
 using Windows.UI.Xaml;
 using Windows.UI.Xaml.Controls;
@@ -177,6 +178,20 @@
         }

         private bool ProcessException(Exception e)
+        {
+            try
+            {
+                return ProcessExceptionInernal(e);
+            }
+            catch(Exception ex)
+            {
+                MessageDialog dialog = new MessageDialog(ex.ToString(), "Fatal Error");
+                dialog.ShowAsync();
+                return true;
+            }
+        }
+
+        private bool ProcessExceptionInernal(Exception e)
         {
             INavigator navigator = ServiceProvider.Navigator;
             if (e is AggregateRootException && navigator != null)


Revert "Take into account the first buffer argument when copying parameters in the marshaller. Fixes #5832."

This reverts commit 7c89590f7af846cbd5c57f44398bac303e0c0a84.

The bug is somewhere else.

--- src/ObjCRuntime/Class.cs
+++ src/ObjCRuntime/Class.cs
@@ -308,8 +308,8 @@
 			if (!TypeRequiresFloatingPointTrampoline (minfo.ReturnType))
 				return fptr;

-			var thunk_ptr = AllocExecMemory (86);
-			var rel_Delegate = new IntPtr (fptr.ToInt32 () - thunk_ptr.ToInt32 () - 73);
+			var thunk_ptr = AllocExecMemory (83);
+			var rel_Delegate = new IntPtr (fptr.ToInt32 () - thunk_ptr.ToInt32 () - 70);
 			var rel_GetFrameLengthPtr = new IntPtr (getFrameLengthPtr.ToInt32 () - thunk_ptr.ToInt32 () - 27);
 			var delptr = BitConverter.GetBytes (rel_Delegate.ToInt32 ());
 			var getlen = BitConverter.GetBytes (rel_GetFrameLengthPtr.ToInt32 ());
@@ -353,8 +353,6 @@
 movl     0x0c(%ebp),%eax        */  0x8b, 0x45, 0x0c,                                     /*
 movl     %eax,(%esp)            */  0x89, 0x04, 0x24,                                     /*
 calll    _get_frame_length      */  0xe8, getlen [0], getlen [1], getlen [2], getlen [3], /*
-# get_frame_length doesn't know about the initial 'buffer' argument, add 4 more bytes to copy
-addl    $0x04,$eax              */  0x83, 0xc0, 0x04,                                     /*
 movl     %eax,0xf0(%ebp)        */  0x89, 0x45, 0xf0,                                     /*

 # use eax to extend the stack, but it needs to be aligned to 16 bytes first


Add comment regarding the reasoning for encapsulating the task in another

--- osu.Game/OsuGame.cs
+++ osu.Game/OsuGame.cs
@@ -429,8 +429,11 @@

         public override Task Import(Stream stream, string filename)
         {
+            // encapsulate task as we don't want to begin the import process until in a ready state.
             var importTask = new Task(async () => await base.Import(stream, filename));
+
             waitForReady(() => this, _ => importTask.Start());
+
             return importTask;
         }


Fade volume when game window becomes inactive (#5047)

Fade volume when game window becomes inactive

Co-authored-by: Dean Herbert <1db828bcd41de75377dce59825af73ae7fca5651@ppy.sh>

--- osu.Game/OsuGame.cs
+++ osu.Game/OsuGame.cs
@@ -181,7 +181,7 @@
             configSkin.ValueChanged += skinId => SkinManager.CurrentSkinInfo.Value = SkinManager.Query(s => s.ID == skinId.NewValue) ?? SkinInfo.Default;
             configSkin.TriggerChange();

-            LocalConfig.BindWith(OsuSetting.VolumeInactive, inactiveVolumeAdjust);
+            LocalConfig.BindWith(OsuSetting.VolumeInactive, userInactiveVolume);

             IsActive.BindValueChanged(active => updateActiveState(active.NewValue), true);
         }
@@ -686,15 +686,27 @@
             return false;
         }

-        private readonly BindableDouble inactiveVolumeAdjust = new BindableDouble();
+        #region Inactive audio dimming
+
+        private readonly BindableDouble userInactiveVolume = new BindableDouble();
+
+        private readonly BindableDouble inactiveVolumeFade = new BindableDouble();

         private void updateActiveState(bool isActive)
         {
             if (isActive)
-                Audio.RemoveAdjustment(AdjustableProperty.Volume, inactiveVolumeAdjust);
+            {
+                this.TransformBindableTo(inactiveVolumeFade, 1, 500, Easing.OutQuint)
+                    .Finally(_ => Audio.RemoveAdjustment(AdjustableProperty.Volume, inactiveVolumeFade)); //wait for the transition to finish to remove the inactive audio adjustment
+            }
             else
-                Audio.AddAdjustment(AdjustableProperty.Volume, inactiveVolumeAdjust);
-        }
+            {
+                Audio.AddAdjustment(AdjustableProperty.Volume, inactiveVolumeFade);
+                this.TransformBindableTo(inactiveVolumeFade, userInactiveVolume.Value, 1500, Easing.OutSine);
+            }
+        }
+
+        #endregion

         public bool OnReleased(GlobalAction action) => false;


Fix handling peer exchange message when it's not completed.

--- sources/Leak.Core/Extensions/PeerExchange/PeerExchangeHandler.cs
+++ sources/Leak.Core/Extensions/PeerExchange/PeerExchangeHandler.cs
@@ -27,7 +27,7 @@
         public void Handle(PeerHash peer, ExtendedIncomingMessage message)
         {
             BencodedValue value = Bencoder.Decode(message.ToBytes());
-            byte[] added = value.Find("added", x => x.Data.GetBytes());
+            byte[] added = value.Find("added", x => x?.Data?.GetBytes());
             List<PeerAddress> peers = new List<PeerAddress>();

             if (added != null)


MAP-97-Code structured-Review points

MAP-97-Code structured-Review points

--- src/CommitmentsV2/SFA.DAS.CommitmentsV2/Models/Apprenticeship.cs
+++ src/CommitmentsV2/SFA.DAS.CommitmentsV2/Models/Apprenticeship.cs
@@ -71,7 +71,7 @@
                 oltd.ActionedOn = DateTime.UtcNow;
             }

-            EmitOverlappingTrainingDateResolvedNotificationEvent(draftApprenticeshipId, oltd.DraftApprenticeship.CommitmentId);
+            Publish(() => new OverlappingTrainingDateResolvedEvent(draftApprenticeshipId, oltd.DraftApprenticeship.CommitmentId));
         }

         private void CheckIsStoppedForChangeOfParty()
@@ -312,11 +312,6 @@
             }

             return newPriceHistory.ToList();
-        }
-
-        public void EmitOverlappingTrainingDateResolvedNotificationEvent(long apprenticeshipId, long cohortId)
-        {
-            Publish(() => new OverlappingTrainingDateResolvedEvent(apprenticeshipId, cohortId));
         }

         private void ApplyApprenticeshipUpdatesToApprenticeship(ApprenticeshipUpdate update, DateTime approvedOn)


fixed configuration lookup

fixed configuration lookup

--- test/ProvisioningBaseTest.cs
+++ test/ProvisioningBaseTest.cs
@@ -37,7 +37,7 @@
         {
             var value = Environment.GetEnvironmentVariable(name);
             if (value != null)
-                return name;
+                return value;

             return ConfigurationManager.AppSettings[name];
         }


Fixes #80 by not adding WS.Caption when DWM is turned off

--- src/ControlzEx/Behaviors/WindowChromeBehavior.MessageHandling.cs
+++ src/ControlzEx/Behaviors/WindowChromeBehavior.MessageHandling.cs
@@ -120,7 +120,9 @@
         }

         // A borderless window lost his animation, with this we bring it back.
-        private bool MinimizeAnimation => SystemParameters.MinimizeAnimation && this.IgnoreTaskbarOnMaximize == false;
+        private bool MinimizeAnimation => SystemParameters.MinimizeAnimation
+                                          && this.IgnoreTaskbarOnMaximize == false
+                                          && NativeMethods.DwmIsCompositionEnabled();

         #region WindowProc and Message Handlers


Fix on MemberModificationHandler for null arrays

git-svn-id: 1800f71f313d917366f95485fa960eed04b40598@909 33146b6e-df29-0410-a1ca-39be37fb9416

--- src/DbLinq/Data/Linq/Implementation/MemberModificationHandler.cs
+++ src/DbLinq/Data/Linq/Implementation/MemberModificationHandler.cs
@@ -86,10 +86,14 @@
                 }
                 else if (memberType.IsArray)
                 {
-                    var arrayValue = (Array)propertyValue;
-                    for (int arrayIndex = 0; arrayIndex < arrayValue.Length; arrayIndex++)
+                    if (propertyValue != null)
                     {
-                        rawData[string.Format("{0}[{1}]", memberInfo.Name, arrayIndex)] = arrayValue.GetValue(arrayIndex);
+                        var arrayValue = (Array) propertyValue;
+                        for (int arrayIndex = 0; arrayIndex < arrayValue.Length; arrayIndex++)
+                        {
+                            rawData[string.Format("{0}[{1}]", memberInfo.Name, arrayIndex)] =
+                                arrayValue.GetValue(arrayIndex);
+                        }
                     }
                 }
                 else // otherwise, we recurse, and prefix the current property name to sub properties to avoid conflicts


wip

wip

ref #308

--- src/FilterLists.Data/Seed/Extensions/SeedFilterListsDbContext.cs
+++ src/FilterLists.Data/Seed/Extensions/SeedFilterListsDbContext.cs
@@ -30,11 +30,13 @@
             dbContext.SeedOrUpdate<SoftwareSyntax>(dataPath);
         }

-        private static void SeedOrUpdate<TEntity>(this DbContext dbContext, string dataPath) where TEntity : IBaseEntity
+        private static void SeedOrUpdate<TEntity>(this DbContext dbContext, string dataPath)
+            where TEntity : class, IBaseEntity
         {
             var entityType = dbContext.Model.FindEntityType(typeof(TEntity));
             var properties = GetPropertiesLessValueGeneratedTimestamps(entityType);
             var seedRows = GetSeedRows<TEntity>(dataPath);
+            Delete(dbContext, seedRows);
             InsertOnDuplicateKeyUpdate(dbContext, properties, entityType, seedRows);
         }

@@ -55,6 +57,17 @@
                 Console.WriteLine(e.Message);
                 return new List<TEntity>();
             }
+        }
+
+        private static void Delete<TEntity>(DbContext dbContext, IEnumerable<TEntity> seedRows)
+            where TEntity : class, IBaseEntity
+        {
+            var idProperties = typeof(TEntity).GetProperties().Where(p => p.Name.Contains("Id"));
+            var toRemove = dbContext.Set<TEntity>()
+                                    .Select(s => idProperties)
+                                    .Except(seedRows.Select(s => idProperties));
+            dbContext.RemoveRange(toRemove);
+            dbContext.SaveChanges();
         }

         private static void InsertOnDuplicateKeyUpdate<TEntity>(DbContext dbContext,


try manual build message serialization

try manual build message serialization

--- src/GrafGenerator.BuildNotificationTools.Interop/BuildMessage.cs
+++ src/GrafGenerator.BuildNotificationTools.Interop/BuildMessage.cs
@@ -1,30 +1,49 @@
 using System;
+using System.Runtime.Serialization;

 namespace GrafGenerator.BuildNotificationTools.Interop
 {
     [Serializable]
-    public class BuildMessage
+    public class BuildMessage: ISerializable
     {
-        public Guid BuildId { get; set; }
-        public BuildMessageKind MessageKind { get; set; }
-        public string Message { get; set; }
+	    private readonly Guid _buildId;
+	    private readonly BuildMessageKind _messageKind;
+	    private readonly string _message;

-        public BuildMessage()
-        {
-
-        }
+	    public Guid BuildId => _buildId;
+	    public BuildMessageKind MessageKind => _messageKind;
+	    public string Message => _message;
+
+	    public BuildMessage()
+	    {
+
+	    }

         private BuildMessage(Guid buildId, BuildMessageKind messageKind, string message)
         {
-            BuildId = buildId;
-            MessageKind = messageKind;
-            Message = message;
+            _buildId = buildId;
+            _messageKind = messageKind;
+            _message = message;
         }

+	    protected BuildMessage(SerializationInfo info, StreamingContext context)
+	    {
+		    _buildId = (Guid) info.GetValue("id", typeof (Guid));
+		    _messageKind = (BuildMessageKind) info.GetValue("kind", typeof (BuildMessageKind));
+		    _message = info.GetString("message");
+	    }

-        public static BuildMessage Create(Guid buildId, BuildMessageKind messageKind, string message)
+
+		public static BuildMessage Create(Guid buildId, BuildMessageKind messageKind, string message)
         {
             return new BuildMessage(buildId, messageKind, message);
         }
+
+	    public virtual void GetObjectData(SerializationInfo info, StreamingContext context)
+	    {
+		    info.AddValue("id", _buildId);
+			info.AddValue("kind", _messageKind);
+			info.AddValue("message", _message);
+	    }
     }
 }


Refactoring

Refactoring

--- src/Microsoft.DotNet.Build.CloudTestTasks/ListAzureContainers.cs
+++ src/Microsoft.DotNet.Build.CloudTestTasks/ListAzureContainers.cs
@@ -40,8 +40,8 @@
                 return false;
             }

-            Log.LogMessage(MessageImportance.Normal, "List of Azure containers in storage account '{0}'.", AccountName);
-            string url = string.Format("https://{0}.blob.core.windows.net/?comp=list", AccountName);
+            Log.LogMessage(MessageImportance.Normal, "Listing Azure containers in storage account '{0}'.", AccountName);
+            string url =$"https://{AccountName}.blob.core.windows.net/?comp=list";

             Log.LogMessage(MessageImportance.Low, "Sending request to list containers in account '{0}'.", AccountName);
             List<ITaskItem> discoveredContainers = new List<ITaskItem>();
@@ -50,30 +50,20 @@
                 string nextMarker = string.Empty;
                 try
                 {
-                    var createRequest = AzureHelper.RequestMessage("GET", url, AccountName, AccountKey);
+                    do
+                    {
+                        string urlToUse = url;
+                        if (!string.IsNullOrEmpty(nextMarker))
+                        {
+                            urlToUse = $"{url}&marker={nextMarker}";
+                        }
+                        var createRequest = AzureHelper.RequestMessage("GET", urlToUse, AccountName, AccountKey);

-                    XmlDocument responseFile;
-                    using (HttpResponseMessage response = await AzureHelper.RequestWithRetry(Log, client, createRequest))
-                    {
-                        responseFile = new XmlDocument();
-                        responseFile.LoadXml(await response.Content.ReadAsStringAsync());
-                        XmlNodeList elemList = responseFile.GetElementsByTagName("Name");
-
-
-                        discoveredContainers.AddRange(from x in elemList.Cast<XmlNode>()
-                                                      where x.InnerText.Contains(Prefix)
-                                                      select new TaskItem(x.InnerText));
-
-                        nextMarker = responseFile.GetElementsByTagName("NextMarker").Cast<XmlNode>().FirstOrDefault()?.InnerText;
-                    }
-                    while (!string.IsNullOrEmpty(nextMarker))
-                    {
-                        string urlNext = string.Format($"{url}&marker={nextMarker}");
-                        var nextRequest = AzureHelper.RequestMessage("GET", urlNext, AccountName, AccountKey);
-                        using (HttpResponseMessage nextResponse = AzureHelper.RequestWithRetry(Log, client, nextRequest).GetAwaiter().GetResult())
+                        XmlDocument responseFile;
+                        using (HttpResponseMessage response = await AzureHelper.RequestWithRetry(Log, client, createRequest))
                         {
                             responseFile = new XmlDocument();
-                            responseFile.LoadXml(await nextResponse.Content.ReadAsStringAsync());
+                            responseFile.LoadXml(await response.Content.ReadAsStringAsync());
                             XmlNodeList elemList = responseFile.GetElementsByTagName("Name");

                             discoveredContainers.AddRange(from x in elemList.Cast<XmlNode>()
@@ -83,6 +73,7 @@
                             nextMarker = responseFile.GetElementsByTagName("NextMarker").Cast<XmlNode>().FirstOrDefault()?.InnerText;
                         }
                     }
+                    while (!string.IsNullOrEmpty(nextMarker));
                 }
                 catch (Exception e)
                 {


Rename db param to descriptorBuilder

Rename db param to descriptorBuilder

--- src/Nest/DSL/Query/Functions/FunctionScoreFunctionsDescriptor.cs
+++ src/Nest/DSL/Query/Functions/FunctionScoreFunctionsDescriptor.cs
@@ -16,44 +16,44 @@
 			this._Functions = new List<FunctionScoreFunction<T>>();
 		}

-		public FunctionScoreFunction<T> Gauss(string field, Action<FunctionScoreDecayFieldDescriptor> db)
+		public FunctionScoreFunction<T> Gauss(string field, Action<FunctionScoreDecayFieldDescriptor> descriptorBuilder)
 		{
-			var fn = new GaussFunction<T>(field, db);
+			var fn = new GaussFunction<T>(field, descriptorBuilder);
 			this._Functions.Add(fn);
 			return fn;
 		}

-		public FunctionScoreFunction<T> Gauss(Expression<Func<T, object>> objectPath, Action<FunctionScoreDecayFieldDescriptor> db)
+		public FunctionScoreFunction<T> Gauss(Expression<Func<T, object>> objectPath, Action<FunctionScoreDecayFieldDescriptor> descriptorBuilder)
 		{
-			var fn = new GaussFunction<T>(objectPath, db);
+			var fn = new GaussFunction<T>(objectPath, descriptorBuilder);
 			this._Functions.Add(fn);
 			return fn;
 		}

-		public FunctionScoreFunction<T> Linear(string field, Action<FunctionScoreDecayFieldDescriptor> db)
+		public FunctionScoreFunction<T> Linear(string field, Action<FunctionScoreDecayFieldDescriptor> descriptorBuilder)
 		{
-			var fn = new LinearFunction<T>(field, db);
+			var fn = new LinearFunction<T>(field, descriptorBuilder);
 			this._Functions.Add(fn);
 			return fn;
 		}

-		public FunctionScoreFunction<T> Linear(Expression<Func<T, object>> objectPath, Action<FunctionScoreDecayFieldDescriptor> db)
+		public FunctionScoreFunction<T> Linear(Expression<Func<T, object>> objectPath, Action<FunctionScoreDecayFieldDescriptor> descriptorBuilder)
 		{
-			var fn = new LinearFunction<T>(objectPath, db);
+			var fn = new LinearFunction<T>(objectPath, descriptorBuilder);
 			this._Functions.Add(fn);
 			return fn;
 		}

-		public FunctionScoreFunction<T> Exp(string field, Action<FunctionScoreDecayFieldDescriptor> db)
+		public FunctionScoreFunction<T> Exp(string field, Action<FunctionScoreDecayFieldDescriptor> descriptorBuilder)
 		{
-			var fn = new ExpFunction<T>(field, db);
+			var fn = new ExpFunction<T>(field, descriptorBuilder);
 			this._Functions.Add(fn);
 			return fn;
 		}

-		public FunctionScoreFunction<T> Exp(Expression<Func<T, object>> objectPath, Action<FunctionScoreDecayFieldDescriptor> db)
+		public FunctionScoreFunction<T> Exp(Expression<Func<T, object>> objectPath, Action<FunctionScoreDecayFieldDescriptor> descriptorBuilder)
 		{
-			var fn = new ExpFunction<T>(objectPath, db);
+			var fn = new ExpFunction<T>(objectPath, descriptorBuilder);
 			this._Functions.Add(fn);
 			return fn;
 		}


comments

comments

--- src/Peachpie.CodeAnalysis/FlowAnalysis/TypeRef/TypeRefContext.cs
+++ src/Peachpie.CodeAnalysis/FlowAnalysis/TypeRef/TypeRefContext.cs
@@ -565,7 +565,7 @@
         }

         /// <summary>
-        /// Gets writable <c>string</c> type (a string builder) for this context.
+        /// Gets PHP <c>string</c> type (a string builder for 8bit and UTF characters) for this context.
         /// </summary>
         public TypeRefMask GetWritableStringTypeMask()
         {


fix : When rabbitmq publish a message with a null header，HeaderDeserializationMiddleware->GetHeaderBytes will throw NullReferenceException

--- src/RawRabbit/Pipe/Middleware/HeaderDeserializationMiddleware.cs
+++ src/RawRabbit/Pipe/Middleware/HeaderDeserializationMiddleware.cs
@@ -74,7 +74,7 @@
 				_logger.Debug("DeliveryEventArgs not found.");
 				return null;
 			}
-			if (!args.BasicProperties.Headers.ContainsKey(headerKey))
+			if (args.BasicProperties.Headers == null || !args.BasicProperties.Headers.ContainsKey(headerKey))
 			{
 				_logger.Info("BasicProperties Header does not contain {headerKey}", headerKey);
 				return null;


removed param

removed param

--- src/SFA.DAS.Commitments.Api/Controllers/HealthCheckController.cs
+++ src/SFA.DAS.Commitments.Api/Controllers/HealthCheckController.cs
@@ -5,7 +5,7 @@
 {
     public class HealthCheckController : ApiController
     {
-        public HealthCheckController(IReservationsApiClient reservationClient)
+        public HealthCheckController()
         {
         }


Decode json.

Decode json.

--- src/Squidex.Domain.Apps.Entities/Contents/ContentQueryService.cs
+++ src/Squidex.Domain.Apps.Entities/Contents/ContentQueryService.cs
@@ -179,6 +179,7 @@
                 yield return FieldConverters.ExcludeChangedTypes();
             }

+            yield return FieldConverters.DecodeJson();
             yield return FieldConverters.ResolveInvariant(context.App.LanguagesConfig);
             yield return FieldConverters.ResolveLanguages(context.App.LanguagesConfig);


Add test case for using XmlSchema with Namespaces defined and passing a namespace manager on write.

#21961

--- src/System.Private.Xml/tests/XmlSerializer/XmlSerializerTests.cs
+++ src/System.Private.Xml/tests/XmlSerializer/XmlSerializerTests.cs
@@ -13,6 +13,7 @@
 using System.Threading;
 using System.Xml;
 using System.Xml.Linq;
+using System.Xml.Schema;
 using System.Xml.Serialization;
 using Xunit;

@@ -1235,6 +1236,16 @@
         Assert.StrictEqual(original.body, actual.body);
         Assert.NotNull(actual.xmlns);
         Assert.Contains(ns, actual.xmlns.ToArray());
+    }
+
+    [Fact]
+    public static void XML_XmlSchemaWithNamespacesWriteWithNamespaceManager()
+    {
+        var schema = new XmlSchema();
+        schema.Namespaces = new XmlSerializerNamespaces();
+
+        using (var memStream = new MemoryStream())
+            schema.Write(memStream, new XmlNamespaceManager(new NameTable()));
     }

     [Fact]


Add a test for AnalyzerConfigDocument synchronization at the OOP layer

--- src/VisualStudio/Core/Test.Next/Services/SolutionServiceTests.cs
+++ src/VisualStudio/Core/Test.Next/Services/SolutionServiceTests.cs
@@ -2,6 +2,7 @@

 using System;
 using System.Collections.Generic;
+using System.Collections.Immutable;
 using System.Linq;
 using System.Threading;
 using System.Threading.Tasks;
@@ -283,6 +284,37 @@
         }

         [Fact, Trait(Traits.Feature, Traits.Features.RemoteHost)]
+        public async Task TestAnalyzerConfigDocument()
+        {
+            var code = @"class Test { void Method() { } }";
+            using (var workspace = TestWorkspace.CreateCSharp(code))
+            {
+                var projectId = workspace.CurrentSolution.ProjectIds.First();
+                var analyzerConfigDocumentId = DocumentId.CreateNewId(projectId);
+                var analyzerConfigDocumentInfo = DocumentInfo.Create(
+                    analyzerConfigDocumentId, ".editorconfig",
+                    loader: TextLoader.From(TextAndVersion.Create(SourceText.From("root = true"), VersionStamp.Create())));
+
+                await VerifySolutionUpdate(workspace, s =>
+                {
+                    return s.AddAnalyzerConfigDocuments(ImmutableArray.Create(analyzerConfigDocumentInfo));
+                });
+
+                workspace.OnAnalyzerConfigDocumentAdded(analyzerConfigDocumentInfo);
+
+                await VerifySolutionUpdate(workspace, s =>
+                {
+                    return s.WithAnalyzerConfigDocumentText(analyzerConfigDocumentId, SourceText.From("root = false"));
+                });
+
+                await VerifySolutionUpdate(workspace, s =>
+                {
+                    return s.RemoveAnalyzerConfigDocument(analyzerConfigDocumentId);
+                });
+            }
+        }
+
+        [Fact, Trait(Traits.Feature, Traits.Features.RemoteHost)]
         public async Task TestDocument()
         {
             var code = @"class Test { void Method() { } }";


Changed negative short to 0 in tournament controller

--- AllInPoker/Controllers/TournamentController.cs
+++ AllInPoker/Controllers/TournamentController.cs
@@ -29,8 +29,8 @@
                 {
                     int id = reader.GetInt32("id");
                     DateTime date = reader.GetDateTime("date");
-                    decimal cost = reader.IsDBNull(reader.GetOrdinal("cost")) ? (decimal)0.00 : reader.GetDecimal("cost");
-                    short minPlayers = reader.IsDBNull(reader.GetOrdinal("min_players")) ? (short)-1 : reader.GetInt16("min_players");
+                    decimal cost = reader.IsDBNull(reader.GetOrdinal("cost")) ? 0 : reader.GetDecimal("cost");
+                    short minPlayers = reader.IsDBNull(reader.GetOrdinal("min_players")) ? (short)0 : reader.GetInt16("min_players");
                     /*
                     short minAge = reader.GetInt16("min_age");
                     short maxAge = reader.GetInt16("max_age");


Remove unused Spot Enabled Changed event

--- Assets/Resources/Scripts/Architecture/Board.cs
+++ Assets/Resources/Scripts/Architecture/Board.cs
@@ -18,12 +18,6 @@
         if(OwnerArrayChanged != null) { OwnerArrayChanged(this, e); }
     }

-    public event EventHandler<BoardEventArgs> SpotEnabledChanged;
-    protected virtual void RaiseSpotEnabledChanged(BoardEventArgs e)
-    {
-        if (SpotEnabledChanged != null) { SpotEnabledChanged(this, e); }
-    }
-
     public Board()
     {
         ownerArray = new Player[3, 3];


fix(Interaction): ensure highlighter exists before highlighting

The highlighter gets destroyed in `OnDisable` and on a rare occasion
there can be a race condition where the highlighter tries to highlight
even though the highliter has been destroyed.

This fix ensures the objectHighlighter exists before attempting the
highlight.

--- Assets/VRTK/Scripts/VRTK_InteractableObject.cs
+++ Assets/VRTK/Scripts/VRTK_InteractableObject.cs
@@ -409,7 +409,7 @@
             {
                 InitialiseHighlighter();
             }
-            if (highlightOnTouch)
+            if (objectHighlighter && highlightOnTouch)
             {
                 if (toggle && !IsGrabbed())
                 {


Add TODO

Add TODO

--- src/WebClient/Program.cs
+++ src/WebClient/Program.cs
@@ -2,6 +2,7 @@
 using System.IO;

 // TODO: numarul de locuinte autorizate in fiecare luna/semestru (Beniamin Petrovai)
+// Ar merge si o piramida a varstelor implementata. (review Google Play 21.03.2019)

 namespace WebClient
 {


-Added InverseKinematicsTestDemo to the standard demo rotation.

--- BEPUphysicsDemos/BEPUphysicsDemos/DemosGame.cs
+++ BEPUphysicsDemos/BEPUphysicsDemos/DemosGame.cs
@@ -108,7 +108,8 @@
                                                     typeof (PlanetDemo),
                                                     typeof (PathFollowingDemo),
                                                     typeof (FishInABarrelDemo),
-                                                    typeof (DetectorVolumeDemo)
+                                                    typeof (DetectorVolumeDemo),
+                                                    typeof (InverseKinematicsTestDemo)
                                                 };


Little bit of docs.

Little bit of docs.

--- BepuPhysics/Collidables/CollidableReference.cs
+++ BepuPhysics/Collidables/CollidableReference.cs
@@ -5,6 +5,9 @@

 namespace BepuPhysics.Collidables
 {
+    /// <summary>
+    /// Represents how a collidable can interact and move.
+    /// </summary>
     public enum CollidableMobility
     {
         /// <summary>
@@ -21,8 +24,14 @@
         Static = 2
     }

+    /// <summary>
+    /// Uses a bitpacked representation to refer to a body or static collidable.
+    /// </summary>
     public struct CollidableReference : IEquatable<CollidableReference>
     {
+        /// <summary>
+        /// Bitpacked representation of the collidable reference.
+        /// </summary>
         public uint Packed;

         /// <summary>
@@ -102,7 +111,6 @@
         /// <summary>
         /// Creates a collidable reference for a static.
         /// </summary>
-        /// <param name="mobility">Mobility type of the owner of the collidable.</param>
         /// <param name="handle">Handle of the owner of the collidable.</param>
         [MethodImpl(MethodImplOptions.AggressiveInlining)]
         public CollidableReference(StaticHandle handle)


Parameterless constructor for TestIndexReaderCloneNorms

git-svn-id: 6c68d65edd5507bf6b37474e0d155329cbeeff2a@836140 13f79535-47bb-0310-9956-ffa450edef68

--- C#/src/Test/Index/TestIndexReaderCloneNorms.cs
+++ C#/src/Test/Index/TestIndexReaderCloneNorms.cs
@@ -86,6 +86,10 @@
 		public TestIndexReaderCloneNorms(System.String s):base(s)
 		{
 		}
+
+        public TestIndexReaderCloneNorms(): base("")
+        {
+        }

 		[SetUp]
 		public override void  SetUp()


Insert missing function calls

Insert missing function calls

--- Camunda.Api.Client/UserTask/UserTaskService.cs
+++ Camunda.Api.Client/UserTask/UserTaskService.cs
@@ -22,9 +22,70 @@
         public QueryResource<TaskQuery, UserTaskInfo> Query(TaskQuery query = null)
             => new QueryResource<TaskQuery, UserTaskInfo>(_api, query);

+        /// <summary>
+        /// Creates a new (user) task.
+        /// </summary>
         public Task Create(UserTask task) => _api.CreateTask(task);

-        // Retrieve a single task
+        /// <summary>
+        /// Retrieves a task by id.
+        /// </summary>
         public Task<UserTaskInfo> Get(string id) => _api.Get(id);
+
+        /// <summary>
+        /// Claims a task for a specific user.
+        /// Note: The difference with the Set Assignee method is that here a check is performed to see if the task already has a user assigned to it.
+        /// </summary>
+        public Task Claim(string id, UserInfo userinfo) => _api.ClaimTask(id, userinfo);
+
+        /// <summary>
+        /// Resets a task’s assignee. If successful, the task is not assigned to a user.
+        /// </summary>
+        public Task Unclaim(string id) => _api.UnclaimTask(id);
+
+        /// <summary>
+        /// Completes a task and updates process variables.
+        /// </summary>
+        public Task Complete(string id, CompleteTask completeTask) => _api.CompleteTask(id, completeTask);
+
+        /// <summary>
+        /// Completes a task and updates process variables using a form submit. There are two difference between this method and the complete method:
+        /// - If the task is in state PENDING - i.e., has been delegated before, it is not completed but resolved.Otherwise it will be completed.
+        /// - If the task has Form Field Metadata defined, the process engine will perform backend validation for any form fields which have validators defined.See the Generated Task Forms section of the User Guide for more information.
+        /// </summary>
+        public Task SubmitForm(string id, CompleteTask completeTask) => _api.SubmitFormTask(id, completeTask);
+
+
+        /// <summary>
+        /// Resolves a task and updates execution variables.
+        /// </summary>
+        public Task ResolveTask(string id, CompleteTask completeTask) => _api.ResolveTask(id, completeTask);
+
+        /// <summary>
+        /// Changes the assignee of a task to a specific user.
+        /// Note: The difference with the Claim Task method is that this method does not check if the task already has a user assigned to it.
+        /// </summary>
+        public Task SetAssignee(string id, UserInfo user) => _api.SetAssignee(id, user);
+
+        /// <summary>
+        /// Delegates a task to another user.
+        /// </summary>
+        public Task Delegate(string id, UserInfo user) => _api.DelegateTask(id, user);
+
+        /// <summary>
+        /// Retrieves the rendered form for a task. This method can be used to get the HTML rendering of a Generated Task Form.
+        /// </summary>
+        public Task<string> GetRenderedForm(string id) => _api.GetRenderedForm(id);
+
+        /// <summary>
+        /// Retrieves the form variables for a task. The form variables take form data specified on the task into account. If form fields are defined, the variable types and default values of the form fields are taken into account.
+        /// </summary>
+        public Task<Dictionary<string, VariableValue>> GetFormVariables(string id, string variableNames, bool deserializeValues = true) => _api.GetFormVariables(id, variableNames, deserializeValues);
+
+        /// <summary>
+        /// Updates a task.
+        /// </summary>
+        public Task Update(string id, UserTask task) => _api.UpdateTask(id, task);
+
     }
 }


Fixes an issue where is was impossible to save announcements created in v4

Closes #30

--- Components/Business/AnnouncementsController.cs
+++ Components/Business/AnnouncementsController.cs
@@ -100,7 +100,7 @@
                     ContentTypeId = 4
                 };

-                if (objContentItem.ContentItemId == Null.NullInteger)
+                if (objContentItem.ContentItemId == Null.NullInteger || objContentItem.ContentItemId == 0)
                 {
                     announcement.ContentItemID = new ContentController().AddContentItem(objContentItem);
                 }