Esempio n. 1
0
        private void LoadOptions(CONF.XmlLoad X)
        {
            while (X.Read())
            {
                switch (X.ElementName)
                {
                    case "list": Ops.Add(LoadList(X.GetAttribute("label"), X.GetSubtree())); break;
                    case "text": Ops.Add(LoadText(X.GetAttribute("label"), X)); break;
                }
            }

            X.Close();
        }
Esempio n. 2
0
        private Options.OptionList LoadList(string Name, CONF.XmlLoad X)
        {
            var O = new Options.OptionList(Name);
            while (X.Read())
            {
                switch (X.ElementName)
                {
                    case "option": LoadOption(O, X, X.GetSubtree()); break;
                }
            }

            X.Close();

            return O;
        }
Esempio n. 3
0
        private void LoadCustomActions(CONF.XmlLoad X)
        {
            while (X.Read())
            {
                ToolAction A = LoadAction(X.GetSubtree());
                A.Name = X.ElementName;

                taCustom.Add(A);
            }

            X.Close();
        }
Esempio n. 4
0
        private void LoadActions(CONF.XmlLoad X)
        {
            while (X.Read())
            {
                switch (X.ElementName)
                {
                    case "erase": taErase = LoadAction(X.GetSubtree()); break;
                    case "woption": taProgramOption = LoadAction(X.GetSubtree()); break;
                    case "wflash": taProgramFlash = LoadAction(X.GetSubtree()); break;
                    case "wdata": taProgramData = LoadAction(X.GetSubtree()); break;
                    case "vflash": taVerifyFlash = LoadAction(X.GetSubtree()); break;
                    case "vdata": taVerifyData = LoadAction(X.GetSubtree()); break;
                    case "lock": taLock = LoadAction(X.GetSubtree()); break;
                    case "launch": taLaunch = LoadAction(X.GetSubtree()); break;
                    case "convert": taConvert = LoadAction(X.GetSubtree()); break;
                    default:
                        {
                            ToolAction A = LoadAction(X.GetSubtree());
                            A.Name = X.ElementName;

                            taCustom.Add(A);
                        }
                        break;
                }
            }

            X.Close();
        }
Esempio n. 5
0
        private ToolAction LoadAction(CONF.XmlLoad X)
        {
            ToolAction A = new ToolAction();

            while (X.Read())
            {
                switch (X.ElementName)
                {
                    case "command": A.Command = X.GetAttribute("value"); break;
                    case "toolpath": A.CustomToolPath = X.GetAttribute("value"); break;
                    case "params":
                        {
                            CONF.XmlLoad Subtree = X.GetSubtree();
                            while (Subtree.Read())
                            {
                                var Name = Subtree.ElementName;
                                var Def = Subtree.GetAttribute("default") ?? "";

                                A.Defaults.setString(Name, Def);
                            }
                            Subtree.Close();
                        }
                        break;
                    case "error":
                        {
                            CONF.XmlLoad Subtree = X.GetSubtree();
                            while (Subtree.Read())
                            {
                                switch (Subtree.ElementName)
                                {
                                    case "string": A.ErrorMask.Add(Subtree.GetAttribute("value")); break;
                                }
                            }
                            Subtree.Close();
                        }
                        break;
                    case "internal":
                        {
                            CONF.XmlLoad Subtree = X.GetSubtree();
                            while (Subtree.Read())
                            {
                                switch (Subtree.ElementName)
                                {
                                    case "string": A.Write.Add(Subtree.GetAttribute("value")); break;
                                }
                            }
                            Subtree.Close();
                        }
                        break;
                }
            }

            return A;
        }
Esempio n. 6
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();
        }