Exemplo n.º 1
0
        public void CategorizeFunctions(
            out OrderedDictionary <string, SpotifyClass> aClasses,
            out OrderedDictionary <string, FunctionCType> aFunctions)
        {
            var classTable         = new OrderedDictionary <string, SpotifyClass>();
            var unclaimedFunctions = new HashSet <string>(FunctionTable.Keys);

            foreach (string handleName in HandleTable)
            {
                var spotifyClass = new SpotifyClass(handleName);
                foreach (var kvp in FunctionTable)
                {
                    string name     = kvp.Key;
                    var    function = kvp.Value;
                    if (name.StartsWith(handleName + "_"))
                    {
                        spotifyClass.AddFunction(name, function);
                        unclaimedFunctions.Remove(name);
                    }
                }
                classTable.Add(handleName, spotifyClass);
            }
            aClasses   = classTable;
            aFunctions = new OrderedDictionary <string, FunctionCType>(FunctionTable.Where(x => unclaimedFunctions.Contains(x.Key)));
        }
 public void CategorizeFunctions(
     out OrderedDictionary<string, SpotifyClass> aClasses,
     out OrderedDictionary<string, FunctionCType> aFunctions)
 {
     var classTable = new OrderedDictionary<string, SpotifyClass>();
     var unclaimedFunctions = new HashSet<string>(FunctionTable.Keys);
     foreach (string handleName in HandleTable)
     {
         var spotifyClass = new SpotifyClass(handleName);
         foreach (var kvp in FunctionTable)
         {
             string name = kvp.Key;
             var function = kvp.Value;
             if (name.StartsWith(handleName + "_"))
             {
                 spotifyClass.AddFunction(name, function);
                 unclaimedFunctions.Remove(name);
             }
         }
         classTable.Add(handleName, spotifyClass);
     }
     aClasses = classTable;
     aFunctions = new OrderedDictionary<string, FunctionCType>(FunctionTable.Where(x => unclaimedFunctions.Contains(x.Key)));
 }