Synchrophasor: COMTRADE initial analog channel code for review. Added station name in initialize method and use while create a COMTRADE file

git-tfs-id: [https://tfs.codeplex.com/tfs/TFS07]$/openpdc/Synchrophasor/Current Version;C55508

--- Source/Libraries/Adapters/COMTRADE/FileExporter.cs
+++ Source/Libraries/Adapters/COMTRADE/FileExporter.cs
@@ -35,215 +35,280 @@
     {
         #region [ Members ]

-        //// Nested Types
-        //private enum DataQuality
-        //{
-        //    Good = 0,
-        //    Suspect = 20,
-        //    Bad = 32
-        //};
-
-        //// Constants
-        //private const double SqrtOf3 = 1.7320508075688772935274463415059D;
-
-        //// Fields
-        //private MultipleDestinationExporter m_dataExporter;
-        //private Dictionary<MeasurementKey, string> m_measurementTags;
-        //private MeasurementKey m_referenceAngleKey;
-        //private bool m_useReferenceAngle;
-        //private bool m_useNumericQuality;
-        //private int m_exportInterval;
-        //private string m_companyTagPrefix;
-        //private bool m_statusDisplayed;
+        /// Nested Types
+        private enum DataQuality
+        {
+            Good = 0,
+            Suspect = 20,
+            Bad = 32
+        };
+
+        /// Constants
+        private const double SqrtOf3 = 1.7320508075688772935274463415059D;
+        //COMTRADE version year 1999
+        private const UInt16 Rev_year = 1999;
+
+        /// Fields
+        private MultipleDestinationExporter m_dataExporter;
+        private Dictionary<MeasurementKey, string> m_measurementTags;
+        private MeasurementKey m_referenceAngleKey;
+        private bool m_useReferenceAngle;
+        private bool m_useNumericQuality;
+        private int m_exportInterval;
+        private string m_companyTagPrefix;
+        private bool m_statusDisplayed;
+        private string m_stationName;
+        private string m_deviceID;

         #endregion

         #region [ Properties ]

-        ///// <summary>
-        ///// Returns the detailed status of the <see cref="FileExporter"/>.
-        ///// </summary>
-        //public override string Status
-        //{
-        //    get
-        //    {
-        //        StringBuilder status = new StringBuilder();
+        /// <summary>
+        /// Returns the detailed status of the <see cref="FileExporter"/>.
+        /// </summary>
+        public override string Status
+        {
+            get
+            {
+                StringBuilder status = new StringBuilder();

-        //        status.AppendFormat("     Using numeric quality: {0}", m_useNumericQuality);
-        //        status.AppendLine();
-        //        status.AppendFormat("     Using reference angle: {0}", m_useReferenceAngle);
-        //        status.AppendLine();
-
-        //        if (m_useReferenceAngle)
-        //        {
-        //            status.AppendFormat("     Reference angle point: {0}", m_referenceAngleKey.ToString());
-        //            status.AppendLine();
-        //        }
-
-        //        if (!string.IsNullOrEmpty(m_companyTagPrefix))
-        //        {
-        //            status.AppendFormat("        Company tag prefix: {0}", m_companyTagPrefix);
-        //            status.AppendLine();
-        //        }
-
-        //        if (m_dataExporter != null)
-        //            status.Append(m_dataExporter.Status);
-
-        //        status.Append(base.Status);
-
-        //        return status.ToString();
-        //    }
-        //}
+                status.AppendFormat("     Using numeric quality: {0}", m_useNumericQuality);
+                status.AppendLine();
+                status.AppendFormat("     Using reference angle: {0}", m_useReferenceAngle);
+                status.AppendLine();
+
+                if (m_useReferenceAngle)
+                {
+                    status.AppendFormat("     Reference angle point: {0}", m_referenceAngleKey.ToString());
+                    status.AppendLine();
+                }
+
+                if (!string.IsNullOrEmpty(m_companyTagPrefix))
+                {
+                    status.AppendFormat("        Company tag prefix: {0}", m_companyTagPrefix);
+                    status.AppendLine();
+                }
+
+                if (m_dataExporter != null)
+                    status.Append(m_dataExporter.Status);
+
+                status.Append(base.Status);
+
+                return status.ToString();
+            }
+        }

         #endregion

         #region [ Methods ]

-        ///// <summary>
-        ///// Intializes <see cref="FileExporter"/>.
-        ///// </summary>
-        //public override void Initialize()
-        //{
-        //    base.Initialize();
-
-        //    Dictionary<string, string> settings = Settings;
-        //    string errorMessage = "{0} is missing from Settings - Example: exportInterval=5; useReferenceAngle=True; referenceAngleMeasurement=DEVARCHIVE:6; companyTagPrefix=TVA; useNumericQuality=True; inputMeasurementKeys={{FILTER ActiveMeasurements WHERE Device='SHELBY' AND SignalType='FREQ'}}";
-        //    string setting;
-
-        //    // Load required parameters
-        //    if (!settings.TryGetValue("exportInterval", out setting))
-        //        throw new ArgumentException(string.Format(errorMessage, "exportInterval"));
+        private bool m_disposed;
+
+        /// <summary>
+        /// Releases the unmanaged resources used by the <see cref="FileExporter"/> object and optionally releases the managed resources.
+        /// </summary>
+        /// <param name="disposing">true to release both managed and unmanaged resources; false to release only unmanaged resources.</param>
+        protected override void Dispose(bool disposing)
+        {
+            if (!m_disposed)
+            {
+                try
+                {
+                    // This will be done regardless of whether the object is finalized or disposed.
+
+                    if (disposing)
+                    {
+                        if (m_dataExporter != null)
+                        {
+                            m_dataExporter.SaveSettings();
+                            m_dataExporter.Dispose();
+                        }
+
+                        m_dataExporter = null;
+                    }
+                }
+                finally
+                {
+                    m_disposed = true;          // Prevent duplicate dispose.
+                    base.Dispose(disposing);    // Call base class Dispose().
+                }
+            }
+        }
+
+        /// <summary>
+        /// Intializes <see cref="FileExporter"/>.
+        /// </summary>
+        public override void Initialize()
+        {
+            base.Initialize();
+
+            Dictionary<string, string> settings = Settings;
+            string errorMessage = "{0} is missing from Settings - Example: exportInterval=5; useReferenceAngle=True; referenceAngleMeasurement=DEVARCHIVE:6; companyTagPrefix=TVA; useNumericQuality=True; inputMeasurementKeys={{FILTER ActiveMeasurements WHERE Device='SHELBY' AND SignalType='FREQ'}}";
+            string setting;
+
+            // Load required parameters
+            if (!settings.TryGetValue("exportInterval", out setting))
+                throw new ArgumentException(string.Format(errorMessage, "exportInterval"));

-        //    m_exportInterval = int.Parse(setting);
-
-        //    if (m_exportInterval == 0)
-        //        throw new ArgumentException("exportInterval should not be 0 - Example: exportInterval=5");
-
-        //    if (InputMeasurementKeys == null || InputMeasurementKeys.Length == 0)
-        //        throw new InvalidOperationException("There are no input measurements defined. You must define \"inputMeasurementKeys\" to define which measurements to export.");
-
-        //    if (!settings.TryGetValue("useReferenceAngle", out setting))
-        //        throw new ArgumentException(string.Format(errorMessage, "useReferenceAngle"));
-
-        //    m_useReferenceAngle = setting.ParseBoolean();
-
-        //    if (m_useReferenceAngle)
-        //    {
-        //        // Reference angle measurement has to be defined if using reference angle
-        //        if (!settings.TryGetValue("referenceAngleMeasurement", out setting))
-        //            throw new ArgumentException(string.Format(errorMessage, "referenceAngleMeasurement"));
-
-        //        m_referenceAngleKey = MeasurementKey.Parse(setting);
-        //    }
-
-        //    // Make sure reference angle is part of input measurement keys collection
-        //    if (!InputMeasurementKeys.Contains(m_referenceAngleKey))
-        //        InputMeasurementKeys = InputMeasurementKeys.Concat(new MeasurementKey[] { m_referenceAngleKey }).ToArray();
-
-        //    // Make sure sure reference angle key is actually an angle measurement
-        //    SignalType signalType = InputMeasurementKeyTypes[InputMeasurementKeys.IndexOf(key => key == m_referenceAngleKey)];
-
-        //    if (signalType != SignalType.IPHA && signalType != SignalType.VPHA)
-        //        throw new InvalidOperationException(string.Format("Specified reference angle measurement key is a {0} signal, not a phase angle.", signalType.GetFormattedSignalTypeName()));
-
-        //    // Load optional parameters
-        //    if (settings.TryGetValue("companyTagPrefix", out setting))
-        //        m_companyTagPrefix = setting.ToUpper().Trim();
-        //    else
-        //        m_companyTagPrefix = null;
-
-        //    if (settings.TryGetValue("useNumericQuality", out setting))
-        //        m_useNumericQuality = setting.ParseBoolean();
-        //    else
-        //        m_useNumericQuality = false;
-
-        //    // Suffix company tag prefix with an underscore if defined
-        //    if (!string.IsNullOrEmpty(m_companyTagPrefix))
-        //        m_companyTagPrefix = m_companyTagPrefix.EnsureEnd('_');
-
-        //    // Define a default export location - user can override and add multiple locations in config later...
-        //    ExportDestination[] defaultDestinations = new ExportDestination[] { new ExportDestination(FilePath.GetAbsolutePath("ICCPExport.txt"), false, "", "", "") };
-        //    m_dataExporter = new MultipleDestinationExporter(ConfigurationSection, m_exportInterval * 1000);
-        //    m_dataExporter.PersistSettings = true;
-        //    m_dataExporter.Initialize(defaultDestinations);
-
-        //    // Create new measurement tag name dictionary
-        //    m_measurementTags = new Dictionary<MeasurementKey, string>();
-        //    string pointID = "undefined";
-
-        //    // Lookup point tag name for input measurement in the ActiveMeasurements table
-        //    foreach (MeasurementKey key in InputMeasurementKeys)
-        //    {
-        //        try
-        //        {
-        //            // Get measurement key as a string
-        //            pointID = key.ToString();
-
-        //            // Lookup measurement key in active measurements table
-        //            DataRow row = DataSource.Tables["ActiveMeasurements"].Select(string.Format("ID='{0}'", pointID))[0];
-
-        //            // Remove invalid symbols that may be in tag name
-        //            string pointTag = row["PointTag"].ToNonNullString(pointID).Replace('-', '_').Replace(':', '_').ToUpper();
-
-        //            // Prefix point tag with company prefix if defined
-        //            if (!string.IsNullOrEmpty(m_companyTagPrefix) && !pointTag.StartsWith(m_companyTagPrefix))
-        //                pointTag = m_companyTagPrefix + pointTag;
-
-        //            m_measurementTags.Add(key, pointTag);
-        //        }
-        //        catch (Exception ex)
-        //        {
-        //            OnProcessException(new InvalidOperationException(string.Format("Failed to lookup point tag for measurement [{0}] due to exception: {1}", pointID, ex.Message)));
-        //        }
-        //    }
-
-        //    // We enable tracking of latest measurements so we can use these values if points are missing
-        //    TrackLatestMeasurements = true;
-        //}
-
-        ///// <summary>
-        ///// Queues a single measurement for processing.
-        ///// </summary>
-        ///// <param name="measurement">Measurement to queue for processing.</param>
-        //public override void QueueMeasurementForProcessing(IMeasurement measurement)
-        //{
-        //    QueueMeasurementsForProcessing(new IMeasurement[] { measurement });
-        //}
-
-        ///// <summary>
-        ///// Queues a collection of measurements for processing.
-        ///// </summary>
-        ///// <param name="measurements">Collection of measurements to queue for processing.</param>
-        ///// <remarks>
-        ///// We override this method to only queue measurements at the desired export interval - no need
-        ///// do excess sorting work for measurements that will never be used :)
-        ///// </remarks>
-        //public override void QueueMeasurementsForProcessing(IEnumerable<IMeasurement> measurements)
-        //{
-        //    List<IMeasurement> inputMeasurements = new List<IMeasurement>();
-        //    Ticks timestamp;
-        //    bool sortMeasurement;
-
-        //    foreach (IMeasurement measurement in measurements)
-        //    {
-        //        timestamp = measurement.Timestamp;
-
-        //        // Measurement will exported if the following criteria are true:
-        //        //   A) Timestamp's seconds are an interval of the defined export interval
-        //        //   B) Timestamp falls within first frame of data in the second
-        //        //   C) This is a defined input measurement for this adapter
-        //        sortMeasurement =
-        //                ((DateTime)timestamp).Second % m_exportInterval == 0 && // <-- A
-        //                timestamp.DistanceBeyondSecond() < TicksPerFrame &&     // <-- B
-        //                IsInputMeasurement(measurement.Key);                    // <-- C
-
-        //        if (sortMeasurement)
-        //            inputMeasurements.Add(measurement);
-        //    }
-
-        //    if (inputMeasurements.Count > 0)
-        //        SortMeasurements(inputMeasurements);
-        //}
+            m_exportInterval = int.Parse(setting);
+
+            if (m_exportInterval == 0)
+                throw new ArgumentException("exportInterval should not be 0 - Example: exportInterval=5");
+
+            if (InputMeasurementKeys == null || InputMeasurementKeys.Length == 0)
+                throw new InvalidOperationException("There are no input measurements defined. You must define \"inputMeasurementKeys\" to define which measurements to export.");
+
+            if (!settings.TryGetValue("useReferenceAngle", out setting))
+                throw new ArgumentException(string.Format(errorMessage, "useReferenceAngle"));
+
+            m_useReferenceAngle = setting.ParseBoolean();
+
+            if (m_useReferenceAngle)
+            {
+                // Reference angle measurement has to be defined if using reference angle
+                if (!settings.TryGetValue("referenceAngleMeasurement", out setting))
+                    throw new ArgumentException(string.Format(errorMessage, "referenceAngleMeasurement"));
+
+                m_referenceAngleKey = MeasurementKey.Parse(setting);
+            }
+
+            // Make sure reference angle is part of input measurement keys collection
+            if (!InputMeasurementKeys.Contains(m_referenceAngleKey))
+                InputMeasurementKeys = InputMeasurementKeys.Concat(new MeasurementKey[] { m_referenceAngleKey }).ToArray();
+
+            // Make sure sure reference angle key is actually an angle measurement
+            SignalType signalType = InputMeasurementKeyTypes[InputMeasurementKeys.IndexOf(key => key == m_referenceAngleKey)];
+
+            if (signalType != SignalType.IPHA && signalType != SignalType.VPHA)
+                throw new InvalidOperationException(string.Format("Specified reference angle measurement key is a {0} signal, not a phase angle.", signalType.GetFormattedSignalTypeName()));
+
+            // Load optional parameters
+            if (settings.TryGetValue("companyTagPrefix", out setting))
+                m_companyTagPrefix = setting.ToUpper().Trim();
+            else
+                m_companyTagPrefix = null;
+
+            if (settings.TryGetValue("useNumericQuality", out setting))
+                m_useNumericQuality = setting.ParseBoolean();
+            else
+                m_useNumericQuality = false;
+
+            // COMTRADE SPECIFIC CODE:
+            //Get station name
+            if (settings.TryGetValue("stationName", out setting))
+                m_stationName = setting;
+            else
+                m_stationName = Name;
+            //Get device id
+            if (settings.TryGetValue("deviceID", out setting))
+                m_deviceID = setting;
+
+
+            // Suffix company tag prefix with an underscore if defined
+            if (!string.IsNullOrEmpty(m_companyTagPrefix))
+                m_companyTagPrefix = m_companyTagPrefix.EnsureEnd('_');
+
+            // Define a default export location - user can override and add multiple locations in config later...
+            m_dataExporter = new MultipleDestinationExporter(ConfigurationSection, m_exportInterval * 1000);
+            m_dataExporter.Initialize(new ExportDestination[] { new ExportDestination(FilePath.GetAbsolutePath(ConfigurationSection + ".txt"), false, "", "", "") });
+
+
+            // Create new measurement tag name dictionary
+            m_measurementTags = new Dictionary<MeasurementKey, string>();
+            string pointID = "undefined";
+
+            // Lookup point tag name for input measurement in the ActiveMeasurements table
+            foreach (MeasurementKey key in InputMeasurementKeys)
+            {
+                try
+                {
+                    // Get measurement key as a string
+                    pointID = key.ToString();
+
+                    // Lookup measurement key in active measurements table
+                    DataRow row = DataSource.Tables["ActiveMeasurements"].Select(string.Format("ID='{0}'", pointID))[0];
+
+                    // Remove invalid symbols that may be in tag name
+                    string pointTag = row["PointTag"].ToNonNullString(pointID).Replace('-', '_').Replace(':', '_').ToUpper();
+
+                    // Prefix point tag with company prefix if defined
+                    if (!string.IsNullOrEmpty(m_companyTagPrefix) && !pointTag.StartsWith(m_companyTagPrefix))
+                        pointTag = m_companyTagPrefix + pointTag;
+
+                    m_measurementTags.Add(key, pointTag);
+                }
+                catch (Exception ex)
+                {
+                    OnProcessException(new InvalidOperationException(string.Format("Failed to lookup point tag for measurement [{0}] due to exception: {1}", pointID, ex.Message)));
+                }
+            }
+
+            // We enable tracking of latest measurements so we can use these values if points are missing
+            TrackLatestMeasurements = true;
+        }
+
+        /// <summary>
+        /// Queues a single measurement for processing.
+        /// </summary>
+        /// <param name="measurement">Measurement to queue for processing.</param>
+        public override void QueueMeasurementForProcessing(IMeasurement measurement)
+        {
+            QueueMeasurementsForProcessing(new IMeasurement[] { measurement });
+        }
+
+        /// <summary>
+        /// Queues a collection of measurements for processing.
+        /// </summary>
+        /// <param name="measurements">Collection of measurements to queue for processing.</param>
+        /// <remarks>
+        /// We override this method to only queue measurements at the desired export interval - no need
+        /// do excess sorting work for measurements that will never be used :)
+        /// </remarks>
+        public override void QueueMeasurementsForProcessing(IEnumerable<IMeasurement> measurements)
+        {
+            List<IMeasurement> inputMeasurements = new List<IMeasurement>();
+            Ticks timestamp;
+            bool sortMeasurement;
+
+            foreach (IMeasurement measurement in measurements)
+            {
+                timestamp = measurement.Timestamp;
+
+                // Measurement will exported if the following criteria are true:
+                //   A) Timestamp's seconds are an interval of the defined export interval
+                //   B) Timestamp falls within first frame of data in the second
+                //   C) This is a defined input measurement for this adapter
+                sortMeasurement =
+                        ((DateTime)timestamp).Second % m_exportInterval == 0 && // <-- A
+                        timestamp.DistanceBeyondSecond() < TicksPerFrame &&     // <-- B
+                        IsInputMeasurement(measurement.Key);                    // <-- C
+
+                if (sortMeasurement)
+                    inputMeasurements.Add(measurement);
+            }
+
+            if (inputMeasurements.Count > 0)
+                SortMeasurements(inputMeasurements);
+        }
+
+        // Lookup signal type for given measurement key
+        private string LookupSignalTypeValue(MeasurementKey key)
+        {
+            try
+            {
+                DataRow[] filteredRows = DataSource.Tables["ActiveMeasurements"].Select(string.Format("ID = '{0}'", key.ToString()));
+
+                if (filteredRows.Length > 0)
+                    return filteredRows[0]["SignalType"].ToString();
+            }
+            catch (Exception ex)
+            {
+                OnProcessException(new InvalidOperationException(string.Format("Failed to lookup signal type value for measurement {0}: {1}", key.ToString(), ex.Message), ex));
+            }
+
+            return string.Empty;
+        }

         /// <summary>
         /// Process frame of time-aligned measurements that arrived within the defined lag time.
@@ -252,146 +317,223 @@
         /// <param name="index">Index of <see cref="IFrame"/> within one second of data ranging from zero to frames per second - 1.</param>
         protected override void PublishFrame(IFrame frame, int index)
         {
-            //Ticks timestamp = frame.Timestamp;
-            //IDictionary<MeasurementKey, IMeasurement> measurements = frame.Measurements;
-
-            //if (measurements.Count > 0)
-            //{
-            //    StringBuilder fileData = new StringBuilder();
-            //    IMeasurement measurement, referenceAngle;
-            //    MeasurementKey inputMeasurementKey;
-            //    SignalType signalType;
-            //    DataQuality measurementQuality;
-            //    double measurementValue, referenceAngleValue;
-            //    string measurementTag;
-
-            //    // We need to get calculated reference angle value in order to export relative phase angles
-            //    // If the value is not here, we don't export
-            //    referenceAngle = null;
-
-            //    // Make sure reference made it in this frame...
-            //    if (m_useReferenceAngle && !measurements.TryGetValue(m_referenceAngleKey, out referenceAngle))
-            //    {
-            //        OnProcessException(new InvalidOperationException("Calculated reference angle was not found in this frame, possible reasons: system is initializing, receiving no data or lag time is too small. File creation was skipped."));
-            //    }
-            //    else
-            //    {
-            //        // Export all defined input measurements
-            //        for (int i = 0; i < InputMeasurementKeys.Length; i++)
-            //        {
-            //            inputMeasurementKey = InputMeasurementKeys[i];
-            //            signalType = InputMeasurementKeyTypes[i];
-
-            //            // Look up measurement's tag name
-            //            if (m_measurementTags.TryGetValue(inputMeasurementKey, out measurementTag))
-            //            {
-            //                // See if measurement exists in this frame
-            //                if (measurements.TryGetValue(inputMeasurementKey, out measurement))
-            //                {
-            //                    // Get measurement's adjusted value (takes into account any adder and or multipler)
-            //                    measurementValue = measurement.AdjustedValue;
-
-            //                    // Interpret data quality flags
-            //                    measurementQuality = (measurement.ValueQualityIsGood ? (measurement.TimestampQualityIsGood ? DataQuality.Good : DataQuality.Suspect) : DataQuality.Bad);
-            //                }
-            //                else
-            //                {
-            //                    // Didn't find measurement in this frame, try using most recent value
-            //                    measurementValue = LatestMeasurements[inputMeasurementKey];
-
-            //                    // Interpret data quality flags - since measurement was missing in this frame we mark it as
-            //                    // suspect. Could have just missed the time window for sorting.
-            //                    measurementQuality = (Double.IsNaN(measurementValue) ? DataQuality.Bad : DataQuality.Suspect);
+            Ticks timestamp = frame.Timestamp;
+            IDictionary<MeasurementKey, IMeasurement> measurements = frame.Measurements;
+
+            if (measurements.Count > 0)
+            {
+                StringBuilder fileData = new StringBuilder();
+                IMeasurement measurement, referenceAngle;
+                MeasurementKey inputMeasurementKey;
+                SignalType signalType;
+                DataQuality measurementQuality;
+                double measurementValue, referenceAngleValue;
+                string measurementTag;
+                int totalChannels, totalAnalogChannels, totalDigitalChannels;
+                int analogChannelID, digitalChannelID;
+
+                // We need to get calculated reference angle value in order to export relative phase angles
+                // If the value is not here, we don't export
+                referenceAngle = null;
+                analogChannelID = 0;
+                digitalChannelID = 0;
+                // Make sure reference made it in this frame...
+                if (m_useReferenceAngle && !measurements.TryGetValue(m_referenceAngleKey, out referenceAngle))
+                {
+                    OnProcessException(new InvalidOperationException("Calculated reference angle was not found in this frame, possible reasons: system is initializing, receiving no data or lag time is too small. File creation was skipped."));
+                }
+                else
+                {
+                    //Get station name, device id and version standard for COMTRADE FILE
+                    //--Code here
+                    fileData.Append(m_stationName);
+                    fileData.Append(",");
+                    fileData.Append(m_deviceID);
+                    fileData.Append(",");
+                    fileData.Append(Rev_year);
+                    // Terminate line
+                    fileData.AppendLine(" ");
+
+                    //Get analog channels count
+                    totalAnalogChannels= InputMeasurementKeyTypes.Count(s => s == SignalType.ALOG);
+                    //Get digital channels count
+                    totalDigitalChannels= InputMeasurementKeyTypes.Count(s => s == SignalType.DIGI);
+                    //Count total analog and digital channels
+                    totalChannels = totalAnalogChannels + totalDigitalChannels;
+                    //
+                    fileData.Append(totalChannels + "," + totalAnalogChannels + "A," + totalDigitalChannels + "D");
+                    fileData.AppendLine(" ");
+
+                    // Export all defined input measurements for analog channel
+                    for (int i = 0; i < InputMeasurementKeys.Length; i++)
+                    {
+                        inputMeasurementKey = InputMeasurementKeys[i];
+                        signalType = InputMeasurementKeyTypes[i];
+
+                        // Look up measurement's tag name
+                        if (m_measurementTags.TryGetValue(inputMeasurementKey, out measurementTag))
+                        {
+                            // See if measurement exists in this frame
+                            if (measurements.TryGetValue(inputMeasurementKey, out measurement))
+                            {
+                                // Get measurement's adjusted value (takes into account any adder and or multipler)
+                                measurementValue = measurement.AdjustedValue;
+
+                                // Interpret data quality flags
+                                measurementQuality = (measurement.ValueQualityIsGood ? (measurement.TimestampQualityIsGood ? DataQuality.Good : DataQuality.Suspect) : DataQuality.Bad);
+                            }
+                            else
+                            {
+                                // Didn't find measurement in this frame, try using most recent value
+                                measurementValue = LatestMeasurements[inputMeasurementKey];
+
+                                // Interpret data quality flags - since measurement was missing in this frame we mark it as
+                                // suspect. Could have just missed the time window for sorting.
+                                measurementQuality = (Double.IsNaN(measurementValue) ? DataQuality.Bad : DataQuality.Suspect);
+
+                                // We'll export zero instead of NaN for bad data
+                                if (measurementQuality == DataQuality.Bad)
+                                    measurementValue = 0.0D;
+                            }
+
+                            //// Export tag name field
+                            //fileData.Append(measurementTag);
+                            //fileData.Append(",");
+
+                            //Get mesurement information by input mesurement key
+                            DataRow[] filteredRows = DataSource.Tables["ActiveMeasurements"].Select(string.Format("ID = '{0}'", inputMeasurementKey));
+
+                            // Export measurement value making any needed adjustments based on signal type
+                            if (signalType == SignalType.ALOG || signalType == SignalType.VPHA ||
+                                    signalType == SignalType.IPHM || signalType == SignalType.VPHA || signalType == SignalType.IPHA)
+                            {
+                                //Increment analog channel counter by 1
+                                analogChannelID += 1;
+                                //Set analog channel counter in file data
+                                fileData.Append(analogChannelID);
+                                fileData.Append(",");
+
+                                if (filteredRows.Length > 0)
+                                {
+                                    //Get COMTRADE Channel id (STATION:CHANNELNAME)
+                                    fileData.Append(m_stationName + ":" + filteredRows[0]["DeviceID"].ToString());
+                                    fileData.Append(",");
+                                    //Get phase value from filter row
+                                    fileData.Append(filteredRows[0]["Phase"].ToString());
+                                    //Magnitude for polar components
+                                    if(signalType == SignalType.VPHA || signalType == SignalType.IPHA)
+                                        fileData.Append("a");
+                                    else
+                                        fileData.Append("m");
+                                    //Get ccbm- circuit component - Currently keep as blank until get more information
+                                    fileData.Append(",");
+                                    //Get uu - Alphanumeric channel units -- Currently keep as blank until get more information
+                                    fileData.Append(",");
+                                    //Get channel multiplier
+                                    fileData.Append(measurement.Multiplier);
+                                    fileData.Append(",");
+                                    //Get channel offset
+                                    fileData.Append(measurement.Adder);
+                                    fileData.Append(",");
+                                    //Get time skew between channels
+                                    fileData.Append(",");
+                                    //Get data range minimun value
+                                    fileData.Append(",");
+                                    //Get data range maximum value
+                                    fileData.Append(",");
+                                    //Get PT/CT primary ratio factor
+                                    fileData.Append(",");
+                                    //Get PT/CT secondary ratio factor
+                                    fileData.Append(",");
+                                    //End of Line
+                                    fileData.AppendLine(" ");
+                                }

-            //                    // We'll export zero instead of NaN for bad data
-            //                    if (measurementQuality == DataQuality.Bad)
-            //                        measurementValue = 0.0D;
-            //                }
-
-            //                // Export tag name field
-            //                fileData.Append(measurementTag);
-            //                fileData.Append(",");
-
-            //                // Export measurement value making any needed adjustments based on signal type
-            //                if (signalType == SignalType.VPHA || signalType == SignalType.IPHA)
-            //                {
-            //                    // This is a phase angle measurement, export the value relative to the reference angle (if available)
-            //                    if (referenceAngle == null)
-            //                    {
-            //                        // No reference angle defined, export raw angle
-            //                        fileData.Append(measurementValue);
-            //                    }
-            //                    else
-            //                    {
-            //                        // Get reference angle's adjusted value (takes into account any adder and or multipler)
-            //                        referenceAngleValue = referenceAngle.AdjustedValue;
-
-            //                        // Handle relative angle wrapping
-            //                        double dis0 = Math.Abs(measurementValue - referenceAngleValue);
-            //                        double dis1 = Math.Abs(measurementValue - referenceAngleValue + 360);
-            //                        double dis2 = Math.Abs(measurementValue - referenceAngleValue - 360);
-
-            //                        if ((dis0 < dis1) && (dis0 < dis2))
-            //                            measurementValue = measurementValue - referenceAngleValue;
-            //                        else if (dis1 < dis2)
-            //                            measurementValue = measurementValue - referenceAngleValue + 360;
-            //                        else
-            //                            measurementValue = measurementValue - referenceAngleValue - 360;
-
-            //                        fileData.Append(measurementValue);
-            //                    }
-            //                }
-            //                else if (signalType == SignalType.VPHM)
-            //                {
-            //                    // Typical voltages from PMU's are line-to-neutral volts so we convert them to line-to-line kilovolts
-            //                    fileData.Append(measurementValue * SqrtOf3 / 1000.0D);
-            //                }
-            //                else
-            //                {
-            //                    // Export all other types of measurements as their raw value
-            //                    fileData.Append(measurementValue);
-            //                }
-
-            //                // Export interpreted measurement quality
-            //                fileData.Append(",");
-
-            //                if (m_useNumericQuality)
-            //                    fileData.Append((int)measurementQuality);
-            //                else
-            //                    fileData.Append(measurementQuality);
-
-            //                // Terminate line (ICCP file link expects these two terminating commas, weird...)
-            //                fileData.AppendLine(",,");
-            //            }
-            //            else
-            //            {
-            //                // We were unable to find measurement tag for this key - this is unexpected
-            //                OnProcessException(new InvalidOperationException(string.Format("Failed to find measurement tag for measurement {0}", inputMeasurementKey)));
-            //            }
-            //        }
-            //    }
-
-            //    // Measurement export to a file may take more than available processing time - so we queue this work up ...
-            //    m_dataExporter.ExportData(fileData.ToString());
-
-            //    // We display export status every other minute
-            //    if (new DateTime(frame.Timestamp).Minute % 2 == 0)
-            //    {
-            //        //Make sure message is only displayed once during the minute
-            //        if (!m_statusDisplayed)
-            //        {
-            //            OnStatusMessage(string.Format("{0} successful file based measurement exports...", m_dataExporter.TotalExports));
-            //            m_statusDisplayed = true;
-            //        }
-            //    }
-            //    else
-            //        m_statusDisplayed = false;
-            //}
-            //else
-            //{
-            //    // No data was available in the frame, lag time set too tight?
-            //    OnProcessException(new InvalidOperationException("No measurements were available for file based data export, possible reasons: system is initializing , receiving no data or lag time is too small. File creation was skipped."));
-            //}
+                            }
+                            //else if (signalType == SignalType.VPHA || signalType == SignalType.IPHA)
+                            //{
+                            //    // Export tag name field
+                            //    fileData.Append(measurementTag);
+                            //    fileData.Append(",");
+                            //    // This is a phase angle measurement, export the value relative to the reference angle (if available)
+                            //    if (referenceAngle == null)
+                            //    {
+                            //        // No reference angle defined, export raw angle
+                            //        fileData.Append(measurementValue);
+                            //    }
+                            //    else
+                            //    {
+
+                            //        // Get reference angle's adjusted value (takes into account any adder and or multipler)
+                            //        referenceAngleValue = referenceAngle.AdjustedValue;
+
+                            //        // Handle relative angle wrapping
+                            //        double dis0 = Math.Abs(measurementValue - referenceAngleValue);
+                            //        double dis1 = Math.Abs(measurementValue - referenceAngleValue + 360);
+                            //        double dis2 = Math.Abs(measurementValue - referenceAngleValue - 360);
+
+                            //        if ((dis0 < dis1) && (dis0 < dis2))
+                            //            measurementValue = measurementValue - referenceAngleValue;
+                            //        else if (dis1 < dis2)
+                            //            measurementValue = measurementValue - referenceAngleValue + 360;
+                            //        else
+                            //            measurementValue = measurementValue - referenceAngleValue - 360;
+
+                            //        fileData.Append(measurementValue);
+                            //    }
+                            //}
+                            //else if (signalType == SignalType.VPHM)
+                            //{
+                            //    // Typical voltages from PMU's are line-to-neutral volts so we convert them to line-to-line kilovolts
+                            //    fileData.Append(measurementValue * SqrtOf3 / 1000.0D);
+                            //}
+                            //else
+                            //{
+                            //    // Export all other types of measurements as their raw value
+                            //    fileData.Append(measurementValue);
+                            //}
+
+                            //// Export interpreted measurement quality
+                            //fileData.Append(",");
+
+                            //if (m_useNumericQuality)
+                            //    fileData.Append((int)measurementQuality);
+                            //else
+                            //    fileData.Append(measurementQuality);
+
+                            // Terminate line (ICCP file link expects these two terminating commas, weird...)
+                            //fileData.AppendLine(",,");
+                            //fileData.AppendLine(" ");
+                        }
+                        else
+                        {
+                            // We were unable to find measurement tag for this key - this is unexpected
+                            OnProcessException(new InvalidOperationException(string.Format("Failed to find measurement tag for measurement {0}", inputMeasurementKey)));
+                        }
+                    }
+                }
+
+                // Measurement export to a file may take more than available processing time - so we queue this work up ...
+                m_dataExporter.ExportData(fileData.ToString());
+
+                // We display export status every other minute
+                if (new DateTime(frame.Timestamp).Minute % 2 == 0)
+                {
+                    //Make sure message is only displayed once during the minute
+                    if (!m_statusDisplayed)
+                    {
+                        OnStatusMessage(string.Format("{0} successful file based measurement exports...", m_dataExporter.TotalExports));
+                        m_statusDisplayed = true;
+                    }
+                }
+                else
+                    m_statusDisplayed = false;
+            }
+            else
+            {
+                // No data was available in the frame, lag time set too tight?
+                OnProcessException(new InvalidOperationException("No measurements were available for COMTRADE file based data export, possible reasons: system is initializing , receiving no data or lag time is too small. COMTRADE File creation was skipped."));
+            }
         }

         #endregion


Fixed bug with stream getting disposed before task could complete.

--- Source/Libraries/openXDA.XMLConfigLoader/Loader.cs
+++ Source/Libraries/openXDA.XMLConfigLoader/Loader.cs
@@ -135,10 +135,22 @@
         /// <param name="file"><seealso cref="Stream"/> containing the xml file to be loaded into the XDA database</param>
         public Task Load(Stream file)
         {
+            byte[] bytes;
+
+            using (MemoryStream ms = new MemoryStream())
+            {
+                file.CopyTo(ms);
+                bytes = ms.ToArray();
+            }
+
             return Task.Run(() => {
-                XmlDocument document = new XmlDocument();
-                document.Load(file);
-                Load(document);
+                using (MemoryStream stream = new MemoryStream())
+                {
+                    stream.Write(bytes, 0, bytes.Length);
+                    XmlDocument document = new XmlDocument();
+                    document.Load(stream);
+                    Load(document);
+                }
             });


Fixed resource data offset calc.

Fixed resource data offset calc.

--- Src/Workshell.PE/Content/Resources/ResourceData.cs
+++ Src/Workshell.PE/Content/Resources/ResourceData.cs
@@ -20,7 +20,7 @@
         {
             LocationCalculator calc = dataEntry.DirectoryEntry.Directory.Resources.DataDirectory.Directories.Image.GetCalculator();
             ulong va = imageBase + dataEntry.OffsetToData;
-            ulong file_offset = calc.RVAToOffset(dataEntry.Size);
+            ulong file_offset = calc.VAToOffset(va);

             data_entry = dataEntry;
             location = new Location(file_offset,dataEntry.OffsetToData,va,dataEntry.Size,dataEntry.Size);


Fix Code analysis issues

Fix Code analysis issues

--- T4MVCHostMvcApp/Controllers/SomeAsyncController.cs
+++ T4MVCHostMvcApp/Controllers/SomeAsyncController.cs
@@ -25,10 +25,12 @@
             return new JsonResult();
         }

+        [SuppressMessage("Microsoft.Design", "CA1026:DefaultParametersShouldNotBeUsed"), SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic"), SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "id")]
         public void ActionWithDefaultsAsync(long? id = null)
         {
         }

+        [SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic"), SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "result")]
         public ActionResult ActionWithDefaultsCompleted(object result)
         {
             return null;


corrected error logging at createModStructure() subelement shortCut

--- RelicModManager/Utils.cs
+++ RelicModManager/Utils.cs
@@ -649,7 +649,7 @@
                                     }
                                     if (sc != null)
                                     {
-                                        if (depScNodeList.Length > 0) { Utils.appendToLog(string.Format("Error: modInfo.xml nodes not used: {0} => Dep {3} (line {4})", string.Join(",", depScNodeList), d.dependencyZipFile, ((IXmlLineInfo)shortCutHolder).LineNumber)); };
+                                        if (depScNodeList.Length > 0) { Utils.appendToLog(string.Format("Error: modInfo.xml nodes not used: {0} => Dep {1} (line {2})", string.Join(",", depScNodeList), d.dependencyZipFile, ((IXmlLineInfo)shortCutHolder).LineNumber)); };
                                         d.shortCuts.Add(sc);
                                     }
                                 }
@@ -685,7 +685,7 @@
                                     }
                                     if (ld != null)
                                     {
-                                        if (logDepNodeList.Length > 0) { Utils.appendToLog(string.Format("Error: modInfo.xml nodes not used: {0} => logDep {3} (line {4})", string.Join(",", logDepNodeList), ld.dependencyZipFile, ((IXmlLineInfo)logDependencyHolder).LineNumber)); };
+                                        if (logDepNodeList.Length > 0) { Utils.appendToLog(string.Format("Error: modInfo.xml nodes not used: {0} => logDep {1} (line {2})", string.Join(",", logDepNodeList), ld.dependencyZipFile, ((IXmlLineInfo)logDependencyHolder).LineNumber)); };
                                         if (ld.packageName.Equals("")) { string rad = Utils.RandomString(30); ld.packageName = rad; Utils.appendToLog("packageName is random generated: " + rad); };              // to avoid exceptions
                                         d.logicalDependencies.Add(ld);
                                     };
@@ -760,7 +760,7 @@
                                     }
                                     if (sc != null)
                                     {
-                                        if (logDepScNodeList.Length > 0) { Utils.appendToLog(string.Format("Error: modInfo.xml nodes not used: {0} => logDep {3} (line {4})", string.Join(",", logDepScNodeList), d.dependencyZipFile, ((IXmlLineInfo)shortCutHolder).LineNumber)); };
+                                        if (logDepScNodeList.Length > 0) { Utils.appendToLog(string.Format("Error: modInfo.xml nodes not used: {0} => logDep {1} (line {2})", string.Join(",", logDepScNodeList), d.dependencyZipFile, ((IXmlLineInfo)shortCutHolder).LineNumber)); };
                                         d.shortCuts.Add(sc);
                                     }
                                 }


Change into properties for easier debugging.

--- RenderEngine.Settings.cs
+++ RenderEngine.Settings.cs
@@ -82,8 +82,8 @@
 			}
 		}

