Example #1
0
        private void LoadScript(CONF.XmlLoad X)
        {
            Script S = new Script();
            Scripts.Add(S);

            if (X.HasAttribute("version"))
                S.Version = X.GetAttribute("version");

            while (X.Read())
            {
                switch (X.ElementName)
                {
                    case "name": S.Name = X.GetAttribute("value"); break;
                    case "device": S.Device = X.GetAttribute("value"); break;
                    case "cathegory": S.Cathegory = X.GetIntAttribute("value"); break;
                    case "input":
                        S.Input = X.GetAttribute("value");
                        S.Default = X.GetAttribute("default");
                        break;
                    case "steps": LoadActions(S, X.GetSubtree()); break;
                    case "default": S.DefaultScript = true; break;
                    case "autorun": S.Autorun = true; break;
                    case "old": S.Old = true; break;
                }
            }

            X.Close();
        }