MonoDevelop.Components.Commands.CommandUpdaterInfo.Init C# (CSharp) Method

Init() public method

public Init ( MethodInfo method, MonoDevelop.Components.Commands.CommandUpdateHandlerAttribute attr ) : void
method System.Reflection.MethodInfo
attr MonoDevelop.Components.Commands.CommandUpdateHandlerAttribute
return void
		public void Init (MethodInfo method, CommandUpdateHandlerAttribute attr)
		{
			base.Init (method, attr);
			ParameterInfo[] pars = method.GetParameters ();
			if (pars.Length == 1) {
				Type t = pars[0].ParameterType;
				
				if (t == typeof(CommandArrayInfo)) {
					isArray = true;
					return;
				} else if (t == typeof(CommandInfo))
					return;
			}
			throw new InvalidOperationException ("Invalid signature for command update handler: " + method.DeclaringType + "." + method.Name + "()");
		}