Exemple #1
0
        private void ReadAction()
        {
            logger.Trace("ReadAction() called...");

            string type = reader.GetAttribute(Tags.ActionTypeAttr);

            if (String.IsNullOrEmpty(type))
            {
                throw new LoaderException(CreatePosMessage("Type attribute for action may not be empty! {0}"));
            }
            else
            {
                logger.Trace(CreatePosMessage("Parsing action of type '{1}' {0}...", type));
            }

            if (actionParsers.ContainsKey(type))
            {
                ActionParameter action = actionParsers[type]();
                if (action != null)
                {
                    button.AddAction(action);
                }
                else
                {
                    throw new LoaderException(CreatePosMessage("Parsing action failed! {0}"));
                }
            }
            else
            {
                throw new LoaderException(CreatePosMessage("Action of type '{1}' is not implemented! {0}", type));
            }
        }