Esempio n. 1
0
        /// <summary>
        ///   add Run Time Events to the events queue
        /// </summary>
        /// <param name = "foundTagName">possible tag name, name of object, which need be allocated</param>
        private bool initEvents(XmlParser parser, String foundTagName)
        {
            if (foundTagName == null)
            {
                return(false);
            }

            if (foundTagName.Equals(ConstInterface.MG_TAG_EVENT))
            {
                var evt = new RunTimeEvent((MgControl)null);
                evt.fillData(parser, null);
                evt.convertParamsToArgs();
                evt.setTask(null);
                evt.setFromServer();
                ClientManager.Instance.EventsManager.addToTail(evt);
            }
            else if (foundTagName.Equals(ConstInterface.MG_TAG_EVENTS_QUEUE))
            {
                parser.setCurrIndex(parser.getXMLdata().IndexOf(XMLConstants.TAG_CLOSE, parser.getCurrIndex()) +
                                    1); // end of outer tag and its ">"
            }
            else if (foundTagName.Equals('/' + ConstInterface.MG_TAG_EVENTS_QUEUE))
            {
                parser.setCurrIndex2EndOfTag();
                return(false);
            }
            else
            {
                Logger.Instance.WriteExceptionToLog("There is no such tag in EventsQueue: " + foundTagName);
                return(false);
            }
            return(true);
        }