void sampleParticipant_ActivityStateTracked(object sender, ActivityStateTrackedEventArgs e) { //Invoke a Treeview method to add all ActivityState names and arguments to Nodes if (Globals.ThisAddIn.CustomTaskPanes.Count > 0) { WorkflowActivitiesControl workflowActivities = Globals.ThisAddIn.CustomTaskPanes[0].Control as WorkflowActivitiesControl; workflowActivities.Invoke(new WorkflowActivitiesControl.AddNodeDelegate (workflowActivities.AddNode), e.ActivityStateRecord.Activity.Name, e.ActivityStateRecord.Arguments); } if (e.ActivityStateRecord.Activity.Name == "WriteLine") { string text = e.ActivityStateRecord.Arguments["Text"].ToString(); Globals.ThisAddIn.Application.ActiveCell.FormulaR1C1 = text; } //Sample uses Excel Automation. It could use XML Mapping if (e.ActivityStateRecord.Activity.Name == "EntityProperties") { IEnumerable<IEnumerable<EntityProperty>> entityProperties = (IEnumerable<IEnumerable<EntityProperty>>)e.ActivityStateRecord.Arguments["Properties"]; TablePartPublisher tablePart = (TablePartPublisher)e.ActivityStateRecord.Arguments["DocumentPart"]; if (tablePart != null) { string styleName = tablePart.StyleName.ToString(); Globals.ThisAddIn.Application.ActiveCell.InsertEntityTable(entityProperties, styleName); } } }
void sampleParticipant_ActivityStateTracked(object sender, ActivityStateTrackedEventArgs e) { wfActivityContol.Invoke(new WorkflowActivitiesControl.AddNodeDelegate (wfActivityContol.AddNode), e.ActivityStateRecord.Activity.Name, e.ActivityStateRecord.Arguments); }
void sampleParticipant_ActivityStateTracked(object sender, ActivityStateTrackedEventArgs e) { string heading = string.Empty; //Invoke a Treeview method to add all ActivityState names and arguments to Nodes if (Globals.ThisAddIn.CustomTaskPanes.Count > 0) { WorkflowActivitiesControl workflowActivitiesControl = Globals.ThisAddIn.CustomTaskPanes[0].Control as WorkflowActivitiesControl; workflowActivitiesControl.Invoke(new WorkflowActivitiesControl.AddNodeDelegate (workflowActivitiesControl.AddNode), e.ActivityStateRecord.Activity.Name, e.ActivityStateRecord.Arguments); } if (e.ActivityStateRecord.Activity.Name == "WriteLine") { heading = e.ActivityStateRecord.Arguments["Text"].ToString(); Globals.ThisAddIn.Application.Selection.TypeText(heading + "\r"); } //Entity Properties and TablePartPublisher if (e.ActivityStateRecord.Activity.Name == "EntityProperties") { m_entityProperties = (IEnumerable<IEnumerable<EntityProperty>>)e.ActivityStateRecord.Arguments["Properties"]; TablePartPublisher tablePart = (TablePartPublisher)e.ActivityStateRecord.Arguments["DocumentPart"]; if (tablePart != null) { Globals.ThisAddIn.Application.Selection.Range.InsertEntityTableXml(m_entityProperties, tablePart.StyleName, tablePart.Resource); } } }