Beispiel #1
0
        public XElement SerializeItem(object item)
        {
            MacroCommandWithArguments commandWA = item as MacroCommandWithArguments;

            if (commandWA == null)
            {
                return(null);
            }

            XElement xmlElement = new XElement(TAG_NAME);

            xmlElement.SetAttributeValue(ATTRIBUTE_CODE, commandWA.CommandCode);

            foreach (string argumentStr in commandWA.ArgumentKeys)
            {
                XElement argElement = new XElement(TAG_NAME_ARGUMENT);
                argElement.SetAttributeValue(ATTRIBUTE_ARGUMENT_KEY, argumentStr);
                xmlElement.Add(argElement);
            }

            return(xmlElement);
        }
 public static string GetCode(this MacroCommandWithArguments commandWA)
 {
     return(GetCode(commandWA.Command, commandWA.ArgumentValues));
 }