-		protected int _throttle = 10;
-		protected int _samples = 1;
+		protected int _throttle { get; set; } = 10;
+		protected int _samples { get; set; } = 1;

 		protected bool _needReset;
 	}


Minor change to cms.businesslogic.template.Template.cs

--- umbraco/cms/businesslogic/template/Template.cs
+++ umbraco/cms/businesslogic/template/Template.cs
@@ -389,6 +389,8 @@

         public static int GetTemplateIdFromAlias(string alias)
         {
+            alias = alias.ToLower();
+
             initTemplateAliases();
             if (TemplateAliases.ContainsKey(alias))
                 return (int)TemplateAliases[alias];


Added Rectangle movement to drag events

Added Rectangle movement to drag events

--- vuwall-motion/vuwall-motion/TransparentForm.cs
+++ vuwall-motion/vuwall-motion/TransparentForm.cs
@@ -13,8 +13,10 @@
         private Brush brush = new SolidBrush(Color.Red);
         private Size clientRes = Screen.PrimaryScreen.Bounds.Size;
         private Window SelectedWindow;
+        private Point? DragOffset;

         Vector3F absoluteTL;
+        Vector3F absoluteBR;

         private Size blob_size = new Size(50,50);

@@ -43,12 +45,13 @@
         private void TransparentForm_Paint(object sender, PaintEventArgs e) {
             foreach (var blob in blobs.ToList())
             {
-                e.Graphics.FillEllipse(brush, blob);
+                var transformed = new Rectangle(blob.X - blob.Width/2, blob.Y - blob.Height/2, blob.Width, blob.Height);
+                e.Graphics.FillEllipse(brush, transformed);
             }

             if (rectangles.Any())
             {
-                foreach (var rect in rectangles)
+                foreach (var rect in rectangles.ToList())
                 {
                     e.Graphics.DrawRectangle(pen, rect);
                 }
@@ -95,11 +98,31 @@

         public void Move(object o, GyroscopeDataEventArgs e)
         {
-            if (absoluteTL != null)
+            if (absoluteTL != null && absoluteBR != null)
             {
                 var myo = (Myo) o;
                 var position = GetPixelPosition(myo);
-                blobs[0] = new Rectangle(position, blob_size);
+
+                if (SelectedWindow != null)
+                {
+                    if (rectangles.Any())
+                    {
+                        UpdateRect(new Rectangle(position.X - DragOffset.Value.X, position.Y - DragOffset.Value.Y,
+                            SelectedWindow.Area.Width, SelectedWindow.Area.Height));
+                    }
+                    else
+                    {
+                        AddRect(new Rectangle(position.X - DragOffset.Value.X, position.Y - DragOffset.Value.Y,
+                            SelectedWindow.Area.Width, SelectedWindow.Area.Height));
+                    }
+                    if (blobs.Any())
+                    {
+                        blobs.ToList().ForEach(b => DeleteBlob(b));
+                    }
+                }
+                else {
+                    blobs[0] = new Rectangle(position, blob_size);
+                }
                 Invalidate();
             }
         }
@@ -113,16 +136,23 @@
                 {
                     absoluteTL = Math3D.FromQuaternion(myo.Orientation);
                     Console.WriteLine("Calibrated Top Left!");
+                    UpdateBlob(new Point(clientRes.Width, clientRes.Height));
+                }
+                else if (absoluteBR == null)
+                {
+                    absoluteBR = Math3D.FromQuaternion(myo.Orientation);
+                    Console.WriteLine("Calibrated Bottom Right!");
                 }
                 else
                 {
                     absoluteTL = null;
+                    absoluteBR = null;
                     UpdateBlob(new Point(0, 0));
                 }
             }
             else if (myo.Pose == MyoSharp.Poses.Pose.Fist)
             {
-                if (absoluteTL != null)
+                if (absoluteTL != null && absoluteBR != null)
                 {
                     var position = GetPixelPosition(myo);
                     var api = new WindowApi();
@@ -130,9 +160,11 @@
                     if (window != null)
                     {
                         SelectedWindow = api.GetRoot(window);
-                        if (SelectedWindow != null)
-                        {
-                            AddRect(SelectedWindow.Area);
+                        if (SelectedWindow != null) {
+                            if (DragOffset == null)
+                            {
+                                DragOffset = new Point(position.X - SelectedWindow.Area.Location.X, position.Y - SelectedWindow.Area.Location.Y);
+                            }
                         }
                     }
                 }
@@ -140,21 +172,23 @@

             else
             {
-                if (absoluteTL != null)
+                if (absoluteTL != null && absoluteBR != null)
                 {
                     if (SelectedWindow != null)
                     {
                         var position = GetPixelPosition(myo);
                         var api = new WindowApi();
-                        var newWindow = new Window(SelectedWindow.Ptr, new Rectangle(position.X, position.Y, SelectedWindow.Area.Width, SelectedWindow.Area.Height));
+                        var newWindow = new Window(SelectedWindow.Ptr, new Rectangle(position.X - DragOffset.Value.X, position.Y - DragOffset.Value.Y, SelectedWindow.Area.Width, SelectedWindow.Area.Height));
                         SelectedWindow = null;
                         api.SetWindow(newWindow);
                         api.BringToFront(newWindow);
-                    }
-                    if (rectangles.Any())
-                    {
+                        Rectangle blob = new Rectangle(position, blob_size);
+                        blobs.Add(blob);
+                    }
+                    if (rectangles.Any()) {
                         rectangles.ToList().ForEach(r => DeleteRect(r));
                     }
+                    DragOffset = null;
                 }
             }
         }
@@ -163,6 +197,7 @@
         {
             var orientation = myo.Orientation;
             var eulerAngles = Math3D.FromQuaternion(orientation) - absoluteTL;
+            eulerAngles = new Vector3F(eulerAngles.X, eulerAngles.Y, eulerAngles.Z);
             var vect = Math3D.DirectionalVector(eulerAngles);
             var position = Math3D.PixelFromVector(vect);


[Fix] Set system error code 995

[Fix] Set system error code 995

--- websocket-sharp/Net/HttpListenerAsyncResult.cs
+++ websocket-sharp/Net/HttpListenerAsyncResult.cs
@@ -162,7 +162,7 @@
     internal void Complete (Exception exception)
     {
       _exception = _inGet && (exception is ObjectDisposedException)
-                   ? new HttpListenerException (500, "Listener closed.")
+                   ? new HttpListenerException (995, "Listener closed.")
                    : exception;

       lock (_sync)


FIX: Missing two round of 16 matches

FIX: Missing two round of 16 matches

--- webstats/Modules/Models/BetterPageViewModel.cs
+++ webstats/Modules/Models/BetterPageViewModel.cs
@@ -230,7 +230,7 @@

 			}

-			for (int i = 0; i < _bet.GetStageOne().winners.Length; i++)
+			for (int i = 0; i < userMatches.Count; i++)
 			{
 				var k = new KnockoutMatch();
 				if (_bet.HasThirdPlaces())


Added Counter

Added Counter

--- Kinect2FaceBasics/Kinect2FaceBasics_NET/MainWindow.xaml.cs
+++ Kinect2FaceBasics/Kinect2FaceBasics_NET/MainWindow.xaml.cs
@@ -71,7 +71,7 @@
             }
         }

-         void BodyReader_FrameArrived(object sender, BodyFrameArrivedEventArgs e)
+        void BodyReader_FrameArrived(object sender, BodyFrameArrivedEventArgs e)
         {
             using (var frame = e.FrameReference.AcquireFrame())
             {
@@ -91,10 +91,11 @@
                     }
                 }
             }
-        }
+        }

         void FaceReader_FrameArrived(object sender, FaceFrameArrivedEventArgs e)
         {
+            int counter = 0;
             using (var frame = e.FrameReference.AcquireFrame())
             {
                 if (frame != null)
@@ -105,10 +106,10 @@
                     if (result != null)
                     {
                         // 5) Do magic!
-
                         // Get the face points, mapped in the color space.
                         var eyeLeft = result.FacePointsInColorSpace[FacePointType.EyeLeft];
                         var eyeRight = result.FacePointsInColorSpace[FacePointType.EyeRight];
+
                         // var nose = result.FacePointsInColorSpace[FacePointType.Nose];
                         //var mouthLeft = result.FacePointsInColorSpace[FacePointType.MouthCornerLeft];
                         //var mouthRight = result.FacePointsInColorSpace[FacePointType.MouthCornerRight];
@@ -132,21 +133,15 @@
                         //ellipseMouth.Width = Math.Abs(mouthRight.X - mouthLeft.X);

                         // Display or hide the ellipses
-                        if (eyeLeftClosed == DetectionResult.Yes || eyeLeftClosed == DetectionResult.Maybe)
+                        if ((eyeLeftClosed == DetectionResult.Yes || eyeLeftClosed == DetectionResult.Maybe) && (eyeRightClosed == DetectionResult.Yes || eyeRightClosed == DetectionResult.Maybe))
                         {
                             ellipseEyeLeft.Visibility = Visibility.Collapsed;
+                            ellipseEyeRight.Visibility = Visibility.Collapsed;
+                            counter++;
                         }
                         else
                         {
                             ellipseEyeLeft.Visibility = Visibility.Visible;
-                        }
-
-                        if (eyeRightClosed == DetectionResult.Yes || eyeRightClosed == DetectionResult.Maybe)
-                        {
-                            ellipseEyeRight.Visibility = Visibility.Collapsed;
-                        }
-                        else
-                        {
                             ellipseEyeRight.Visibility = Visibility.Visible;
                         }


Corrected system test to restore packages using RestorePackages target in build file

--- Lucid.System.Tests/ProjectCreation/GenerateProjectTests.cs
+++ Lucid.System.Tests/ProjectCreation/GenerateProjectTests.cs
@@ -30,7 +30,6 @@
             Directory.GetFiles(Path.Combine(buildFolder, "ShinyNewProject1.Web/fonts")).Length.Should().BeGreaterThan(1, "should copy fonts");
             Directory.GetFiles(Path.Combine(buildFolder, "ShinyNewProject1.Web/Content")).Length.Should().BeGreaterThan(1, "should copy css");

-            CopyFolder(@"..\..\..\packages", Path.Combine(buildFolder, "packages"));
             var currentSettings = File.ReadAllText(Path.Combine(originalFolder, "Lucid.Web/settings.config"));
             File.WriteAllText(Path.Combine(buildFolder, "ShinyNewProject1.Web/settings.config"), currentSettings.Replace("Lucid", "ShinyNewProject1"));

@@ -90,11 +89,12 @@
                 if (newGuids.Contains(originalGuid))
                     Assert.Fail("GUID {0} was found in both the original project and the generated project", originalGuid);

+            RunVerify(msBuild, "ShinyNewProject1.proj /t:RestorePackages", buildFolder);
             RunVerify(msBuild, "ShinyNewProject1.proj", buildFolder);

             // Assert DB?  NUnit logs?

-            RunVerify(msBuild, "ShinyNewProject1.proj /t:clean", buildFolder);
+            RunVerify(msBuild, "ShinyNewProject1.proj /t:Clean", buildFolder);
             DeleteFolder(buildFolder, 5);
         }


Moved initialization from Start() to Awake() (#1338)

Awake() is more commonly used to initialize variables as it is
guaranteed to run as soon as the game object is instantiated or
activated. Start() is called before the first Update(), which
might be up to a frame later.

See Unity docs for reference
https://docs.unity3d.com/ScriptReference/MonoBehaviour.Awake.html

--- sdks/unity/AgonesSdk.cs
+++ sdks/unity/AgonesSdk.cs
@@ -59,10 +59,14 @@

         #region Unity Methods
         // Use this for initialization.
-        private void Start()
+        private void Awake()
         {
             String port = Environment.GetEnvironmentVariable("AGONES_SDK_HTTP_PORT");
             sidecarAddress = "http://localhost:" + (port ?? "9358");
+        }
+
+        private void Start()
+        {
             HealthCheckAsync();
         }


- CHG: code cleanups and improvements

- CHG: code cleanups and improvements

--- MarcelJoachimKloubert.SendNET/Contracts/SendDataService.cs
+++ MarcelJoachimKloubert.SendNET/Contracts/SendDataService.cs
@@ -318,6 +318,11 @@
                 }
             }

+            if (targetFile == null)
+            {
+                throw new Exception("No filename!");
+            }
+
             try
             {
                 this._faulted = false;
@@ -340,7 +345,7 @@
             Console.WriteLine();
             Console.WriteLine();

-            ConsoleHelper.InvokeForColor(() => Console.Write("Receiving file '{0}'... ", targetFile.Name),
+            ConsoleHelper.InvokeForColor(() => Console.Write("Receiving file '{0}'... ", fullname),
                                          ConsoleColor.White);

             return null;


Code cleanup.

Code cleanup.

--- ATZ.Reflection.Tests/IContravariantInterface.cs
+++ ATZ.Reflection.Tests/IContravariantInterface.cs
@@ -1,5 +1,6 @@
 namespace ATZ.Reflection.Tests
 {
+    // ReSharper disable once UnusedTypeParameter => T parameter used for testing.
     public interface IContravariantInterface<in T>
     {
     }


Incremented version number

Incremented version number

--- Assets/Scripts/Atlas/Editor/Internal/Version.cs
+++ Assets/Scripts/Atlas/Editor/Internal/Version.cs
@@ -14,7 +14,7 @@

         public static int Revision
         {
-            get { return 0; }
+            get { return 1; }
         }

         public static string Full


Updated version number to 0.9.3

Updated version number to 0.9.3

--- Assets/Scripts/Atlas/Editor/Internal/Version.cs
+++ Assets/Scripts/Atlas/Editor/Internal/Version.cs
@@ -14,7 +14,7 @@

         public static int Revision
         {
-            get { return 2; }
+            get { return 3; }
         }

         public static string Full


Removed unused usings

Removed unused usings

--- Basic.Azure.Storage/Communications/QueueService/MessageOperations/GetMessagesRequest.cs
+++ Basic.Azure.Storage/Communications/QueueService/MessageOperations/GetMessagesRequest.cs
@@ -1,10 +1,4 @@
 using Basic.Azure.Storage.Communications.Core;
-using Basic.Azure.Storage.Communications.Core.Interfaces;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;

 namespace Basic.Azure.Storage.Communications.QueueService.MessageOperations
 {


Add a 'revert shade world' command to revert the shading and fix the percent calculation with shade world.

--- Aurora/Modules/World/WorldShader/WorldShader.cs
+++ Aurora/Modules/World/WorldShader/WorldShader.cs
@@ -30,7 +30,10 @@
         public void RegionLoaded (Scene scene)
         {
             if (MainConsole.Instance != null && !initialized)
+            {
+                MainConsole.Instance.Commands.AddCommand ("revert shade world", "revert shade world", "Reverts the shading of the world", RevertShadeWorld);
                 MainConsole.Instance.Commands.AddCommand ("shade world", "shade world", "Shades the world with a color", ShadeWorld);
+            }
             initialized = true;
         }

@@ -55,7 +58,34 @@
             get { return null; }
         }

+        public void RevertShadeWorld (string[] cmd)
+        {
+            if (MainConsole.Instance.ConsoleScene == null)
+            {
+                MainConsole.Instance.Output ("Select a scene first");
+                return;
+            }
+            ISceneEntity[] entities = MainConsole.Instance.ConsoleScene.Entities.GetEntities ();
+            foreach (ISceneEntity entity in entities)
+            {
+                foreach (ISceneChildEntity child in entity.ChildrenEntities ())
+                {
+                    UUID[] textures = GetTextures (child.Shape.Textures);
+                    foreach (UUID t in textures)
+                    {
+                        UUID oldID = t;
+                        while (m_revertConverted.ContainsKey (oldID))
+                        {
+                            child.Shape.Textures = SetTexture (child.Shape, m_revertConverted[oldID], oldID);
+                            oldID = m_revertConverted[oldID];
+                        }
+                    }
+                }
+            }
+        }
+
         private Dictionary<UUID, UUID> m_previouslyConverted = new Dictionary<UUID, UUID> ();
+        private Dictionary<UUID, UUID> m_revertConverted = new Dictionary<UUID, UUID> ();
         public void ShadeWorld (string[] cmd)
         {
             if (MainConsole.Instance.ConsoleScene == null)
@@ -67,11 +97,12 @@
             int G = int.Parse (MainConsole.Instance.CmdPrompt ("G color (0 - 255)"));
             int B = int.Parse (MainConsole.Instance.CmdPrompt ("B color (0 - 255)"));
             float percent = float.Parse (MainConsole.Instance.CmdPrompt ("Percent to merge in the shade (0 - 100)"));
+            if(percent > 1)
+            percent /= 100;
             Color shader = Color.FromArgb (R, G, B);

             IJ2KDecoder j2kDecoder = MainConsole.Instance.ConsoleScene.RequestModuleInterface<IJ2KDecoder>();
             ISceneEntity[] entities = MainConsole.Instance.ConsoleScene.Entities.GetEntities ();
-            m_previouslyConverted.Clear ();
             foreach (ISceneEntity entity in entities)
             {
                 foreach (ISceneChildEntity child in entity.ChildrenEntities ())
@@ -98,7 +129,7 @@
                                 MainConsole.Instance.ConsoleScene.AssetService.Store (a);
                                 child.Shape.Textures = SetTexture (child.Shape, a.FullID, t);
                                 m_previouslyConverted.Add (t, a.FullID);
-                                m_previouslyConverted.Add (a.FullID, a.FullID);
+                                m_revertConverted.Add (a.FullID, t);
                             }
                         }
                     }


Fix push from post build event

Fix push from post build event

--- Unosquare.Labs.SshDeploy/DeploymentManager.Push.cs
+++ Unosquare.Labs.SshDeploy/DeploymentManager.Push.cs
@@ -30,11 +30,7 @@
                 {
                     // Connect SSH and SFTP clients
                     EnsureMonitorConnection(sshClient, sftpClient, verbOptions);
-
-                    using (var shellStream = CreateShellStream(sshClient))
-                    {
-                        CreateNewDeployment(sshClient, sftpClient, shellStream, verbOptions);
-                    }
+                    CreateNewDeployment(sshClient, sftpClient, verbOptions);
                 }
             }
         }
@@ -66,7 +62,6 @@
         private static void CreateNewDeployment(
             SshClient sshClient,
             SftpClient sftpClient,
-            ShellStream shellStream,
             PushVerbOptions verbOptions)
         {
             // At this point the change has been detected; Make sure we are not deploying


update

update

--- CSharpGL/Renderers/PickableRenderer/OneIndexRenderer/OneIndexRenderer.GetLastIndexId.cs
+++ CSharpGL/Renderers/PickableRenderer/OneIndexRenderer/OneIndexRenderer.GetLastIndexId.cs
@@ -23,6 +23,13 @@
             int x, int y)
         {
             if (lastIndexIdList == null || lastIndexIdList.Count == 0) { return null; }
+#if DEBUG
+            SameLengths(lastIndexIdList);
+#endif
+            if (lastIndexIdList[0].VertexIdList.Length == 1)// picking a point.
+            {
+                return lastIndexIdList[0];
+            }

             int current = 0;
 #if DEBUG
@@ -50,6 +57,18 @@
             return lastIndexIdList[current];
         }

+        private void SameLengths(List<RecognizedPrimitiveInfo> lastIndexIdList)
+        {
+            int length = lastIndexIdList[0].VertexIdList.Length;
+            for (int i = 0; i < lastIndexIdList.Count; i++)
+            {
+                if (lastIndexIdList[i].VertexIdList.Length != length)
+                {
+                    throw new Exception("This should not happen!");
+                }
+            }
+        }
+
         private void NoPrimitiveRestartIndex(List<RecognizedPrimitiveInfo> lastIndexIdList)
         {
             PrimitiveRestartSwitch glSwitch = GetPrimitiveRestartSwitch();


Bugfixing isLightning compare for Conversion tab

--- BTCPayServer/Views/Invoice/Checkout-Body.cshtml
+++ BTCPayServer/Views/Invoice/Checkout-Body.cshtml
@@ -199,6 +199,13 @@

+                        {{$t("ConversionTab_Lightning")}}
+
+

+

+

+

+
                         {{$t("ConversionTab_BodyTop", srvModel)}}

                         {{$t("ConversionTab_BodyDesc", srvModel)}}
@@ -211,18 +218,11 @@

                     @*Changelly doesn't have TO_AMOUNT support so we can't include it
-
-
-
-                        *@
+
+
+
+            *@

-

-

-

-
-                        {{$t("ConversionTab_Lightning")}}
-
-

     }


Updated rhino mocks integration title

Updated rhino mocks integration title

--- src/stashbox.mocking.rhino.mocks/Properties/AssemblyInfo.cs
+++ src/stashbox.mocking.rhino.mocks/Properties/AssemblyInfo.cs
@@ -4,11 +4,11 @@
 // General Information about an assembly is controlled through the following
 // set of attributes. Change these attribute values to modify the information
 // associated with an assembly.
-[assembly: AssemblyTitle("Stashbox.Mocking.RhinoMocks")]
+[assembly: AssemblyTitle("Stashbox.RhinoMocks")]
 [assembly: AssemblyDescription("RhinoMocks auto mocking integration for Stashbox.")]
 [assembly: AssemblyConfiguration("")]
 [assembly: AssemblyCompany("Peter Csajtai")]
-[assembly: AssemblyProduct("Stashbox.Mocking.RhinoMocks")]
+[assembly: AssemblyProduct("Stashbox.RhinoMocks")]
 [assembly: AssemblyCopyright("Copyright © Peter Csajtai 2017")]
 [assembly: AssemblyTrademark("")]
 [assembly: AssemblyCulture("")]


Fixes font styling in subtitles.

Fixes font styling in subtitles.

--- Videre/Videre/Controls/SubtitleAreaControl.xaml.cs
+++ Videre/Videre/Controls/SubtitleAreaControl.xaml.cs
@@ -1,5 +1,7 @@
 using System;
+using System.Collections.Generic;
 using System.Windows;
+using System.Windows.Documents;
 using VidereLib.Components;
 using VidereLib.EventArgs;

@@ -35,13 +37,82 @@
             if ( OnSubtitlesChangedEventArgs.Subtitles.Lines.Count <= 0 )
                 return;

-            for ( int X = 0; X < OnSubtitlesChangedEventArgs.Subtitles.Lines.Count; X++ )
+            List<Inline> inlines = ConvertLinesToRuns( OnSubtitlesChangedEventArgs.Subtitles.Lines );
+            foreach ( Inline inline in inlines )
+                SubsTextBlock.Inlines.Add( inline );
+        }
+
+        private Inline GetInlineWithStyling( string line, System.Drawing.FontStyle style )
+        {
+            Inline styledText = new Run( line );
+            if ( style.HasFlag( System.Drawing.FontStyle.Bold ) )
+                styledText = new Bold( styledText );
+
+            if ( style.HasFlag( System.Drawing.FontStyle.Italic ) )
+                styledText = new Italic( styledText );
+
+            if ( style.HasFlag( System.Drawing.FontStyle.Underline ) )
+                styledText = new Underline( styledText );
+
+            return styledText;
+        }
+
+        private List<Inline> ConvertLinesToRuns( List<string> lines )
+        {
+            System.Drawing.FontStyle currentStyle = System.Drawing.FontStyle.Regular;
+            List<Inline> inlines = new List<Inline>( );
+            for ( int X = 0; X < lines.Count; ++X )
             {
-                SubsTextBlock.Inlines.Add( OnSubtitlesChangedEventArgs.Subtitles.Lines[ X ] );
+                string line = lines[ X ];

-                if ( X < OnSubtitlesChangedEventArgs.Subtitles.Lines.Count - 1 )
-                    SubsTextBlock.Inlines.Add( Environment.NewLine );
+                string currentText = string.Empty;
+                for ( int q = 0; q < line.Length; q++ )
+                {
+                    if ( line[ q ] == '<' )
+                    {
+                        inlines.Add( GetInlineWithStyling( currentText, currentStyle ) );
+                        currentText = string.Empty;
+                        string contents = string.Empty;
+                        while ( line[ ++q ] != '>' )
+                            contents += line[ q ];
+
+                        string[ ] separated = contents.Split( new[ ] { ' ' }, StringSplitOptions.RemoveEmptyEntries );
+                        switch ( separated[ 0 ] )
+                        {
+                            case "i":
+                                currentStyle |= System.Drawing.FontStyle.Italic;
+                                break;
+
+                            case "/i":
+                                currentStyle &= ~System.Drawing.FontStyle.Italic;
+                                break;
+
+                            case "b":
+                                currentStyle |= System.Drawing.FontStyle.Bold;
+                                break;
+
+                            case "/b":
+                                currentStyle &= ~System.Drawing.FontStyle.Bold;
+                                break;
+
+                            case "u":
+                                currentStyle |= System.Drawing.FontStyle.Underline;
+                                break;
+
+                            case "/u":
+                                currentStyle &= ~System.Drawing.FontStyle.Underline;
+                                break;
+                        }
+
+                        continue;
+                    }
+                    currentText += line[ q ];
+                }
+
+                inlines.Add( GetInlineWithStyling( currentText + Environment.NewLine, currentStyle ) );
             }
+
+            return inlines;
         }
     }
 }


