Exemplo n.º 1
0
        /// <summary>
        /// Gets a correctly formatted timestamp.
        /// </summary>
        /// <returns>A <see langword="string"/> with a properly formatted timestamp.</returns>
        private static string GetTimestamp()
        {
            if (Options.Instance.Use24HourTime)
            {
                return(CrestronEnvironment.GetLocalTime().ToString("HH:mm:ss"));
            }

            return(CrestronEnvironment.GetLocalTime().ToLongTimeString());
        }
Exemplo n.º 2
0
        /// <summary>
        /// Gets a correctly formatted timestamp.
        /// </summary>
        /// <returns>A <see langword="string"/> with a properly formatted timestamp.</returns>
        private static string GetTimestamp()
        {
            if (!Options.Instance.UseTimestamps)
            {
                return(string.Empty);
            }

            if (Options.Instance.Use24HourTime)
            {
                return(string.Format("[{0}]", CrestronEnvironment.GetLocalTime().ToString("HH:mm:ss")));
            }

            return(string.Format("[{0}]", CrestronEnvironment.GetLocalTime().ToLongTimeString()));
        }
Exemplo n.º 3
0
        /// <summary>
        /// Writes a list of SignedAnalogPropertyInterlocks to the XML Document in memory.
        /// </summary>
        /// <param name="items">The list of SignedAnalogPropertyInterlock items to write.</param>
        /// <returns>True if successful, false if any item fails.</returns>
        public bool WriteSignedAnalogPropertyInterlocks(List <SignedAnalogPropertyInterlock> items)
        {
            var status     = true;
            var markerTime = CrestronEnvironment.GetLocalTime().AddSeconds(20);

            for (var i = 0; i < items.Count; i++)
            {
                if (CrestronEnvironment.GetLocalTime() > markerTime)
                {
                    CrestronEnvironment.AllowOtherAppsToRun();
                    markerTime = CrestronEnvironment.GetLocalTime().AddSeconds(20);
                }
                if (WriteElement(items[i].Element) == false)
                {
                    status = false;
                }
            }
            return(status);
        }
Exemplo n.º 4
0
        /// <summary>
        /// Writes all the SerialElements from a list of SerialProcessors to the XML Document in memory.
        /// </summary>
        /// <param name="items">A list of SerialProcessors.</param>
        /// <returns>True if successful, false if it fails.</returns>
        public bool WriteSerials(List <SerialProcessor> items)
        {
            var status     = true;
            var markerTime = CrestronEnvironment.GetLocalTime().AddSeconds(20);

            for (var i = 0; i < items.Count; i++)
            {
                if (CrestronEnvironment.GetLocalTime() > markerTime)
                {
                    CrestronEnvironment.AllowOtherAppsToRun();
                    markerTime = CrestronEnvironment.GetLocalTime().AddSeconds(20);
                }
                if (WriteSerials(items[i]) == false)
                {
                    status = false;
                }
            }
            return(status);
        }