|
using System;
using System.ComponentModel;
using System.ComponentModel.Design;
using System.Collections;
using System.Drawing;
using System.Linq;
using System.Workflow.ComponentModel.Compiler;
using System.Workflow.ComponentModel.Serialization;
using System.Workflow.ComponentModel;
using System.Workflow.ComponentModel.Design;
using System.Workflow.Runtime;
using System.Workflow.Activities;
using System.Workflow.Activities.Rules;
using System.Windows.Forms;
using System.Collections.Specialized;
using System.Reflection;
using System.Drawing.Design;
using System.Threading;
using TestflowFramework.Design;
namespace TestflowFramework.Activities
{
[ToolboxItem(typeof(ActivityToolboxItem))]
[Designer(typeof(ClickButtonActivityDesigner), typeof(IDesigner))]
[ToolboxBitmap(typeof(ClickButtonActivity), "Resources.ClickButton.png")]
public partial class ClickButtonActivity : WindowsControlActivity, IControlFieldProvider
{
public ClickButtonActivity()
{
InitializeComponent();
filterType = typeof(System.Windows.Forms.Button);
}
#region Execute Activity
protected override void DoControlActivity(Form form)
{
Button button = GetControl(form, Button) as Button;
button.PerformClick();
}
#endregion
#region Button
public static readonly DependencyProperty ButtonProperty = DependencyProperty.Register("Button", typeof(string), typeof(ClickButtonActivity), new PropertyMetadata("", DependencyPropertyOptions.Metadata, new Attribute[] { new ValidationOptionAttribute(ValidationOption.Required) }));
[DefaultValue(""),
Description("Button to click"),
RefreshProperties(RefreshProperties.All),
MergableProperty(false),
TypeConverter(typeof(ControlTypeConverter)),
Category("Testing")]
public string Button
{
get
{
return (base.GetValue(ButtonProperty) as string);
}
set
{
base.SetValue(ButtonProperty, value);
}
}
#endregion
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.