Example #1
0
		/// <summary>
		/// Merge a function list into the current one
		/// </summary>
		/// <param name="functionList"></param>
		public void Merge(FunctionList functionList)
		{
			foreach (FunctionBase function in functionList.Functions)
			{
				Functions.Add(function);
			}
			Functions.Sort();
		}
Example #2
0
		public void Add(FunctionList functionList)
		{
			functionLists.Add(functionList);
		}
Example #3
0
			public FunctionListEnumerator(FunctionList functionList)
			{
				this.functionList = functionList;
			}
Example #4
0
		// walk through all the types in an assembly,
		// and add them to the list...
		public void AddAllFromType(Type type)
		{

			FunctionList functionList = new FunctionList();
			functionList.AddAllFromType(type);
			functionLists.Add(functionList);

			//// TODO: Figure out how to deal with 
			//// instance methods here. It would require creating
			//// an instance here...

			//MethodInfo[] methods = type.GetMethods(BindingFlags.Static | BindingFlags.Instance | BindingFlags.Public);
			//object instance = null;

			//// any function that takes parameters
			//// of type double and returns double
			//// is fine with us...
			//foreach (MethodInfo m in methods)
			//{
			//    // if it doesn't return double, skip it
			//    if (m.ReturnType != typeof(void))
			//        continue;

			//    if (0 != m.GetParameters().Length)
			//    {
			//        continue;
			//    }

			//    string funcName =
			//        type.Name + "." + m.Name;

			//    // if it's an instance method, we'll
			//    // need to create an instance to use
			//    // when creating the delegate...
			//    if (!m.IsStatic)
			//    {
			//        if (instance == null)
			//        {
			//            try
			//            {
			//                instance = Activator.CreateInstance(type);
			//            }
			//            catch (MissingMethodException)
			//            {
			//                continue;
			//            }
			//        }
			//    }

			//    functionLists.Add(new Function(funcName, m, instance));
			//}
		}