Windows Workflow Foundation 3
How to display the provider type summary in RuleSetDialog
Hi, I am using the customized type provider as the typeprovider in the RuleSetDialog, now I want to display some description for the type when user edit the ruleset, so I add some summary ahead of the class. But the summary doesn't display when I edit the condition/then action. Can anyone tell me is it possible to display the tips for the type, any help will be appreciated. Here is my code. /// <summary> /// Material tip /// </summary> [Serializable] public static class M { /// <summary> /// Product tip /// </summary> public static class Product { } } And the "Material tip" does not show when I edit the condition. Sam
Hello guys, I have fixed this problem now, I listed the solution below in case someone want to implement the same functionility. Add MouseHover, MouseLeave, MouseLeave events to the textbox, when the mouse stayed on the text for 300mm, pop up the tooltips. Demo code looks like this. class TestTextBox : TextBox { System.Timers.Timer timer; int cout = 0; Point pt = new Point(); ToolTip tooltip; string splitString; protected override void OnCreateControl() { base.OnCreateControl(); timer = new System.Timers.Timer(); timer.Elapsed += new System.Timers.ElapsedEventHandler(timer_Elapsed); timer.Interval = 100; timer.Enabled = false; splitString = ".() |&^!\0\n\r\"'=[]+-*/\\"; tooltip = new ToolTip(); } protected override void OnMouseHover(EventArgs e) { base.OnMouseHover(e); timer.Enabled = true; } protected override void OnMouseLeave(EventArgs e) { base.OnMouseLeave(e); timer.Enabled = false; } protected override void OnMouseMove(MouseEventArgs e) { base.OnMouseMove(e); if (!timer.Enabled) timer.Enabled = true; cout = 0; pt.X = e.Location.X; pt.Y = e.Location.Y; } void timer_Elapsed(object sender, System.Timers.ElapsedEventArgs e) { if (cout >= 300) { timer.Enabled = false; ShowToolTip(); } else cout += 100; } void ShowToolTip() { this.Invoke(new MethodInvoker(delegate { int index = this.GetCharIndexFromPosition(pt); char c = this.GetCharFromPosition(pt); if (splitString.Contains(c.ToString())) { return; } int endIndex = 0; for (int i = index + 1; i < this.Text.Length; i++) { if (splitString.Contains(this.Text[i].ToString())) { endIndex = i; break; } } if (endIndex == 0) { endIndex = this.Text.Length; } int startIndex = 0; for (int i = index - 1; i >= 0; i--) { if (splitString.Contains(this.Text[i].ToString())) { startIndex = i + 1; break; } } string key = this.Text.Substring(startIndex, endIndex - startIndex); if (!string.IsNullOrEmpty(key)) { Point point = this.GetPositionFromCharIndex(startIndex); point.Y += (int)Math.Ceiling(this.Font.GetHeight()) + 2; point.X += 2; tooltip.Show(key, this, point, 2000); } })); } } Heere is the effect: Sam
Related Links
State Machine "Undo" to previous state
Bind workflow property to a read-only activity property
Developing an application for a service support provider.
WorkflowRuntime.CreateWorkflow Performance
Access sequential workflow dependency property from custom activity
Access to workflow queues from external processes
Persiste in a custom activity
Workflow re-activates on Final State when using OnWorkflowItemChanged Event
Windows WorkFlow Foundation: Cannot add a new state in between two existing states.
Within VS2008, can't drill down into a workflow without checking it out
SQLTrackingService tracks incorrect WorkflowInstanceEvent order?
XAML Workflows, Property Bindings and Conditions sample
Tracking query timeouts
Insert activity during PreFilterProperties
Passing data from Activity to Activity in XAML Workflows
Problem with x:Class and CreateWorkflow