Ejemplo n.º 1
0
        public void BuildTree(SearchOptions searchOptions = null)
        {
            Tree       = new TreeGraph <BaseNode>(new GroupNode("Root", "Root"));
            GroupNodes = new Dictionary <string, GroupNode>();
            TweakerDictionary <IInvokable> invokables = Tweaker.Invokables.GetInvokables(searchOptions);
            TweakerDictionary <ITweakable> tweakables = Tweaker.Tweakables.GetTweakables(searchOptions);
            List <ITweakerObject>          list       = new List <ITweakerObject>();

            list.AddRange(invokables.Values.Where(PublicTweak.IsUnlocked).ToArray());
            list.AddRange(tweakables.Values.Where(PublicTweak.IsUnlocked).ToArray());
            foreach (ITweakerObject item in list)
            {
                string name = item.Name;
                string text = "";
                int    num  = name.LastIndexOf('.');
                if (num >= 0)
                {
                    text = name.Substring(0, num);
                }
                TreeNode <BaseNode> parent = Tree.Root;
                if (!string.IsNullOrEmpty(text))
                {
                    parent = EnsureGroupExists(text);
                }
                CreateTweakerNode(parent, item);
            }
            SortGroupChildren();
        }
Ejemplo n.º 2
0
 public BaseTweakerManager(IScanner scanner, TweakerOptions options)
 {
     objects      = new TweakerDictionary <T>();
     this.options = options;
     this.scanner = scanner;
     if (this.scanner != null)
     {
         this.scanner.GetResultProvider <T>().ResultProvided += OnObjectFound;
     }
 }
Ejemplo n.º 3
0
        public TweakerDictionary <T> GetObjects(SearchOptions options = null)
        {
            PruneDeadInstances();
            TweakerDictionary <T> tweakerDictionary = new TweakerDictionary <T>();

            lock (lockObj)
            {
                foreach (T value in objects.Values)
                {
                    if (options == null || options.CheckMatch(value))
                    {
                        tweakerDictionary.Add(value.Name, value);
                    }
                }
            }
            return(tweakerDictionary);
        }