Changing hint spans to use Html.Hint() BTLR-52

--HG--
branch : dev

--- Views/DefinitionTemplates/HintFieldSettings.cshtml
+++ Views/DefinitionTemplates/HintFieldSettings.cshtml
@@ -4,6 +4,6 @@
     <legend>@T("Hint field settings")</legend>
      m.Hint)">@T("Hint text")
     @Html.TextAreaFor(m => m.Hint, new { @class = "html tinymce" })
-    @T("This text will be dislayed any time the item is displayed or edited.")
+    @Html.Hint(T("This text will be dislayed any time the item is displayed or edited."))
     @Html.ValidationMessageFor(m => m.Hint)
 </fieldset>


Update CalculatingFormulas.cs

Update CalculatingFormulas.cs

--- Examples/CSharp/Formulas/CalculatingFormulas.cs
+++ Examples/CSharp/Formulas/CalculatingFormulas.cs
@@ -8,6 +8,7 @@
     {
         public static void Main(string[] args)
         {
+            //ExStart:1
             // The path to the documents directory.
             string dataDir = Aspose.Cells.Examples.Utils.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);

@@ -45,7 +46,8 @@

             //Saving the Excel file
             workbook.Save(dataDir + "output.out.xls");
+            //ExEnd:1

         }
     }
