English 中文(简体)
在工作流程中增加多个不动产元数据
原标题:Add multiple Property Metadata to a Dependency Property in a Workflow Activity

我正在视窗工作流程中建造一些习俗活动,我需要增加一个可达到list>的若干价值,用户可在使用活动时选择这些财产。

e. 真实或合法。

我知道,如何简单地利用不动产数据通过违约,并假定我现在必须通过现在的不动产数据清单/分类?

是否有任何人已经举出了如何这样做的例子?

(下文例例)

public static DependencyProperty TestProperty = DependencyProperty.Register("Test", typeof(string), typeof(CheckActivity), new PropertyMetadata("True"));
/// <summary>
/// Dependency property for  TestProperty 
/// </summary>   
[DescriptionAttribute("Whether a True/False entry is required")]
[CategoryAttribute("Settings")]
[BrowsableAttribute(true)]
[DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Visible)]
public string Type
{
    get
    {
        return ((string)(base.GetValue(CheckActivity.TestProperty)));
    }
    set
    {
        base.SetValue(CheckActivity.TestProperty, value);
    }
}
最佳回答

首先,真实/False的例子并不大,在这种情况下使用的是ool。

关于不使用Enum的多价值项目:-

 public enum ItemEnum
 {
    First,
    Second,
    Third
 }

您 活动:

 public static DependencyProperty TestProperty = DependencyProperty.Register("Test",  
   typeof(ItemEnum), typeof(TestActivity), new PropertyMetadata(ItemEnum.First));

[Description("Select Item value")]
[Category("Settings")]
[DefaultValue(ItemEnum.First)]
public ItemEnum Type
{
  get
  {
    return (ItemEnum)GetValue(TestActivity.TestProperty);
  }
  set
  {
    SetValue(TestActivity.TestProperty, value);
  }
}

注意简化财产分配。 尤其是,可浏览的是真实的,而设计的航空化是可见的,因此就予以消除。 如果确定DefaultValue,则“用户”更容易使用财产网。 说明还删除了“Attribute”的内容,使之更加直截了当。

问题回答

暂无回答




相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...