示例#1
0
        public override void Load()
        {
            if (type == null)
            {
                Info = null;
            }
            else
            {
                MethodInfo[] staticMethods   = (MethodInfo[])Members(BindingFlags.Static);
                MethodInfo[] instanceMethods = (MethodInfo[])Members(BindingFlags.Instance);
                int          count           = 0;

                foreach (MethodInfo mi in staticMethods)
                {
                    if (!mi.IsSpecialName &&
                        !mi.Name.StartsWith("add_") && !mi.Name.StartsWith("remove_") &&                        // FIXME: remove once mcs is fixed
                        !mi.Name.StartsWith("get_") && !mi.Name.StartsWith("set_"))
                    {
                        count++;
                    }
                }
                staticCount = count;
                foreach (MethodInfo mi in instanceMethods)
                {
                    if (!mi.IsSpecialName &&
                        !mi.Name.StartsWith("add_") && !mi.Name.StartsWith("remove_") &&                        // FIXME: remove once mcs is fixed
                        !mi.Name.StartsWith("get_") && !mi.Name.StartsWith("set_"))
                    {
                        count++;
                    }
                }
                instanceCount = count - staticCount;

                Info  = new MethodRecord [nRecords];
                count = 0;
                if ((BindingFlags.Static & flags) == BindingFlags.Static)
                {
                    foreach (MethodInfo mi in staticMethods)
                    {
                        if (!mi.IsSpecialName &&
                            !mi.Name.StartsWith("add_") && !mi.Name.StartsWith("remove_") &&                           // FIXME: remove once mcs is fixed
                            !mi.Name.StartsWith("get_") && !mi.Name.StartsWith("set_"))
                        {
                            Info [count] = Record(mi);
                            count++;
                        }
                    }
                }
                if ((BindingFlags.Instance & flags) == BindingFlags.Instance)
                {
                    foreach (MethodInfo mi in instanceMethods)
                    {
                        if (!mi.IsSpecialName &&
                            !mi.Name.StartsWith("add_") && !mi.Name.StartsWith("remove_") &&                           // FIXME: remove once mcs is fixed
                            !mi.Name.StartsWith("get_") && !mi.Name.StartsWith("set_"))
                        {
                            Info [count] = Record(mi);
                            count++;
                        }
                    }
                }
            }
        }
示例#2
0
		public override void Load ()
		{
			if (type == null)
				Info = null;
			else {
				MethodInfo[] staticMethods = (MethodInfo[]) Members (BindingFlags.Static);
				MethodInfo[] instanceMethods = (MethodInfo[]) Members (BindingFlags.Instance);
				int count = 0;

				foreach (MethodInfo mi in staticMethods)
				         if (!mi.IsSpecialName
					     && !mi.Name.StartsWith ("add_") && !mi.Name.StartsWith ("remove_") // FIXME: remove once mcs is fixed
					     && !mi.Name.StartsWith ("get_") && !mi.Name.StartsWith ("set_"))
						 count ++;
				staticCount = count;
				foreach (MethodInfo mi in instanceMethods)
				         if (!mi.IsSpecialName
					     && !mi.Name.StartsWith ("add_") && !mi.Name.StartsWith ("remove_") // FIXME: remove once mcs is fixed
					     && !mi.Name.StartsWith ("get_") && !mi.Name.StartsWith ("set_"))
						 count ++;
				instanceCount = count - staticCount;

				Info = new MethodRecord [nRecords];
				count = 0;
				if ((BindingFlags.Static & flags) == BindingFlags.Static)
					foreach (MethodInfo mi in staticMethods)
					        if (!mi.IsSpecialName
						    && !mi.Name.StartsWith ("add_") && !mi.Name.StartsWith ("remove_") // FIXME: remove once mcs is fixed
						    && !mi.Name.StartsWith ("get_") && !mi.Name.StartsWith ("set_")) {
							Info [count] = Record (mi);
							count ++;
						}
				if ((BindingFlags.Instance & flags) == BindingFlags.Instance)
					foreach (MethodInfo mi in instanceMethods)
					        if (!mi.IsSpecialName
						    && !mi.Name.StartsWith ("add_") && !mi.Name.StartsWith ("remove_") // FIXME: remove once mcs is fixed
						    && !mi.Name.StartsWith ("get_") && !mi.Name.StartsWith ("set_")) {
							Info [count] = Record (mi);
							count ++;
						}
			}
		}