Exemplo n.º 1
0
        TreeStore CreateActionTree()
        {
            var store = new TreeStore(typeof(string), typeof(IExecutable));

            string scriptDir = Gimp.Directory +
                               System.IO.Path.DirectorySeparatorChar + "scripts";

            var parser = new ActionParser(_image, _drawable);

            int nrScripts = 0;

            DebugOutput.Quiet = false;

            foreach (string fileName in Directory.GetFiles(scriptDir))
            {
                if (fileName.EndsWith(".atn"))
                {
                    Console.WriteLine(fileName);
                    nrScripts++;

                    var actions = parser.Parse(fileName);

                    if (actions != null)
                    {
                        _set.Add(actions);

                        var iter = store.AppendValues(actions.ExtendedName, actions);
                        foreach (var action in actions)
                        {
                            var iter1 = store.AppendValues(iter, action.Name,
                                                           action);
                            foreach (var actionEvent in action)
                            {
                                Console.WriteLine(actionEvent.EventForDisplay);
                                actionEvent.FillStore(store, iter1);
                            }
                        }
                    }
                }
            }

            DumpStatistics(parser, nrScripts);

            return(store);
        }
Exemplo n.º 2
0
        TreeStore CreateActionTree()
        {
            var store = new TreeStore(typeof(string), typeof(IExecutable));

              string scriptDir = Gimp.Directory +
            System.IO.Path.DirectorySeparatorChar + "scripts";

              var parser = new ActionParser(_image, _drawable);

              int nrScripts = 0;

              DebugOutput.Quiet = false;

              foreach (string fileName in Directory.GetFiles(scriptDir))
            {
              if (fileName.EndsWith(".atn"))
            {
              Console.WriteLine(fileName);
              nrScripts++;

              var actions = parser.Parse(fileName);

              if (actions != null)
            {
              _set.Add(actions);

              var iter = store.AppendValues(actions.ExtendedName, actions);
              foreach (var action in actions)
            {
              var iter1 = store.AppendValues(iter, action.Name,
                              action);
              foreach (var actionEvent in action)
            {
              Console.WriteLine(actionEvent.EventForDisplay);
              actionEvent.FillStore(store, iter1);
            }
            }
            }
            }
            }

              DumpStatistics(parser, nrScripts);

              return store;
        }