-}+}


Handle edge case

Handle edge case

--- WalletWasabi/Blockchain/Blocks/SmartHeaderChain.cs
+++ WalletWasabi/Blockchain/Blocks/SmartHeaderChain.cs
@@ -93,9 +93,9 @@
 		private void SetTip(SmartHeader header)
 		{
 			Tip = header;
-			TipHeight = header.Height;
-			TipHash = header.BlockHash;
-			HashCount = Chain.Count;
+			TipHeight = header?.Height ?? default;
+			TipHash = header?.BlockHash;
+			HashCount = Chain?.Count ?? default;
 			SetHashesLeft();
 		}

@@ -110,9 +110,16 @@
 			{
 				if (Chain.Any())
 				{
-					Chain.Remove(Chain.Keys.Max());
-					var last = Chain.Last();
-					SetTip(last.Value);
+					Chain.Remove(Chain.Last().Key);
+					if (Chain.Any())
+					{
+						var newLast = Chain.Last();
+						SetTip(newLast.Value);
+					}
+					else
+					{
+						SetTip(null);
+					}
 				}
 			}
 		}


Adding in code snippets for time

Adding in code snippets for time

--- Module1-IntelligentApp/Source/Ex1/Begin/src/PartsUnlimited.Models/ProductsRepository.cs
+++ Module1-IntelligentApp/Source/Ex1/Begin/src/PartsUnlimited.Models/ProductsRepository.cs
@@ -81,14 +81,17 @@

         public Product GetById(int id)
         {
-            // TODO: implement GetById
-            throw new NotImplementedException();
+            return this.Set<Product>()
+                .Where(d => d.ProductId == id)
+                .AsEnumerable()
+                .FirstOrDefault();
         }

         public IEnumerable<Product> Find(Expression<Func<Product, bool>> predicate)
         {
-            // TODO: implement Find
-            throw new NotImplementedException();
+            return this.Set<Product>()
+                .Where(predicate)
+                .AsEnumerable();
         }

         public IQueryable<T> Set<T>()
