2009-11-12 59 views

回答

0

我做了类似的事情,我可以提供一些提示。我没有找到代码示例,所以我使用Reflector复制了SharePoint的DLL中的代码。

 
File: C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\ISAPI\microsoft.sharepoint.WorkflowActions.dll 
Class (for example): Microsoft.SharePoint.WorkflowActions.WaitForActivity 

你会发现三个属性和DependencyProperty S:您actions文件

static MyActivity() 
{ 
    __ContextProperty = DependencyProperty.Register("__Context", typeof(WorkflowContext), typeof(MyActivity)); 
    __ListIdProperty = DependencyProperty.Register("__ListId", typeof(string), typeof(MyActivity)); 
    __ListItemProperty = DependencyProperty.Register("__ListItem", typeof(int), typeof(MyActivity)); 
} 

它们绑定:

<Parameters> 
    <Parameter Name="__Context" Type="Microsoft.SharePoint.WorkflowActions.WorkflowContext, Microsoft.SharePoint.WorkflowActions" Direction="In"/> 
    <Parameter Name="__ListId" Type="System.String, mscorlib, mscorlib" Direction="In" /> 
    <Parameter Name="__ListItem" Type="System.Int32, mscorlib, mscorlib" Direction="In" /> 
    </Parameters> 

[Browsable(true), ValidationOption(ValidationOption.Required), DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)] 
public WorkflowContext __Context 
{ 
    get { return (WorkflowContext)base.GetValue(__ContextProperty); } 
    set { base.SetValue(__ContextProperty, value); } 
} 

[DesignerSerializationVisibility(DesignerSerializationVisibility.Visible), Browsable(true), ValidationOption(ValidationOption.Required)] 
public string __ListId 
{ 
    get { return (string)base.GetValue(__ListIdProperty); } 
    set { base.SetValue(__ListIdProperty, value); } 
} 

[Browsable(true), DesignerSerializationVisibility(DesignerSerializationVisibility.Visible), ValidationOption(ValidationOption.Required)] 
public int __ListItem 
{ 
    get { return (int)base.GetValue(__ListItemProperty); } 
    set { base.SetValue(__ListItemProperty, value); } 
} 

public static DependencyProperty __ContextProperty; 
public static DependencyProperty __ListIdProperty; 
public static DependencyProperty __ListItemProperty; 

这在静态构造函数

这可以从文件中复制

 
C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\1033\Workflow\WSS.ACTIONS

然后,它是前人的精力比较容易得到GUID,并使用属性和输出参数绑定返回。

相关问题