예제 #1
0
        /// <summary>
        /// Turns a phase into its textual representation
        /// </summary>
        /// <param name="phase"></param>
        /// <returns></returns>
        public static string PhaseToSuffix(ReleasePhase phase)
        {
            var suffix = "";

            var  value = (ushort)phase;
            byte chr   = 0;

            for (var i = 0; i < 16; i++)
            {
                if ((value & (1 << i)) != 0)
                {
                    chr |= (byte)(1 << (i % 8));
                }

                if (i > 0 && (i + 1) % 8 == 0)
                {
                    if (chr > 0)
                    {
                        suffix += (char)chr;
                    }
                    chr = 0;
                }
            }

            return(suffix);
        }
        /// <summary>
        /// Turns a phase into its textual representation
        /// </summary>
        /// <param name="phase"></param>
        /// <returns></returns>
        public static string PhaseToSuffix(ReleasePhase phase)
        {
            var suffix = "";

            var value = (ushort)phase;
            byte chr = 0;
            for (var i = 0; i < 16; i++)
            {
                if ((value & (1 << i)) != 0) chr |= (byte)(1 << (i % 8));

                if (i > 0 && (i + 1) % 8 == 0)
                {
                    if (chr > 0) suffix += (char)chr;
                    chr = 0;
                }
            }

            return suffix;
        }