Hi i am currently building a custom workflow activity for visual studio 2010
i would like to create a method invoking property, like many of the oob activities have
public static DependencyProperty WebNameProperty = DependencyProperty.Register("WebName", typeof(string), typeof(ListIteratorActivity));
[Category("Cross-Site Actions"), Browsable(true)]
[DesignerSerializationVisibility
(DesignerSerializationVisibility.Visible)]
public string WebName
{
get
{
return Convert.ToString(base.GetValue(FirstNameProperty));
}
set
{
base.SetValue(FirstNameProperty, value);
}
}
above is an example of a method accepting a string, how do i make a property to accept a method?
UPDATE
when i try
public static DependencyProperty MethodInvokingProperty = DependencyProperty.Register("MethodInvoking", typeof(Delegate), typeof(ListIteratorActivity));
[Category("Cross-Site Actions"), Browsable(true)]
[DesignerSerializationVisibility
(DesignerSerializationVisibility.Visible)]
public Delegate MethodInvoking
{
get
{
return (Delegate)base.GetValue(MethodInvokingProperty);
}
set
{
base.SetValue(MethodInvokingProperty, value);
}
}
it throws an error of
Error 1 Could not create activity of type 'HumanResources.ListIteratorActivity'. System.ArgumentException: Type 'HumanResources.ListIteratorActivity' does not define a static dependency event with name 'MethodInvokingEvent'. Parameter name: ownerType at System.Workflow.ComponentModel.DependencyProperty.ValidateAndRegister(String name, Type propertyType, Type ownerType, PropertyMetadata defaultMetadata, Type validatorType, Boolean isRegistered) at System.Workflow.ComponentModel.DependencyProperty.Register(String name, Type propertyType, Type ownerType) at HumanResources.ListIteratorActivity..cctor() C:\Users\sebastiens\Documents\Visual Studio 2010\Projects\Quarphix\HumanResources 1 1