Пример #1
0
        private void ProcessUpdateNode(MemoryInputStream stream, JORNode node)
        {
            Debug.WriteLine("<- ORef ProcessUpdate CMD {0}", JHI.HexDump(stream.data));

            while (stream.HasData())
            {
                JORMessageCommand command = (JORMessageCommand)stream.ReadU32();

                Debug.WriteLine("<- ORef ProcessUpdate {0}", command);

                if (command == JORMessageCommand.UpdateControl)
                {
                    uint updateMode = stream.ReadU32();
                    uint id         = stream.ReadU32();
                    var  control    = node.FindControlByID(id, 0);

                    if (control == null)
                    {
                        // No clue about this control; can't parse.
                        return;
                    }

                    if (control is JORControlCheckBox)
                    {
                        // Checkboxes can have multiple controls with the same ID.
                        uint subID = stream.ReadU32();
                        control = node.FindControlByID(id, subID);

                        if (control == null)
                        {
                            // Shouldn't happen, but just in case...
                            return;
                        }
                    }

                    control.Update(updateMode, stream);
                }
            }
        }
Пример #2
0
        private void ProcessUpdateNode(MemoryInputStream stream, JORNode node)
        {
            while (stream.HasData())
            {
                JORMessageCommand command = (JORMessageCommand)stream.ReadU32();

                // Debug.WriteLine("<- ORef ProcessUpdate {0}", command);

                if (command == JORMessageCommand.UpdateControl)
                {
                    uint updateMode = stream.ReadU32();
                    uint id         = stream.ReadU32();
                    var  control    = node.FindControlByID(id);

                    if (control == null)
                    {
                        // No clue about this control; can't parse.
                        return;
                    }

                    control.Update(updateMode, stream);
                }
            }
        }