Exemplo n.º 1
0
        public void WriteUserState(ThreadVM vm)
        {
            var  state     = vm.UserState;
            bool needComma = false;

            foreach (var t in UserStates)
            {
                if ((state & t.Item1) != 0)
                {
                    state &= ~t.Item1;
                    if (needComma)
                    {
                        output.WriteCommaSpace();
                    }
                    needComma = true;
                    output.Write(t.Item2, TextTokenType.EnumField);
                }
            }
            if (state != 0)
            {
                if (needComma)
                {
                    output.WriteCommaSpace();
                }
                output.Write(string.Format("0x{0:X}", (int)state), TextTokenType.Number);
            }
        }