Esempio n. 1
0
 /// <summary>
 /// 获取对象信息
 /// </summary>
 /// <param name="element">对象类型</param>
 /// <param name="selectedID">选中对象ID</param>
 /// <returns>对象信息(对象序列化的字符串信息)</returns>
 private string GetExtraInfo(SrcElement element, string selectedID)
 {
     string extraInfo = string.Empty;
     if (!string.IsNullOrEmpty(selectedID))
     {
         TabItem selectedItem = this.tabControl.SelectedItem as TabItem;
         if (selectedItem != null)
         {
             WorkflowInfo selectedInfo = (selectedItem.DataContext as DiagramPageViewModel).WfInfo;
             if (element == SrcElement.Point)
             {
                 foreach (var activity in selectedInfo.Activities)
                 {
                     if (activity.ID == selectedID)
                     {
                         extraInfo = JsonConvert.SerializeObject(activity);
                         break;
                     }
                 }
             }
             else if (element == SrcElement.Line)
             {
                 foreach (var transction in selectedInfo.Transitions)
                 {
                     if (transction.Key == selectedID)
                     {
                         extraInfo = JsonConvert.SerializeObject(transction);
                         break;
                     }
                 }
             }
         }
     }
     return extraInfo;
 }