Imported Upstream version 4.6.0.125

Former-commit-id: a2155e9bd80020e49e72e86c44da02a8ac0e57a4
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2016-08-03 10:59:49 +00:00
parent a569aebcfd
commit e79aa3c0ed
17047 changed files with 3137615 additions and 392334 deletions

View File

@@ -0,0 +1,75 @@
namespace System.Workflow.ComponentModel
{
using System;
using System.Text;
using System.Reflection;
using System.Collections;
using System.CodeDom;
using System.ComponentModel;
using System.ComponentModel.Design;
using System.Drawing;
using System.Workflow.ComponentModel;
using System.Workflow.ComponentModel.Design;
using System.Collections.Generic;
using System.Drawing.Design;
using System.Workflow.ComponentModel.Compiler;
using System.Workflow.Runtime;
[SRDescription(SR.TerminateActivityDescription)]
[ToolboxItem(typeof(ActivityToolboxItem))]
[Designer(typeof(TerminateDesigner), typeof(IDesigner))]
[ToolboxBitmap(typeof(TerminateActivity), "Resources.Terminate.png")]
[SRCategory(SR.Standard)]
[Obsolete("The System.Workflow.* types are deprecated. Instead, please use the new types from System.Activities.*")]
public sealed class TerminateActivity : Activity
{
public static readonly DependencyProperty ErrorProperty = DependencyProperty.Register("Error", typeof(string), typeof(TerminateActivity));
#region Constructors
public TerminateActivity()
{
}
public TerminateActivity(string name)
: base(name)
{
}
#endregion
protected internal override void Initialize(IServiceProvider provider)
{
if (this.Parent == null)
throw new InvalidOperationException(SR.GetString(SR.Error_MustHaveParent));
base.Initialize(provider);
}
protected internal override sealed ActivityExecutionStatus Execute(ActivityExecutionContext executionContext)
{
executionContext.CloseActivity();
string terminateReason = this.Error;
executionContext.TerminateWorkflowInstance(new WorkflowTerminatedException(terminateReason));
return ActivityExecutionStatus.Closed;
}
[Browsable(true)]
[SRCategory(SR.Activity)]
[SRDescription(SR.TerminateErrorMessageDescr)]
[MergableProperty(false)]
[DefaultValue((string)null)]
public string Error
{
get
{
return (string)base.GetValue(ErrorProperty);
}
set
{
base.SetValue(ErrorProperty, value);
}
}
}
}