@@ -98,8 +101,13 @@

         public async Task CreateAsync(Product product)
         {
-            // TODO: implement CreateAsync
-            throw new NotImplementedException();
+            if (product.ProductId == 0)
+            {
+                product.ProductId = GenerateProductId();
+            }
+
+            var response = await this.Client.CreateDocumentAsync(this.Collection.SelfLink, product);
+            this.EnsureSuccessStatusCode(response);
         }

         public async Task UpdateAsync(Product product)


Fix build

Fix build

--- Xwt.WPF/Xwt.WPFBackend/ComboBoxTextEntryBackend.cs
+++ Xwt.WPF/Xwt.WPFBackend/ComboBoxTextEntryBackend.cs
@@ -169,6 +169,11 @@

 		public bool MultiLine { get; set; }

+		public void SetCompletions(string[] completions)
+		{
+			// TODO
+		}
+
 		public override void EnableEvent (object eventId)
 		{
 			base.EnableEvent (eventId);


Use the passed-in ruleset

Use the passed-in ruleset

--- osu.Game.Rulesets.Mania/Difficulty/ManiaDifficultyCalculator.cs
+++ osu.Game.Rulesets.Mania/Difficulty/ManiaDifficultyCalculator.cs
@@ -34,7 +34,7 @@
         public ManiaDifficultyCalculator(Ruleset ruleset, WorkingBeatmap beatmap)
             : base(ruleset, beatmap)
         {
-            isForCurrentRuleset = beatmap.BeatmapInfo.Ruleset.Equals(new ManiaRuleset().RulesetInfo);
+            isForCurrentRuleset = beatmap.BeatmapInfo.Ruleset.Equals(ruleset.RulesetInfo);
         }

         protected override DifficultyAttributes Calculate(IBeatmap beatmap, Mod[] mods, double timeRate)


Fix missing HeadlessTest specification in new test

--- osu.Game.Tests/Rulesets/TestSceneDrawableRulesetDependencies.cs
+++ osu.Game.Tests/Rulesets/TestSceneDrawableRulesetDependencies.cs
@@ -16,12 +16,14 @@
 using osu.Framework.Graphics.OpenGL.Textures;
 using osu.Framework.Graphics.Shapes;
 using osu.Framework.Graphics.Textures;
+using osu.Framework.Testing;
 using osu.Game.Rulesets.Osu;
 using osu.Game.Rulesets.UI;
 using osu.Game.Tests.Visual;

 namespace osu.Game.Tests.Rulesets
 {
+    [HeadlessTest]
     public class TestSceneDrawableRulesetDependencies : OsuTestScene
     {
         [Test]


Use longer hash string

Use longer hash string

--- osu.Game.Tests/Visual/Gameplay/TestSceneReplayDownloadButton.cs
+++ osu.Game.Tests/Visual/Gameplay/TestSceneReplayDownloadButton.cs
@@ -211,7 +211,7 @@
             OnlineID = hasOnlineId ? online_score_id : 0,
             Ruleset = new OsuRuleset().RulesetInfo,
             BeatmapInfo = beatmapManager.GetAllUsableBeatmapSets().First().Beatmaps.First(),
-            Hash = replayAvailable ? "hash" : string.Empty,
+            Hash = replayAvailable ? "online" : string.Empty,
             User = new APIUser
             {
                 Id = 39828,


Fix failing multiplayer player test

Fix failing multiplayer player test

--- osu.Game.Tests/Visual/Multiplayer/TestSceneMultiplayerPlayer.cs
+++ osu.Game.Tests/Visual/Multiplayer/TestSceneMultiplayerPlayer.cs
@@ -3,7 +3,9 @@

 using System.Linq;
 using NUnit.Framework;
+using osu.Framework.Screens;
 using osu.Framework.Testing;
+using osu.Game.Online.Multiplayer;
 using osu.Game.Rulesets.Osu;
 using osu.Game.Screens.OnlinePlay.Multiplayer;

@@ -27,6 +29,9 @@
             {
                 Stack.Push(player = new MultiplayerPlayer(Client.APIRoom, Client.CurrentMatchPlayingItem.Value, Client.Room?.Users.ToArray()));
             });
+
+            AddUntilStep("wait for player to be current", () => player.IsCurrentScreen() && player.IsLoaded);
+            AddStep("start gameplay", () => ((IMultiplayerClient)Client).MatchStarted());
         }

         [Test]


Added additional exception handling and logging

--- pMixins.VSPackage/pMixinsVisualStudioCodeGenerateInitializer.cs
+++ pMixins.VSPackage/pMixinsVisualStudioCodeGenerateInitializer.cs
@@ -84,12 +84,23 @@

         private void InitializeSolutionManager(DTE dte)
         {
-            _solutionManager = ServiceLocator.Kernel.Get<ISolutionManager>();
+            try
+            {
+                _solutionManager = ServiceLocator.Kernel.Get<ISolutionManager>();

-            if (null == dte.Solution)
-                _log.Error("Failed to load Solution object from DTE");
-            else
-                _solutionManager.LoadSolution(dte.Solution.FileName);
+                if (null == dte.Solution)
+                    _log.Error("Failed to load Solution object from DTE");
+                else
+                    _solutionManager.LoadSolution(dte.Solution.FileName);
+
+                _log.InfoFormat("Loaded Solution [{0}]", dte.Solution.FileName);
+            }
+            catch (Exception e)
+            {
+                _log.Fatal("Exception creating Solution Manager", e);
+
+                throw;
+            }
         }

         private void InitializeFileGenerators()
@@ -99,6 +110,8 @@
                 _onBuildCodeGenerator = ServiceLocator.Kernel.Get<pMixinsOnBuildCodeGenerator>();

                 _onItemSaveCodeGenerator = ServiceLocator.Kernel.Get<pMixinsOnItemSaveCodeGenerator>();
+
+                _log.Info("Loaded Code Generators");
             }
             catch (Exception e)
             {


Add IsNullToVisibility converter

Add IsNullToVisibility converter

--- GoldenAnvil.Utility.Windows/CommonConverters.cs
+++ GoldenAnvil.Utility.Windows/CommonConverters.cs
@@ -14,6 +14,8 @@
 		public static readonly IValueConverter IsEqual = new IsEqualConverter();

 		public static readonly IValueConverter IsEqualToVisibility = new IsEqualToVisibilityConverter();
+
+		public static readonly IValueConverter IsNullToVisibility = new IsNullToVisibilityConverter();

 		private sealed class BooleanNotConverter : IValueConverter
 		{
@@ -78,5 +80,21 @@
 				throw new NotImplementedException();
 			}
 		}
+
+		private sealed class IsNullToVisibilityConverter : IValueConverter
+		{
+			public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+			{
+				if (!targetType.IsAssignableFrom(typeof(Visibility)))
+					throw new InvalidOperationException(@"The target must be assignable from a Visibility.");
+
+				return value is null ? Visibility.Collapsed : Visibility.Visible;
+			}
+
+			public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+			{
+				throw new NotImplementedException();
+			}
+		}
 	}
 }


