簡體   English   中英

將子類別添加到工作流活動中的依賴項屬性

[英]Add sub categories to a Dependency Property in a Workflow Activity

我希望創建一個具有這樣的依賴屬性結構的工作流程活動

  • 設置
    • 等待期
      • 小時
      • 分鍾

目前,以下代碼將顯示“ 等待時間 設置為整數”,但現在需要將其擴展為DayshoursMins的 3個子子屬性。

我知道我將不得不更改Wait Period ,但是我不確定如何將其他3個屬性附加到它。

任何幫助將不勝感激...謝謝。

public static DependencyProperty WaitPeriodProperty = DependencyProperty.Register("WaitPeriod", typeof(int), typeof(CheckActivity));
/// <summary>
/// Dependency property for 'Wait Period'
/// </summary>   
///        
[DescriptionAttribute("The email of the sender")]
[CategoryAttribute("Settings")]        
public int WaitPeriod
{
    get
    {
        return (int)(base.GetValue(CheckActivity.WaitPeriodProperty));
    }
    set
    {
        base.SetValue(CheckActivity.WaitPeriodProperty, value);
    }
}

首先,您絕對應該將類型從int更改為TimeSpan 那有天,小時,分鍾,秒和毫秒。

輸入UI可能只是您喜歡的一個字符串,而不是您喜歡的:d.hh:mm:ss.msecs

但是,就我個人而言,我會為使用專門為任務設計的Type的簡單性而忍受。 不過,可能可以為其創建自定義編輯器。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM