本文整理汇总了C#中System.Workflow.Runtime.Tracking.TrackingProfileSerializer类的典型用法代码示例。如果您正苦于以下问题:C# TrackingProfileSerializer类的具体用法?C# TrackingProfileSerializer怎么用?C# TrackingProfileSerializer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TrackingProfileSerializer类属于System.Workflow.Runtime.Tracking命名空间,在下文中一共展示了TrackingProfileSerializer类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: CreateAndInsertTrackingProfile
private static void CreateAndInsertTrackingProfile()
{
TrackingProfile profile = new TrackingProfile();
ActivityTrackPoint activityTrack = new ActivityTrackPoint();
ActivityTrackingLocation activityLocation = new ActivityTrackingLocation(typeof(Activity));
activityLocation.MatchDerivedTypes = true;
IEnumerable<ActivityExecutionStatus> statuses = Enum.GetValues(typeof(ActivityExecutionStatus)) as IEnumerable<ActivityExecutionStatus>;
foreach (ActivityExecutionStatus status in statuses)
{
activityLocation.ExecutionStatusEvents.Add(status);
}
activityTrack.MatchingLocations.Add(activityLocation);
profile.ActivityTrackPoints.Add(activityTrack);
profile.Version = version;
WorkflowTrackPoint workflowTrack = new WorkflowTrackPoint();
WorkflowTrackingLocation workflowLocation = new WorkflowTrackingLocation();
IEnumerable<TrackingWorkflowEvent> eventStatuses = Enum.GetValues(typeof(TrackingWorkflowEvent)) as IEnumerable<TrackingWorkflowEvent>;
foreach (TrackingWorkflowEvent status in eventStatuses)
{
workflowLocation.Events.Add(status);
}
workflowTrack.MatchingLocation = workflowLocation;
profile.WorkflowTrackPoints.Add(workflowTrack);
TrackingProfileSerializer serializer = new TrackingProfileSerializer();
StringWriter writer = new StringWriter(new StringBuilder(), CultureInfo.InvariantCulture);
serializer.Serialize(writer, profile);
String trackingprofile = writer.ToString();
InsertTrackingProfile(trackingprofile);
}
开发者ID:.NET开发者,项目名称:System.Workflow.Runtime.Tracking,代码行数:33,代码来源:TrackingProfileSerializer
注:本文中的System.Workflow.Runtime.Tracking.TrackingProfileSerializer类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论