Removed unused using statement. Deploy tiem

--- HispterOfTheDay.Domain/Services/ImageService.cs
+++ HispterOfTheDay.Domain/Services/ImageService.cs
@@ -1,5 +1,4 @@
 using System;
-using HispterOfTheDay.Domain.Helpers;
 using HispterOfTheDay.Domain.Model;
 using HispterOfTheDay.Domain.Repositories;


Bugfix: Kommentar-Autor wird nach dem Verfassen nicht angezeigt

--- ILK-Protokoll/Controllers/CommentsController.cs
+++ ILK-Protokoll/Controllers/CommentsController.cs
@@ -13,7 +13,7 @@
 	{
 		public PartialViewResult _List(Topic topic)
 		{
-			List<Comment> comments = topic.Comments.OrderBy(c => c.Created).ToList();
+			var comments = db.Comments.Include(c => c.Author).Where(c => c.TopicID == topic.ID).OrderBy(c => c.Created).ToList();
 			ViewBag.TopicID = topic.ID;
 			ViewBag.ShowCreateForm = !topic.IsReadOnly && !IsTopicLocked(topic);


Bug fixed: LDAPプロパティが指定されていない場合のチェックが正しく行なわれない問題を解消。

--- Implem.Pleasanter/Libraries/DataSources/Ldap.cs
+++ Implem.Pleasanter/Libraries/DataSources/Ldap.cs
@@ -78,7 +78,7 @@

         private static string Property(this DirectoryEntry entry, string propertyName)
         {
-            if (propertyName != "N/A")
+            if (!propertyName.IsNullOrEmpty())
             {
                 try
                 {


Implement repo method for changing user password.

--- Infopulse.EDemocracy.Web/Auth/AuthRepository.cs
+++ Infopulse.EDemocracy.Web/Auth/AuthRepository.cs
@@ -41,6 +41,20 @@
 			{
 				throw exc.GetMostInnerException();
 			}
+		}
+
+		public async Task<IdentityResult> ChangePassword(int userID, string currentPassword, string newPassword)
+		{
+			try
+			{
+				var result = await applicationUserManager.ChangePasswordAsync(userID, currentPassword, newPassword);
+
+				return result;
+			}
+			catch (Exception exc)
+			{
+				throw exc.GetMostInnerException();
+			}
 		}

 		public async Task<ApplicationUser> FindUser(string userName, string password)


Added .NET Core 3.0 mapping.

Added .NET Core 3.0 mapping.

--- JexusManager/Features/Main/KestrelDiagDialog.cs
+++ JexusManager/Features/Main/KestrelDiagDialog.cs
@@ -26,6 +26,7 @@
     public partial class KestrelDiagDialog : DialogForm
     {
         private static IDictionary<Version, Version> mappings = new Dictionary<Version, Version> {
+            { Version.Parse("3.0.0"), Version.Parse("13.0.19258.0") },
             { Version.Parse("2.2.7"), Version.Parse("12.2.19169.6") },
             { Version.Parse("2.2.6"), Version.Parse("12.2.19169.6") },
             { Version.Parse("2.2.5"), Version.Parse("12.2.19109.5") },


Added Arguments to Excel reports

Added Arguments to Excel reports

--- src/Ampla.LogReader/Remoting/RemotingEntry.cs
+++ src/Ampla.LogReader/Remoting/RemotingEntry.cs
@@ -58,12 +58,28 @@
             dataTable.Columns.Add("Method", typeof(string));
             dataTable.Columns.Add("Duration", typeof(double));
             dataTable.Columns.Add("Arguments", typeof(string));
+            dataTable.Columns.Add("ArgumentCount", typeof(int));
+            dataTable.Columns.Add("Argument_01", typeof(string));
+            dataTable.Columns.Add("Argument_02", typeof(string));
+            dataTable.Columns.Add("Argument_03", typeof(string));
+            dataTable.Columns.Add("Argument_04", typeof(string));
+            dataTable.Columns.Add("Argument_05", typeof(string));
+            dataTable.Columns.Add("Argument_06", typeof(string));
+            dataTable.Columns.Add("Argument_07", typeof(string));
             dataTable.Columns.Add("Source", typeof(string));

             int count = 0;

             foreach (RemotingEntry entry in entries)
             {
+                string argument01 = entry.Arguments.Length > 0 ? entry.Arguments[0].Value : null;
+                string argument02 = entry.Arguments.Length > 1 ? entry.Arguments[1].Value : null;
+                string argument03 = entry.Arguments.Length > 2 ? entry.Arguments[2].Value : null;
+                string argument04 = entry.Arguments.Length > 3 ? entry.Arguments[3].Value : null;
+                string argument05 = entry.Arguments.Length > 4 ? entry.Arguments[4].Value : null;
+                string argument06 = entry.Arguments.Length > 5 ? entry.Arguments[5].Value : null;
+                string argument07 = entry.Arguments.Length > 6 ? entry.Arguments[6].Value : null;
+
                 dataTable.Rows.Add(++count,
                                    entry.CallTime,
                                    entry.CallTime.ToLocalTime(),
@@ -72,6 +88,14 @@
                                    entry.Method,
                                    entry.Duration.TotalSeconds,
                                    entry.ArgumentXml,
+                                   entry.Arguments.Length,
+                                   argument01,
+                                   argument02,
+                                   argument03,
+                                   argument04,
+                                   argument05,
+                                   argument06,
+                                   argument07,
                                    entry.Source);
             }


还原对dictionary的容错

还原对dictionary的容错

--- KSFramework/Assets/XLua/Src/Editor/Generator.cs
+++ KSFramework/Assets/XLua/Src/Editor/Generator.cs
@@ -1273,7 +1273,14 @@
                 {
                     foreach(var type in (obj as IEnumerable<Type>))
                     {
-                        OptimizeCfg.Add(type, flag);
+                        if (!OptimizeCfg.ContainsKey(type))
+                        {
+                            OptimizeCfg.Add(type, flag);
+                        }
+                        else
+                        {
+                            Debug.LogWarningFormat("相同的Key:{0}",type);
+                        }
                     }
                 }
             }


9954: remove unused code

9954: remove unused code

--- a_mini/projects/PixelFarm/PixelFarm.DrawingCanvas/5_Agg_DrawElements/StrokeGenerator.cs
+++ a_mini/projects/PixelFarm/PixelFarm.DrawingCanvas/5_Agg_DrawElements/StrokeGenerator.cs
@@ -27,21 +27,7 @@
     static class MyMath
     {

-        /// <summary>
-        /// Convert degrees to radians
-        /// </summary>
-        /// <param name="degrees">An angle in degrees</param>
-        /// <returns>The angle expressed in radians</returns>
-        public static double DegreesToRadians(double degrees)
-        {
-
-            return degrees * System.Math.PI / 180.0f;
-        }
-        public static double RadToDegrees(double rad)
-        {
-
-            return rad * (180.0f / System.Math.PI);
-        }
+
         public static bool MinDistanceFirst(Vector2 baseVec, Vector2 compare0, Vector2 compare1)
         {
             return (SquareDistance(baseVec, compare0) < SquareDistance(baseVec, compare1)) ? true : false;
@@ -52,30 +38,6 @@
             double xdiff = v1.X - v0.X;
             double ydiff = v1.Y - v0.Y;
             return (xdiff * xdiff) + (ydiff * ydiff);
-        }
-        public static int Min(double v0, double v1, double v2)
-        {
-            //find min of 3
-            unsafe
-            {
-                double* doubleArr = stackalloc double[3];
-                doubleArr[0] = v0;
-                doubleArr[1] = v1;
-                doubleArr[2] = v2;
-
-                double min = double.MaxValue;
-                int foundAt = 0;
-                for (int i = 0; i < 3; ++i)
-                {
-                    if (doubleArr[i] < min)
-                    {
-                        foundAt = i;
-                        min = doubleArr[i];
-                    }
-                }
-                return foundAt;
-            }
-
         }

         /// <summary>
@@ -429,7 +391,7 @@
     class LineStrokeGenerator
     {

-        LineJoiner _lineJoiner;
+        LineJoiner _lineJoiner;
         double latest_moveto_x;
         double latest_moveto_y;
         double positiveSide;
@@ -647,7 +609,7 @@

             positiveSideVectors.Clear();
             negativeSideVectors.Clear();
-
+
             bool has_some_results = false;
             for (int i = 0; i < cmdCount; ++i)
             {
@@ -852,7 +814,7 @@
                         double c_y = (y0 + y1) / 2;
                         Vector2 delta = new Vector2(x0 - c_x, y0 - c_y);
                         ArcGenerator.GenerateArcNew(outputVectors,
-                                     c_x, c_y, delta, MyMath.DegreesToRadians(180));
+                                     c_x, c_y, delta, AggMath.deg2rad(180));
                     }
                     break;
             }
@@ -881,7 +843,7 @@
                         double c_y = (y0 + y1) / 2;
                         Vector2 delta = new Vector2(x1 - c_x, y1 - c_y);
                         ArcGenerator.GenerateArcNew(outputVectors,
-                                     c_x, c_y, delta, MyMath.DegreesToRadians(180));
+                                     c_x, c_y, delta, AggMath.deg2rad(180));
                     }
                     break;
             }
@@ -901,7 +863,7 @@

             //TODO: review here ***
             int nsteps = 4;
-            double eachStep = MyMath.RadToDegrees(sweepAngleRad) / nsteps;
+            double eachStep = AggMath.rad2deg(sweepAngleRad) / nsteps;
             double angle = 0;
             for (int i = 0; i < nsteps; ++i)
             {